@wfgraph/client 2.3.0 → 2.5.0
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.
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},p=new class extends f{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},m={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},h=new class{#e=m;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function g(e){setTimeout(e,0)}var _=typeof window>`u`||`Deno`in globalThis;function v(){}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return typeof e==`number`&&e>=0&&e!==1/0}function x(e,t){return Math.max(e+(t||0)-Date.now(),0)}function S(e,t){return typeof e==`function`?e(t):e}function C(e,t){return typeof e==`function`?e(t):e}function w(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==E(o,t.options))return!1}else if(!O(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function T(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(D(t.options.mutationKey)!==D(a))return!1}else if(!O(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function E(e,t){return(t?.queryKeyHashFn||D)(e)}function D(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function O(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!O(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!O(e[r],t[r]))return!1;return!0}return!1}var k=Object.prototype.hasOwnProperty;function A(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=M(e)&&M(t);if(!r&&!(N(e)&&N(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:k.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=A(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function j(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function M(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!P(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!P(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function P(e){return Object.prototype.toString.call(e)===`[object Object]`}function F(e){return new Promise(t=>{h.setTimeout(t,e)})}function I(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:A(e,t)}function L(e){return e}function R(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var B=Symbol();function V(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===B?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function H(e,t){return typeof e==`function`?e(...t):!!e}function U(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var W=(()=>{let e=()=>_;return{isServer(){return e()},setIsServer(t){e=t}}})();function G(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var K=g;function ee(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=K,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var q=ee(),te=new class extends f{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ne(e){return Math.min(1e3*2**e,3e4)}function re(e){return(e??`online`)!==`online`||te.isOnline()}var ie=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ae(e){let t=!1,n=0,r,i=G(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ie(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>p.isFocused()&&(e.networkMode===`always`||te.isOnline())&&e.canRun(),u=()=>re(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(W.isServer()?0:3),o=e.retryDelay??ne,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),F(s).then(()=>l()?void 0:m()).then(()=>{t?f(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?h():m().then(h),i)}}var oe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),b(this.gcTime)&&(this.#e=h.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(W.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(h.clearTimeout(this.#e),this.#e=void 0)}};function se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{U(e,()=>t.signal,()=>n=!0)},u=V(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?z:R;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?le:ce,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ce(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function ce(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function le(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function ue(e,t){return t?ce(e,t)!=null:!1}function de(e,t){return!t||!e.getPreviousPageParam?!1:le(e,t)!=null}var fe=class extends oe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=he(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=he(this.options);e.data!==void 0&&(this.setState(me(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=I(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>C(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===B||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>S(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!x(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=V(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ae({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ie&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ie){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...pe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...me(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),q.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function pe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:re(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function me(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function he(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ge=class extends f{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=G(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ve(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ye(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ye(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof C(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!j(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&be(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(t.enabled,this.#t)||S(this.options.staleTime,this.#t)!==S(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Se(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(v)),t}#g(){this.#b();let e=S(this.options.staleTime,this.#t);if(W.isServer()||this.#r.isStale||!b(e))return;let t=x(this.#r.dataUpdatedAt,e)+1;this.#d=h.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(W.isServer()||C(this.options.enabled,this.#t)===!1||!b(this.#p)||this.#p===0)&&(this.#f=h.setInterval(()=>{(this.options.refetchIntervalInBackground||p.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(h.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(h.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ve(e,t),o=i&&be(e,n,t,r);(a||o)&&(l={...l,...pe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=I(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=I(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:xe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:C(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=G();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!j(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){q.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function _e(e,t){return C(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||C(t.retryOnMount,e)!==!1)}function ve(e,t){return _e(e,t)||e.state.data!==void 0&&ye(e,t,t.refetchOnMount)}function ye(e,t,n){if(C(t.enabled,e)!==!1&&S(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&xe(e,t)}return!1}function be(e,t,n,r){return(e!==t||C(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&xe(e,n)}function xe(e,t){return C(t.enabled,e)!==!1&&e.isStaleByTime(S(t.staleTime,e))}function Se(e,t){return!j(e.getCurrentResult(),t)}var Ce=class extends ge{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ue(t,n.data),hasPreviousPage:de(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},we=class extends oe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Te(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ae({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),q.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Te(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ee=class extends f{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new we({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=De(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=De(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=De(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=De(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){q.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>T(t,e))}findAll(e={}){return this.getAll().filter(t=>T(e,t))}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return q.batch(()=>Promise.all(e.map(e=>e.continue().catch(v))))}};function De(e){return e.options.scope?.id}var Oe=class extends f{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),j(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&D(t.mutationKey)!==D(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Te();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){q.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},ke=class extends f{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??E(r,t),a=this.get(i);return a||(a=new fe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){q.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>w(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>w(e,t)):t}notify(e){q.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){q.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){q.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ae=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ke,this.#t=e.mutationCache||new Ee,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=te.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(S(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=y(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return q.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;q.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return q.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=q.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(v).catch(v)}invalidateQueries(e,t={}){return q.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=q.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(v)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(v)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(S(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(v).catch(v)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(v).catch(v)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return te.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(D(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{O(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(D(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{O(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=E(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===B&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},je=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),Me=s(((e,t)=>{t.exports=je()})),Ne=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Pe=s(((e,t)=>{t.exports=Ne()})),J=u(Me(),1),Y=Pe(),Fe=J.createContext(void 0),Ie=e=>{let t=J.useContext(Fe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Le=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Y.jsx)(Fe.Provider,{value:e,children:t})),Re=J.createContext(!1),ze=()=>J.useContext(Re);Re.Provider;function Be(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ve=J.createContext(Be()),He=()=>J.useContext(Ve),Ue=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?H(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},We=e=>{J.useEffect(()=>{e.clearReset()},[e])},Ge=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||H(n,[e.error,r])),Ke=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},qe=(e,t)=>e.isLoading&&e.isFetching&&!t,Je=(e,t)=>e?.suspense&&t.isPending,Ye=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xe(e,t,n){let r=ze(),i=He(),a=Ie(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ke(o),Ue(o,i,s),We(i);let l=!a.getQueryCache().get(o.queryHash),[u]=J.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=f?u.subscribe(q.batchCalls(e)):v;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),J.useEffect(()=>{u.setOptions(o)},[o,u]),Je(o,d))throw Ye(o,u,i);if(Ge({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!W.isServer()&&qe(d,r)&&(l?Ye(o,u,i):s?.promise)?.catch(v).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Ze(e,t){return Xe(e,ge,t)}function Qe(e,t){let n=Ie(t),[r]=J.useState(()=>new Oe(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(q.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((e,t)=>{r.mutate(e,t).catch(v)},[r]);if(i.error&&H(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function $e(e,t){return Xe(e,Ce,t)}var et=J.useLayoutEffect;function tt(e,t,n={},r){J.useEffect(()=>{if(!e.current||r||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,r,n,e])}function nt(e){let t=J.useRef(null);return J.useImperativeHandle(e,()=>t.current,[]),t}function rt(e){return e[e.length-1]}function it(e){return typeof e==`function`}function at(e,t){return it(e)?e(t):e}var ot=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;function ct(e){for(let t in e)if(ot.call(e,t))return!0;return!1}var lt=()=>Object.create(null),ut=(e,t)=>dt(e,t,lt);function dt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ht(e)&&ht(i);if(!a&&!(pt(e)&&pt(i)))return i;let o=a?e:ft(e);if(!o)return i;let s=a?i:ft(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ot.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=dt(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ft(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!st.call(e,r))return!1;t.push(r)}return t}function pt(e){if(!mt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!mt(n)||!n.hasOwnProperty(`isPrototypeOf`))}function mt(e){return Object.prototype.toString.call(e)===`[object Object]`}function ht(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gt(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!gt(e[r],t[r],n))return!1;return!0}if(pt(e)&&pt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!gt(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!gt(e[o],t[o],n)))return!1;return i===a}return!1}var _t=/[\x00-\x1f\x7f"<>`{}]/g;function vt(e){return e.replace(_t,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function yt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return vt(t)}var bt=[`http:`,`https:`,`mailto:`,`tel:`];function xt(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function St(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=yt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=yt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ct(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function wt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Tt(){throw Error(`Invariant failed`)}function Et(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Dt=4,Ot=5;function kt(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function At(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=kt(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function jt(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=At(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=Nt(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=Pt(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Nt(r);e.kind=Ot,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=Nt(r);e.kind=Dt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)jt(e,t,r,c,i,a,o,s)}function Mt(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Nt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Pt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Ft(e,t){let n=Nt(`/`),r=new Uint16Array(6),i=[];for(let t of e)jt(!1,r,t,1,n,0,i);for(let e of i)e.sort(Mt);t.masksTree=n,t.flatCache=Et(1e3)}function It(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Vt(e,t.masksTree);return t.flatCache.set(e,r),r}function Lt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Nt(`/`),jt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Vt(r,o,n)}function Rt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Vt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ut(a.route)),t.matchCache.set(r,a),a}function zt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Bt(e,t=!1,n){let r=Nt(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;jt(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&Tt(),o[e.id]=e,c!==0&&e.path){let t=zt(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(Mt);return{processedTree:{segmentTree:r,singleCache:Et(1e3),matchCache:Et(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Vt(e,t,n=!1){let r=e.split(`/`),i=Gt(e,r,t,n);if(!i)return null;let[a]=Ht(e,r,i);return{route:i.node.route,rawParams:a}}function Ht(e,t,n){let r=Wt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Dt)break;if(u.kind===Ot){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ut(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Wt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Gt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!rt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Yt(l,n))continue;if(i.parse){if(!Jt(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Dt&&Yt(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Dt||i.kind===2)&&Yt(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Jt(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&qt(f,o))return n;Yt(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Kt(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Kt(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Kt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Kt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Kt(e,t){return 2**(e-t-1)}function qt(e,t){return e===2**(t-1)-1}function Jt(e,t,n){let r,i;try{[r,i]=Ht(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Yt(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Dt)>(e.node.kind===Dt)||t.node.kind===Dt==(e.node.kind===Dt)&&t.node.depth>e.node.depth)))}function Xt(e){return Zt(e.filter(e=>e!==void 0).join(`/`))}function Zt(e){return e.replace(/\/{2,}/g,`/`)}function Qt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function $t(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function en(e){return $t(Qt(e))}function tn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function nn(e,t,n){return tn(e,n)===tn(t,n)}function rn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&rt(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(rt(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Zt(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function an(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function on(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>cn(e,n)).join(`/`):cn(r,n):r}function sn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=At(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=on(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=on(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=on(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function cn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function ln(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function un(e){return e?.isNotFound===!0}function dn(){try{return sessionStorage}catch{return}}var fn=`tsr-scroll-restoration-v1_3`,pn=dn();function mn(){try{return JSON.parse(pn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function hn(){try{pn?.setItem(fn,JSON.stringify(gn))}catch{}}var gn=mn(),_n=`data-scroll-restoration-id`,vn=e=>e.state.__TSR_key||e.href;function yn(e){let t=e.getAttribute(_n);if(t)return`[${_n}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var bn=!1,xn=`window`;function Sn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Cn(e){let t=new Set;for(let n of e){if(n===xn)continue;let e=Sn(n);e&&t.add(e)}return t}function wn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||vn,a=new Set,o=e=>{let t=gn[e]||={};for(let e of a)e===document?t[xn]={scrollX,scrollY}:e.isConnected&&(t[yn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,bn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{bn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),hn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=gn[d];if(e){let t=gn[u];for(let n in e){if(n===xn){if(s)continue}else{let e=Sn(n);if(!e||s&&o&&(l??=Cn(o),l.has(e)))continue}t||=gn[u]={},t[n]??=e[n]}}}bn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Cn(o));let t=e&&i&&c,s=r.restoring?gn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===xn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Sn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{bn=!1}}))}function Tn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function En(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Dn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=En(r):Array.isArray(t)?t.push(En(r)):n[e]=[t,En(r)]}return n}var On=/^(?:\s|["[{\d-]|fa|nu|tr)/,kn=jn(JSON.parse),An=Mn(JSON.stringify,JSON.parse);function jn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Dn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Mn(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!On.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Tn(e,r);return t?`?${t}`:``}}var Nn=`__root__`;function Pn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Fn(e){return e instanceof Response&&!!e.options}function In(e){return{input:({url:t})=>{for(let n of e)t=Rn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=zn(e[n],t);return t}}}function Ln(e){let t=en(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Xt([`/`,t,e.pathname]),e)}}function Rn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function zn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Bn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{wt(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Vn=`__TSR_index`,Hn=`popstate`,Un=`beforeunload`;function Wn(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Jn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Vn];i=Gn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Vn];i=Gn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Vn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Gn(e,t){t||={};let n=Yn();return{...t,key:n,__TSR_key:n,[Vn]:e}}function Kn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Jn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Yn();t.history.replaceState({[Vn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=Jn(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Vn]-l.state[Vn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Wn({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Un,x,{capture:!0}),t.removeEventListener(Hn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Un,x,{capture:!0}),t.addEventListener(Hn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function qn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Jn(e,t){let n=qn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Yn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Vn]:0,key:a,__TSR_key:a}}}function Yn(){return(Math.random()+1).toString(36).substring(7)}function Xn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Zn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Qn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function $n(e,t,n,r){for(let i of t){if(r?.()===!1)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r?.()===!1)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var er=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=an(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Kn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Et(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Bn(this.latestLocation,e),wn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=en(a);t&&t!==`/`&&e.push(Ln({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:In(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Bt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Ft(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:St(e).path,external:!1,searchStr:o,search:ut(t?.search,i),hash:St(r.slice(1)).path,state:dt(t?.state,a)}}let o=new URL(i,this.origin),s=Rn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:St(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:ut(t?.search,c),hash:St(s.hash.slice(1)).path,state:dt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>rn({base:e,to:t.includes(`//`)?Zt(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Rt($t(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=t.to?`${t.to}`:void 0,o=r[2],s=Object.assign(Object.create(null),r[3]),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=or(t.params,s),d=this.routesByPath[$t(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let[e,t,n]=this.getMatchedRoutes(l);f=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&ct(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:St(sn({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,rr(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=ir(m,t,f,e._includeValidateSearch),m=ut(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?at(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?at(t.state,n.state):{};v=dt(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=zn(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=Ct(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=It(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=or(s,n);r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=$t(this.latestLocation.href)===$t(n.href)&>(Qn(n.state),Qn(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,_redirects:a,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=Jn(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=Rn(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});a&&(c._redirects=a),this._pendingLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(xt(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Qr(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Zn(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Xn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=(e.options._builtLocation??this.buildLocation(e.options)).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&xt(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=ur,this.preloadRoute=e=>$r(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Lt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!gt(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?gt(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??An,parseSearch:e.parseSearch??kn,protocolAllowlist:e.protocolAllowlist??bt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ut(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:$t(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?ar(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=rr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof tr||(r=new tr(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=sn({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{sr(i,d)}catch(e){if(x=un(e)||Fn(e)?e:new nr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:ut(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Xn(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?ut(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?dt(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?ut(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=rt(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=rt(a),c={...e.search};for(let e of a)try{Object.assign(c,rr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{sr(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},tr=class extends Error{},nr=class extends Error{};function rr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new tr(`Async validation not supported`);if(n.issues)throw new tr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ir(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;n&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(r)try{let e=rr(n,a);if(i&&e)for(let t in e)t in a||(i.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=at(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function ar(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Nn}function or(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,at(e,t))}function sr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function cr(e,t){return e.options[t]?.preload?.()}function lr(e,t){let n=cr(e,`component`),r=cr(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function ur(e,t,n){let r=()=>t===!1?void 0:t?cr(e,t):lr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function dr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var fr=0,pr=1,mr=2,hr=3,gr=4;function _r(e){return typeof e[0]==`number`}function vr(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function yr(e,t){return e.routesById[t.routeId]}function br(e,t,n){return Fn(e)?[hr,e]:un(e)?(e.routeId||=n,[mr,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[pr,e]:[fr,e])}function xr(e,t){let n=br(t,!0,e.id);if(n[0]!==pr)return n;try{e.options.onError?.(n[1])}catch(t){n=br(t,!0,e.id)}return n}function Sr(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[gr]):xr(e,t)}function Cr(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function wr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[4];for(let t=n[7]??0;t<r;t++){let r=s[t],i=yr(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Cr(e,o),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:i.id},f=u;try{let e=r._ctx;!e&&i.options.context&&(e=r._ctx=i.options.context({...d,deps:r.loaderDeps,context:u})||{}),f={...u,...e},r.context=f}catch(a){return Er(e,r),[t,Sr(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[gr]];let p=r.paramsError??r.searchError;if(p!==void 0)return Er(e,r),[t,Sr(i,p,n)];let m=i.options.beforeLoad;if(!m)continue;let h={...d,search:r.search,context:f,...e.options.additionalContext},g=r.status;g===`success`&&t>=a&&(r.status=`pending`),n[8]?.();try{kr(e,r,`beforeLoad`,n[0]);let a=await vr(m(h),c);if(!n[2]())return n[0].abort(),[t,[gr]];let o=br(a,!1,i.id);if(o[0]!==fr)return Er(e,r),[t,o];r.context={...f,...a}}catch(a){return Er(e,r),[t,Sr(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),kr(e,r,!1,n[0])}}i()}function Tr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Er(e,t){let n=t._flight;t._flight=void 0,Tr(e,t,n)?.abort()}function Dr(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Tr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Or(e){for(let t of e){let e=t._flight;e&&e[2]++}}function kr(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ar(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Cr(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function jr(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[gr];if(!i)return[fr,void 0];let l=n._flight;kr(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ar(e,t,n,r,s,a,o))).then(e=>br(e,!1,r.id),e=>br(e,!0,r.id)).then(t=>(t[0]!==fr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===pr&&l[2]?xr(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await vr(l[0],c)}catch(t){if(t!==c)throw t;return Er(e,n),[gr]}finally{kr(e,n,!1,s)}}function Mr(e,t,n){t[0]===fr?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==hr&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Nr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Er(e,r)}function Pr(e,t){return t[0]===pr||t[0]===mr?{...e,status:t[0]===pr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Fr(e,t,n,r,i,a,o){let s=t[1][n],c=yr(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ar(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[gr])),!p){if(s.status!==`success`)f=!0;else{let t=a[4]||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[6]||s.cause===`enter`||a[3].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(t){s.invalid=!0,Er(e,s),p=Sr(c,t,a)}let m=c.options.loader,h=typeof m==`function`?m:m?.handler,g=(!l||c.options.preload!==!1)&&m?e._flights?.get(s.id):void 0;g===s._flight||p?g=void 0:g&&!f&&!l&&d===void 0?f=!0:f||(g=void 0);let _=!!(m&&f&&s.status===`success`&&!l&&!a[5]&&((typeof m==`function`?void 0:m?.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),v=f&&(!l||c.options.preload!==!1),y=v&&!_&&(s.status!==`success`||!!m),b=c.lazyFn&&c._lazy!==!0?a[8]:void 0;if(v&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),g&&g[2]++,y){let t=s._flight;s._flight=g,Tr(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?jr(e,t,s,c,h,i,l,a[0]):Promise.resolve([fr,s.loaderData])).then(t=>(y&&(Mr(s,t,l),t[0]===fr&&(l&&m&&!a[0].signal.aborted&&Nr(e,s,u),s.status=`pending`)),t)),S=vr(Promise.resolve().then(()=>ur(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,Sr(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===fr&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Pr(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=jr(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Mr(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>Pr(C,e))}async function Ir(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=yr(e,t[n]),a=ur(i,!1);if(a)try{await vr(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Lr(e,t){t[2]&&=(Dr(e,t[2].map(e=>e[3])),void 0)}async function Rr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=hr)throw[a,t];!i&&t[0]!==fr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===hr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function zr(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===mr?Ir(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=hr)f=0;else if(c){f=c[2]??=await d(c);for(let e of n){if(e[0]>=f)break;let t=await e[1];if(t[0]!==fr&&t[0]<hr&&!(`loaderData`in s[e[0]])){c=[e[0],t],f=c[2]=await d(c);break}}}for(let e of n){if(e[0]>=f)break;let t=await e[2];if(t){c=t;break}}if((c?.[1][0]??0)>=hr){let n=c[1];if(n[0]!==hr||n[1].options.reloadDocument||i<20)return Lr(e,t),n;l=!0,c=[0,[pr,Error(`Too many redirects`)]]}let p=c?c[2]??await d(c):u;if(p>=0){let i=c?.[1],a=i?.[0],u=s[p],d=i?.[1],f=()=>{i&&(u._notFound=void 0,a===pr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};f();let m=yr(e,u);try{await vr(i?Promise.resolve().then(()=>ur(m,a===pr?`errorComponent`:`notFoundComponent`)):Promise.all([ur(m),ur(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return Lr(e,t),[gr]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Lr(e,t),Dr(e,s),f()):(u.status=`success`,o?.())}return t}async function Br(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=yr(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await vr(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Vr(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Ir(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=Fr(e,i,t,l,d,r,c)},p=await wr(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===mr?(p[2]=await Ir(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=hr&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=zr(e,i,l,r[0],r[1],Rr(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Rr(i[2],void 0,void 0,t.then(e=>_r(e)?0:dr(e[1]).length,()=>0))),m=await t}catch(t){throw Lr(e,i),t}return _r(m)?m:Br(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function Hr(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=yr(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>Hr(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function Ur(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function Wr(e,t){e._committed=t,e.stores.setMatches(t)}function Gr(e,t){Dr(e,t[1]),Lr(e,t)}function Kr(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=dr(n).length,s=new Map,c=Date.now();for(let t of[...i,...a.values()]){if(t.status!==`success`||n.some((e,n)=>e.id===t.id&&(n<o||e.status===`success`)))continue;let r=yr(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,Wr(e,n),Dr(e,[...a.values(),...i],[...n,...s.values()]),$n(e,i,n,()=>e._tx===t)}async function qr(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function Jr(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function Yr(e,t){Ur(e,t),t[0].abort(),Dr(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function Xr(e,t,n,r,i){let a=n.map(e=>({...e}));Or(a);for(let t of r)Er(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await zr(e,o,r,t[0],t[1],i)}catch(t){throw Dr(e,a),t}if(_r(s)){Dr(e,a),s[0]===hr&&e._tx===t&&e._committed===n&&await Jr(e,t,s[1]);return}let c=await Br(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){Dr(e,c[1]);return}for(let t of c[1]){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Er(e,n))}Wr(e,c[1]),Dr(e,n,c[1])}async function Zr(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Vr(e,t[2],t[3],o);if(_r(s)){s[0]===hr&&e._tx===t?(Ur(e,t),Dr(e,t[3]),t[3]=[],e._tx===t&&await Jr(e,t,s[1])):Yr(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await vr(c[4],n)}catch(e){if(e!==n)throw e}if(r&&e._pending===c&&c[0]===t){let e=c[2]-Date.now();if(e>0){try{await vr(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){Ur(e,t),Gr(e,s);return}let l=t[2],u=Zn(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){Gr(e,s);return}let n=await e.startTransition(()=>{Ur(e,t),Kr(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){Lr(e,s);return}d?.length&&Xr(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Qr(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await qr(e,n);return}let f=Zn(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await qr(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Or(m)}catch(t){if(u.abort(),!Fn(t)){await qr(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await qr(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){Dr(e,m),await qr(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>Zr(e,_,p,()=>Hr(e,_),t?.sync,g)).catch(()=>{e._tx===_&&Yr(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&kr(e,t,!1)}n[0].abort(),Dr(e,n[3],_[3],!0)}if(e._tx!==_){Dr(e,_[3]),_[3]=[],await qr(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&Hr(e,_);try{await _[5]}finally{await qr(e,_)}}async function $r(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Or(o)}catch(e){a.abort(),un(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Vr(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),Dr(e,o),a.abort()}if(!_r(t))return t[1];if(s&&t[0]===hr&&!t[1].options.reloadDocument)return $r(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){un(e)||console.error(e)}}var ei=`Error preloading route! ☝️`,ti=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Nn:this.parentRoute||Tt();let r=n?Nn:t?.path;r&&r!==`/`&&(r=Qt(r));let i=t?.id||r,a=n?Nn:Xt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Xt([`/`,a]));let o=a===`__root__`?`/`:Xt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=$t(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Pn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ni=class{constructor({id:e}){this.notFound=e=>ln({routeId:this.id,...e}),this.redirect=e=>Pn({from:this.id,...e}),this.id=e}},ri=class extends ti{constructor(e){super(e)}};function ii(e){return(0,Y.jsx)(ai,{...e})}var ai=class extends J.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?J.createElement(this.props.errorComponent??oi,{error:e,reset:this.reset}):this.props.children}};function oi({error:e}){let[t,n]=J.useState(!1);return(0,Y.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Y.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Y.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Y.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Y.jsx)(`code`,{children:e.message}):null})}):null]})}function si({children:e,fallback:t=null}){return(0,Y.jsx)(J.Fragment,{children:ci()?e:t})}function ci(){return J.useSyncExternalStore(li,()=>!0,()=>!1)}function li(){return()=>{}}var ui=J.createContext(null);function di(e){return J.useContext(ui)}var fi=J.createContext(void 0),pi=J.createContext(void 0),mi=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(mi||{});function hi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function gi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var _i=[],vi=0,{link:yi,unlink:bi,propagate:xi,checkDirty:Si,shallowPropagate:Ci}=hi({update(e){return e._update()},notify(e){_i[Ti++]=e,e.flags&=~mi.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=mi.Mutable|mi.Dirty,ki(e))}}),wi=0,Ti=0,Ei,Di=0;function Oi(e){try{++Di,e()}finally{--Di||Ai()}}function ki(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=bi(n,e)}function Ai(){if(!(Di>0)){for(;wi<Ti;){let e=_i[wi];_i[wi++]=void 0,e.notify()}wi=0,Ti=0}}function ji(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?mi.None:mi.Mutable,get(){return Ei!==void 0&&yi(i,Ei,vi),i._snapshot},subscribe(e){let t=gi(e),n={current:!1},r=Mi(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ei,o=t?.compare??Object.is;if(n)Ei=i,++vi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=mi.Mutable|mi.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Ei=a,n&&(i.flags&=~mi.RecursedCheck),ki(i)}}};return n?(i.flags=mi.Mutable|mi.Dirty,i.get=function(){let e=i.flags;if(e&mi.Dirty||e&mi.Pending&&Si(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ci(e)}}else e&mi.Pending&&(i.flags=e&~mi.Pending);return Ei!==void 0&&yi(i,Ei,vi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(xi(e),Ci(e),Ai())}},i}function Mi(e){let t=()=>{let t=Ei;Ei=n,++vi,n.depsTail=void 0,n.flags=mi.Watching|mi.RecursedCheck;try{return e()}finally{Ei=t,n.flags&=~mi.RecursedCheck,ki(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:mi.Watching|mi.RecursedCheck,notify(){let e=this.flags;e&mi.Dirty||e&mi.Pending&&Si(this.deps,this)?t():this.flags=mi.Watching},stop(){this.flags=mi.None,this.depsTail=void 0,ki(this)}};return t(),n}var Ni=s((e=>{var t=Me();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Pi=s(((e,t)=>{t.exports=Ni()})),Fi=s((e=>{var t=Me(),n=Pi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ii=u(s(((e,t)=>{t.exports=Fi()}))(),1);function Li(e,t){return e===t}function Ri(e,t,n=Li){let r=(0,J.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,J.useCallback)(()=>e?.get(),[e]);return(0,Ii.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var zi={};function Bi(e,t){let n=J.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=dt(n.current,i):i}}function Vi(e){let t=di(),n=J.useContext(e.from?pi:fi),r=e.from??n,i=t.stores.getMatchStore(r),a=Bi(e,t),o=Ri(i,e=>e?a(e):zi);if(o!==zi)return o;(e.shouldThrow??!0)&&Tt()}function Hi(e){return Vi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ui(e){let{select:t,...n}=e;return Vi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Wi(e){return Vi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Gi(e){return Vi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ki(e){let t=di();return J.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function qi(e){let t=di(),n=Ki(),r=J.useRef(null);return et(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function Ji(e){return Vi({...e,select:t=>e.select?e.select(t.context):t.context})}var Yi=s((e=>{var t=Me();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),Xi=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Yi()})),Zi=u(Xi(),1);function Qi(e){let t=J.useRef(e);return gt(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function $i(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ea(e,t,n){if(e?.external)return xt(e.href,n)?void 0:e.href;if(!fa(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),xt(t,n)?void 0:t}catch{}}function ta(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!nn(e.pathname,t.pathname,r))return!1}else{let n=tn(e.pathname,r),i=tn(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!gt(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function na(e,t){let n=di(),r=nt(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:P,from:F,_fromLocation:I,...L}=e,R=ci(),z=Qi(e.search),B=Qi(e.params),V=Qi(o),H=J.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,z,B,e.state,e.mask,e.unsafeRelative]),U=J.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...H}),r=da(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,v),i=ea(r,s,n.protocolAllowlist);return[r?.href,i,ta(e,t,V,n.basepath,R,i!==void 0)]},[V,v,R,H,n,s]),[W,G,K]=Ri(n.stores.location,U,$i),ee=K?at(i,{})??ia:ra,q=K?ra:at(a,{})??ra,te=[b,ee.className,q.className].filter(Boolean).join(` `),ne=(y||ee.style||q.style)&&{...y,...ee.style,...q.style},[re,ie]=J.useState(!1),ae=J.useRef(!1),oe=e.reloadDocument||G?!1:c??n.options.defaultPreload,se=l??n.options.defaultPreloadDelay??0,ce=J.useCallback(()=>{n.preloadRoute(H).catch(e=>{console.warn(e),console.warn(ei)})},[n,H]);tt(r,J.useCallback(e=>{e?.isIntersecting&&ce()},[ce]),la,!!v||oe!==`viewport`),J.useEffect(()=>{ae.current||!v&&oe===`render`&&(ce(),ae.current=!0)},[v,ce,oe]);let le=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!ma(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Zi.flushSync)(()=>{ie(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ie(!1)});n.navigate({...H,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(G)return{...L,ref:r,href:G,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let ue=e=>{if(v||oe!==`intent`)return;if(!se){ce();return}let t=e.currentTarget;if(ca.has(t))return;let n=setTimeout(()=>{ca.delete(t),ce()},se);ca.set(t,n)},de=e=>{v||oe!==`intent`||ce()},fe=e=>{if(v||!oe||!se)return;let t=e.currentTarget,n=ca.get(t);n&&(clearTimeout(n),ca.delete(t))};return{...L,...ee,...q,href:W,ref:r,onClick:ua([x,le]),onBlur:ua([S,fe]),onFocus:ua([C,ue]),onMouseEnter:ua([w,ue]),onMouseLeave:ua([T,fe]),onTouchStart:ua([E,de]),disabled:!!v,target:_,...ne&&{style:ne},...te&&{className:te},...v&&aa,...K&&oa,...R&&re&&sa}}var ra={},ia={className:`active`},aa={role:`link`,"aria-disabled":!0},oa={"data-status":`active`,"aria-current":`page`},sa={"data-transitioning":`transitioning`},ca=new WeakMap,la={rootMargin:`100px`},ua=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function da(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function fa(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var pa=J.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=na(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return J.createElement(`a`,t,o)}return J.createElement(n,a,o)});function ma(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ha(e){return new ga({id:e})}var ga=class extends ni{constructor({id:e}){super({id:e}),this.useMatch=e=>Vi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ji({...e,from:this.id}),this.useSearch=e=>Gi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ui({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Hi({...e,from:this.id,strict:!1}),this.useNavigate=()=>Ki({from:di().routesById[this.id].fullPath}),this.notFound=e=>ln({routeId:this.id,...e}),this.Link=J.forwardRef((e,t)=>{let n=di().routesById[this.id].fullPath;return(0,Y.jsx)(pa,{ref:t,from:n,...e})})}},_a=class extends ti{constructor(e){super(e),this.useMatch=e=>Vi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ji({...e,from:this.id}),this.useSearch=e=>Gi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ui({...e,from:this.id}),this.useLoaderData=e=>Hi({...e,from:this.id}),this.useNavigate=()=>Ki({from:this.fullPath}),this.Link=J.forwardRef((e,t)=>(0,Y.jsx)(pa,{ref:t,from:this.fullPath,...e}))}};function va(e){return new _a(e)}var ya=class extends ri{constructor(e){super(e),this.useMatch=e=>Vi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ji({...e,from:this.id}),this.useSearch=e=>Gi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ui({...e,from:this.id}),this.useLoaderData=e=>Hi({...e,from:this.id}),this.useNavigate=()=>Ki({from:this.fullPath}),this.Link=J.forwardRef((e,t)=>(0,Y.jsx)(pa,{ref:t,from:this.fullPath,...e}))}};function ba(e){return new ya(e)}function xa(e){let t=di(),n=`not-found-${Ri(t.stores.location,e=>e.pathname)}-${Ri(t.stores.status,e=>e)}`;return(0,Y.jsx)(ii,{getResetKey:()=>n,onCatch:(t,n)=>{if(un(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(un(t))return e.fallback?.(t);throw t},children:e.children})}function Sa(){return(0,Y.jsx)(`p`,{children:`Not Found`})}function Ca(e){return(0,Y.jsx)(Y.Fragment,{children:e.children})}function wa(e,t,n){return t.options.notFoundComponent?(0,Y.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Y.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Y.jsx)(Sa,{})}function Ta(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,Y.jsx)(n,{}):null}var Ea=(e,t)=>e[0]===t[0]&&e[1]===t[1],Da=J.memo(function({routeId:e}){let t=di();return(0,Y.jsx)(Oa,{router:t,match:Ri(t.stores.getMatchStore(e),e=>e)})});function Oa({router:e,match:t}){let n=e.routesById[t.routeId],r=Ta(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)?J.Suspense:Ca,l=i?ii:Ca,u=o?xa:Ca;return(0,Y.jsxs)(n.isRoot?n.options.shellComponent??Ca:Ca,{children:[(0,Y.jsx)(fi.Provider,{value:t.routeId,children:(0,Y.jsx)(c,{fallback:r,children:(0,Y.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(un(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,Y.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return J.createElement(o,e)},children:s?(0,Y.jsx)(si,{fallback:r,children:(0,Y.jsx)(ka,{match:t})}):(0,Y.jsx)(ka,{match:t})})})})}),null]})}var ka=J.memo(function({match:e}){let t=di(),n=e.routeId,r=t.routesById[n],i=J.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=J.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,Y.jsx)(e,{},i):(0,Y.jsx)(Aa,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t._tx)throw t._tx[5];return Ta(t,r)}if(e.status===`notFound`)return wa(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Aa=J.memo(function(){let e=di(),t=J.useContext(fi),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Ri(a,e=>[!!e._notFound,e.error],Ea),i=Ri(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return wa(e,e.routesById[t],r);if(!i)return null;let a=(0,Y.jsx)(Da,{routeId:i});return t===`__root__`?(0,Y.jsx)(J.Suspense,{fallback:Ta(e),children:a}):a});function ja(e,t){let n=e[1];e.length=0,n?.(t)}function Ma({t:e}){let t=di(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{ja(n,!1),n.push(i,a),e(t),J.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),et(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if($t(r.publicHref)!==$t(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Zn(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Na(){let e=di(),t=e.routesById[Nn],n=Ta(e,t),r=e.ssr?Ca:J.Suspense,i=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ma,{t:J.useState()[1]}),(0,Y.jsx)(r,{fallback:n,children:(0,Y.jsx)(Pa,{})})]});return e.options.InnerWrap?(0,Y.jsx)(e.options.InnerWrap,{children:i}):i}function Pa(){let e=di(),t=e._rendered,n=Ri(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;et(()=>{t[0]===n&&ja(t,!0)},[t,n]);let a=i?(0,Y.jsx)(Da,{routeId:i}):null;return(0,Y.jsx)(fi.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,Y.jsx)(ii,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Fa=e=>({createMutableStore:ji,createReadonlyStore:ji,batch:Oi}),Ia=e=>new La(e),La=class extends er{constructor(e){super(e,Fa)}};function Ra({router:e,children:t,...n}){ct(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,Y.jsx)(ui.Provider,{value:e,children:t});return e.options.Wrap?(0,Y.jsx)(e.options.Wrap,{children:r}):r}function za({router:e,...t}){return(0,Y.jsx)(Ra,{router:e,...t,children:(0,Y.jsx)(Na,{})})}var Ba=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),eee=s(((e,t)=>{t.exports=Ba()})),Va=s((e=>{var t=eee(),n=Me(),r=Xi();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function R(e){return{current:e}}function z(e){0>L||(e.current=I[L],I[L]=null,L--)}function B(e,t){L++,I[L]=e.current,e.current=t}var V=R(null),H=R(null),U=R(null),W=R(null);function G(e,t){switch(B(U,t),B(H,e),B(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(V),B(V,e)}function K(){z(V),z(H),z(U)}function ee(e){e.memoizedState!==null&&B(W,e);var t=V.current,n=Gd(t,e.type);t!==n&&(B(H,e),B(V,n))}function q(e){H.current===e&&(z(V),z(H)),W.current===e&&(z(W),tp._currentValue=F)}var te,ne;function re(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``,ne=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+te+e+ne}var ie=!1;function ae(e,t){if(!e||ie)return``;ie=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?re(n):``}function oe(e,t){switch(e.tag){case 26:case 27:case 5:return re(e.type);case 16:return re(`Lazy`);case 13:return e.child!==t&&t!==null?re(`Suspense Fallback`):re(`Suspense`);case 19:return re(`SuspenseList`);case 0:case 15:return ae(e.type,!1);case 11:return ae(e.type.render,!1);case 1:return ae(e.type,!0);case 31:return re(`Activity`);default:return``}}function se(e){try{var t=``,n=null;do t+=oe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var ce=Object.prototype.hasOwnProperty,le=t.unstable_scheduleCallback,ue=t.unstable_cancelCallback,de=t.unstable_shouldYield,fe=t.unstable_requestPaint,pe=t.unstable_now,me=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,_e=t.unstable_NormalPriority,ve=t.unstable_LowPriority,ye=t.unstable_IdlePriority,be=t.log,xe=t.unstable_setDisableYieldValue,Se=null,Ce=null;function we(e){if(typeof be==`function`&&xe(e),Ce&&typeof Ce.setStrictMode==`function`)try{Ce.setStrictMode(Se,e)}catch{}}var Te=Math.clz32?Math.clz32:Oe,Ee=Math.log,De=Math.LN2;function Oe(e){return e>>>=0,e===0?32:31-(Ee(e)/De|0)|0}var ke=256,Ae=262144,je=4194304;function Ne(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ne(n))):i=Ne(o):i=Ne(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ne(n))):i=Ne(o)):i=Ne(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function J(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Y(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fe(){var e=je;return je<<=1,!(je&62914560)&&(je=4194304),e}function Ie(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Le(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Re(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Te(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Te(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Be(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Te(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ve(e,t){var n=t&-t;return n=n&42?1:He(n),(n&(e.suspendedLanes|t))===0?n:0}function He(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ue(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function We(){var e=P.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function Ge(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ke=Math.random().toString(36).slice(2),qe=`__reactFiber$`+Ke,Je=`__reactProps$`+Ke,Ye=`__reactContainer$`+Ke,Xe=`__reactEvents$`+Ke,Ze=`__reactListeners$`+Ke,Qe=`__reactHandles$`+Ke,$e=`__reactResources$`+Ke,et=`__reactMarker$`+Ke;function tt(e){delete e[qe],delete e[Je],delete e[Xe],delete e[Ze],delete e[Qe]}function nt(e){var t=e[qe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ye]||n[qe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[qe])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function rt(e){if(e=e[qe]||e[Ye]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function it(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function at(e){var t=e[$e];return t||=e[$e]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ot(e){e[et]=!0}var st=new Set,ct={};function lt(e,t){ut(e,t),ut(e+`Capture`,t)}function ut(e,t){for(ct[e]=t,e=0;e<t.length;e++)st.add(t[e])}var dt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),ft={},pt={};function mt(e){return ce.call(pt,e)?!0:ce.call(ft,e)?!1:dt.test(e)?pt[e]=!0:(ft[e]=!0,!1)}function ht(e,t,n){if(mt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function _t(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function vt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function bt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xt(e){if(!e._valueTracker){var t=yt(e)?`checked`:`value`;e._valueTracker=bt(e,t,``+e[t])}}function St(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ct(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var wt=/[\n"\\]/g;function Tt(e){return e.replace(wt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Et(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+vt(t)):e.value!==``+vt(t)&&(e.value=``+vt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ot(e,o,vt(n)):Ot(e,o,vt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+vt(s):e.removeAttribute(`name`)}function Dt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){xt(e);return}n=n==null?``:``+vt(n),t=t==null?n:``+vt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),xt(e)}function Ot(e,t,n){t===`number`&&Ct(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function kt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function At(e,t,n){if(t!=null&&(t=``+vt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+vt(n)}function jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=vt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),xt(e)}function Mt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Pt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Nt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ft(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Pt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Pt(e,o,t[o])}function It(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Lt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Rt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function zt(e){return Rt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Bt(){}var Vt=null;function Ht(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ut=null,Wt=null;function Gt(e){var t=rt(e);if(t&&(e=t.stateNode)){var n=e[Je]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Et(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Tt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Je]||null;if(!a)throw Error(i(90));Et(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&St(r)}break a;case`textarea`:At(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&kt(e,!!n.multiple,t,!1)}}}var Kt=!1;function qt(e,t,n){if(Kt)return e(t,n);Kt=!0;try{return e(t)}finally{if(Kt=!1,(Ut!==null||Wt!==null)&&(bu(),Ut&&(t=Ut,e=Wt,Wt=Ut=null,Gt(t),e)))for(t=0;t<e.length;t++)Gt(e[t])}}function Jt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Je]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Yt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Xt=!1;if(Yt)try{var Zt={};Object.defineProperty(Zt,"passive",{get:function(){Xt=!0}}),window.addEventListener(`test`,Zt,Zt),window.removeEventListener(`test`,Zt,Zt)}catch{Xt=!1}var Qt=null,$t=null,en=null;function tn(){if(en)return en;var e,t=$t,n=t.length,r,i=`value`in Qt?Qt.value:Qt.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return en=i.slice(e,1<r?1-r:void 0)}function nn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function rn(){return!0}function an(){return!1}function on(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?rn:an,this.isPropagationStopped=an,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(sn),ln=f({},sn,{view:0,detail:0}),un=on(ln),dn,fn,pn,mn=f({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==pn&&(pn&&e.type===`mousemove`?(dn=e.screenX-pn.screenX,fn=e.screenY-pn.screenY):fn=dn=0,pn=e),dn)},movementY:function(e){return`movementY`in e?e.movementY:fn}}),hn=on(mn),gn=on(f({},mn,{dataTransfer:0})),_n=on(f({},ln,{relatedTarget:0})),vn=on(f({},sn,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=on(f({},sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),bn=on(f({},sn,{data:0})),xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Sn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Cn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cn[e])?!!t[e]:!1}function Tn(){return wn}var En=on(f({},ln,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=nn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Sn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tn,charCode:function(e){return e.type===`keypress`?nn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?nn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Dn=on(f({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),On=on(f({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),kn=on(f({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=on(f({},mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),jn=on(f({},sn,{newState:0,oldState:0})),Mn=[9,13,27,32],Nn=Yt&&`CompositionEvent`in window,Pn=null;Yt&&`documentMode`in document&&(Pn=document.documentMode);var Fn=Yt&&`TextEvent`in window&&!Pn,In=Yt&&(!Nn||Pn&&8<Pn&&11>=Pn),Ln=` `,Rn=!1;function zn(e,t){switch(e){case`keyup`:return Mn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Bn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Vn=!1;function Hn(e,t){switch(e){case`compositionend`:return Bn(t);case`keypress`:return t.which===32?(Rn=!0,Ln):null;case`textInput`:return e=t.data,e===Ln&&Rn?null:e;default:return null}}function Un(e,t){if(Vn)return e===`compositionend`||!Nn&&zn(e,t)?(e=tn(),en=$t=Qt=null,Vn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return In&&t.locale!==`ko`?null:t.data;default:return null}}var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Wn[e.type]:t===`textarea`}function Kn(e,t,n,r){Ut?Wt?Wt.push(r):Wt=[r]:Ut=r,t=Od(t,`onChange`),0<t.length&&(n=new cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var qn=null,Jn=null;function Yn(e){bd(e,0)}function Xn(e){if(St(it(e)))return e}function Zn(e,t){if(e===`change`)return t}var Qn=!1;if(Yt){var $n;if(Yt){var er=`oninput`in document;if(!er){var tr=document.createElement(`div`);tr.setAttribute(`oninput`,`return;`),er=typeof tr.oninput==`function`}$n=er}else $n=!1;Qn=$n&&(!document.documentMode||9<document.documentMode)}function nr(){qn&&(qn.detachEvent(`onpropertychange`,rr),Jn=qn=null)}function rr(e){if(e.propertyName===`value`&&Xn(Jn)){var t=[];Kn(t,Jn,e,Ht(e)),qt(Yn,t)}}function ir(e,t,n){e===`focusin`?(nr(),qn=t,Jn=n,qn.attachEvent(`onpropertychange`,rr)):e===`focusout`&&nr()}function ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Xn(Jn)}function or(e,t){if(e===`click`)return Xn(t)}function sr(e,t){if(e===`input`||e===`change`)return Xn(t)}function cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var lr=typeof Object.is==`function`?Object.is:cr;function ur(e,t){if(lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ce.call(t,i)||!lr(e[i],t[i]))return!1}return!0}function dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fr(e,t){var n=dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=dr(n)}}function pr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ct(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ct(e.document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var gr=Yt&&`documentMode`in document&&11>=document.documentMode,_r=null,vr=null,yr=null,br=!1;function xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;br||_r==null||_r!==Ct(r)||(r=_r,`selectionStart`in r&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),yr&&ur(yr,r)||(yr=r,r=Od(vr,`onSelect`),0<r.length&&(t=new cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=_r)))}function Sr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Cr={animationend:Sr(`Animation`,`AnimationEnd`),animationiteration:Sr(`Animation`,`AnimationIteration`),animationstart:Sr(`Animation`,`AnimationStart`),transitionrun:Sr(`Transition`,`TransitionRun`),transitionstart:Sr(`Transition`,`TransitionStart`),transitioncancel:Sr(`Transition`,`TransitionCancel`),transitionend:Sr(`Transition`,`TransitionEnd`)},wr={},Tr={};Yt&&(Tr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),`TransitionEvent`in window||delete Cr.transitionend.transition);function Er(e){if(wr[e])return wr[e];if(!Cr[e])return e;var t=Cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Tr)return wr[e]=t[n];return e}var Dr=Er(`animationend`),Or=Er(`animationiteration`),kr=Er(`animationstart`),Ar=Er(`transitionrun`),jr=Er(`transitionstart`),Mr=Er(`transitioncancel`),Nr=Er(`transitionend`),Pr=new Map,Fr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Fr.push(`scrollEnd`);function Ir(e,t){Pr.set(e,t),lt(t,[e])}var Lr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Rr=[],zr=0,Br=0;function Vr(){for(var e=zr,t=Br=zr=0;t<e;){var n=Rr[t];Rr[t++]=null;var r=Rr[t];Rr[t++]=null;var i=Rr[t];Rr[t++]=null;var a=Rr[t];if(Rr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Gr(n,i,a)}}function Hr(e,t,n,r){Rr[zr++]=e,Rr[zr++]=t,Rr[zr++]=n,Rr[zr++]=r,Br|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ur(e,t,n,r){return Hr(e,t,n,r),Kr(e)}function Wr(e,t){return Hr(e,null,null,t),Kr(e)}function Gr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Te(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Kr(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var qr={};function Jr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(e,t,n,r){return new Jr(e,t,n,r)}function Xr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zr(e,t){var n=e.alternate;return n===null?(n=Yr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Qr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function $r(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)Xr(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,V.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=Yr(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ei(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=Yr(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=Yr(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=Yr(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Yr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ei(e,t,n,r){return e=Yr(7,e,r,t),e.lanes=n,e}function ti(e,t,n){return e=Yr(6,e,null,t),e.lanes=n,e}function ni(e){var t=Yr(18,null,null,0);return t.stateNode=e,t}function ri(e,t,n){return t=Yr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ii=new WeakMap;function ai(e,t){if(typeof e==`object`&&e){var n=ii.get(e);return n===void 0?(t={value:e,source:t,stack:se(t)},ii.set(e,t),t):n}return{value:e,source:t,stack:se(t)}}var oi=[],si=0,ci=null,li=0,ui=[],di=0,fi=null,pi=1,mi=``;function hi(e,t){oi[si++]=li,oi[si++]=ci,ci=e,li=t}function gi(e,t,n){ui[di++]=pi,ui[di++]=mi,ui[di++]=fi,fi=e;var r=pi;e=mi;var i=32-Te(r)-1;r&=~(1<<i),n+=1;var a=32-Te(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,pi=1<<32-Te(t)+i|n<<i|r,mi=a+e}else pi=1<<a|n<<i|r,mi=e}function _i(e){e.return!==null&&(hi(e,1),gi(e,1,0))}function vi(e){for(;e===ci;)ci=oi[--si],oi[si]=null,li=oi[--si],oi[si]=null;for(;e===fi;)fi=ui[--di],ui[di]=null,mi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null}function yi(e,t){ui[di++]=pi,ui[di++]=mi,ui[di++]=fi,pi=t.id,mi=t.overflow,fi=e}var bi=null,xi=null,Si=!1,Ci=null,wi=!1,Ti=Error(i(519));function Ei(e){throw Mi(ai(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ti}function Di(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[qe]=e,t[Je]=r,n){case`dialog`:xd(`cancel`,t),xd(`close`,t);break;case`iframe`:case`object`:case`embed`:xd(`load`,t);break;case`video`:case`audio`:for(n=0;n<vd.length;n++)xd(vd[n],t);break;case`source`:xd(`error`,t);break;case`img`:case`image`:case`link`:xd(`error`,t),xd(`load`,t);break;case`details`:xd(`toggle`,t);break;case`input`:xd(`invalid`,t),Dt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:xd(`invalid`,t);break;case`textarea`:xd(`invalid`,t),jt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Pd(t.textContent,n)?(r.popover!=null&&(xd(`beforetoggle`,t),xd(`toggle`,t)),r.onScroll!=null&&xd(`scroll`,t),r.onScrollEnd!=null&&xd(`scrollend`,t),r.onClick!=null&&(t.onclick=Bt),t=!0):t=!1,t||Ei(e,!0)}function Oi(e){for(bi=e.return;bi;)switch(bi.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:bi=bi.return}}function ki(e){if(e!==bi)return!1;if(!Si)return Oi(e),Si=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Kd(e.type,e.memoizedProps)),n=!n),n&&xi&&Ei(e),Oi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));xi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));xi=pf(e)}else t===27?(t=xi,ef(e.type)?(e=ff,ff=null,xi=e):xi=t):xi=bi?df(e.stateNode.nextSibling):null;return!0}function Ai(){xi=bi=null,Si=!1}function ji(){var e=Ci;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ci=null),e}function Mi(e){Ci===null?Ci=[e]:Ci.push(e)}var Ni=R(null),Pi=null,Fi=null;function Ii(e,t,n){B(Ni,t._currentValue),t._currentValue=n}function Li(e){e._currentValue=Ni.current,z(Ni)}function Ri(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ri(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ri(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Bi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===W.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&zi(t,e,n,r),t.flags|=262144}function Vi(e){for(e=e.firstContext;e!==null;){if(!lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hi(e){Pi=e,Fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ui(e){return Gi(Pi,e)}function Wi(e,t){return Pi===null&&Hi(e),Gi(e,t)}function Gi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fi===null){if(e===null)throw Error(i(308));Fi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fi=Fi.next=t;return n}var Ki=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},qi=t.unstable_scheduleCallback,Ji=t.unstable_NormalPriority,Yi={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zi(){return{controller:new Ki,data:new Map,refCount:0}}function Qi(e){e.refCount--,e.refCount===0&&qi(Ji,function(){e.controller.abort()})}var $i=null,ea=0,ta=0,na=null;function ra(e,t){if($i===null){var n=$i=[];ea=0,ta=fd(),na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ea++,t.then(ia,ia),t}function ia(){if(--ea===0&&$i!==null){na!==null&&(na.status=`fulfilled`);var e=$i;$i=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function aa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var oa=N.S;N.S=function(e,t){eu=pe(),typeof t==`object`&&t&&typeof t.then==`function`&&ra(e,t),oa!==null&&oa(e,t)};var sa=R(null);function ca(){var e=sa.current;return e===null?Fl.pooledCache:e}function la(e,t){t===null?B(sa,sa.current):B(sa,t.pool)}function ua(){var e=ca();return e===null?null:{parent:Yi._currentValue,pool:e}}var da=Error(i(460)),fa=Error(i(474)),pa=Error(i(542)),ma={then:function(){}};function ha(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Bt,Bt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e;default:if(typeof t.status==`string`)t.then(Bt,Bt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e}throw va=t,da}}function _a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(va=e,da):e}}var va=null;function ya(){if(va===null)throw Error(i(459));var e=va;return va=null,e}function ba(e){if(e===da||e===pa)throw Error(i(483))}var xa=null,Sa=0;function Ca(e){var t=Sa;return Sa+=1,xa===null&&(xa=[]),ga(xa,e,t)}function wa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ta(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ea(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Zr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ti(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&_a(i)===t.type)?(t=a(t,n.props),wa(t,n),t.return=e,t):(t=$r(n.type,n.key,n.props,null,e.mode,r),wa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ri(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ei(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ti(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=$r(t.type,t.key,t.props,null,e.mode,n),wa(n,t),n.return=e,n;case h:return t=ri(t,e.mode,n),t.return=e,t;case T:return t=_a(t),f(e,t,n)}if(M(t)||k(t))return t=ei(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ca(t),n);if(t.$$typeof===b)return f(e,Wi(e,t),n);Ta(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=_a(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ca(n),r);if(n.$$typeof===b)return p(e,t,Wi(e,n),r);Ta(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=_a(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ca(r),i);if(r.$$typeof===b)return _(e,t,n,Wi(t,r),i);Ta(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Si&&hi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Si&&hi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Si&&hi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Si&&hi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Si&&hi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Si&&hi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&_a(l)===r.type){n(e,r.sibling),c=a(r,o.props),wa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=ei(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=$r(o.type,o.key,o.props,null,e.mode,c),wa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ri(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=_a(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ca(o),c);if(o.$$typeof===b)return x(e,r,Wi(e,o),c);Ta(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ti(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Sa=0;var i=x(e,t,n,r);return xa=null,i}catch(t){if(t===da||t===pa)throw t;var a=Yr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Da=Ea(!0),Oa=Ea(!1),ka=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Kr(e),Gr(e,null,n),t}return Hr(e,r,t,n),Kr(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Be(e,n)}}function Fa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ia=!1;function La(){if(Ia){var e=na;if(e!==null)throw e}}function Ra(e,t,n,r){Ia=!1;var i=e.updateQueue;ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ll&p)===p:(r&p)===p){p!==0&&p===ta&&(Ia=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:ka=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ba(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)za(n[e],t)}var Va=R(null),Ha=R(0);function Ua(e,t){e=Ul,B(Ha,e),B(Va,t),Ul=e|t.baseLanes}function Wa(){B(Ha,Ul),B(Va,Va.current)}function Ga(){Ul=Ha.current,z(Va),z(Ha)}var Ka=R(null),qa=null;function Ja(e){var t=e.alternate;B($a,$a.current&1),B(Ka,e),qa===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(qa=e)}function Ya(e){B($a,$a.current),B(Ka,e),qa===null&&(qa=e)}function Xa(e){e.tag===22?(B($a,$a.current),B(Ka,e),qa===null&&(qa=e)):Za(e)}function Za(){B($a,$a.current),B(Ka,Ka.current)}function Qa(e){z(Ka),qa===e&&(qa=null),z($a)}var $a=R(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=0,no=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return to=a,no=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){N.H=js;var t=ro!==null&&ro.next!==null;if(to=0,io=ro=no=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Vi(e)&&(Xs=!0))}function _o(e,t,n,r){no=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(no.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}to=0,io=ro=no=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?no.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=no.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?no.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw no.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?no.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=ga(uo,e,t),t=no,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===b)return Ui(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=no.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=no.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),no.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(to&f)===f:(Ll&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ta&&(d=!0);else if((to&p)===p){u=u.next,p===ta&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,no.lanes|=p,Gl|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,no.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!lr(o,e.memoizedState)&&(Xs=!0,d&&(n=na,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);lr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=no,a=Co(),o=Si;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!lr((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||to&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=no.updateQueue,t===null?(t=wo(),no.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lr(e,n)}catch{return!0}}function Lo(e){var t=Wr(e,2);t!==null&&hu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){we(!0);try{n()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(Si){var n=Fl.formState;if(n!==null){a:{var r=no;if(Si){if(xi){b:{for(var i=xi,a=wi;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){xi=df(i.nextSibling),r=i.data===`F!`;break a}}Ei(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,no,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,no,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,no,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===da?pa:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(no.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=no.updateQueue,t===null&&(t=wo(),no.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();no.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(no.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){no.flags|=4;var t=no.updateQueue;if(t===null)t=wo(),no.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||to&1073741824&&!(Ll&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),no.lanes|=e,Gl|=e,n)}function ms(e,t,n,r){return lr(n,t)?n:Va.current===null?!(to&42)||to&1073741824&&!(Ll&261930)?(Xs=!0,e.memoizedState=n):(e=mu(),no.lanes|=e,Gl|=e,t):(e=ps(e,n,r),lr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ds(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,aa(c,r),pu(e)):Es(e,t,r,pu(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,F,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},pu())}function bs(){return Ui(tp)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ma(n);var r=Na(t,e,n);r!==null&&(hu(r,t,n),Pa(r,t,n)),t={cache:Zi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Ur(e,t,n,r),n!==null&&(hu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,pu())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,lr(s,o))return Hr(e,t,i,0),Fl===null&&Vr(),!1}catch{}if(n=Ur(e,t,i,r),n!==null)return hu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Ur(e,n,r,2),t!==null&&hu(t,e,2)}function Os(e){var t=e.alternate;return e===no||t!==null&&t===no}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Be(e,n)}}var js={readContext:Ui,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Ui,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Ui,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){we(!0);try{n(t)}finally{we(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,no,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,no,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,no,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=no,a=So();if(Si){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Ll&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(Si){var n=mi,r=pi;n=(r&~(1<<32-Te(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,no,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,no)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Ui,use:Eo,useCallback:ds,useContext:Ui,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Ui,use:Eo,useCallback:ds,useContext:Ui,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ma(r);i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(hu(t,e,r),Pa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ma(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(hu(t,e,r),Pa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ma(n);r.tag=2,t!=null&&(r.callback=t),t=Na(e,r,n),t!==null&&(hu(t,e,n),Pa(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!ur(n,r)||!ur(i,a):!0}function Rs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Lr(e)}function Vs(e){console.error(e)}function Hs(e){Lr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Ma(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Bi(t,n,a,!0),n=Ka.current,n!==null){switch(n.tag){case 31:case 13:return qa===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ku(e,r,a)),!1;case 22:return n.flags|=65536,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ku(e,r,a)),!1}throw Error(i(435,n.tag))}return Ku(e,r,a),Du(),!1}if(Si)return t=Ka.current,t===null?(r!==Ti&&(t=Error(i(423),{cause:r}),Mi(ai(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ai(r,n),a=Gs(e.stateNode,r,a),Fa(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ti&&(e=Error(i(422),{cause:r}),Mi(ai(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ai(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=ai(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Fa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Fa(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Da(t,e.child,n,r)}function Qs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Hi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Si&&s&&_i(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Xr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=$r(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?ur:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=Zr(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(ur(a,r)&&e.ref===t.ref){if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}}return cc(e,t,n,r,i)}function tc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&la(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Xa(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&la(t,null),Wa(),Za(t)):(la(t,a.cachePool),Ua(t,a),Za(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=ca();return a=a===null?null:{parent:Yi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&la(t,null),Wa(),Xa(t),e!==null&&Bi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Da(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,Qa(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Si){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Ya(t),(e=xi)?(e=sf(e,wi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fi===null?null:{id:pi,overflow:mi},retryLane:536870912,hydrationErrors:null},n=ni(e),n.return=t,t.child=n,bi=t,xi=null)):e=null,e===null)throw Ei(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ya(t),a){if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Xs||Bi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=Ve(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Wr(e,s),hu(r,e,s),Ys;Du(),t=ac(e,t,n)}else e=o.treeContext,xi=df(s.nextSibling),bi=t,Si=!0,Ci=null,wi=!1,e!==null&&yi(t,e),t=ic(t,r),t.flags|=4096;return t}return e=Zr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Hi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Si&&r&&_i(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Hi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(Si&&r&&_i(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Hi(t),t.stateNode===null){var a=qr,o=n.contextType;typeof o==`object`&&o&&(a=Ui(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Aa(t),o=n.contextType,a.context=typeof o==`object`&&o?Ui(o):qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Is.enqueueReplaceState(a,a.state,null),Ra(t,r,a,i),La(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=qr,typeof u==`object`&&u&&(o=Ui(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Rs(t,a,r,o),ka=!1;var f=t.memoizedState;a.state=f,Ra(t,r,a,i),La(),l=t.memoizedState,s||f!==l||ka?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=ka||Ls(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ja(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=qr,typeof l==`object`&&l&&(c=Ui(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Rs(t,a,r,c),ka=!1,f=t.memoizedState,a.state=f,Ra(t,r,a,i),La();var p=t.memoizedState;o!==d||f!==p||ka||e!==null&&e.dependencies!==null&&Vi(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=ka||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Vi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,sc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Da(t,e.child,null,i),t.child=Da(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Ai(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:ua()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!($a.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Si){if(a?Ja(t):Za(t),(e=xi)?(e=sf(e,wi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fi===null?null:{id:pi,overflow:mi},retryLane:536870912,hydrationErrors:null},n=ni(e),n.return=t,t.child=n,bi=t,xi=null)):e=null,e===null)throw Ei(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Za(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=ei(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ja(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ja(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Za(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=ei(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Da(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Za(t),t.child=e.child,t.flags|=128,t=null);else if(Ja(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Mi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Bi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=Ve(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Wr(e,r),hu(s,e,r),Ys;cf(c)||Du(),t=vc(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,xi=df(c.nextSibling),bi=t,Si=!0,Ci=null,wi=!1,e!==null&&yi(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Za(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=Zr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ei(c,a,n,null),c.flags|=2):c=Zr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=ua():(l=Yi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ja(t),n=e.child,e=n.sibling,n=Zr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=Yr(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Da(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ri(e.return,t,n)}function bc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=$a.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,B($a,o),Zs(e,t,r,n),r=Si?li:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Bi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Zr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Vi(e)))}function wc(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),Ii(t,Yi,e.memoizedState.cache),Ai();break;case 27:case 5:ee(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:Ii(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ya(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ja(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ja(t),t.flags|=128,null);Ja(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Bi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B($a,$a.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ii(t,Yi,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}}else Xs=!1,Si&&t.flags&1048576&&gi(t,li,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=_a(t.elementType),t.type=e,typeof e==`function`)Xr(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Qs(null,t,e,r,n);break a}if(a===w){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(G(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ja(e,t),Ra(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ii(t,Yi,r),r!==o.cache&&zi(t,[Yi],n,!0),La(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}if(r!==a){a=ai(Error(i(424)),t),Mi(a),t=dc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(xi=df(e.firstChild),bi=t,Si=!0,Ci=null,wi=!0,n=Oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ai(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Si||(n=t.type,e=t.pendingProps,r=Ud(U.current).createElement(n),r[qe]=t,r[Je]=e,Ld(r,n,e),ot(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Si&&(r=t.stateNode=hf(t.type,t.pendingProps,U.current),bi=t,wi=!0,a=xi,ef(t.type)?(ff=a,xi=df(r.firstChild)):xi=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Si&&((a=r=xi)&&(r=af(r,t.type,t.pendingProps,wi),r===null?a=!1:(t.stateNode=r,bi=t,xi=df(r.firstChild),wi=!1,a=!0)),a||Ei(t)),ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Kd(a,o)?r=null:s!==null&&Kd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),tp._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Si&&((e=n=xi)&&(n=of(n,t.pendingProps,wi),n===null?e=!1:(t.stateNode=n,bi=t,xi=null,e=!0)),e||Ei(t)),null;case 13:return hc(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Da(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ii(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Hi(t),a=Ui(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Hi(t),r=Ui(Yi),e===null?(a=ca(),a===null&&(a=Fl,o=Zi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Aa(t),Ii(t,Yi,a)):((e.lanes&n)!==0&&(ja(e,t),Ra(t,null,null,n),La()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ii(t,Yi,r),r!==a.cache&&zi(t,[Yi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ii(t,Yi,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw va=ma,fa}}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t)){if(wu())e.flags|=8192;else throw va=ma,fa}}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Fe(),e.lanes|=t,Yl|=t)}function Ac(e,t){if(!Si)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(vi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Li(Yi),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ki(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ji())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(q(t),n=U.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=V.current,ki(t)?Di(t,e):(e=hf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(q(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=V.current,ki(t))Di(t,o);else{var s=Ud(U.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[qe]=t,o[Je]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ld(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=U.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=bi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[qe]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Ei(t,!0)}else e=Ud(e).createTextNode(r),e[qe]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ki(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[qe]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qa(t),t):(Qa(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[qe]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Qa(t),t):(Qa(t),null)}return Qa(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return K(),e===null&&wd(t.stateNode.containerInfo),jc(t),null;case 10:return Li(t.type),jc(t),null;case 19:if(z($a),r=t.memoizedState,r===null)return jc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ac(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eo(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Qr(n,e),n=n.sibling;return B($a,$a.current&1|2),Si&&hi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&pe()>tu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}}else{if(!a){if(e=eo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Si)return jc(t),null}else 2*pe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=pe(),e.sibling=null,n=$a.current,B($a,a?n&1|2:n&1),Si&&hi(t,r.treeForkCount),e);case 22:case 23:return Qa(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Li(Yi),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(vi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Li(Yi),K(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return q(t),null;case 31:if(t.memoizedState!==null){if(Qa(t),t.alternate===null)throw Error(i(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z($a),null;case 4:return K(),null;case 10:return Li(t.type),null;case 22:case 23:return Qa(t),Ga(),e!==null&&z(sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Li(Yi),null;case 25:return null;default:return null}}function Pc(e,t){switch(vi(t),t.tag){case 3:Li(Yi),K();break;case 26:case 27:case 5:q(t);break;case 4:K();break;case 31:t.memoizedState!==null&&Qa(t);break;case 13:Qa(t);break;case 19:z($a);break;case 10:Li(t.type);break;case 22:case 23:Qa(t),Ga(),e!==null&&z(sa);break;case 24:Li(Yi)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Gu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Gu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Gu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ba(t,n)}catch(t){Gu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Gu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Gu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Gu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Gu(e,t,n)}else n.current=null}}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Gu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Rd(r,e.type,n,t),r[Je]=t}catch(t){Gu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bt));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ld(t,r,n),t[qe]=e,t[Je]=n}catch(t){Gu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Vd=up,e=mr(e),hr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Hd={focusedElem:e,selectionRange:n},up=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Gu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Gu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Gu(n,n.return,e)}}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ba(e,t)}catch(e){Gu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Yu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,!!(n.subtreeFlags&8772)):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Ce&&typeof Ce.onCommitFiberUnmount==`function`)try{Ce.onCommitFiberUnmount(Se,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;ef(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),gf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null){if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Gu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Gu(n,t,e)}}break;case 18:nl!==null&&(rl?(e=nl,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):tf(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Gu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Gu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Xu.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ef(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[et]||o[qe]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ld(o,r,n),o[qe]=e,ot(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[qe]=e,ot(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode)}else e.stateNode=zf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Mt(a,``)}catch(t){Gu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Gu(e,e.return,t)}}break;case 3:if(Uf=null,a=dl,dl=yf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Gu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=yf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=pe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Gu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Gu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?nf(m,!0):nf(l.stateNode,!1)}catch(e){Gu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Mt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Gu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:gf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Gu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)za(c[i],s)}catch(e){Gu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qi(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Gu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Jf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=yf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Qi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Ui(Yi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ui(Yi).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Il=null,Ll=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return Pl&2&&Ll!==0?Ll&-Ll:N.T===null?We():fd()}function mu(){if(Jl===0){if(!(Ll&536870912)||Si){var e=Ae;Ae<<=1,!(Ae&3932160)&&(Ae=262144),Jl=e}else Jl=536870912}return e=Ka.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Fl&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Ll,Jl,!1)),Le(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Kl|=n),Wl===4&&yu(e,Ll,Jl,!1)),id(e))}function gu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||J(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-pe(),10<a)){if(yu(r,t,Jl,!Bl),Pe(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Yd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}break}while(1);id(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Bt},El(t,a,d);var m=(a&62914560)===a?$l-pe():(a&4194048)===a?eu-pe():0;if(m=Xf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Te(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ze(e,n,t)}function bu(){return Pl&6?!0:(ad(0,!1),!1)}function xu(){if(Il!==null){if(Rl===0)var e=Il.return;else e=Il,Fi=Pi=null,xo(e),xa=null,Sa=0,e=Il;for(;e!==null;)Pc(e.alternate,e),e=e.return;Il=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Fl=e,Il=n=Zr(e.current,null),Ll=t,Rl=0,zl=null,Bl=!1,Vl=J(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Te(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Vr(),n}function Cu(e,t){no=null,N.H=js,t===da||t===pa?(t=ya(),Rl=3):t===fa?(t=ya(),Rl=4):Rl=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,Il===null&&(Wl=1,Us(e,ai(t,e.current)))}function wu(){var e=Ka.current;return e===null?!0:(Ll&4194048)===Ll?qa===null:(Ll&62914560)===Ll||Ll&536870912?e===qa:!1}function Tu(){var e=N.H;return N.H=js,e===null?js:e}function Eu(){var e=N.A;return N.A=Ml,e}function Du(){Wl=4,Bl||(Ll&4194048)!==Ll&&Ka.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Fl===null||yu(Fl,Ll,Jl,!1)}function Ou(e,t,n){var r=Pl;Pl|=2;var i=Tu(),a=Eu();(Fl!==e||Ll!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&Il!==null){var s=Il,c=zl;switch(Rl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:Ka.current===null&&(t=!0);var l=Rl;if(Rl=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=Rl,Rl=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Fi=Pi=null,Pl=r,N.H=i,N.A=a,Il===null&&(Fl=null,Ll=0,Vr()),o}function ku(){for(;Il!==null;)Mu(Il)}function Au(e,t){var n=Pl;Pl|=2;var r=Tu(),a=Eu();Fl!==e||Ll!==t?(nu=null,tu=pe()+500,Su(e,t)):Vl=J(e,t);a:do try{if(Rl!==0&&Il!==null){t=Il;var o=zl;b:switch(Rl){case 1:Rl=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(ha(o)){Rl=0,zl=null,Nu(t);break}t=function(){Rl!==2&&Rl!==9||Fl!==e||(Rl=7),id(e)},o.then(t,t);break a;case 3:Rl=7;break a;case 4:Rl=5;break a;case 7:ha(o)?(Rl=0,zl=null,Nu(t)):(Rl=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(Il.tag){case 26:s=Il.memoizedState;case 5:case 27:var c=Il;if(s?qf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)Il=l;else{var u=c.return;u===null?Il=null:(Il=u,Fu(u))}break b}}Rl=0,zl=null,Pu(e,t,o,5);break;case 6:Rl=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Fi=Pi=null,N.H=r,N.A=a,Pl=n,Il===null?(Fl=null,Ll=0,Vr(),Wl):0}function ju(){for(;Il!==null&&!de();)Mu(Il)}function Mu(e){var t=Tc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):Il=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Ll);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Ll);break;case 5:xo(t);default:Pc(n,t),t=Il=Qr(t,Ul),t=Tc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):Il=t}function Pu(e,t,n,r){Fi=Pi=null,xo(t),xa=null,Sa=0;var i=t.return;try{if(Js(e,i,t,n,Ll)){Wl=1,Us(e,ai(n,e.current)),Il=null;return}}catch(t){if(i!==null)throw Il=i,t;Wl=1,Us(e,ai(n,e.current)),Il=null;return}t.flags&32768?(Si||r===1?e=!0:Vl||Ll&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ka.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Mc(t.alternate,t,Ul);if(n!==null){Il=n;return}if(t=t.sibling,t!==null){Il=t;return}Il=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Il=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Il=e;return}Il=e=n}while(e!==null);Wl=6,Il=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Br,Re(e,n,o,s,c,l),e===Fl&&(Il=Fl=null,Ll=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Zu(_e,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,P.p=a,N.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=Hd,o=mr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&pr(s.ownerDocument.documentElement,s)){if(c!==null&&hr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=fr(s,h),v=fr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}up=!!Vd,Hd=Vd=null}finally{Pl=i,P.p=r,N.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,P.p=r,N.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,fe();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),Ue(n),t=t.stateNode,Ce&&typeof Ce.onCommitFiberRoot==`function`)try{Ce.onCommitFiberRoot(Se,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}su&3&&Hu(),id(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,ad(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qi(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=Ue(su),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,ad(0,!1),Ce&&typeof Ce.onPostCommitFiberRoot==`function`)try{Ce.onPostCommitFiberRoot(Se,o)}catch{}return!0}finally{P.p=a,N.T=r,Vu(e,t)}}function Wu(e,t,n){t=ai(n,t),t=Gs(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(Le(e,2),id(e))}function Gu(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=ai(n,e),n=Ks(2),r=Na(t,n,2),r!==null&&(qs(n,r,t,e),Le(r,2),id(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Ll&n)===n&&(Wl===4||Wl===3&&(Ll&62914560)===Ll&&300>pe()-$l?!(Pl&2)&&Su(e,0):ql|=n,Yl===Ll&&(Yl=0)),id(e)}function Ju(e,t){t===0&&(t=Fe()),e=Wr(e,t),e!==null&&(Le(e,t),id(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ju(e,n)}function Zu(e,t){return le(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,rd=0;function id(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,dd())}function ad(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Te(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ud(r,a))}else a=Ll,a=Pe(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||J(r,a)||(n=!0,ud(r,a))}r=r.next}while(n);nd=!1}}function od(){sd()}function sd(){td=ed=!1;var e=0;rd!==0&&Jd()&&(e=rd);for(var t=pe(),n=null,r=Qu;r!==null;){var i=r.next,a=cd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}iu!==0&&iu!==5||ad(e,!1),rd!==0&&(rd=0)}function cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Te(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Y(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Ll,n=Pe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ue(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||J(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ue(r),Ue(n)){case 2:case 8:n=ge;break;case 32:n=_e;break;case 268435456:n=ye;break;default:n=_e}return r=ld.bind(null,e),n=le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ue(r),e.callbackPriority=2,e.callbackNode=null,2}function ld(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Ll;return r=Pe(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),cd(e,pe()),e.callbackNode!=null&&e.callbackNode===n?ld.bind(null,e):null)}function ud(e,t){if(Hu())return null;gu(e,t,!0)}function dd(){Qd(function(){Pl&6?le(he,od):sd()})}function fd(){if(rd===0){var e=ta;e===0&&(e=ke,ke<<=1,!(ke&261888)&&(ke=256)),rd=e}return rd}function pd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:zt(``+e)}function md(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function hd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=pd((i[Je]||null).action),o=r.submitter;o&&(t=(t=o[Je]||null)?pd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(rd!==0){var e=o?md(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?md(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var gd=0;gd<Fr.length;gd++){var _d=Fr[gd];Ir(_d.toLowerCase(),`on`+(_d[0].toUpperCase()+_d.slice(1)))}Ir(Dr,`onAnimationEnd`),Ir(Or,`onAnimationIteration`),Ir(kr,`onAnimationStart`),Ir(`dblclick`,`onDoubleClick`),Ir(`focusin`,`onFocus`),Ir(`focusout`,`onBlur`),Ir(Ar,`onTransitionRun`),Ir(jr,`onTransitionStart`),Ir(Mr,`onTransitionCancel`),Ir(Nr,`onTransitionEnd`),ut(`onMouseEnter`,[`mouseout`,`mouseover`]),ut(`onMouseLeave`,[`mouseout`,`mouseover`]),ut(`onPointerEnter`,[`pointerout`,`pointerover`]),ut(`onPointerLeave`,[`pointerout`,`pointerover`]),lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var vd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),yd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(vd));function bd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Lr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Lr(e)}i.currentTarget=null,a=c}}}}function xd(e,t){var n=t[Xe];n===void 0&&(n=t[Xe]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,st.forEach(function(t){t!==`selectionchange`&&(yd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!Xt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ed(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}qt(function(){var r=a,i=Ht(n),s=[];a:{var c=Pr.get(e);if(c!==void 0){var l=cn,u=e;switch(e){case`keypress`:if(nn(n)===0)break a;case`keydown`:case`keyup`:l=En;break;case`focusin`:u=`focus`,l=_n;break;case`focusout`:u=`blur`,l=_n;break;case`beforeblur`:case`afterblur`:l=_n;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=On;break;case Dr:case Or:case kr:l=vn;break;case Nr:l=kn;break;case`scroll`:case`scrollend`:l=un;break;case`wheel`:l=An;break;case`copy`:case`cut`:case`paste`:l=yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Dn;break;case`toggle`:case`beforetoggle`:l=jn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Jt(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Vt&&(u=n.relatedTarget||n.fromElement)&&(nt(u)||u[Ye]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?nt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Dn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:it(l),h=u==null?c:it(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,nt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(s,c,l,d,!1),u!==null&&f!==null&&Ad(s,f,u,d,!0)}}a:{if(c=r?it(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Zn;else if(Gn(c)){if(Qn)v=sr;else{v=ar;var y=ir}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&It(r.elementType)&&(v=Zn):v=or;if(v&&=v(e,r)){Kn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ot(c,`number`,c.value)}switch(y=r?it(r):window,e){case`focusin`:(Gn(y)||y.contentEditable===`true`)&&(_r=y,vr=r,yr=null);break;case`focusout`:yr=vr=_r=null;break;case`mousedown`:br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:br=!1,xr(s,n,i);break;case`selectionchange`:if(gr)break;case`keydown`:case`keyup`:xr(s,n,i)}var b;if(Nn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Vn?zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(In&&n.locale!==`ko`&&(Vn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Vn&&(b=tn()):(Qt=i,$t=`value`in Qt?Qt.value:Qt.textContent,Vn=!0)),y=Od(r,x),0<y.length&&(x=new bn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Bn(n),b!==null&&(x.data=b)))),(b=Fn?Hn(e,n):Un(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new bn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),hd(s,e,r,n,i)}bd(s,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Jt(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=Jt(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Jt(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=Jt(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
|
|
9
|
+
`).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Fd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Mt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Mt(e,``+r);break;case`className`:gt(e,`class`,r);break;case`tabIndex`:gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:gt(e,n,r);break;case`style`:Ft(e,r,o);break;case`data`:if(t!==`object`){gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Fd(e,t,`name`,a.name,a,null),Fd(e,t,`formEncType`,a.formEncType,a,null),Fd(e,t,`formMethod`,a.formMethod,a,null),Fd(e,t,`formTarget`,a.formTarget,a,null)):(Fd(e,t,`encType`,a.encType,a,null),Fd(e,t,`method`,a.method,a,null),Fd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Bt);break;case`onScroll`:r!=null&&xd(`scroll`,e);break;case`onScrollEnd`:r!=null&&xd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:xd(`beforetoggle`,e),xd(`toggle`,e),ht(e,`popover`,r);break;case`xlinkActuate`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:_t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:_t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:ht(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Lt.get(n)||n,ht(e,n,r))}}function Id(e,t,n,r,a,o){switch(n){case`style`:Ft(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Mt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Mt(e,``+r);break;case`onScroll`:r!=null&&xd(`scroll`,e);break;case`onScrollEnd`:r!=null&&xd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Bt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[Je]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):ht(e,n,r)}}}function Ld(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:xd(`error`,e),xd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,o,s,n,null)}}a&&Fd(e,t,`srcSet`,n.srcSet,n,null),r&&Fd(e,t,`src`,n.src,n,null);return;case`input`:xd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Fd(e,t,r,d,n,null)}}Dt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in xd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Fd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&kt(e,!!r,n,!0):kt(e,!!r,t,!1);return;case`textarea`:for(s in xd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Fd(e,t,s,c,n,null)}jt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Fd(e,t,l,r,n,null)}return;case`dialog`:xd(`beforetoggle`,e),xd(`toggle`,e),xd(`cancel`,e),xd(`close`,e);break;case`iframe`:case`object`:xd(`load`,e);break;case`video`:case`audio`:for(r=0;r<vd.length;r++)xd(vd[r],e);break;case`image`:xd(`error`,e),xd(`load`,e);break;case`details`:xd(`toggle`,e);break;case`embed`:case`source`:case`link`:xd(`error`,e),xd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,u,r,n,null)}return;default:if(It(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Id(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Fd(e,t,c,r,n,null))}function Rd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Fd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Fd(e,t,p,m,r,f)}}Et(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Fd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Fd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?kt(e,!!n,n?[]:``,!1):kt(e,!!n,t,!0)):kt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Fd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Fd(e,t,s,a,r,o)}At(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Fd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Fd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Fd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Fd(e,t,u,p,r,m)}return;default:if(It(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Id(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Id(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Fd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Fd(e,t,f,p,r,m)}function zd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Bd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&zd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&zd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Vd=null,Hd=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Gd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Kd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e!==qd&&(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body)}n=i}while(n);Ip(t)}function nf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:rf(n),tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function df(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hf(e,t,n){switch(t=Ud(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);tt(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=P.d;P.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=bu();return e||t}function Sf(e){var t=rt(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):bf.r(e)}var Cf=typeof document>`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Tt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),ot(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Tt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Tt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Tt(n.imageSizes)+`"]`)):i+=`[href="`+Tt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),ot(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Tt(r)+`"][href="`+Tt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=f({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),ot(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=at(r).hoistableStyles,a=Nf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);ot(c),Ld(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=at(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=f({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),ot(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=at(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),ot(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=U.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=at(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=at(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=at(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+Tt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),ot(t),e.head.appendChild(t))}function Lf(e){return`[src="`+Tt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Tt(n.href)+`"]`);if(r)return t.instance=r,ot(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ot(r),Ld(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,ot(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,ot(a),a):(r=n,(a=_f.get(o))&&(r=f({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ot(a),Ld(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[et]||a[qe]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ot(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(`link`),ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Bd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Zf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var tp={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function np(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ie(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ie(0),this.hiddenUpdates=Ie(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Yr(3,null,null,t),e.current=a,a.stateNode=e,t=Zi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Aa(a),e}function ip(e){return e?(e=qr,e):qr}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=Ma(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Na(e,r,t),n!==null&&(hu(n,e,t),Pa(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Wr(e,67108864);t!==null&&hu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=pu();t=He(t);var n=Wr(e,t);n!==null&&hu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Ed(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ne(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Te(o);s.entanglements[1]|=c,o&=~c}id(a),!(Pl&6)&&(tu=pe()+500,ad(0,!1))}}break;case 31:case 13:s=Wr(a,2),s!==null&&hu(s,a,2),bu(),sp(a,2)}if(a=mp(r),a===null&&Ed(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function mp(e){return e=Ht(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hp=e,null}function _p(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(me()){case he:return 2;case ge:return 8;case _e:case ve:return 32;case ye:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ep(e,t){switch(e){case`focusin`:case`focusout`:yp=null;break;case`dragenter`:case`dragleave`:bp=null;break;case`mouseover`:case`mouseout`:xp=null;break;case`pointerover`:case`pointerout`:Sp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Cp.delete(t.pointerId)}}function Dp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=rt(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case`focusin`:return yp=Dp(yp,e,t,n,r,i),!0;case`dragenter`:return bp=Dp(bp,e,t,n,r,i),!0;case`mouseover`:return xp=Dp(xp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ge(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ge(e.priority,function(){lp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Vt=r,n.target.dispatchEvent(r),Vt=null}else return t=rt(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(gp(r||n)===null)continue;break}var a=rt(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Je]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Je]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,pu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),bu(),t[Ye]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=We();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.8`)throw Error(i(527,Bp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{Se=Hp.inject(Vp),Ce=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[Ye]=t.current,wd(e),new Rp(t)}})),Ha=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Va()})),Ua=s((e=>{var t=Me().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),Wa=s(((e,t)=>{t.exports=Ua()}));function Ga(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function Ka(e,t){let n={};for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);Object.hasOwn(n,a)||(n[a]=[]),n[a].push(i)}return n}function qa(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i];t(a,i,e)?n.push(a):r.push(a)}return[n,r]}function Ja(e){return[...new Set(e)]}var Ya=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Xa={pipe(){return Ya(this,arguments)}},Za=function(){function e(){}return e.prototype=Xa,e}(),Qa=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},$a=e=>e,eo=e=>()=>e,to=eo(null),no=eo(void 0),ro=no;function io(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function ao(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var oo=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},so=new WeakSet;function co(e){return typeof e==`string`}function lo(e){return typeof e==`number`}function uo(e){return typeof e==`boolean`}function fo(e){return typeof e==`symbol`}function po(e){return co(e)||lo(e)||fo(e)}function mo(e){return typeof e==`function`}function ho(e){return e!=null}function go(e){return!0}function _o(e){return typeof e==`object`&&!!e||mo(e)}var vo=Qa(2,(e,t)=>_o(e)&&t in e),yo=`~effect/interfaces/Hash`,bo=e=>{switch(typeof e){case`number`:return To(e);case`bigint`:return Eo(e.toString(10));case`boolean`:return Eo(String(e));case`symbol`:return Eo(String(e));case`string`:return Eo(e);case`undefined`:return Eo(`undefined`);case`function`:case`object`:if(e===null)return Eo(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?Eo(`Invalid Date`):Eo(e.toISOString());if(e instanceof RegExp)return Eo(e.toString());{if(so.has(e))return xo(e);if(Po.has(e))return Po.get(e);let t=Io(e,()=>wo(e)?e[yo]():typeof e==`function`?xo(e):e instanceof DataView?Ao(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?Ao(e):e instanceof Map?jo(e):e instanceof Set?Mo(e):Oo(e));return Po.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},xo=e=>(No.has(e)||No.set(e,To(Math.floor(Math.random()*(2**53-1)))),No.get(e)),So=Qa(2,(e,t)=>e*53^t),Co=e=>e&3221225471|e>>>1&1073741824,wo=e=>vo(e,yo),To=e=>{if(e!==e)return Eo(`NaN`);if(e===1/0)return Eo(`Infinity`);if(e===-1/0)return Eo(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Co(t)},Eo=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Co(t)},Do=(e,t)=>{let n=12289;for(let r of t)n^=So(bo(r),bo(e[r]));return Co(n)},Oo=e=>Do(e,oo(e)),ko=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Co(r)},Ao=ko(6151,bo),jo=ko(Eo(`Map`),([e,t])=>So(bo(e),bo(t))),Mo=ko(Eo(`Set`),bo),No=new WeakMap,Po=new WeakMap,Fo=new WeakSet;function Io(e,t){if(Fo.has(e))return Eo(`[Circular]`);Fo.add(e);let n=t();return Fo.delete(e),n}var Lo=`~effect/interfaces/Equal`;function Ro(){return arguments.length===1?e=>zo(e,arguments[0]):zo(arguments[0],arguments[1])}function zo(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||so.has(e)||so.has(t)?!1:Wo(e,t,Uo):!1}function Bo(e,t,n){let r=Vo.has(e),i=Ho.has(t);if(r&&i)return!0;if(r||i)return!1;Vo.add(e),Ho.add(t);let a=n();return Vo.delete(e),Ho.delete(t),a}var Vo=new WeakSet,Ho=new WeakSet;function Uo(e,t){if(bo(e)!==bo(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=$o(e),r=$o(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:Bo(e,t,()=>{if(i)return e[Lo](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Ko(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return qo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return qo(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Xo(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Qo(e,t):Jo(e,t)})}function Wo(e,t,n){let r=Go.get(e);if(!r)r=new WeakMap,Go.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=Go.get(t);return a||(a=new WeakMap,Go.set(t,a)),a.set(e,i),i}var Go=new WeakMap;function Ko(e,t){for(let n=0;n<e.length;n++)if(!zo(e[n],t[n]))return!1;return!0}function qo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Jo(e,t){let n=oo(e),r=oo(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!zo(e[i],t[i]))return!1;return!0}function Yo(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var Xo=Yo(zo,zo);function Zo(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var Qo=Zo(zo),$o=e=>vo(e,Lo),es=e=>(t,n)=>t===n||e(t,n),ts=e=>e.length>0;function ns(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function rs(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&ns(e,n,t[n])}var is=Symbol.for(`~effect/Redactable`),as=e=>vo(e,is);function os(e){return as(e)?ss(e):e}function ss(e){return e[is](globalThis[`~effect/Fiber/currentFiber`]?.context??us)}var cs=`~effect/Fiber/currentFiber`,ls=new Map,us={"~effect/Context":{},base:ls,depth:0,mapUnsafe:ls,pipe(){return Ya(this,arguments)}};function ds(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return fs;r.add(e);let l;if(is in e)l=c(ss(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
10
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=hs(e);else if(!t?.ignoreToString&&vo(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=gs(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${ps(t)}:${c(e[t],n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${ps(t)}: ${c(e[t],n+1)}`).join(`,
|
|
11
|
+
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var fs=`[Circular]`;function ps(e){return typeof e==`string`?JSON.stringify(e):String(e)}function ms(e){return e.map(e=>`[${ps(e)}]`).join(``)}function hs(e){try{return e.toISOString()}catch{return`Invalid Date`}}function gs(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var _s=Symbol.for(`nodejs.util.inspect.custom`),vs=e=>{try{return e=os(e),vo(e,`toJSON`)&&mo(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(vs):e}catch{return`[toJSON threw]`}},ys=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},bs=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),xs=`~effect/Effect`,Ss=`~effect/Exit`,Cs={_A:$a,_E:$a,_R:$a},ws=`${xs}/identifier`,Ts=`${xs}/args`,Es=`${xs}/evaluate`,Ds=`${xs}/successCont`,Os=`${xs}/failureCont`,ks=`${xs}/ensureCont`,As=Symbol.for(`effect/Effect/Yield`),js={pipe(){return Ya(this,arguments)},toJSON(){return{...this}},toString(){return ds(this.toJSON(),{ignoreToString:!0,space:2})},[_s](){return this.toJSON()}},Ms={[xs]:Cs,...js,[Symbol.iterator](){return new ys(this)},toJSON(){return{_id:`Effect`,op:this[ws],...Ts in this?{args:this[Ts]}:void 0}}},Ns=e=>vo(e,Ss),Ps=`~effect/Cause`,Fs=`~effect/Cause/Reason`,Is=e=>vo(e,Ps),Ls=class{[Ps];reasons;constructor(e){this[Ps]=Ps,this.reasons=e}pipe(){return Ya(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${ds(this.reasons)})`}[_s](){return this.toJSON()}[Lo](e){return Is(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Ro(t,e.reasons[n]))}[yo](){return Ao(this.reasons)}},Rs=new WeakMap,zs=class{[Fs];annotations;_tag;constructor(e,t,n){if(this[Fs]=Fs,this._tag=e,t!==Bs&&typeof n==`object`&&n&&t.size>0){let e=Rs.get(n);e&&(t=new Map([...e,...t])),Rs.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ya(this,arguments)}toString(){return ds(this)}[_s](){return this.toString()}},Bs=new Map,Vs=class extends zs{error;constructor(e,t=Bs){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${ds(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[Lo](e){return qs(e)&&Ro(this.error,e.error)&&Ro(this.annotations,e.annotations)}[yo](){return So(Eo(this._tag))(So(bo(this.error))(bo(this.annotations)))}},Hs=e=>new Ls(e),Us=e=>new Ls([new Vs(e)]),Ws=class extends zs{defect;constructor(e,t=Bs){super(`Die`,t,e),this.defect=e}toString(){return`Die(${ds(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[Lo](e){return Js(e)&&Ro(this.defect,e.defect)&&Ro(this.annotations,e.annotations)}[yo](){return So(Eo(this._tag))(So(bo(this.defect))(bo(this.annotations)))}},Gs=e=>new Ls([new Ws(e)]),Ks=Qa(e=>Is(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Ls(e.reasons.map(e=>e.annotate(t,n)))),qs=e=>e._tag===`Fail`,Js=e=>e._tag===`Die`,Ys=e=>e._tag===`Interrupt`;function Xs(e){return ac(`Effect.evaluate: Not implemented`)}var Zs=e=>({...Ms,[ws]:e.op,[Es]:e[Es]??Xs,[Ds]:e[Ds],[Os]:e[Os],[ks]:e[ks]}),Qs=e=>{let t=Zs(e);return function(){let n=Object.create(t);return n[Ts]=e.single===!1?arguments:arguments[0],n}},$s=e=>{let t={[Ss]:Ss,_tag:e.op,get[e.prop](){return this[Ts]},...Zs(e),toString(){return`${e.op}(${ds(this[Ts])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[Ts]}},[Lo](e){return Ns(e)&&e._tag===this._tag&&Ro(this[Ts],e[Ts])},[yo](){return So(Eo(e.op),bo(this[Ts]))}};return function(e){let n=Object.create(t);return n[Ts]=e,n}},ec=$s({op:`Success`,prop:`value`,[Es](e){let t=e.getCont(Ds);return t?t[Ds](this[Ts],e,this):e.yieldWith(this)}}),tc={key:`effect/Cause/StackTrace`},nc={key:`effect/Cause/InterruptorStackTrace`},rc=$s({op:`Failure`,prop:`cause`,[Es](e){let t=this[Ts],n=!1;e.currentStackFrame&&(t=Ks(t,{mapUnsafe:new Map([[tc.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(Os);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(Os);return r?r[Os](t,e,n?void 0:this):e.yieldWith(n?rc(t):this)}}),ic=e=>rc(Us(e)),ac=e=>rc(Gs(e)),oc=Qs({op:`WithFiber`,[Es](e){return this[Ts](e)}}),sc=function(){class e extends globalThis.Error{}let t=Zs({op:`YieldableError`,[Es](){return ic(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),cc=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends sc{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(rs(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),lc=e=>{class t extends cc{_tag=e}return t.prototype.name=e,t};lc(`NoSuchElementError`);var uc=`~effect/data/Option`,dc={[uc]:{_A:e=>e},...js,[Symbol.iterator](){return new ys(this)}},fc=Object.defineProperty(Object.assign(Object.create(dc),{_tag:`Some`,_op:`Some`,[Lo](e){return hc(e)&&_c(e)&&Ro(this.value,e.value)},[yo](){return So(bo(this._tag))(bo(this.value))},toString(){return`some(${ds(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:vs(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),pc=bo(`None`),mc=Object.assign(Object.create(dc),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[Lo](e){return hc(e)&&gc(e)},[yo](){return pc},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),hc=e=>vo(e,uc),gc=e=>e._tag===`None`,_c=e=>e._tag===`Some`,vc=Object.create(mc),yc=e=>{let t=Object.create(fc);return t.value=e,t},bc=`~effect/data/Result`,xc={[bc]:{_A:e=>e,_E:e=>e},...js,[Symbol.iterator](){return new ys(this)}},Sc=Object.assign(Object.create(xc),{_tag:`Success`,_op:`Success`,[Lo](e){return wc(e)&&Ec(e)&&Ro(this.success,e.success)},[yo](){return So(bo(this._tag))(bo(this.success))},toString(){return`success(${ds(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:vs(this.success)}}}),Cc=Object.assign(Object.create(xc),{_tag:`Failure`,_op:`Failure`,[Lo](e){return wc(e)&&Tc(e)&&Ro(this.failure,e.failure)},[yo](){return So(bo(this._tag))(bo(this.failure))},toString(){return`failure(${ds(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:vs(this.failure)}}}),wc=e=>vo(e,bc),Tc=e=>e._tag===`Failure`,Ec=e=>e._tag===`Success`,Dc=e=>{let t=Object.create(Cc);return t.failure=e,t},Oc=e=>{let t=Object.create(Sc);return t.success=e,t};function kc(e){return(t,n)=>t===n?0:e(t,n)}var Ac=kc((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),jc=Qa(2,(e,t)=>kc((n,r)=>e(t(n),t(r))))(Ac,e=>e.getTime()),Mc=e=>Qa(2,(t,n)=>e(t,n)===1),Nc=()=>vc,Pc=yc,Fc=gc,Ic=Qa(2,(e,t)=>Fc(e)?t():e.value),Lc=Ic(to),Rc=Ic(no),zc=Qa(2,(e,t)=>Fc(e)?Nc():Pc(t(e.value))),Bc=Oc,Vc=Dc,Hc=Tc,Uc=Qa(2,(e,t)=>Hc(e)?Vc(t(e.failure)):e),Wc=globalThis.Array,Gc=e=>Wc.isArray(e)?e:Wc.from(e),Kc=Qa(2,(e,t)=>[...e,t]),qc=Qa(2,(e,t)=>Gc(e).concat(Gc(t)));Wc.isArray;var Jc=ts,Yc=ts,Xc=(e,t)=>{let n=bo(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(Ro(e,t))return!1;return r.push(t),!0},Zc=Qa(2,(e,t)=>{let n=Gc(e),r=Gc(t);return Yc(n)?Yc(r)?el(qc(n,r)):n:r}),Qc=()=>[],$c=Qa(2,(e,t)=>e.map(t)),el=e=>{let t=Gc(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)Xc(n,e)&&r.push(e);return r},tl=`~effect/BigDecimal`,nl={[tl]:tl,[yo](){let e=ll(this);return So(bo(e.value),To(e.scale))},[Lo](e){return rl(e)&&pl(this,e)},toString(){return`BigDecimal(${ml(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[_s](){return this.toJSON()},pipe(){return Ya(this,arguments)}},rl=e=>vo(e,tl),il=(e,t)=>{let n=Object.create(nl);return n.value=e,n.scale=t,n},al=(e,t)=>{if(e!==ol&&e%sl===ol)throw RangeError(`Value must be normalized`);let n=il(e,t);return n.normalized=n,n},ol=BigInt(0),sl=BigInt(10),cl=al(ol,0),ll=e=>{if(e.normalized===void 0){if(e.value===ol)e.normalized=cl;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=al(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},ul=Qa(2,(e,t)=>t>e.scale?il(e.value*sl**BigInt(t-e.scale),t):t<e.scale?il(e.value/sl**BigInt(e.scale-t),t):e),dl=e=>e.value<ol?il(-e.value,e.scale):e,fl=es((e,t)=>e.scale>t.scale?ul(t,e.scale).value===e.value:e.scale<t.scale?ul(e,t.scale).value===t.value:e.value===t.value),pl=Qa(2,(e,t)=>fl(e,t)),ml=e=>{let t=ll(e);if(Math.abs(t.scale)>=16)return hl(t);let n=t.value<ol,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},hl=e=>{if(gl(e))return`0e+0`;let t=ll(e),n=`${dl(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${_l(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},gl=e=>e.value===ol,_l=e=>e.value<ol,vl=e=>Zs({op:e.label,[Es]:e.evaluate}),yl=`~effect/Context/Service`,bl=function(){function e(){}let t=e;Object.setPrototypeOf(t,xl);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Cl]=Cl,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Sl.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},xl={[yl]:yl,...vl({label:`Service`,evaluate(e){return ec(Ul(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return zl(this,e)},use(e){return oc(t=>e(Ul(t.context,this)))},useSync(e){return oc(t=>ec(e(Ul(t.context,this))))}},Sl=new Set,Cl=`~effect/Context/Reference`,wl=`~effect/Context`,Tl=8,El=8,Dl=(e,t,n,r)=>{let i=Object.create(Nl);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Ol=(e,t)=>{t&&(Ol(e,t.parent),e.set(t.key,t.value))},kl=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Ol(t,e.overlay),e._flat=t},Al=Symbol(),jl=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Al:(n.overlay&&++n.baseHits>=El&&(n.base=kl(n),n.overlay=void 0,n.depth=0),r)},Ml=e=>Dl(void 0,e,void 0,0),Nl={...js,[wl]:{_Services:e=>e},get mapUnsafe(){return kl(this)},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Lo](e){if(!Fl(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!Ro(r,n.get(e)))return!1;return!0},[yo](){return To(this.mapUnsafe.size)}},Pl=(e,t)=>e.cacheRoot===t.cacheRoot,Fl=e=>vo(e,wl),Il=e=>!!e[Cl],Ll=()=>Rl,Rl=Ml(new Map),zl=(e,t)=>Ml(new Map([[e.key,t]])),Bl=Qa(3,(e,t,n)=>Vl(e,t.key,n)),Vl=(e,t,n)=>{let r=e,i=Sl.has(t)?void 0:r.cacheRoot;if(r.depth>=Tl){let e=new Map(r.mapUnsafe);return e.set(t,n),Dl(i,e,void 0,0)}return Dl(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Hl=(e,t)=>{let n=jl(e,t);return n===Al?void 0:n},Ul=Qa(2,(e,t)=>{let n=jl(e,t.key);if(n===Al){if(Il(t))return Gl(t);throw Kl(t)}return n}),Wl=`~effect/Context/defaultValue`,Gl=e=>Wl in e?e[Wl]:e[Wl]=e.defaultValue(),Kl=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
12
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
13
|
+
`)}return t},ql=bl,Jl=ql(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Ql}),Yl=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Xl=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Zl=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Ql=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Xl:Yl)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new $l(this.setImmediate)}},$l=class{tasks=new Zl;running=void 0;setImmediate;constructor(e=Yl){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},eu=ql(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),tu=ql(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),nu=`effect/Tracer/ParentSpan`;bl()(nu,{fiberCached:!0});var ru=`effect/Tracer`,iu=`effect/observability/Metric/FiberRuntimeMetricsKey`,au=ql(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:no}),ou=ql(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),su=ql(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),cu=class extends zs{fiberId;constructor(e,t=Bs){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[Lo](e){return Ys(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[yo](){return So(Eo(`${this._tag}:${this.fiberId}`))(xo(this.annotations))}},lu=e=>new Ls([new cu(e)]),uu=e=>e.reasons.some(Ys),du=Qa(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Ls(Zc(e.reasons,t.reasons));return Ro(e,n)?e:n}),fu=Qa(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>qs(e)?(n=!0,new Vs(t(e.error),e.annotations)):e);return n?Hs(r):e}),pu=`~effect/Fiber`,mu={_A:$a,_E:$a},hu={id:0},gu=()=>globalThis[cs],_u=class{constructor(e,t=!0){this[pu]=mu,this.setContext(e),this.id=++hu.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[pu];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return Ul(this.context,e)}addObserver(e){return this._exit?(e(this._exit),ro):(this._observers.push(e),()=>{let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=lu(e);this.currentStackFrame&&(n=Ks(n,zl(tc,this.currentStackFrame))),t&&(n=Ks(n,t)),this._interruptedCause=this._interruptedCause?du(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(wu(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===As)return;let n=yu.interruptChildren&&yu.interruptChildren(this);if(n!==void 0)return this.evaluate(Bu(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Ll()}runLoop(e){let t=globalThis[cs];globalThis[cs]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=wu(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=Bu(Ou,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Es](this),i===As){let e=this._yielded;if(Ss in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return As}}}catch(e){return vo(i,Es)?this.runLoop(ac(e)):ac(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[cs]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,vu;for(;;){let t=this._stack.pop();if(!t)return;let n=t[ks]&&t[ks](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,As}children(){return this._children??=new Set}pipe(){return Ya(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Pl(t,e))return;let n=this.getRef(Jl);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=Hl(e,nu),this.currentLogLevel=this.getRef(ou),this.minimumLogLevel=this.getRef(su),this.currentStackFrame=this.getRef(au),this.maxOpsBeforeYield=this.getRef(eu),this.currentPreventYield=this.getRef(tu),this.runtimeMetrics=Hl(e,iu);let r=Hl(e,ru);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},vu={[Ds](e,t){return wu(t._interruptedCause)},[Os](e,t){return wu(t._interruptedCause)}},yu={interruptChildren:void 0},bu=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(nc.key,e.currentStackFrame),Ml(t)},xu=e=>Pu(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Cu(r))}return a(),Eu(()=>i?.())}),Su=e=>oc(t=>{let n=bu(t),r=Qc();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return zu(xu(r))}),Cu=ec,wu=rc,Tu=ic,Eu=Qs({op:`Sync`,[Es](e){let t=this[Ts](),n=e.getCont(Ds);return n?n[Ds](t,e):e.yieldWith(ec(t))}}),Du=Qs({op:`Suspend`,[Es](e){return this[Ts]()}}),Ou=Qs({op:`Yield`,[Es](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(qu)},this[Ts]??0),e.yieldWith(()=>{t=!0})}})(0),ku=e=>Du(()=>wu(bs(e))),Au=e=>ac(e),ju=Cu(void 0),Mu=Qs({op:`Async`,single:!1,[Es](e){let t=bs(()=>this[Ts][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[Ts][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(Nu(()=>(n=!0,i?.abort(),a??qu))),As):r}}),Nu=Qs({op:`AsyncFinalizer`,[ks](e){e.interruptible&&(e.interruptible=!1,e._stack.push(ed))},[Os](e,t){return uu(e)?Bu(this[Ts](),()=>wu(e)):wu(e)}}),Pu=e=>Mu(e,e.length>=2),Fu=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Iu=(e,...t)=>Fu(e.length,t.length===0?function(){return Lu(()=>e.apply(this,arguments))}:function(){let n=Lu(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),Lu=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Cu(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Du(()=>n?(n=!1,Bu(r.value,e=>Ru(t,e))):Du(()=>Ru(e())))}}}catch(e){return Au(e)}},Ru=Qs({op:`Iterator`,single:!1,[Ds](e,t){let n=this[Ts][0];for(;;){let r=n.next(e);if(r.done)return Cu(r.value);if(!Hu(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Es](e){return this[Ds](this[Ts][1],e)}}),zu=e=>Bu(e,e=>qu),Bu=Qa(2,(e,t)=>{let n=Object.create(Vu);return n[Ts]=e,n[Ds]=t.length===1?t:e=>t(e),n}),Vu=Zs({op:`OnSuccess`,[Es](e){return e._stack.push(this),this[Ts]}}),Hu=e=>Ss in e,Uu=Qa(2,(e,t)=>Hu(e)?e._tag===`Success`?t(e.value):e:Bu(e,t)),Wu=Qa(2,(e,t)=>Bu(e,e=>Cu(bs(()=>t(e))))),Gu=Qa(2,(e,t)=>Hu(e)?Ju(e,t):Wu(e,t)),Ku=e=>e._tag===`Success`,qu=ec(void 0),Ju=Qa(2,(e,t)=>e._tag===`Success`?ec(t(e.value)):e),Yu=Qa(2,(e,t)=>{let n=Object.create(Xu);return n[Ts]=e,n[Os]=t.length===1?t:e=>t(e),n}),Xu=Zs({op:`OnFailure`,[Es](e){return e._stack.push(this),this[Ts]}}),Zu=e=>Hu(e)?ec(e):Qu(e),Qu=Qs({op:`Exit`,[Es](e){return e._stack.push(this),this[Ts]},[Ds](e,t,n){return Cu(n??ec(e))},[Os](e,t,n){return Cu(n??rc(e))}}),$u=e=>oc(t=>t.interruptible?(t.interruptible=!1,t._stack.push(ed),e):e),ed=Qs({op:`SetInterruptible`,[ks](e){if(e.interruptible=this[Ts],e._interruptedCause&&e.interruptible)return()=>wu(e._interruptedCause)}})(!0),td=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Hu(c))return Bu(Zu(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??ju);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0&&c>1,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=ac(e);return h=t,u=!0,m=!0,f&&f.size>0?Bu($u(Su(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(Hu(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=rd(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=rc(Hs([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?rc(Hs(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??ju)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return Pu(e=>{d=gu(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):Du(()=>(h=qu,m=!0,f?Su(f):ju))})}if(u=!0,h){if(f&&f.size>0){let e=bu(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p){if(f)f.size===0&&p(ju);else return qu}};return x()}},nd=()=>td,rd=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new _u(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},id=e=>(t,n)=>{let r=new _u(n?.scheduler?Bl(e,Jl,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},ad=(e=>{let t=id(e);return e=>{if(Hu(e))return e;let n=new Ql(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??ac(new sd(r))}})(Ll());lc(`TimeoutError`),lc(`IllegalArgumentError`),lc(`ExceededCapacityError`);var od=`~effect/Cause/AsyncFiberError`,sd=class extends lc(`AsyncFiberError`){[od]=od;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}};lc(`UnknownError`);var cd={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};cd.gray,cd.blue,cd.green,cd.yellow,cd.red,cd.bgBrightRed,cd.black;var ld=qs,ud=fu;bl()(`effect/Cause/StackTrace`),bl()(`effect/Cause/InterruptorStackTrace`);var dd=ec,fd=rc,pd=ic,md=qu,hd=Ku,gd=lc,_d=`~effect/time/DateTime`,vd=`~effect/time/DateTime/TimeZone`,yd={[_d]:_d,pipe(){return Ya(this,arguments)},[_s](){return this.toString()},toJSON(){return xd(this).toJSON()}};({...yd}),{...yd};var bd={[vd]:vd,[_s](){return this.toString()}};({...bd}),{...bd};var xd=e=>new Date(e.epochMilliseconds);globalThis.String;var Sd=e=>e.trim(),Cd=Cu,wd=Tu,Td=ku,Ed=Bu,Dd=Zu,Od=Yu,kd=ad;bl()(`effect/Effect/Transaction`);var Ad=Gu,jd=Uu,Md=Iu;function Nd(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var Pd=`~structural`,Fd=`~sentinels`,Id=`~constructor`,Ld=io(e=>{let t=Nd(e)?.identifier;return typeof t==`string`?t:e.getExpected(Ld)}),Rd=Symbol(),zd=dd,Bd=zd(Rd),Vd=zd(Rd),Hd=e=>e===Rd?Nc():Pc(e),Ud=e=>e._tag===`None`?Bd:zd(e.value),Wd=`~effect/SchemaIssue/Issue`;function Gd(e){return vo(e,Wd)&&e[Wd]===Wd}function Kd(e){return Object.hasOwn(e,`input`)}var qd=class{[Wd]=Wd;constructor(e,t){t?.reportInput===!0&&e!==Rd&&(this.input=e)}},Jd=class extends qd{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Yd=class extends qd{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Xd=class extends qd{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Zd=class extends qd{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Qd=class extends qd{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},$d=class extends qd{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},ef=class extends qd{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},tf=class extends qd{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},nf=class extends qd{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},rf=class extends qd{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function af(e,t,n){if(Gd(e))return e;if(typeof e==`string`)return new tf({message:e},t,n);let r=typeof e.issue==`string`?new tf({message:e.issue},t,n):e.issue;return new Xd(e.path,r)}function of(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new tf(void 0,t,n):af(e,t,n)}function sf(e,t,n,r){return Array.isArray(t)?Yc(t)?t.length===1?af(t[0],n,r):new $d(e,$c(t,e=>af(e,n,r)),n,r):void 0:of(t,n,r)}var cf=e=>{let t=yf(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return pf(Ld(e.ast),e);case`InvalidValue`:{let t=ff(e);if(t!==void 0)return pf(t,e);let n=df(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=df(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=df(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},lf=e=>yf(e.issue)??yf(e);function uf(e){return t=>({issues:mf(t,[],e?.leafHook??cf,e?.checkHook??lf)})}function df(e){return Kd(e)?ds(e.input):void 0}function ff(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function pf(e,t){let n=df(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function mf(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return mf(e.issue,t,n,r);let a=ff(e.issue);return[{path:t,message:a===void 0?pf(hf(e.filter),e):pf(a,e.issue)}]}case`Encoding`:return mf(e.issue,t,n,r);case`Pointer`:return mf(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>mf(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:yf(e)??pf(Ld(e.ast),e)}]:e.issues.flatMap(e=>mf(e,t,n,r));default:return[{path:t,message:n(e)}]}}function hf(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>hf(e)).join(` & `)}}function gf(){return e=>vf(e,``)}var _f=gf();function vf(e,t){let n;switch(e._tag){case`Filter`:{let r=lf(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return vf(e.issue,t);let r=ff(e.issue);n=r===void 0?pf(hf(e.filter),e):pf(r,e.issue)}break}case`Encoding`:return vf(e.issue,t);case`Pointer`:return vf(e.issue,t+ms(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>vf(e,t)).join(`
|
|
14
|
+
`);n=yf(e)??pf(Ld(e.ast),e);break;default:n=cf(e)}return t?`${n}\n at ${t}`:n}function yf(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return yf(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function bf(e){let t;for(let n of e.reasons){if(!ld(n)||!Gd(n.error))return;t??=n.error}return t}function xf(e,t){let n=bf(e);if(n===void 0)throw Error(t,{cause:e});return n}bl()(`effect/DateTime/CurrentTimeZone`),gd(`EncodingError`);var Sf=class e extends Za{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(Ad(zc(t))))}compose(t){return wf(this)?t:wf(t)?this:new e((e,n)=>this.run(e,n).pipe(jd(e=>t.run(e,n))))}},Cf=new Sf(Cd);function wf(e){return e.run===Cf.run}function Tf(){return Cf}function Ef(e){return Df(zc(e))}function Df(e){return new Sf(t=>Cd(e(t)))}function Of(){return Ef(globalThis.String)}function kf(){return Ef(globalThis.Number)}function Af(){return Ef(e=>new globalThis.Date(e))}function jf(){return Ef(Sd)}var Mf=`~effect/SchemaTransformation/Transformation`,Nf=class e{[Mf]=Mf;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function Pf(e){return vo(e,Mf)&&e[Mf]===Mf}var Ff=e=>Pf(e)?e:new Nf(e.decode,e.encode);function If(){return new Nf(jf(),Tf())}var Lf=new Nf(Tf(),Tf());function Rf(){return Lf}var zf=new Nf(kf(),Of()),Bf=new Nf(Af(),Ef(hs));function Vf(e){return t=>t._tag===e}var Hf=Vf(`Declaration`),Uf=Vf(`Never`),Wf=Vf(`Literal`),Gf=Vf(`UniqueSymbol`),Kf=Vf(`Arrays`),qf=Vf(`Objects`),Jf=Vf(`Suspend`),Yf=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Xf={},Zf=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Qf=`~effect/Schema`,$f=class{[Qf]=Qf;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},ep=class e extends $f{_tag=`Declaration`;typeParameters;run;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o}getParser(){let e;return(t,n)=>t===Rd?Bd:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r){let i=om(this.typeParameters,t);return i===this.typeParameters&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.run,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},tp=new class extends $f{_tag=`Null`;getParser(){return mm(this,null)}getExpected(){return`null`}},np=class extends $f{_tag=`Undefined`;getParser(){return mm(this,void 0)}toCodecJson(){return em(this,[rp])}getExpected(){return`undefined`}},rp=new Yf(tp,new Nf(Ef(()=>void 0),Ef(()=>null))),ip=new np,ap=new class extends $f{_tag=`Unknown`;getParser(){return hm(this,go)}getExpected(){return`unknown`}},op=class extends $f{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${ds(e)}`);this.literal=e}getParser(){return mm(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?sp(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:sp(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function sp(e){let t=globalThis.String(e.literal);return em(e,[new Yf(new op(t),new Nf(Ef(()=>e.literal),Ef(()=>t)))])}var cp=new class extends $f{_tag=`String`;getParser(){return hm(this,co)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&ym(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},lp=class extends $f{_tag=`Number`;getParser(){return hm(this,lo)}matchKey(e,t){return this._match(pee,e,t)}matchPart(e,t){return this._match(_m,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:ym(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(up(this.checks,`effect/schema/isFinite`)||up(this.checks,`effect/schema/isInt`))?this:em(this,[dp(this.checks)])}toCodecStringTree(){return this.toCodecJson()===this?em(this,[hee]):em(this,[gee])}getExpected(){return`number`}};function up(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&up(e.checks,t))}function dp(e){return new Yf(new zp([e?im(Yp,e):Yp,Hp],`anyOf`),new Nf(kf(),Ef(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))))}var fp=new lp,pp=new class extends $f{_tag=`Boolean`;getParser(){return hm(this,uo)}getExpected(){return`boolean`}},mp=class e extends $f{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(cm(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(cm(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return Md(function*(e,c){if(e===Rd)return Rd;if(!Array.isArray(e))return yield*wd(new ef(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=hp(u,e,{concurrency:gp(c?.concurrency)?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(d&&(yield*d),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new Qd(n,e[t],c),i=new Xd([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*wd(new $d(n,[i],e,c))}return u.issues?yield*wd(new $d(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=om(this.elements,t),a=om(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}},hp=nd()({onItem(e,t,n){let r=n<e.len?t:Rd;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return _p(e,e.ast,r,n);let i=n===Vd?t:n[Ts];if(i!==Rd)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(cm(t.ast))return;let n=new Xd([r],new Zd(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return pd(new $d(e.ast,[n],e.input,e.options))}}}),gp=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),_p=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=bf(r.cause);if(i===void 0)return fd(ud(r.cause,r=>new $d(t,[new Xd([n],r)],e.input,e.options)));let a=new Xd([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return pd(new $d(t,[a],e.input,e.options))},vp=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function yp(e,t,n=Xf){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(gm(dm(t)))}var bp=class{name;type;constructor(e,t){this.name=e,this.type=t}};function xp(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(xp);default:return!1}}function Sp(e){return xp(e)&&xp(dm(e))}var Cp=class{parameter;type;constructor(e,t){if(!Sp(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,cm(t)&&!pm(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},wp=class e extends $f{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return hm(n,ho);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return _p(e,n,t,s)??md;let c=s===Vd?a:s[Ts];if(r!==Rd&&c!==Rd){if(i&&(o.has(t)||o.has(r)))return md;ns(e.out,r,c)}return md},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!Hu(n))return Ed(Dd(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return _p(e,n,t,i)??md;let a=i===Vd?t:i[Ts],o=e.input[t],s=r.parserValue(o,e.options);return Hu(s)?l(e,t,a,o,s):Ed(Dd(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return Hu(i)?l(e,t,t,r,i):Ed(Dd(i),n=>l(e,t,t,r,n))},f=a?nd()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return Md(function*(l,p){if(l===Rd)return Rd;if(!(typeof l==`object`&&l&&!Array.isArray(l)))return yield*wd(new ef(n,l,p));s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(gm(n.parameter)),parserValue:t(n.type)})):void 0);let m=l,h={},g={ast:n,input:m,out:h,issues:void 0,options:p},_=p.errors===`all`,v=p.onExcessProperty===`error`,y=p.onExcessProperty===`preserve`,b;if(!a&&(v||y)){o??=new Set(r),b=Reflect.ownKeys(m);for(let e=0;e<b.length;e++){let t=b[e];if(!o.has(t)){if(v){let e=new Qd(n,m[t],p),r=new Xd([t],e);if(_){g.issues?g.issues.push(r):g.issues=[r];continue}return yield*wd(new $d(n,[r],l,p))}ns(h,t,m[t])}}}let x=gp(p?.concurrency);if(i){let e=Tp(g,s,x);e&&(yield*e)}if(a&&!x)for(let e=0;e<a;e++){let t=c[e],n=t.is.parameter===cp?d:u,r=t.is.parameter===cp?Object.keys(m):yp(m,t.is.parameter,p);for(let e=0;e<r.length;e++){let i=n(g,r[e],t);if(!Hu(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(f){let e=Qc();for(let t=0;t<a;t++){let n=c[t],r=yp(m,n.is.parameter,p);for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=f(g,e,x);t&&(yield*t)}if(g.issues)return yield*wd(new $d(n,g.issues,l,p));if(p.propertyOrder===`original`){let e=(b??Reflect.ownKeys(m)).concat(r),t={};for(let n of e)Object.hasOwn(h,n)&&ns(t,n,h[n]);return t}return h})}_rebuild(t,n,r,i){let a=om(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new bp(e.name,n)}),o=om(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Cp(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}},Tp=nd()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(Rd,e.options);let n=e.input[t.name];return ns(e.out,t.name,n),t.parser(n,e.options)},step(e,t,n){if(n._tag===`Failure`)return _p(e,e.ast,t.name,n);if(n===Vd)return;let r=n[Ts];if(r!==Rd){ns(e.out,t.name,r);return}if(delete e.out[t.name],!cm(t.type)){let n=new Xd([t.name],new Zd(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return pd(new $d(e.ast,[n],e.input,e.options))}}});function Ep(e,t){return e?t?[...e,...t]:e:t}function Dp(e,t,n){return new wp(Reflect.ownKeys(e).map(t=>new bp(t,e[t].ast)),[],n,t)}function Op(e){return e.ast}function kp(e,t,n){return new zp(e.map(Op),t,void 0,n)}function Ap(e,t){if(e.encoding||t.some(e=>e.encoding))throw Error(`StructWithRest does not support encodings`);let n=e.propertySignatures,r=e.indexSignatures,i=e.checks;for(let e of t)n=n.concat(e.propertySignatures),r=r.concat(e.indexSignatures),i=Ep(i,e.checks);return new wp(n,r,void 0,i)}var jp=ao(e=>{for(;;){if(Jf(e))return ap;let t=e.encoding;if(!t)return e.recur?.(jp,$a)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==$a))return ap;e=t[t.length-1].to}});function Mp(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Mp)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Np(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Fd];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!cm(t)){if(Wf(t))return[{key:e.name,literal:t.literal}];if(Gf(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!cm(e)){if(Wf(e))return[{key:t,literal:e.literal}];if(Gf(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Np(jp(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Np(e.thunk())}}var Pp=new WeakMap,Fp=Object.freeze([]);function Ip(e){let t=Pp.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=jp(s);if(Uf(c))continue;if(o){if(Wf(c)||Gf(c)){a??=new Map;let e=Wf(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Np(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Mp(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Fp;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(_o(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Fp;if(n)return e}return Fp}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Fp;if(!_o(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Fp).map(t=>e[t]).filter(Lp(t));return Pp.set(e,t),t}function Lp(e){return t=>{let n=jp(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Rp(e,t,n=!1){return Ip(t)(e,n)}var zp=class e extends $f{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===Rd)return Bd;let a=Rp(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:Hu(t)?Bp(n,t.cause,r,i):Od(t,e=>Bp(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=gp(i?.concurrency),c=Vp(o,a,s?{...s,orderedStep:!0}:void 0);return c?jd(c,e=>o.out===Vd?Cd(r):o.out?o.out:wd(new nf(n,o.issues??[],r,i))):o.out?o.out:wd(new nf(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=om(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=dm(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Wf);if(t.length>0)return`${Up(n.isMutable)}[ ${t.map(t=>e(t)+Wp(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Wf(e.type));if(t.length>0)return`{ ${t.map(t=>`${Up(t.type.context?.isMutable)}${ps(t.name)}${Wp(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Bp(e,t,n,r){let i=bf(t);return i?pd(new nf(e,[i],n,r)):fd(t)}var Vp=nd()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=bf(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),pd(new rf(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return md}}}),Hp=new zp([new op(`Infinity`),new op(`-Infinity`),new op(`NaN`)],`anyOf`);function Up(e){return e?``:`readonly `}function Wp(e){return e?`?`:``}var Gp=class e extends Za{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new Kp([this,e],t)}},Kp=class e extends Za{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function qp(e,t,n=!1){return new Gp((t,n,r)=>sf(n,e(t,n,r),t,r),t,n)}function Jp(e){return qp(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var Yp=im(fp,[Jp()]);function Xp(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return qp(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function Zp(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var Qp=new WeakMap;function $p(e){return Qp.get(e)??e}function em(e,t){return e.encoding===t?e:Zp(e,e=>{e.encoding.value=t})}function tm(e,t){if(e.context===t)return e;let n=$p(e);if(n.context===t)return n;let r=Zp(e,e=>{e.context.value=t});return Qp.set(r,n),r}function nm(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return rm(e,Kc(e.checks.slice(0,-1),n.annotate(t)))}return Zp(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function rm(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:Zp(e,e=>{e.checks.value=t})}function im(e,t){return rm(e,Ep(e.checks,t))}function tee(e,t){let n=t(e.to);return n===e.to?e:new Yf(n,e.transformation)}function am(e,t){let n=e,r=n[n.length-1],i=tee(r,t);return i===r?e:Kc(e.slice(0,e.length-1),i)}function nee(e){return t=>t.encoding?em(t,am(t.encoding,e)):t}function ree(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:em(r,am(r.encoding,n))}return e(r)}return ao(n)}function iee(e,t,n){let r=new Yf(e,t);return em(n,n.encoding?[...n.encoding,r]:[r])}function om(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function aee(e,t){return tm(e,e.context?new Zf(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Zf(!1,!1,void 0,t))}var sm=ao(e=>oee(tm(e,e.context?e.context.isOptional===!1?new Zf(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Zf(!0,!1)))),oee=nee(sm),see=io(e=>sm(new zp([e,ip],`anyOf`)));function cee(e,t,n){return iee(e,n,t)}function lee(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:po(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function uee(e,t){let{literals:n,parameters:r}=lee(e);return new wp(n.map(e=>new bp(e,t)),r.map(e=>new Cp(e,t)))}function cm(e){return e.context?.isOptional??!1}function lm(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(lm)}function dee(e){function t(e){return lm(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Jc(n)?n:void 0}var um=ao(e=>{if(e.encoding)return um(em(e,void 0));let t=e,n=t.recur?.(um)??t,r=n.encodingChecks;if(r){let t=n===e?r:Kf(n)||qf(n)||Hf(n)&&n.typeParameters.length>0?dee(r):void 0;return Zp(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Ep(n.checks,t)})}return n}),dm=ao(e=>um(fm(e)));function fee(e,t){let n=t,r=n.length,i=n[r-1],a=[new Yf(fm(em(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Yf(fm(n[e-1].to),n[e].transformation.flip()));let o=fm(i.to);return o.encoding?em(o,[...o.encoding,...a]):em(o,a)}var fm=io(e=>{if(e.encoding)return fee(e,e.encoding);let t=e;return t.flip?.(fm)??t.recur?.(fm)??t});function pm(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(pm);default:return!1}}function mm(e,t){let n=zd(t);return(r,i)=>r===Rd?Bd:r===t?n:wd(new ef(e,r,i))}function hm(e,t){return(n,r)=>n===Rd?Bd:t(n)?Vd:wd(new ef(e,n,r))}var gm=ree(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(gm)}}),_m=new globalThis.RegExp(`^${vp}$`),pee=new globalThis.RegExp(`^(?:${vp}|Infinity|-Infinity|NaN)$`);function mee(e){return Xp(_m,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:_m.source}),...e})}var vm=im(cp,[mee()]),hee=new Yf(vm,zf),gee=new Yf(new zp([vm,Hp],`anyOf`),zf);function ym(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=ym(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Jd(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function _ee(e){if(!Hf(e))return;let t=e.annotations?.[Id];return mo(t)?t(e.typeParameters):void 0}function bm(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function vee(e){return e===void 0||typeof e==`string`}function xm(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function yee(e){return xm(e,bm)}var bee=nm(new ep([],()=>(e,t,n)=>yee(e)?Vd:wd(new ef(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>See,toArbitrary:()=>e=>e.jsonValue()}),{representation:{id:`effect/schema/MutableJson`,payload:null}});function xee(e){return xm(e,vee)}var See=new Yf(new ep([],()=>(e,t,n)=>xee(e)?Vd:wd(new ef(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Rf());function Sm(e){let t=jm(Im,um(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function Cee(e){let t=Sm(e);return(e,n)=>{let r=kd(t(e,n));return hd(r)?Pc(r.value):(xf(r.cause,`Option adapter can only return none for schema issues`),Nc())}}function wee(e){let t=Sm(e);return(e,n)=>{let r=kd(t(e,n));if(hd(r))return r.value;let i=xf(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function Cm(e,t){let n=Am(e.ast);return t===void 0?n:(e,r)=>n(e,Om(t,r))}function wm(e,t){return Nm(Cm(e,t))}var Tm=wm;function Em(e,t){return Pm(Cm(e,t))}function Dm(e,t){let n=Am(fm(e.ast));return t===void 0?n:(e,r)=>n(e,Om(t,r))}var Om=(e,t)=>t?{...e,...t}:e,km=e=>e===Rd?wd(new tf):Cd(e);function Am(e){return jm(Fm,e)}function jm(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Xf);return a===Vd?Cd(r):Hu(a)?a[Ts]===Rd?km(Rd):a:jd(a,km)}}function Mm(e){return(t,n)=>kd(e(t,n))}function Nm(e){let t=Mm(e);return(e,n)=>{let r=t(e,n);return hd(r)?Pc(r.value):(xf(r.cause,`Option adapter can only return none for schema issues`),Nc())}}function Pm(e){let t=Mm(e);return(e,n)=>{let r=t(e,n);return hd(r)?Bc(r.value):Vc(xf(r.cause,`Result adapter can only return schema issues`))}}var Fm=io(e=>Vm(e,Fm)),Im=io(e=>Vm(e,Im,Rm)),Lm=io(e=>Vm(e,Im,Rm,e.context?.constructorDefault));function Rm(e){return e.context?.constructorDefault?Lm(e):Im(e)}function zm(e,t,n,r){let i;if(Hu(e)&&e._tag===`Success`){let a=Hd(e===Vd?t:e[Ts]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(zd(a),r)}else i=n._tag===`Transformation`?jd(e,e=>n.decode.run(Hd(e),r)):n.decode(Ad(e,Hd),r);return Hu(i)&&i._tag===`Success`?Ud(i[Ts]):jd(i,Ud)}function Bm(e,t){let n;return(r,i)=>r===Rd?Bd:e.isConstructed(r)?Vd:zm((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function Vm(e,t,n,r){let i=n?_ee(e):void 0,a=i?Bm(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,Om(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(Hu(r)){if(r._tag===`Success`){let i=r===Vd?t:r[Ts];if(t!==Rd&&i!==Rd){let i=ym(c,t,void 0,e,n);i&&(r=wd(new $d(e,i,t,n)))}}}else r=Ed(r,r=>{if(t!==Rd&&r!==Rd){let r=ym(c,t,void 0,e,n);if(r)return wd(new $d(e,r,t,n))}return Cd(r)})}if(o&&!n.disableChecks){if(Hu(r)){if(r._tag===`Success`){let i=r===Vd?t:r[Ts];if(i===Rd)return r;let a=ym(o,i,void 0,e,n);a&&(r=wd(new $d(e,a,i,n)))}}else r=Ed(r,t=>{if(t!==Rd){let r=ym(o,t,void 0,e,n);if(r)return wd(new $d(e,r,t,n))}return Cd(t)})}return r};return s?(n,r)=>{l&&(r=Om(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=zm(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[Ts],o=t(a,r)):o=jd(o,e=>{let n=t(e,r);return n===Vd?zd(e):n})}if(o._tag===`Success`){let e=o[Ts],t=d(e,r);return t===Vd?o:t}return o=Od(o,t=>Td(()=>ud(t,t=>new Yd(e,t,n,r)))),jd(o,e=>{let t=d(e,r);return t===Vd?zd(e):t})}:l?(e,t)=>d(e,Om(t,l)):d}var Hm=`~effect/Schema/Schema`,Um={[Hm]:Hm,pipe(){return Ya(this,arguments)},annotate(e){return this.rebuild(nm(this.ast,e))},annotateKey(e){return this.rebuild(aee(this.ast,e))},check(...e){return this.rebuild(im(this.ast,e))}};function Wm(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,Um),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>Wm(e,t),r.makeEffect=Sm(r),r.make=wee(r),r.makeOption=Cee(r),r}var Gm=e=>e;function Km(){return(e,t,n)=>eh(new ep(e.map(Op),e=>t(e.map(e=>eh(e))),n))}function qm(e,t){return Km()([],()=>(t,n,r)=>e(t)?Cd(t):wd(new ef(n,t,r)),t)}var Jm=`~effect/SchemaError/SchemaError`,Ym=class extends gd(`SchemaError`){[Jm]=Jm;constructor(e){super({issue:e})}get message(){return _f(this.issue)}toString(){return`SchemaError(${this.message})`}};function Tee(e){return vo(e,Jm)&&e[Jm]===Jm}function Eee(e,t){let n=Cm(e,t);return(e,t)=>Xm(n(e,t))}function Xm(e){return Od(e,e=>Td(()=>ud(e,e=>new Ym(e))))}function Dee(e,t){let n;for(let r of e.reasons){if(!ld(r)||!Tee(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function Zm(e){let t=kd(e);if(hd(t))return t.value;throw Dee(t.cause,`Sync adapter can only throw schema errors`)}var Oee=wm,kee=Tm;function Qm(e,t){let n=Em(e,t);return(e,t)=>Uc(n(e,t),e=>new Ym(e))}function $m(e,t){let n=Eee(e,t);return(e,t)=>Zm(n(e,t))}var Aee=$m;function jee(e,t){let n=Dm(e,t);return(e,t)=>Xm(n(e,t))}function Mee(e,t){let n=jee(e,t);return(e,t)=>Zm(n(e,t))}var Nee=Mee,eh=Wm,th=Gm(e=>eh(sm(e.ast),{schema:e})),nh=Gm(e=>{let t=yh(e);return eh(see(e.ast),{schema:t})});function rh(e){let t=eh(new op(e),{literal:e,transform(n){return t.pipe(bh(rh(n),{decode:Ef(()=>n),encode:Ef(()=>e)}))}});return t}var ih=eh(ap),Pee=eh(tp),ah=eh(ip),oh=eh(cp),sh=eh(fp),ch=eh(pp);function lh(e,t){return eh(e,{fields:t,mapFields(e,t){let n=e(this.fields);return lh(Dp(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function uh(e){return lh(Dp(e,void 0),e)}function dh(e,t){return eh(uee(e.ast,t.ast),{key:e,value:t})}function fh(e,t){return eh(Ap(e.ast,t.map(Op)),{schema:e,records:t})}var ph=Gm(e=>eh(new mp(!1,[],[e.ast]),{value:e})),mh=Gm(e=>eh(new mp(!0,e.ast.elements,e.ast.rest),{schema:e}));function hh(e,t){return eh(e,{members:t,mapMembers(e,t){let n=e(this.members);return hh(kp(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function gh(e,t){return hh(kp(e,t?.mode??`anyOf`,void 0),e)}function _h(e){let t=e.map(rh);return eh(kp(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return gh(e(this.members))},pick(e){return _h(e)},transform(e){return gh(t.map((t,n)=>t.transform(e[n])))}})}var vh=Gm(e=>gh([e,Pee])),yh=Gm(e=>gh([e,ah]));function bh(e,t){return n=>eh(cee(n.ast,e.ast,t?Ff(t):Rf()),{from:n,to:e})}function xh(){return(e,t)=>new Yf(e.ast,Ff(t))}var Sh=qp,Ch=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function wh(e){let t=new globalThis.RegExp(Ch);return Sh(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitrary:{constraint:{patterns:[Ch]}},...e})}function Th(e,t){let n=e.source,r=e.flags,i=r===``?`new RegExp(${ds(n)})`:`new RegExp(${ds(n)}, ${ds(r)})`;return Xp(e,{toCode:()=>({runtime:`Schema.isPattern(${i})`}),...t})}var Eh=eh(Yp),Dh=Jp;function Oh(e){let t=Mc(e.order),n=e.formatter??ds;return(r,i)=>Sh(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:r,exclusiveMinimum:!0}}},...e.annotate?.(r),...i})}function kh(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${ds(e)}`);return e}var Ah=Oh({order:Ac,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:kh(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${ds(e)})`})})});function jh(e){return Sh(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>({type:`integer`}),toCode:()=>({runtime:`Schema.isInt()`}),arbitrary:{constraint:{integer:!0}},...e})}function Mh(e,t){return e=Math.max(0,Math.floor(e)),Sh(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Pd]:!0,arbitrary:{constraint:{minLength:e}},...t})}globalThis.RegExp,globalThis.URL;function Nh(e,t,n){let r={...t};if(e?.minimum!==void 0){let t=n===void 0?e.minimum:n(e.minimum),i=e.exclusiveMinimum?new globalThis.Date(t.getTime()+1):t;(r.min===void 0||i.getTime()>r.min.getTime())&&(r.min=i)}if(e?.maximum!==void 0){let t=n===void 0?e.maximum:n(e.maximum),i=e.exclusiveMaximum?new globalThis.Date(t.getTime()-1):t;(r.max===void 0||i.getTime()<r.max.getTime())&&(r.max=i)}return r}var Ph=oh.annotate({expected:`a string that will be decoded as a Date`}),Fh=qm(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:`effect/schema/Date`,payload:null},toCode:()=>({runtime:`Schema.Date`,Type:`globalThis.Date`}),expected:`a valid Date`,toCodecJson:()=>xh()(Ph,Bf),toArbitrary:()=>(e,t)=>e.date(Nh(t?.constraint?.ordered?.order===jc?t.constraint.ordered:void 0,{noInvalidDate:!0}))});globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Ih=oh.check(wh()),Lh=oh.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(bh(Ih,If()));globalThis.Uint8Array;var Rh=eh(nm(bee,{toCode:()=>({runtime:`Schema.MutableJson`,Type:`Schema.MutableJson`})})),zh=Ha(),X=Wa(),Bh=oh.pipe(bh(oh,If())).check(Mh(1)),Vh={onExcessProperty:`error`},Hh=[dh(oh,ih)];function Uh(e){return mh(ph(e))}function Wh(e){let t=Oee(e);return e=>Rc(t(e))}var Gh=Wh(uh({id:oh,firstName:vh(oh),lastName:vh(oh),primaryEmailAddress:vh(oh),createdAt:Eh}));function Kh(e){let t=(0,X.c)(21),{output:n}=e,r,i,a,o,s;if(t[0]!==n){s=Symbol.for(`react.early_return_sentinel`);bb0:{if(r=Gh(n),!r){s=null;break bb0}a=Ga([r.firstName?.[0],r.lastName?.[0]]).join(``).toUpperCase(),i=Ga([r.firstName,r.lastName]).join(` `),o=new Date(r.createdAt).toLocaleDateString()}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s}else r=t[1],i=t[2],a=t[3],o=t[4],s=t[5];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c=o,l=a||`?`,u;t[6]===l?u=t[7]:(u=(0,Y.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-violet-600 font-semibold text-lg text-white`,children:l}),t[6]=l,t[7]=u);let d=i||`Unknown User`,f;t[8]===d?f=t[9]:(f=(0,Y.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:d}),t[8]=d,t[9]=f);let p;t[10]===r.primaryEmailAddress?p=t[11]:(p=r.primaryEmailAddress&&(0,Y.jsx)(`div`,{className:`truncate text-muted-foreground text-sm`,children:r.primaryEmailAddress}),t[10]=r.primaryEmailAddress,t[11]=p);let m;t[12]===c?m=t[13]:(m=(0,Y.jsxs)(`div`,{className:`mt-0.5 font-mono text-muted-foreground text-xs`,children:[`Created `,c]}),t[12]=c,t[13]=m);let h;t[14]!==f||t[15]!==p||t[16]!==m?(h=(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[f,p,m]}),t[14]=f,t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==u||t[19]!==h?(g=(0,Y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[u,h]}),t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function qh(e){let t=(0,X.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`circle`,{cx:`64`,cy:`64`,fill:`currentColor`,r:`20`}),i=(0,Y.jsx)(`path`,{d:`M99.5716 10.788C101.571 12.1272 101.742 14.9444 100.04 16.646L85.4244 31.2618C84.1035 32.5828 82.0542 32.7914 80.3915 31.9397C75.4752 29.421 69.9035 28 64 28C44.1177 28 28 44.1177 28 64C28 69.9035 29.421 75.4752 31.9397 80.3915C32.7914 82.0542 32.5828 84.1035 31.2618 85.4244L16.646 100.04C14.9444 101.742 12.1272 101.571 10.788 99.5716C3.97411 89.3989 0 77.1635 0 64C0 28.6538 28.6538 0 64 0C77.1635 0 89.3989 3.97411 99.5716 10.788Z`,fill:`currentColor`,fillOpacity:`0.6`}),a=(0,Y.jsx)(`path`,{d:`M100.04 111.354C101.742 113.056 101.571 115.873 99.5717 117.212C89.3989 124.026 77.1636 128 64 128C50.8364 128 38.6011 124.026 28.4283 117.212C26.4289 115.873 26.2581 113.056 27.9597 111.354L42.5755 96.7382C43.8965 95.4172 45.9457 95.2085 47.6084 96.0603C52.5248 98.579 58.0964 100 64 100C69.9036 100 75.4753 98.579 80.3916 96.0603C82.0543 95.2085 84.1036 95.4172 85.4245 96.7382L100.04 111.354Z`,fill:`currentColor`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,Y.jsxs)(`svg`,{className:n,role:`img`,viewBox:`0 0 128 128`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Jh(e){let t=(0,X.c)(4),{className:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`title`,{children:`Linear`}),i=(0,Y.jsx)(`path`,{d:`M1.225 61.523c-.222-.949.908-1.546 1.597-.857l36.512 36.512c.69.69.092 1.82-.857 1.597-18.425-4.323-32.93-18.827-37.252-37.252ZM.002 46.889a.99.99 0 0 0 .29.76L52.35 99.71c.201.2.478.307.76.29 2.37-.149 4.695-.46 6.963-.927.765-.157 1.03-1.096.478-1.648L2.576 39.448c-.552-.551-1.491-.286-1.648.479a50.067 50.067 0 0 0-.926 6.962ZM4.21 29.705a.988.988 0 0 0 .208 1.1l64.776 64.776c.289.29.726.375 1.1.208a49.908 49.908 0 0 0 5.185-2.684.981.981 0 0 0 .183-1.54L8.436 24.336a.981.981 0 0 0-1.541.183 49.896 49.896 0 0 0-2.684 5.185Zm8.448-11.631a.986.986 0 0 1-.045-1.354C21.78 6.46 35.111 0 49.952 0 77.592 0 100 22.407 100 50.048c0 14.84-6.46 28.172-16.72 37.338a.986.986 0 0 1-1.354-.045L12.659 18.074Z`,fill:`#5E6AD2`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;return t[2]===n?a=t[3]:(a=(0,Y.jsxs)(`svg`,{"aria-label":`Linear`,className:n,fill:`none`,viewBox:`0 0 100 100`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i]}),t[2]=n,t[3]=a),a}function Yh(e){let t=(0,X.c)(3),{className:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`path`,{d:`M1000.46 450C1174.77 450 1278.43 553.669 1278.43 691.282C1278.43 828.896 1174.77 932.563 1000.46 932.563H912.382L1350 1350H1040.82L707.794 1033.48C683.944 1011.47 672.936 985.781 672.935 963.765C672.935 932.572 694.959 905.049 737.161 893.122L908.712 847.244C973.85 829.812 1018.81 779.353 1018.81 713.298C1018.8 632.567 952.745 585.78 871.095 585.78H450V450H1000.46Z`,fill:`currentColor`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,Y.jsx)(`svg`,{className:n,fill:`currentColor`,viewBox:`0 0 1800 1800`,xmlns:`http://www.w3.org/2000/svg`,children:r}),t[1]=n,t[2]=i),i}function Xh(e){let t=(0,X.c)(4),{className:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`title`,{children:`Slack`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsxs)(`g`,{clipRule:`evenodd`,fillRule:`evenodd`,children:[(0,Y.jsx)(`path`,{d:`m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z`,fill:`#36c5f0`}),(0,Y.jsx)(`path`,{d:`m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z`,fill:`#2eb67d`}),(0,Y.jsx)(`path`,{d:`m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z`,fill:`#ecb22e`}),(0,Y.jsx)(`path`,{d:`m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0`,fill:`#e01e5a`})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,Y.jsxs)(`svg`,{"aria-label":`Slack`,className:n,viewBox:`0 0 2447.6 2452.5`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i]}),t[2]=n,t[3]=a),a}function Zh(e){let t=(0,X.c)(8),{className:n}=e,r,i,a,o,s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`title`,{children:`Twilio`}),i=(0,Y.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`currentColor`,r:`10`}),a=(0,Y.jsx)(`circle`,{cx:`9`,cy:`9`,fill:`white`,r:`2`}),o=(0,Y.jsx)(`circle`,{cx:`15`,cy:`9`,fill:`white`,r:`2`}),s=(0,Y.jsx)(`circle`,{cx:`9`,cy:`15`,fill:`white`,r:`2`}),c=(0,Y.jsx)(`circle`,{cx:`15`,cy:`15`,fill:`white`,r:`2`}),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c):(r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]);let l;return t[6]===n?l=t[7]:(l=(0,Y.jsxs)(`svg`,{"aria-label":`Twilio`,className:n,fill:`none`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a,o,s,c]}),t[6]=n,t[7]=l),l}var Qh={clerk:{icon:qh,outputComponents:{"get-user":Kh,"create-user":Kh,"update-user":Kh}},linear:{icon:Jh},resend:{icon:Yh},slack:{icon:Xh},twilio:{icon:Zh}};function $h(){return typeof window<`u`}function eg(e){return rg(e)?(e.nodeName||``).toLowerCase():`#document`}function tg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ng(e){return((rg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rg(e){return $h()?e instanceof Node||e instanceof tg(e).Node:!1}function ig(e){return $h()?e instanceof Element||e instanceof tg(e).Element:!1}function ag(e){return $h()?e instanceof HTMLElement||e instanceof tg(e).HTMLElement:!1}function og(e){return!$h()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tg(e).ShadowRoot}function sg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=hg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cg(e){return/^(table|td|th)$/.test(eg(e))}function lg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Fee=/transform|translate|scale|rotate|perspective|filter/,Iee=/paint|layout|strict|content/,ug=e=>!!e&&e!==`none`,dg;function fg(e){let t=ig(e)?hg(e):e;return ug(t.transform)||ug(t.translate)||ug(t.scale)||ug(t.rotate)||ug(t.perspective)||!pg()&&(ug(t.backdropFilter)||ug(t.filter))||Fee.test(t.willChange||``)||Iee.test(t.contain||``)}function Lee(e){let t=_g(e);for(;ag(t)&&!mg(t);){if(fg(t))return t;if(lg(t))return null;t=_g(t)}return null}function pg(){return dg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),dg}function mg(e){return/^(html|body|#document)$/.test(eg(e))}function hg(e){return tg(e).getComputedStyle(e)}function gg(e){return ig(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _g(e){if(eg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||og(e)&&e.host||ng(e);return og(t)?t.host:t}function vg(e){let t=_g(e);return mg(t)?(e.ownerDocument||e).body:ag(t)&&sg(t)?t:vg(t)}function yg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=vg(e),i=r===e.ownerDocument?.body,a=tg(r);if(i){let e=bg(a);return t.concat(a,a.visualViewport||[],sg(r)?r:[],e&&n?yg(e):[])}return t.concat(r,yg(r,[],n))}function bg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var xg={...J},Sg={};function Cg(e,t){let n=J.useRef(Sg);return n.current===Sg&&(n.current=e(t)),n}var wg=xg.useInsertionEffect,Ree=wg&&wg!==xg.useLayoutEffect?wg:e=>e();function Z(e){let t=Cg(zee).current;return t.next=e,Ree(t.effect),t.trampoline}function zee(){let e={next:void 0,callback:Bee,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Bee(){}var Tg=typeof document<`u`?J.useLayoutEffect:()=>{};function Eg(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Dg={};function Og(e,t,n,r,i){if(!n&&!r&&!i&&!e)return kg(t);let a=kg(e);return t&&(a=Ag(a,t)),n&&(a=Ag(a,n)),r&&(a=Ag(a,r)),i&&(a=Ag(a,i)),a}function Vee(e){if(e.length===0)return Dg;if(e.length===1)return kg(e[0]);let t=kg(e[0]);for(let n=1;n<e.length;n+=1)t=Ag(t,e[n]);return t}function kg(e){return Mg(e)?{...Ng(e,Dg)}:Hee(e)}function Ag(e,t){return Mg(t)?Ng(t,e):Uee(e,t)}function Hee(e){let t={...e};for(let e in t){let n=t[e];jg(e,n)&&(t[e]=Pg(n))}return t}function Uee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Eg(e.style,r);break;case`className`:e[n]=Ig(e.className,r);break;default:e[n]=jg(n,r)?Wee(e[n],r):r}}return e}function jg(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Mg(e){return typeof e==`function`}function Ng(e,t){return Mg(e)?e(t):e??Dg}function Wee(e,t){return t?e?(...n)=>{let r=n[0];if(Lg(r)){let i=r;Fg(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Pg(t):e}function Pg(e){return e&&((...t)=>{let n=t[0];return Lg(n)&&Fg(n),e(...t)})}function Fg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ig(e,t){return t?e?t+` `+e:t:e}function Lg(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Gee(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Rg=Gee(`https://base-ui.com/production-error`,`Base UI`),zg=J.createContext(void 0);function Bg(e=!1){let t=J.useContext(zg);if(t===void 0&&!e)throw Error(Rg(16));return t}function Kee(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:J.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Vg(e){return e?.ownerDocument||document}function Hg(e,t,{detail:n=0}={}){e.dispatchEvent(new(tg(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ug(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=J.useRef(null),s=Bg(!0),c=a??s!==void 0,{props:l}=Kee({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=J.useCallback(()=>{let e=o.current;Wg(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Tg(u,[u]),{getButtonProps:J.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Og({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Fg(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Wg(r),s=!i&&qee(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Hg(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Hg(r,e)))},onKeyUp(e){if(!t){if(Fg(e),a?.(e),e.target===e.currentTarget&&i&&c&&Wg(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Hg(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Z(e=>{o.current=e,u()})}}function Wg(e){return ag(e)&&e.tagName===`BUTTON`}function qee(e){return ag(e)&&e.tagName===`A`&&!!e.href}function Gg(e,t,n,r){let i=Cg(Kg).current;return Yee(i,e,t,n,r)&&qg(i,[e,t,n,r]),i.callback}function Jee(e){let t=Cg(Kg).current;return Xee(t,e)&&qg(t,e),t.callback}function Kg(){return{callback:null,cleanup:null,refs:[]}}function Yee(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Xee(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function qg(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Zee=19;function Jg(e){return Zee>=e}function Yg(e){if(!J.isValidElement(e))return null;let t=e,n=t.props;return(Jg(19)?n?.ref:t.ref)??null}function Xg(){}var Zg=Object.freeze([]),Qg=Object.freeze({});function Qee(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function $ee(e,t){return typeof e==`function`?e(t):e}function $g(e,t){return typeof e==`function`?e(t):e}function e_(e,t,n={}){let r=t.render,i=t_(t,n);return n.enabled===!1?null:r_(e,r,i,n.state??Qg)}function t_(e,t={}){let{className:n,style:r,render:i}=e,{state:a=Qg,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?$ee(n,a):void 0,d=l?$g(r,a):void 0,f=l?Qee(a,c):Qg,p=l&&s?ete(s):void 0,m=l?Eg(f,p)??{}:Qg;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Jee([m.ref,Yg(i),...o]):Gg(m.ref,Yg(i),o):Gg(null,null)),l?(u!==void 0&&(m.className=Ig(m.className,u)),d!==void 0&&(m.style=Eg(m.style,d)),m):Qg}function ete(e){return Array.isArray(e)?Vee(e):Og(void 0,e)}var n_=Symbol.for(`react.lazy`);function r_(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Og(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===n_&&(i=J.Children.toArray(t)[0]),J.cloneElement(i,e)}if(e&&typeof e==`string`)return i_(e,n);throw Error(Rg(8))}function i_(e,t){return e===`button`?(0,J.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,J.createElement)(`img`,{alt:``,...t,key:t.key}):J.createElement(e,t)}var a_=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Ug({disabled:i,focusableWhenDisabled:a,native:o});return e_(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function o_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=o_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function s_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=o_(e))&&(r&&(r+=` `),r+=t);return r}var c_=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,l_=s_,u_=(e,t)=>n=>{if(t?.variants==null)return l_(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=c_(t)||c_(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return l_(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},d_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},f_=(e,t)=>({classGroupId:e,validator:t}),p_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),m_=`-`,h_=[],tte=`arbitrary..`,nte=e=>{let t=ite(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return rte(e);let n=e.split(m_);return g_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?d_(i,t):t:i||h_}return n[e]||h_}}},g_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=g_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(m_):e.slice(t).join(m_),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},rte=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?tte+r:void 0})(),ite=e=>{let{theme:t,classGroups:n}=e;return ate(n,t)},ate=(e,t)=>{let n=p_();for(let r in e){let i=e[r];__(i,n,r,t)}return n},__=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ote(i,t,n,r)}},ote=(e,t,n,r)=>{if(typeof e==`string`){ste(e,t,n);return}if(typeof e==`function`){cte(e,t,n,r);return}lte(e,t,n,r)},ste=(e,t,n)=>{let r=e===``?t:v_(t,e);r.classGroupId=n},cte=(e,t,n,r)=>{if(ute(e)){__(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(f_(n,e))},lte=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];__(o,v_(t,a),n,r)}},v_=(e,t)=>{let n=e,r=t.split(m_),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=p_(),n.nextPart.set(t,i)),n=i}return n},ute=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,dte=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},y_=`!`,b_=`:`,fte=[],x_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),pte=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===b_){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(y_)?(c=s.slice(0,-1),l=!0):s.startsWith(y_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return x_(t,l,c,u)};if(t){let e=t+b_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):x_(fte,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mte=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hte=e=>({cache:dte(e.cacheSize),parseClassName:pte(e),sortModifiers:mte(e),postfixLookupClassGroupIds:gte(e),...nte(e)}),gte=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},_te=/\s+/,vte=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_te),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+y_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},yte=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=S_(n))&&(i&&(i+=` `),i+=r);return i},S_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=S_(e[r]))&&(n&&(n+=` `),n+=t);return n},bte=(e,...t)=>{let n,r,i,a,o=o=>(n=hte(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=vte(e,n);return i(e,a),a};return a=o,(...e)=>a(yte(...e))},xte=[],C_=e=>{let t=t=>t[e]||xte;return t.isThemeGetter=!0,t},w_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,T_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ste=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wte=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ete=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E_=e=>Ste.test(e),D_=e=>!!e&&!Number.isNaN(Number(e)),O_=e=>!!e&&Number.isInteger(Number(e)),k_=e=>e.endsWith(`%`)&&D_(e.slice(0,-1)),A_=e=>Cte.test(e),j_=()=>!0,M_=e=>wte.test(e)&&!Tte.test(e),N_=()=>!1,P_=e=>Ete.test(e),F_=e=>Dte.test(e),I_=e=>!z_(e)&&!q_(e),L_=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),R_=e=>tv(e,av,N_),z_=e=>w_.test(e),B_=e=>tv(e,ov,M_),V_=e=>tv(e,sv,D_),H_=e=>tv(e,lv,j_),U_=e=>tv(e,cv,N_),W_=e=>tv(e,rv,N_),G_=e=>tv(e,iv,F_),K_=e=>tv(e,uv,P_),q_=e=>T_.test(e),J_=e=>nv(e,ov),Y_=e=>nv(e,cv),X_=e=>nv(e,rv),Z_=e=>nv(e,av),Q_=e=>nv(e,iv),$_=e=>nv(e,uv,!0),ev=e=>nv(e,lv,!0),tv=(e,t,n)=>{let r=w_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},nv=(e,t,n=!1)=>{let r=T_.exec(e);return r?r[1]?t(r[1]):n:!1},rv=e=>e===`position`||e===`percentage`,iv=e=>e===`image`||e===`url`,av=e=>e===`length`||e===`size`||e===`bg-size`,ov=e=>e===`length`,sv=e=>e===`number`,cv=e=>e===`family-name`,lv=e=>e===`number`||e===`weight`,uv=e=>e===`shadow`,dv=bte(()=>{let e=C_(`color`),t=C_(`font`),n=C_(`text`),r=C_(`font-weight`),i=C_(`tracking`),a=C_(`leading`),o=C_(`breakpoint`),s=C_(`container`),c=C_(`spacing`),l=C_(`radius`),u=C_(`shadow`),d=C_(`inset-shadow`),f=C_(`text-shadow`),p=C_(`drop-shadow`),m=C_(`blur`),h=C_(`perspective`),g=C_(`aspect`),_=C_(`ease`),v=C_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),q_,z_],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[q_,z_,c],T=()=>[E_,`full`,`auto`,...w()],E=()=>[O_,`none`,`subgrid`,q_,z_],D=()=>[`auto`,{span:[`full`,O_,q_,z_]},O_,q_,z_],O=()=>[O_,`auto`,q_,z_],k=()=>[`auto`,`min`,`max`,`fr`,q_,z_],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[E_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[E_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[E_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,q_,z_],L=()=>[...b(),X_,W_,{position:[q_,z_]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Z_,R_,{size:[q_,z_]}],B=()=>[k_,J_,B_],V=()=>[``,`none`,`full`,l,q_,z_],H=()=>[``,D_,J_,B_],U=()=>[`solid`,`dashed`,`dotted`,`double`],W=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],G=()=>[D_,k_,X_,W_],K=()=>[``,`none`,m,q_,z_],ee=()=>[`none`,D_,q_,z_],q=()=>[`none`,D_,q_,z_],te=()=>[D_,q_,z_],ne=()=>[E_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[A_],breakpoint:[A_],color:[j_],container:[A_],"drop-shadow":[A_],ease:[`in`,`out`,`in-out`],font:[I_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[A_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[A_],shadow:[A_],spacing:[`px`,D_],text:[A_],"text-shadow":[A_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,E_,z_,q_,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,q_,z_]}],"container-named":[L_],columns:[{columns:[D_,z_,q_,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[O_,`auto`,q_,z_]}],basis:[{basis:[E_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[D_,E_,`auto`,`initial`,`none`,z_]}],grow:[{grow:[``,D_,q_,z_]}],shrink:[{shrink:[``,D_,q_,z_]}],order:[{order:[O_,`first`,`last`,`none`,q_,z_]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,J_,B_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ev,H_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,k_,z_]}],"font-family":[{font:[Y_,U_,t]}],"font-features":[{"font-features":[z_]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,q_,z_]}],"line-clamp":[{"line-clamp":[D_,`none`,q_,V_]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,q_,z_]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,q_,z_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...U(),`wavy`]}],"text-decoration-thickness":[{decoration:[D_,`from-font`,`auto`,q_,B_]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[D_,`auto`,q_,z_]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[O_,q_,z_]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,q_,z_]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,q_,z_]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},O_,q_,z_],radial:[``,q_,z_],conic:[O_,q_,z_]},Q_,G_]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":H()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...U(),`hidden`,`none`]}],"divide-style":[{divide:[...U(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...U(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[D_,q_,z_]}],"outline-w":[{outline:[``,D_,J_,B_]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,$_,K_]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,$_,K_]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[D_,B_]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,$_,K_]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[D_,q_,z_]}],"mix-blend":[{"mix-blend":[...W(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":W()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[D_]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[q_,z_]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[D_]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,q_,z_]}],filter:[{filter:[``,`none`,q_,z_]}],blur:[{blur:K()}],brightness:[{brightness:[D_,q_,z_]}],contrast:[{contrast:[D_,q_,z_]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,$_,K_]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,D_,q_,z_]}],"hue-rotate":[{"hue-rotate":[D_,q_,z_]}],invert:[{invert:[``,D_,q_,z_]}],saturate:[{saturate:[D_,q_,z_]}],sepia:[{sepia:[``,D_,q_,z_]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,q_,z_]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[D_,q_,z_]}],"backdrop-contrast":[{"backdrop-contrast":[D_,q_,z_]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,D_,q_,z_]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[D_,q_,z_]}],"backdrop-invert":[{"backdrop-invert":[``,D_,q_,z_]}],"backdrop-opacity":[{"backdrop-opacity":[D_,q_,z_]}],"backdrop-saturate":[{"backdrop-saturate":[D_,q_,z_]}],"backdrop-sepia":[{"backdrop-sepia":[``,D_,q_,z_]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,q_,z_]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[D_,`initial`,q_,z_]}],ease:[{ease:[`linear`,`initial`,_,q_,z_]}],delay:[{delay:[D_,q_,z_]}],animate:[{animate:[`none`,v,q_,z_]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,q_,z_]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":[`scale-3d`],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[q_,z_,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":[`translate-none`],zoom:[{zoom:[O_,q_,z_]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,q_,z_]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,q_,z_]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[D_,J_,B_,V_]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Q(...e){return dv(s_(e))}Wh(oh),Wh(Eh);var fv=u_(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,xs:`h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5`,sm:`h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4`,icon:`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-xs":`size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5`,"icon-sm":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-lg":`size-8 [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`,size:`default`}});function pv(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?`default`:a,c;t[5]!==n||t[6]!==s||t[7]!==o?(c=Q(fv({variant:o,size:s,className:n})),t[5]=n,t[6]=s,t[7]=o,t[8]=c):c=t[8];let l;return t[9]!==r||t[10]!==c?(l=(0,Y.jsx)(a_,{"data-slot":`button`,className:c,...r}),t[9]=r,t[10]=c,t[11]=l):l=t[11],l}var mv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),hv=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),gv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_v=e=>{let t=gv(e);return t.charAt(0).toUpperCase()+t.slice(1)},vv={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},yv=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},bv=(0,J.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,J.createElement)(`svg`,{ref:c,...vv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:mv(`lucide`,i),...!a&&!yv(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,J.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xv=(e,t)=>{let n=(0,J.forwardRef)(({className:n,...r},i)=>(0,J.createElement)(bv,{ref:i,iconNode:t,className:mv(`lucide-${hv(_v(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_v(e),n},Sv=xv(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),Cv=xv(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),wv=xv(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Tv=xv(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ev=xv(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Dv=xv(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ov=xv(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),kv=xv(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Av=xv(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),jv=xv(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Mv=xv(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Nv=xv(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Pv=xv(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),Fv=xv(`clock-3`,[[`path`,{d:`M12 6v6h4`,key:`135r8i`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Iv=xv(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Lv=xv(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Rv=xv(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),zv=xv(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Bv=xv(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Vv=xv(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Hv=xv(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Uv=xv(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Wv=xv(`grid-3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Gv=xv(`group`,[[`path`,{d:`M3 7V5c0-1.1.9-2 2-2h2`,key:`adw53z`}],[`path`,{d:`M17 3h2c1.1 0 2 .9 2 2v2`,key:`an4l38`}],[`path`,{d:`M21 17v2c0 1.1-.9 2-2 2h-2`,key:`144t0e`}],[`path`,{d:`M7 21H5c-1.1 0-2-.9-2-2v-2`,key:`rtnfgi`}],[`rect`,{width:`7`,height:`5`,x:`7`,y:`7`,rx:`1`,key:`1eyiv7`}],[`rect`,{width:`7`,height:`5`,x:`10`,y:`12`,rx:`1`,key:`1qlmkx`}]]),Kv=xv(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),qv=xv(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Jv=xv(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Yv=xv(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),Xv=xv(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Zv=xv(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Qv=xv(`map-pin-x-inside`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`path`,{d:`m14.5 7.5-5 5`,key:`3lb6iw`}],[`path`,{d:`m9.5 7.5 5 5`,key:`ko136h`}]]),$v=xv(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),ey=xv(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ty=xv(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ny=xv(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),ry=xv(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),iy=xv(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ay=xv(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Ote=xv(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),oy=xv(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),kte=xv(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),sy=xv(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Ate=xv(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),cy=xv(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ly=xv(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),uy=xv(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),jte=xv(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Mte=xv(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),Nte=xv(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),dy=xv(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),fy=xv(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Pte=xv(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),py=xv(`ungroup`,[[`rect`,{width:`8`,height:`6`,x:`5`,y:`4`,rx:`1`,key:`nzclkv`}],[`rect`,{width:`8`,height:`6`,x:`11`,y:`14`,rx:`1`,key:`4tytwb`}]]),Fte=xv(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),my=xv(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),hy=xv(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Ite=xv(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Lte=xv(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);function gy(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`size-4 animate-spin`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Zv,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rte(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{className:`flex h-dvh items-center justify-center`,children:(0,Y.jsx)(gy,{className:`size-6 text-muted-foreground`})}),e[0]=t):t=e[0],t}var zte={unreachable:`The server did not answer. It may be down, or something between the browser and it is dropping the request.`,refused:`The server answered with an error. Check that Workflow Graph is mounted where this page expects it.`,mismatch:`The server answered with a document this editor cannot read. The two are most likely different builds of Workflow Graph.`};function Bte(e){let t=(0,X.c)(9),{endpoint:n,reason:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`h1`,{className:`font-medium text-base`,children:`The editor cannot start`}),t[0]=i):i=t[0];let a=zte[r],o;t[1]===a?o=t[2]:(o=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:a}),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`It asks `,(0,Y.jsxs)(`code`,{className:`font-mono text-xs`,children:[`GET `,n]}),` for the Events, actions and integrations this server carries.`]}),t[3]=n,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(pv,{onClick:Vte,size:`sm`,type:`button`,variant:`outline`,children:`Try again`}),t[5]=c):c=t[5];let l;return t[6]!==o||t[7]!==s?(l=(0,Y.jsx)(`div`,{className:`flex h-dvh items-center justify-center p-6`,children:(0,Y.jsxs)(`div`,{className:`max-w-md space-y-3 rounded-lg border p-6`,children:[i,o,s,c]})}),t[6]=o,t[7]=s,t[8]=l):l=t[8],l}function Vte(){return window.location.reload()}var _y=(0,J.createContext)(null);function Hte(e){let t=(0,X.c)(3),{children:n,value:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Y.jsx)(_y.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function vy(){let e=(0,J.useContext)(_y);if(!e)throw Error(`useExtensionCatalog must be used within an ExtensionCatalogProvider`);return e}var yy=(0,J.createContext)(null);function Ute(e){let t=(0,X.c)(3),{children:n,value:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Y.jsx)(yy.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function by(){let e=(0,J.useContext)(yy);if(!e)throw Error(`useIntegrationUi must be used within an IntegrationUiProvider`);return e}var Wte=/\/$/;function xy(){if(typeof document>`u`)return``;let e=document.querySelector(`base`)?.getAttribute(`href`);return e?e.replace(Wte,``):``}function Gte(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Kte=e=>{switch(e){case`success`:return Yte;case`info`:return Zte;case`warning`:return Xte;case`error`:return Qte;default:return null}},qte=Array(12).fill(0),Jte=({visible:e,className:t})=>J.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},J.createElement(`div`,{className:`sonner-spinner`},qte.map((e,t)=>J.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Yte=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Xte=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Zte=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Qte=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},J.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),$te=J.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},J.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),J.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ene=()=>{let[e,t]=J.useState(document.hidden);return J.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},tne=1,nne=100,Sy=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:tne++,Cy=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-nne;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Sy(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],J.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ine(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!J.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Sy(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},rne=(e,t)=>Cy.message(e,t),ine=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,wy=Object.assign(rne,{success:Cy.success,info:Cy.info,warning:Cy.warning,error:Cy.error,custom:Cy.custom,message:Cy.message,promise:Cy.promise,dismiss:Cy.dismiss,loading:Cy.loading},{getHistory:()=>Cy.toasts,getToasts:()=>Cy.getActiveToasts()});Gte(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Ty(e){return e.label!==void 0}var ane=3,one=`24px`,sne=`16px`,Ey=4e3,cne=356,lne=14,une=45,dne=200;function Dy(...e){return e.filter(Boolean).join(` `)}function fne(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var pne=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=J.useState(null),[O,k]=J.useState(null),[A,j]=J.useState(!1),[M,N]=J.useState(!1),[P,F]=J.useState(!1),[I,L]=J.useState(!1),[R,z]=J.useState(!1),[B,V]=J.useState(0),[H,U]=J.useState(0),W=J.useRef(n.duration||y||Ey),G=J.useRef(null),K=J.useRef(null),ee=c===0,q=c+1<=o,te=n.type,ne=te??`default`,re=n.dismissible!==!1,ie=n.className||``,ae=n.descriptionClassName||``,oe=J.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),se=J.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ce=J.useMemo(()=>n.duration||y||Ey,[n.duration,y]),le=J.useRef(0),ue=J.useRef(0),de=J.useRef(0),fe=J.useRef(null),[pe,me]=b.split(`-`),he=J.useMemo(()=>s.reduce((e,t,n)=>n>=oe?e:e+t.height,0),[s,oe]),ge=ene(),_e=J.useMemo(()=>e.swipeDirections??fne(b),[e.swipeDirections,b]),ve=n.invert||t,ye=te===`loading`;ue.current=J.useMemo(()=>oe*x+he,[oe,he]),J.useEffect(()=>{W.current=ce},[ce]),J.useEffect(()=>{j(!0)},[]),J.useEffect(()=>{let e=K.current;if(e){let t=e.getBoundingClientRect().height;return U(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),J.useLayoutEffect(()=>{if(!A)return;let e=K.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let be=J.useCallback(()=>{N(!0),V(ue.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},dne)},[n,d,a,ue]);J.useEffect(()=>{if(n.promise&&te===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||ge?(()=>{if(de.current<le.current){let e=new Date().getTime()-le.current;W.current-=e}de.current=new Date().getTime()})():W.current!==1/0&&(le.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),be()},W.current)),()=>clearTimeout(e)},[u,i,n,te,ge,be]),J.useEffect(()=>{n.delete&&(be(),n.onDismiss==null||n.onDismiss.call(n,n))},[be,n.delete]);function xe(){return w?.loading?J.createElement(`div`,{className:Dy(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":te===`loading`},w.loading):J.createElement(Jte,{className:Dy(C?.loader,n?.classNames?.loader),visible:te===`loading`})}let Se=n.icon||w?.[te]||Kte(te);return J.createElement(`li`,{tabIndex:0,ref:K,className:Dy(_,ie,C?.toast,n?.classNames?.toast,C?.[ne],n?.classNames?.[ne]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":q,"data-y-position":pe,"data-x-position":me,"data-index":c,"data-front":ee,"data-swiping":P,"data-dismissible":re,"data-type":te,"data-invert":ve,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?B:ue.current}px`,"--initial-height":S?`auto`:`${H}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),fe.current=null},onPointerDown:e=>{e.button!==2&&(ye||!re||(G.current=new Date,V(ue.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),fe.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!re)return;fe.current=null;let e=Number(K.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(K.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-G.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?_e.includes(e>0?`right`:`left`):_e.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=une||a>.11)){V(ue.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),be(),L(!0);return}var o,s;(o=K.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=K.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)},onPointerMove:e=>{var t,n;if(!fe.current||!re||window.getSelection()?.toString().length>0)return;let r=e.clientY-fe.current.y,i=e.clientX-fe.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(_e.includes(`top`)||_e.includes(`bottom`)){if(_e.includes(`top`)&&r<0||_e.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(_e.includes(`left`)||_e.includes(`right`))){if(_e.includes(`left`)&&i<0||_e.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=K.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=K.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},se&&!n.jsx&&te!==`loading`?J.createElement(`button`,{"aria-label":T,"data-disabled":ye,"data-close-button":!0,onClick:ye||!re?()=>{}:()=>{be(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Dy(C?.closeButton,n?.classNames?.closeButton)},w?.close??$te):null,(te||n.icon||n.promise)&&n.icon!==null&&(w?.[te]!==null||n.icon)?J.createElement(`div`,{"data-icon":``,className:Dy(C?.icon,n?.classNames?.icon)},te===`loading`?n.icon||xe():n.promise?xe():null,te===`loading`?null:Se):null,J.createElement(`div`,{"data-content":``,className:Dy(C?.content,n?.classNames?.content)},J.createElement(`div`,{"data-title":``,className:Dy(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?J.createElement(`div`,{"data-description":``,className:Dy(v,ae,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),J.isValidElement(n.cancel)?n.cancel:n.cancel&&Ty(n.cancel)?J.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Ty(n.cancel)&&re&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),be())},className:Dy(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,J.isValidElement(n.action)?n.action:n.action&&Ty(n.action)?J.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Ty(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&be())},className:Dy(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Oy(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function mne(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?sne:one;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var hne=J.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=ane,toastOptions:g,dir:_=Oy(),gap:v=lne,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=J.useState([]),w=J.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=J.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=J.useState([]),[O,k]=J.useState(!1),[A,j]=J.useState(!1),[M,N]=J.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=J.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=J.useRef(null),L=J.useRef(!1),R=J.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Cy.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return J.useEffect(()=>Cy.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Zi.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),J.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),J.useEffect(()=>{S.length<=1&&k(!1)},[S]),J.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),J.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),J.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?J.createElement(`ol`,{key:t,dir:_===`auto`?Oy():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${cne}px`,"--gap":`${v}px`,...m,...mne(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>J.createElement(pne,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),gne=`wfgraph`;function ky(){}function _ne(e){let t=`[${[gne,...e].join(`.`)}]`;return{debug:ky,info:ky,warn:(e,n)=>console.warn(t,e,n),error:(e,n)=>console.error(t,e,n)}}function Ay(...e){return _ne(e)}function vne(e,t){return t?.errorShownByCaller?null:t?.errorMessage??(e instanceof Error?e.message:`Request failed`)}var yne=Ay(`query`),jy=new Ae({queryCache:new ke({onError:(e,t)=>{let n=t.meta?.errorMessage;n?wy.error(n):yne.error(`Background query failed`,{queryHash:t.queryHash,error:e})}}),mutationCache:new Ee({onError:(e,t,n,r)=>{let i=vne(e,r.meta);i!==null&&wy.error(i)}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1,staleTime:3e4}}}),bne={events:[],actions:[],integrations:[]};function My(e,t){return e.events.find(e=>e.name===t)}function Ny(e,t){return e.actions.find(e=>e.id===t)}function Py(e,t){return e.integrations.find(e=>e.type===t)}function Fy(e){return e.actions.filter(e=>e.hidden!==!0)}function xne(e,t){let n=Fy(e);if(!t)return n;let r=Ny(e,t);return!r||r.hidden!==!0||n.some(e=>e.id===t)?n:[...n,r]}function Sne(e,t){return Cne({...e,actions:xne(e,t)})}function Cne(e){let t={};for(let n of e.actions){let e=t[n.category];e?e.push(n):t[n.category]=[n]}return t}var wne=uh({value:oh,label:oh}),Iy=uh({field:oh,equals:oh}),Ly=uh({key:oh,label:oh,type:_h([`template-input`,`template-textarea`,`text`,`number`,`select`,`key-value`]),placeholder:th(oh),defaultValue:th(oh),example:th(oh),options:th(mh(ph(wne))),rows:th(Eh),min:th(Eh),required:th(ch),literal:th(rh(!0)),showWhen:th(Iy)}),Tne=gh([uh({label:oh,type:rh(`group`),fields:mh(ph(Ly)),defaultExpanded:th(ch)}),Ly]),Ry=uh({path:oh,description:th(oh),type:th(_h([`string`,`number`,`boolean`,`timestamp`,`duration`,`array`,`object`])),nullable:th(ch),enumValues:th(mh(ph(oh))),showWhen:th(Iy)}),Ene=uh({name:Bh,label:Bh,description:th(oh),correlationPath:th(oh),payloadFields:ph(Ry)}),Dne=uh({id:Bh,label:Bh,description:oh,category:oh,integration:th(oh),logoUrl:th(oh),sideEffect:th(ch),hidden:th(ch),configFields:ph(Tne),outputFields:ph(Ry)}),One=uh({type:Bh,label:Bh,description:oh,credentialFields:dh(oh,uh({label:oh,type:_h([`text`,`password`,`url`]),placeholder:th(oh),helpText:th(oh),helpLink:th(uh({text:oh,url:oh}))})),hasTest:ch}),kne=Wh(uh({events:ph(Ene),actions:ph(Dne),integrations:ph(One)})),Ane=Wh(uh({catalog:th(ih)})),jne=Ay(`extensions`),zy=bne;function By(){return zy}async function Vy(){let e;try{let t=await fetch(`${xy()}/api/extensions`,{method:`GET`,headers:{accept:`application/json`}});if(!t.ok)return{ok:!1,reason:`refused`};e=await t.json()}catch{return{ok:!1,reason:`unreachable`}}let t=kne(Ane(e)?.catalog);return t?(zy=t,{ok:!0}):(jne.warn(`The extension catalog from /api/extensions did not fit the wire schema in @wfgraph/shared/extensions/catalog-wire, so the editor is drawing from the catalog it had. The server serving it is most likely a different build of Workflow Graph.`),{ok:!1,reason:`mismatch`})}function Hy(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Hy(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Uy={value:()=>{}};function Wy(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Gy(n)}function Gy(e){this._=e}function Ky(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Gy.prototype=Wy.prototype={constructor:Gy,on:function(e,t){var n=this._,r=Ky(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=qy(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Jy(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Jy(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gy(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function qy(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Jy(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Uy,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Yy={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Xy(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Yy.hasOwnProperty(t)?{space:Yy[t],local:e}:e}function Zy(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Qy(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function $y(e){var t=Xy(e);return(t.local?Qy:Zy)(t)}function eb(){}function tb(e){return e==null?eb:function(){return this.querySelector(e)}}function nb(e){typeof e!=`function`&&(e=tb(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Wx(r,this._parents)}function rb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ib(){return[]}function ab(e){return e==null?ib:function(){return this.querySelectorAll(e)}}function ob(e){return function(){return rb(e.apply(this,arguments))}}function sb(e){e=typeof e==`function`?ob(e):ab(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Wx(r,i)}function cb(e){return function(){return this.matches(e)}}function lb(e){return function(t){return t.matches(e)}}var ub=Array.prototype.find;function db(e){return function(){return ub.call(this.children,e)}}function fb(){return this.firstElementChild}function pb(e){return this.select(e==null?fb:db(typeof e==`function`?e:lb(e)))}var mb=Array.prototype.filter;function hb(){return Array.from(this.children)}function gb(e){return function(){return mb.call(this.children,e)}}function _b(e){return this.selectAll(e==null?hb:gb(typeof e==`function`?e:lb(e)))}function vb(e){typeof e!=`function`&&(e=cb(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Wx(r,this._parents)}function yb(e){return Array(e.length)}function bb(){return new Wx(this._enter||this._groups.map(yb),this._parents)}function xb(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xb.prototype={constructor:xb,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Sb(e){return function(){return e}}function Cb(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new xb(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function wb(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new xb(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Tb(e){return e.__data__}function Eb(e,t){if(!arguments.length)return Array.from(this,Tb);var n=t?wb:Cb,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Sb(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Db(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Wx(o,r),o._enter=s,o._exit=c,o}function Db(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ob(){return new Wx(this._exit||this._groups.map(yb),this._parents)}function kb(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Ab(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Wx(s,this._parents)}function jb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Mb(e){e||=Nb;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Wx(i,this._parents).order()}function Nb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Fb(){return Array.from(this)}function Ib(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Lb(){let e=0;for(let t of this)++e;return e}function Rb(){return!this.node()}function zb(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Bb(e){return function(){this.removeAttribute(e)}}function Vb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hb(e,t){return function(){this.setAttribute(e,t)}}function Ub(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Wb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Gb(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Kb(e,t){var n=Xy(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Vb:Bb:typeof t==`function`?n.local?Gb:Wb:n.local?Ub:Hb)(n,t))}function qb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Jb(e){return function(){this.style.removeProperty(e)}}function Yb(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Xb(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Zb(e,t,n){return arguments.length>1?this.each((t==null?Jb:typeof t==`function`?Xb:Yb)(e,t,n??``)):Qb(this.node(),e)}function Qb(e,t){return e.style.getPropertyValue(t)||qb(e).getComputedStyle(e,null).getPropertyValue(t)}function $b(e){return function(){delete this[e]}}function ex(e,t){return function(){this[e]=t}}function tx(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function nx(e,t){return arguments.length>1?this.each((t==null?$b:typeof t==`function`?tx:ex)(e,t)):this.node()[e]}function rx(e){return e.trim().split(/^|\s+/)}function ix(e){return e.classList||new ax(e)}function ax(e){this._node=e,this._names=rx(e.getAttribute(`class`)||``)}ax.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function ox(e,t){for(var n=ix(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function sx(e,t){for(var n=ix(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function cx(e){return function(){ox(this,e)}}function lx(e){return function(){sx(this,e)}}function ux(e,t){return function(){(t.apply(this,arguments)?ox:sx)(this,e)}}function dx(e,t){var n=rx(e+``);if(arguments.length<2){for(var r=ix(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?ux:t?cx:lx)(n,t))}function fx(){this.textContent=``}function px(e){return function(){this.textContent=e}}function mx(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function hx(e){return arguments.length?this.each(e==null?fx:(typeof e==`function`?mx:px)(e)):this.node().textContent}function gx(){this.innerHTML=``}function _x(e){return function(){this.innerHTML=e}}function vx(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function yx(e){return arguments.length?this.each(e==null?gx:(typeof e==`function`?vx:_x)(e)):this.node().innerHTML}function bx(){this.nextSibling&&this.parentNode.appendChild(this)}function xx(){return this.each(bx)}function Sx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cx(){return this.each(Sx)}function wx(e){var t=typeof e==`function`?e:$y(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Tx(){return null}function Ex(e,t){var n=typeof e==`function`?e:$y(e),r=t==null?Tx:typeof t==`function`?t:tb(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Dx(){var e=this.parentNode;e&&e.removeChild(this)}function Ox(){return this.each(Dx)}function kx(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ax(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jx(e){return this.select(e?Ax:kx)}function Mx(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Nx(e){return function(t){e.call(this,t,this.__data__)}}function Px(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Fx(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Ix(e,t,n){return function(){var r=this.__on,i,a=Nx(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Lx(e,t,n){var r=Px(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Ix:Fx,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Rx(e,t,n){var r=qb(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function zx(e,t){return function(){return Rx(this,e,t)}}function Bx(e,t){return function(){return Rx(this,e,t.apply(this,arguments))}}function Vx(e,t){return this.each((typeof t==`function`?Bx:zx)(e,t))}function*Hx(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Ux=[null];function Wx(e,t){this._groups=e,this._parents=t}function Gx(){return new Wx([[document.documentElement]],Ux)}function Kx(){return this}Wx.prototype=Gx.prototype={constructor:Wx,select:nb,selectAll:sb,selectChild:pb,selectChildren:_b,filter:vb,data:Eb,enter:bb,exit:Ob,join:kb,merge:Ab,selection:Kx,order:jb,sort:Mb,call:Pb,nodes:Fb,node:Ib,size:Lb,empty:Rb,each:zb,attr:Kb,style:Zb,property:nx,classed:dx,text:hx,html:yx,raise:xx,lower:Cx,append:wx,insert:Ex,remove:Ox,clone:jx,datum:Mx,on:Lx,dispatch:Vx,[Symbol.iterator]:Hx};function qx(e){return typeof e==`string`?new Wx([[document.querySelector(e)]],[document.documentElement]):new Wx([[e]],Ux)}function Jx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yx(e,t){if(e=Jx(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Xx={passive:!1},Zx={capture:!0,passive:!1};function Qx(e){e.stopImmediatePropagation()}function $x(e){e.preventDefault(),e.stopImmediatePropagation()}function eS(e){var t=e.document.documentElement,n=qx(e).on(`dragstart.drag`,$x,Zx);`onselectstart`in t?n.on(`selectstart.drag`,$x,Zx):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function tS(e,t){var n=e.document.documentElement,r=qx(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,$x,Zx),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var nS=e=>()=>e;function rS(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}rS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function iS(e){return!e.ctrlKey&&!e.button}function aS(){return this.parentNode}function oS(e,t){return t??{x:e.x,y:e.y}}function sS(){return navigator.maxTouchPoints||`ontouchstart`in this}function cS(){var e=iS,t=aS,n=oS,r=sS,i={},a=Wy(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Xx).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(qx(n.view).on(`mousemove.drag`,m,Zx).on(`mouseup.drag`,h,Zx),eS(n.view),Qx(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if($x(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){qx(e.view).on(`mousemove.drag mouseup.drag`,null),tS(e.view,l),$x(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Qx(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&($x(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Qx(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Yx(l||r,t),p,m,h;if((h=n.call(e,new rS(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Yx(l||a,t),_=o}u.call(r,e,new rS(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:nS(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:nS(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:nS(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:nS(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function lS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uS(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dS(){}var fS=.7,pS=1/fS,mS=`\\s*([+-]?\\d+)\\s*`,hS=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,gS=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,_S=/^#([0-9a-f]{3,8})$/,vS=RegExp(`^rgb\\(${mS},${mS},${mS}\\)$`),yS=RegExp(`^rgb\\(${gS},${gS},${gS}\\)$`),bS=RegExp(`^rgba\\(${mS},${mS},${mS},${hS}\\)$`),xS=RegExp(`^rgba\\(${gS},${gS},${gS},${hS}\\)$`),SS=RegExp(`^hsl\\(${hS},${gS},${gS}\\)$`),CS=RegExp(`^hsla\\(${hS},${gS},${gS},${hS}\\)$`),wS={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};lS(dS,kS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:TS,formatHex:TS,formatHex8:ES,formatHsl:DS,formatRgb:OS,toString:OS});function TS(){return this.rgb().formatHex()}function ES(){return this.rgb().formatHex8()}function DS(){return HS(this).formatHsl()}function OS(){return this.rgb().formatRgb()}function kS(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=_S.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?AS(t):n===3?new PS(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?jS(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?jS(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vS.exec(e))?new PS(t[1],t[2],t[3],1):(t=yS.exec(e))?new PS(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=bS.exec(e))?jS(t[1],t[2],t[3],t[4]):(t=xS.exec(e))?jS(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SS.exec(e))?VS(t[1],t[2]/100,t[3]/100,1):(t=CS.exec(e))?VS(t[1],t[2]/100,t[3]/100,t[4]):wS.hasOwnProperty(e)?AS(wS[e]):e===`transparent`?new PS(NaN,NaN,NaN,0):null}function AS(e){return new PS(e>>16&255,e>>8&255,e&255,1)}function jS(e,t,n,r){return r<=0&&(e=t=n=NaN),new PS(e,t,n,r)}function MS(e){return e instanceof dS||(e=kS(e)),e?(e=e.rgb(),new PS(e.r,e.g,e.b,e.opacity)):new PS}function NS(e,t,n,r){return arguments.length===1?MS(e):new PS(e,t,n,r??1)}function PS(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}lS(PS,NS,uS(dS,{brighter(e){return e=e==null?pS:pS**+e,new PS(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fS:fS**+e,new PS(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new PS(zS(this.r),zS(this.g),zS(this.b),RS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:FS,formatHex:FS,formatHex8:IS,formatRgb:LS,toString:LS}));function FS(){return`#${BS(this.r)}${BS(this.g)}${BS(this.b)}`}function IS(){return`#${BS(this.r)}${BS(this.g)}${BS(this.b)}${BS((isNaN(this.opacity)?1:this.opacity)*255)}`}function LS(){let e=RS(this.opacity);return`${e===1?`rgb(`:`rgba(`}${zS(this.r)}, ${zS(this.g)}, ${zS(this.b)}${e===1?`)`:`, ${e})`}`}function RS(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zS(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function BS(e){return e=zS(e),(e<16?`0`:``)+e.toString(16)}function VS(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new WS(e,t,n,r)}function HS(e){if(e instanceof WS)return new WS(e.h,e.s,e.l,e.opacity);if(e instanceof dS||(e=kS(e)),!e)return new WS;if(e instanceof WS)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new WS(o,s,c,e.opacity)}function US(e,t,n,r){return arguments.length===1?HS(e):new WS(e,t,n,r??1)}function WS(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}lS(WS,US,uS(dS,{brighter(e){return e=e==null?pS:pS**+e,new WS(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fS:fS**+e,new WS(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new PS(qS(e>=240?e-240:e+120,i,r),qS(e,i,r),qS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new WS(GS(this.h),KS(this.s),KS(this.l),RS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=RS(this.opacity);return`${e===1?`hsl(`:`hsla(`}${GS(this.h)}, ${KS(this.s)*100}%, ${KS(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function GS(e){return e=(e||0)%360,e<0?e+360:e}function KS(e){return Math.max(0,Math.min(1,e||0))}function qS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var JS=e=>()=>e;function YS(e,t){return function(n){return e+n*t}}function XS(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ZS(e){return(e=+e)==1?QS:function(t,n){return n-t?XS(t,n,e):JS(isNaN(t)?n:t)}}function QS(e,t){var n=t-e;return n?YS(e,n):JS(isNaN(e)?t:e)}var $S=(function e(t){var n=ZS(t);function r(e,t){var r=n((e=NS(e)).r,(t=NS(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=QS(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function eC(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function tC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nC(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=dC(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function rC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function iC(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function aC(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=dC(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var oC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sC=new RegExp(oC.source,`g`);function cC(e){return function(){return e}}function lC(e){return function(t){return e(t)+``}}function uC(e,t){var n=oC.lastIndex=sC.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=oC.exec(e))&&(i=sC.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:iC(r,i)})),n=sC.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?lC(c[0].x):cC(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function dC(e,t){var n=typeof t,r;return t==null||n===`boolean`?JS(t):(n===`number`?iC:n===`string`?(r=kS(t))?(t=r,$S):uC:t instanceof kS?$S:t instanceof Date?rC:tC(t)?eC:Array.isArray(t)?nC:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?aC:iC)(e,t)}var fC=180/Math.PI,pC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mC(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*fC,skewX:Math.atan(c)*fC,scaleX:o,scaleY:s}}var hC;function gC(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?pC:mC(t.a,t.b,t.c,t.d,t.e,t.f)}function _C(e){return e==null||(hC||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),hC.setAttribute(`transform`,e),!(e=hC.transform.baseVal.consolidate()))?pC:(e=e.matrix,mC(e.a,e.b,e.c,e.d,e.e,e.f))}function vC(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:iC(e,i)},{i:c-2,x:iC(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:iC(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:iC(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:iC(e,n)},{i:s-2,x:iC(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var yC=vC(gC,`px, `,`px)`,`deg)`),bC=vC(_C,`, `,`)`,`)`),xC=1e-12;function SC(e){return((e=Math.exp(e))+1/e)/2}function CC(e){return((e=Math.exp(e))-1/e)/2}function wC(e){return((e=Math.exp(2*e))-1)/(e+1)}var TC=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<xC)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=SC(y),c=s/(n*g)*(i*wC(t*r+y)-CC(y));return[a+c*d,o+c*f,s*i/SC(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),EC=0,DC=0,OC=0,kC=1e3,AC,jC,MC=0,NC=0,PC=0,FC=typeof performance==`object`&&performance.now?performance:Date,IC=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function LC(){return NC||=(IC(RC),FC.now()+PC)}function RC(){NC=0}function zC(){this._call=this._time=this._next=null}zC.prototype=BC.prototype={constructor:zC,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?LC():+n)+(t==null?0:+t),!this._next&&jC!==this&&(jC?jC._next=this:AC=this,jC=this),this._call=e,this._time=n,GC()},stop:function(){this._call&&(this._call=null,this._time=1/0,GC())}};function BC(e,t,n){var r=new zC;return r.restart(e,t,n),r}function VC(){LC(),++EC;for(var e=AC,t;e;)(t=NC-e._time)>=0&&e._call.call(void 0,t),e=e._next;--EC}function HC(){NC=(MC=FC.now())+PC,EC=DC=0;try{VC()}finally{EC=0,WC(),NC=0}}function UC(){var e=FC.now(),t=e-MC;t>kC&&(PC-=t,MC=e)}function WC(){for(var e,t=AC,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:AC=n);jC=e,GC(r)}function GC(e){EC||(DC&&=clearTimeout(DC),e-NC>24?(e<1/0&&(DC=setTimeout(HC,e-FC.now()-PC)),OC&&=clearInterval(OC)):(OC||=(MC=FC.now(),setInterval(UC,kC)),EC=1,IC(HC)))}function KC(e,t,n){var r=new zC;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var qC=Wy(`start`,`end`,`cancel`,`interrupt`),JC=[];function YC(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;$C(e,n,{name:t,index:r,group:i,on:qC,tween:JC,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function XC(e,t){var n=QC(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function ZC(e,t){var n=QC(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function QC(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function $C(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=BC(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return KC(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(KC(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function ew(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function tw(e){return this.each(function(){ew(this,e)})}function nw(e,t){var n,r;return function(){var i=ZC(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function rw(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ZC(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function iw(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=QC(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?nw:rw)(n,e,t))}function aw(e,t,n){var r=e._id;return e.each(function(){var e=ZC(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return QC(e,r).value[t]}}function ow(e,t){var n;return(typeof t==`number`?iC:t instanceof kS?$S:(n=kS(t))?(t=n,$S):uC)(e,t)}function sw(e){return function(){this.removeAttribute(e)}}function cw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lw(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function uw(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function dw(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function fw(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function pw(e,t){var n=Xy(e),r=n===`transform`?bC:ow;return this.attrTween(e,typeof t==`function`?(n.local?fw:dw)(n,r,aw(this,`attr.`+e,t)):t==null?(n.local?cw:sw)(n):(n.local?uw:lw)(n,r,t))}function mw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function hw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gw(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&hw(e,i)),n}return i._value=t,i}function _w(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&mw(e,i)),n}return i._value=t,i}function vw(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Xy(e);return this.tween(n,(r.local?gw:_w)(r,t))}function yw(e,t){return function(){XC(this,e).delay=+t.apply(this,arguments)}}function bw(e,t){return t=+t,function(){XC(this,e).delay=t}}function xw(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?yw:bw)(t,e)):QC(this.node(),t).delay}function Sw(e,t){return function(){ZC(this,e).duration=+t.apply(this,arguments)}}function Cw(e,t){return t=+t,function(){ZC(this,e).duration=t}}function ww(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sw:Cw)(t,e)):QC(this.node(),t).duration}function Tw(e,t){if(typeof t!=`function`)throw Error();return function(){ZC(this,e).ease=t}}function Ew(e){var t=this._id;return arguments.length?this.each(Tw(t,e)):QC(this.node(),t).ease}function Mne(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ZC(this,e).ease=n}}function Nne(e){if(typeof e!=`function`)throw Error();return this.each(Mne(this._id,e))}function Pne(e){typeof e!=`function`&&(e=cb(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Ow(r,this._parents,this._name,this._id)}function Fne(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Ow(o,this._parents,this._name,this._id)}function Ine(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Lne(e,t,n){var r,i,a=Ine(t)?XC:ZC;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Rne(e,t){var n=this._id;return arguments.length<2?QC(this.node(),n).on.on(e):this.each(Lne(n,e,t))}function zne(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Bne(){return this.on(`end.remove`,zne(this._id))}function Vne(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=tb(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,YC(l[f],t,n,f,l,QC(u,n)));return new Ow(a,this._parents,t,n)}function Hne(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ab(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=QC(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&YC(p,t,n,h,f,m);a.push(f),o.push(u)}return new Ow(a,o,t,n)}var Une=Gx.prototype.constructor;function Wne(){return new Une(this._groups,this._parents)}function Gne(e,t){var n,r,i;return function(){var a=Qb(this,e),o=(this.style.removeProperty(e),Qb(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Dw(e){return function(){this.style.removeProperty(e)}}function Kne(e,t,n){var r,i=n+``,a;return function(){var o=Qb(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function qne(e,t,n){var r,i,a;return function(){var o=Qb(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Qb(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Jne(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ZC(this,e),l=c.on,u=c.value[a]==null?s||=Dw(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Yne(e,t,n){var r=(e+=``)==`transform`?yC:ow;return t==null?this.styleTween(e,Gne(e,r)).on(`end.style.`+e,Dw(e)):typeof t==`function`?this.styleTween(e,qne(e,r,aw(this,`style.`+e,t))).each(Jne(this._id,e)):this.styleTween(e,Kne(e,r,t),n).on(`end.style.`+e,null)}function Xne(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Zne(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Xne(e,a,n)),r}return a._value=t,a}function Qne(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Zne(e,t,n??``))}function $ne(e){return function(){this.textContent=e}}function ere(e){return function(){var t=e(this);this.textContent=t??``}}function tre(e){return this.tween(`text`,typeof e==`function`?ere(aw(this,`text`,e)):$ne(e==null?``:e+``))}function nre(e){return function(t){this.textContent=e.call(this,t)}}function rre(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&nre(r)),t}return r._value=e,r}function ire(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,rre(e))}function are(){for(var e=this._name,t=this._id,n=kw(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=QC(c,t);YC(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ow(r,this._parents,e,n)}function ore(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ZC(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var sre=0;function Ow(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function kw(){return++sre}var Aw=Gx.prototype;Ow.prototype={constructor:Ow,select:Vne,selectAll:Hne,selectChild:Aw.selectChild,selectChildren:Aw.selectChildren,filter:Pne,merge:Fne,selection:Wne,transition:are,call:Aw.call,nodes:Aw.nodes,node:Aw.node,size:Aw.size,empty:Aw.empty,each:Aw.each,on:Rne,attr:pw,attrTween:vw,style:Yne,styleTween:Qne,text:tre,textTween:ire,remove:Bne,tween:iw,delay:xw,duration:ww,ease:Ew,easeVarying:Nne,end:ore,[Symbol.iterator]:Aw[Symbol.iterator]};function cre(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var lre={time:null,delay:0,duration:250,ease:cre};function ure(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function dre(e){var t,n;e instanceof Ow?(t=e._id,e=e._name):(t=kw(),(n=lre).time=LC(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&YC(c,e,t,l,o,n||ure(c,t));return new Ow(r,this._parents,e,t)}Gx.prototype.interrupt=tw,Gx.prototype.transition=dre;var jw=e=>()=>e;function fre(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Mw(e,t,n){this.k=e,this.x=t,this.y=n}Mw.prototype={constructor:Mw,scale:function(e){return e===1?this:new Mw(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Mw(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Nw=new Mw(1,0,0);Pw.prototype=Mw.prototype;function Pw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Nw;return e.__zoom}function Fw(e){e.stopImmediatePropagation()}function Iw(e){e.preventDefault(),e.stopImmediatePropagation()}function pre(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function mre(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Lw(){return this.__zoom||Nw}function hre(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gre(){return navigator.maxTouchPoints||`ontouchstart`in this}function _re(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Rw(){var e=pre,t=mre,n=_re,r=hre,i=gre,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=TC,l=Wy(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Lw).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Lw),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Nw.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Mw(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Mw(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Mw(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=qx(this.that).datum();l.call(e,this.that,new fre(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Yx(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],ew(this),s.start();Iw(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=qx(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Yx(t,i),l=t.clientX,u=t.clientY;eS(t.view),Fw(t),a.mouse=[c,this.__zoom.invert(c)],ew(this),a.start();function d(e){if(Iw(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Yx(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),tS(e.view,a.moved),Iw(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Yx(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Iw(r),s>0?qx(this).transition().duration(s).call(x,d,c,r):qx(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Fw(t),s=0;s<i;++s)c=r[s],l=Yx(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),ew(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Iw(e),s=0;s<a;++s)c=i[s],l=Yx(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Fw(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Yx(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=qx(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:jw(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:jw(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:jw(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:jw([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var zw={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Bw=[[-1/0,-1/0],[1/0,1/0]],Vw=[`Enter`,` `,`Escape`],Hw={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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`},Uw;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Uw||={});var Ww;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Ww||={});var Gw;(function(e){e.Partial=`partial`,e.Full=`full`})(Gw||={});var Kw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},qw;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(qw||={});var Jw;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Jw||={});var Yw;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Yw||={});var Xw={[Yw.Left]:Yw.Right,[Yw.Right]:Yw.Left,[Yw.Top]:Yw.Bottom,[Yw.Bottom]:Yw.Top};function Zw(e){return e===null?null:e?`valid`:`invalid`}var Qw=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,vre=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),$w=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),eT=(e,t=[0,0])=>{let{width:n,height:r}=DT(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},yre=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:dT(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):$w(n)?n:t.nodeLookup.get(n.id)),lT(e,i?pT(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),tT=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=lT(n,pT(e)),r=!0)}),r?dT(n):{x:0,y:0,width:0,height:0}},nT=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=hT(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},bre=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function xre(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=DT(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Sre({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=wT(tT(xre(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function rT({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,zw.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&ET(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=ET(d)?aT(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,zw.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Cre({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=bre(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var iT=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),aT=(e={x:0,y:0},t,n)=>({x:iT(e.x,t[0][0],t[1][0]-(n?.width??0)),y:iT(e.y,t[0][1],t[1][1]-(n?.height??0))});function oT(e,t,n){let{width:r,height:i}=DT(n),{x:a,y:o}=n.internals.positionAbsolute;return aT(e,[[a,o],[a+r,o+i]],t)}var sT=(e,t,n)=>e<t?iT(Math.abs(e-t),1,t)/t:e>n?-iT(Math.abs(e-n),1,t)/t:0,cT=(e,t,n=15,r=40)=>[sT(e.x,r,t.width-r)*n,sT(e.y,r,t.height-r)*n],lT=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),uT=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),dT=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),fT=(e,t=[0,0])=>{let{x:n,y:r}=$w(e)?e.internals.positionAbsolute:eT(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},pT=(e,t=[0,0])=>{let{x:n,y:r}=$w(e)?e.internals.positionAbsolute:eT(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},mT=(e,t)=>dT(lT(uT(e),uT(t))),hT=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},gT=(e,t)=>hT(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_T=e=>vT(e.width)&&vT(e.height)&&vT(e.x)&&vT(e.y),vT=e=>!isNaN(e)&&isFinite(e),yT=(e,t)=>(e,t)=>{},bT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xT=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?bT(s,o):s},ST=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function CT(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function wre(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=CT(e,n),i=CT(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=CT(e.top??e.y??0,n),i=CT(e.bottom??e.y??0,n),a=CT(e.left??e.x??0,t),o=CT(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Tre(e,t,n,r,i,a){let{x:o,y:s}=ST(e,[t,n,r]),{x:c,y:l}=ST({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var wT=(e,t,n,r,i,a)=>{let o=wre(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=iT(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Tre(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},TT=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function ET(e){return e!=null&&e!==`parent`}function DT(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function OT(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function kT(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function AT(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ere(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Dre(e){return{...Hw,...e||{}}}function jT(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=IT(e),s=xT({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?bT(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var MT=e=>({width:e.offsetWidth,height:e.offsetHeight}),NT=e=>e?.getRootNode?.()||window?.document,Ore=[`INPUT`,`SELECT`,`TEXTAREA`];function PT(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Ore.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var FT=e=>`clientX`in e,IT=(e,t)=>{let n=FT(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},LT=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...MT(t)}})};function RT({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function zT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function BT({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Yw.Left:return[t-zT(t-r,a),n];case Yw.Right:return[t+zT(r-t,a),n];case Yw.Top:return[t,n-zT(n-i,a)];case Yw.Bottom:return[t,n+zT(i-n,a)]}}function VT({sourceX:e,sourceY:t,sourcePosition:n=Yw.Bottom,targetX:r,targetY:i,targetPosition:a=Yw.Top,curvature:o=.25}){let[s,c]=BT({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=BT({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=RT({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function HT({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function kre({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Are({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=lT(pT(e),pT(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),gT({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},dT(a))>0}var jre=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Mre=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Nre=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,zw.error006()),t;let r=n.getEdgeId||jre,i;return i=Qw(e)?{...e}:{...e,id:r(e)},Mre(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function UT({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=HT({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var WT={[Yw.Left]:{x:-1,y:0},[Yw.Right]:{x:1,y:0},[Yw.Top]:{x:0,y:-1},[Yw.Bottom]:{x:0,y:1}},Pre=({source:e,sourcePosition:t=Yw.Bottom,target:n})=>t===Yw.Left||t===Yw.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},GT=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Fre({source:e,sourcePosition:t=Yw.Bottom,target:n,targetPosition:r=Yw.Top,center:i,offset:a,stepPosition:o}){let s=WT[t],c=WT[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Pre({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=HT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Ire(e,t,n,r){let i=Math.min(GT(e,t)/2,GT(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function KT({sourceX:e,sourceY:t,sourcePosition:n=Yw.Bottom,targetX:r,targetY:i,targetPosition:a=Yw.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Fre({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Ire(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function qT(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Lre(e){let{sourceNode:t,targetNode:n}=e;if(!qT(t)||!qT(n))return null;let r=t.internals.handleBounds||JT(t.handles),i=n.internals.handleBounds||JT(n.handles),a=XT(r?.source??[],e.sourceHandle),o=XT(e.connectionMode===Uw.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,zw.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Yw.Bottom,c=o?.position||Yw.Top,l=YT(t,a,s),u=YT(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function JT(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function YT(e,t,n=Yw.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??DT(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Yw.Top:return{x:i+o/2,y:a};case Yw.Right:return{x:i+o,y:a+s/2};case Yw.Bottom:return{x:i+o/2,y:a+s};case Yw.Left:return{x:i,y:a+s/2}}}function XT(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function ZT(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Rre(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=ZT(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var QT=1e3,zre=10,$T={nodeOrigin:[0,0],nodeExtent:Bw,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Bre={...$T,checkEquality:!0};function eE(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Vre(e,t,n){let r=eE($T,n);for(let n of e.values())if(n.parentId)rE(n,e,t,r);else{let e=aT(eT(n,r.nodeOrigin),ET(n.extent)?n.extent:r.nodeExtent,DT(n));n.internals.positionAbsolute=e}}function Hre(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function tE(e){return e===`manual`}function nE(e,t,n,r={}){let i=eE(Bre,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!tE(i.zIndexMode)?QT:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=aT(eT(u,i.nodeOrigin),ET(u.extent)?u.extent:i.nodeExtent,DT(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Hre(u,e),z:iE(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&rE(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Ure(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function rE(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=eE($T,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ure(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*zre),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Wre(e,u,o,s,a&&!tE(c)?QT:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function iE(e,t,n){let r=vT(e.zIndex)?e.zIndex:0;return tE(n)?r:r+(e.selected?t:0)}function Wre(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=DT(e),l=eT(e,n),u=ET(e.extent)?aT(l,e.extent,c):l,d=aT({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=oT(d,c,t));let f=iE(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function aE(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=mT(a.get(n.parentId)?.expandedRect??fT(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=DT(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Gre(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=MT(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=ET(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=oT(h,s,n))}else m&&(h=aT(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:LT(`source`,r.nodeElement,p,d,e.id),target:LT(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&rE(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:fT(g,i)}))}}if(f.length>0){let e=aE(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Kre({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function oE(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function sE(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;oE(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),oE(`target`,s,c,e,i,o),t.set(r.id,r)}}function cE(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:cE(n,t):!1}function lE(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function qre(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!cE(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function uE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Jre({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=bT(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Yre({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=qx(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?uT(tT(s)):null,x=v&&l?Jre({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:bT(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=rT({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=uE({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=cT(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=jT(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=qre(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=uE({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=cS().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=jT(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=IT(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=jT(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=IT(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=IT(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=uE({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!lE(t,`.${g}`,v))&&(!_||lE(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Xre(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())gT(i,fT(e))>0&&r.push(e);return r}var Zre=250;function Qre(e,t,n,r){let i=[],a=1/0,o=Xre(e,n,t+Zre);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=YT(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function dE(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...YT(o,c,c.position,!0)}:c}function fE(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function $re(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var pE=()=>!0;function eie(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=pE,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=NT(e.target),E=0,D,{x:O,y:k}=IT(e),A=fE(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=dE(i,A,r,c,t);if(!N)return;let P=IT(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=cT(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},V=c.get(i),H={inProgress:!0,isValid:null,from:YT(V,B,Yw.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:V,to:P,toHandle:null,toPosition:Xw[B.position],toNode:null,pointer:P};function U(){M=!0,y(H),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&U();function W(e){if(!M){let{x:t,y:n}=IT(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;U()}if(!x()||!B){G(e);return}let a=b();P=IT(e,j),D=Qre(xT(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=mE(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=$re(!!D,s.isValid);let u=c.get(i),f=u?YT(u,B,Yw.Left,!0):H.from,p={...H,from:f,isValid:L,to:s.toHandle&&L?ST({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:Xw[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),H=p}function G(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,W),T.removeEventListener(`mouseup`,G),T.removeEventListener(`touchmove`,W),T.removeEventListener(`touchend`,G)}}T.addEventListener(`mousemove`,W),T.addEventListener(`mouseup`,G),T.addEventListener(`touchmove`,W),T.addEventListener(`touchend`,G)}function mE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=pE,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=IT(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=fE(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Uw.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=dE(t,e,a,u,n,!0)}return _}var hE={onPointerDown:eie,isValid:mE};function tie({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=qx(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&TT()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Rw().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Yx}}var gE=e=>({x:e.x,y:e.y,zoom:e.k}),_E=({x:e,y:t,zoom:n})=>Nw.translate(e,t).scale(n),vE=(e,t)=>e.target.closest(`.${t}`),yE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),nie=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,bE=(e,t=0,n=nie,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},xE=e=>{let t=e.ctrlKey&&TT()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function rie({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(vE(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Yx(u),t=d*2**xE(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Ww.Vertical?0:u.deltaX*f,m=i===Ww.Horizontal?0:u.deltaY*f;!TT()&&u.shiftKey&&i!==Ww.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=gE(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function iie({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=vE(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function aie({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=gE(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function oie({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&yE(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,gE(a.transform))}}function sie({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&yE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=gE(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function cie({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(vE(d,`${l}-flow__node`)||vE(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||vE(d,s)&&m||vE(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function lie({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Rw().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=qx(e).call(f);y({x:i.x,y:i.y,zoom:iT(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(xE);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?dC:TC).transform(bE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!vT(E)||E<0?0:E);let k=O?rie({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):iie({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=aie({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=oie({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=sie({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=cie({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=_E(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=_E(e);return await g(n,t),n}function x(e){if(p){let t=_E(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Pw(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?dC:TC).scaleTo(bE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?dC:TC).scaleBy(bE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!vT(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var SE;(function(e){e.Line=`line`,e.Handle=`handle`})(SE||={});function uie({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function CE(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function wE(e,t){return Math.max(0,t-e)}function TE(e,t){return Math.max(0,e-t)}function EE(e,t,n){return Math.max(0,t-e,e-n)}function DE(e,t){return e?!t:t}function die(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=EE(E,h,g),j=EE(D,_,v);if(o){let e=0,t=0;c&&w<0?e=wE(y+w+O,o[0][0]):!c&&w>0&&(e=TE(y+E+O,o[1][0])),l&&T<0?t=wE(b+T+k,o[0][1]):!l&&T>0&&(t=TE(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=TE(y+w,s[0][0]):!c&&w<0&&(e=wE(y+E,s[1][0])),l&&T>0?t=TE(b+T,s[0][1]):!l&&T<0&&(t=wE(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=EE(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?TE(b+k+E/C,o[1][1])*C:wE(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?wE(b+E/C,s[1][1])*C:TE(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=EE(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?TE(y+D*C+O,o[1][0])/C:wE(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?wE(y+D*C,s[1][0])/C:TE(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(DE(c,l)?-w:w)/C:w=(DE(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var OE={width:0,height:0,x:0,y:0},fie={...OE,pointerX:0,pointerY:0,aspectRatio:1};function pie(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function mie({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=qx(e),o={controlDirection:CE(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...OE},h={...fie};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:CE(e)};let g,_=null,v=[],y,b,x,S=!1,C=cS().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=jT(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=ET(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=pie(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=jT(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=die(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=uie({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var kE=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},hie=e=>e?kE(e):kE,{useDebugValue:gie}=J.default,{useSyncExternalStoreWithSelector:_ie}=Ii.default,vie=e=>e;function AE(e,t=vie,n){let r=_ie(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return gie(r),r}var jE=(e,t)=>{let n=hie(e),r=(e,r=t)=>AE(n,e,r);return Object.assign(r,n),r},ME=(e,t)=>e?jE(e,t):jE;function NE(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var PE=(0,J.createContext)(null),FE=PE.Provider,IE=zw.error001(`react`);function LE(e,t){let n=(0,J.useContext)(PE);if(n===null)throw Error(IE);return AE(n,e,t)}function RE(){let e=(0,J.useContext)(PE);if(e===null)throw Error(IE);return(0,J.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var zE={display:`none`},BE={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},VE=`react-flow__node-desc`,HE=`react-flow__edge-desc`,yie=`react-flow__aria-live`,bie=e=>e.ariaLiveMessage,xie=e=>e.ariaLabelConfig;function UE({rfId:e}){let t=LE(bie);return(0,Y.jsx)(`div`,{id:`${yie}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:BE,children:t})}function WE({rfId:e,disableKeyboardA11y:t}){let n=LE(xie);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{id:`${VE}-${e}`,style:zE,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,Y.jsx)(`div`,{id:`${HE}-${e}`,style:zE,children:n[`edge.a11yDescription.default`]}),!t&&(0,Y.jsx)(UE,{rfId:e})]})}var GE=(0,J.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,Y.jsx)(`div`,{className:Hy([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});GE.displayName=`Panel`;var KE=`https://reactflow.dev?utm_source=attribution`;function qE({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,Y.jsx)(GE,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${KE}`,children:(0,Y.jsx)(`a`,{href:KE,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var JE=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},YE=e=>e.id;function XE(e,t){return NE(e.selectedNodes.map(YE),t.selectedNodes.map(YE))&&NE(e.selectedEdges.map(YE),t.selectedEdges.map(YE))}function ZE({onSelectionChange:e}){let t=RE(),{selectedNodes:n,selectedEdges:r}=LE(JE,XE);return(0,J.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var QE=e=>!!e.onSelectionChangeHandlers;function $E({onSelectionChange:e}){let t=LE(QE);return e||t?(0,Y.jsx)(ZE,{onSelectionChange:e}):null}var eD=[0,0],tD={x:0,y:0,zoom:1},nD=[...`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`.split(`.`),`rfId`],Sie=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),rD={translateExtent:Bw,nodeOrigin:eD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Cie(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=LE(Sie,NE),l=RE();(0,J.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=rD,s()}),[]);let u=(0,J.useRef)(rD);return(0,J.useEffect)(()=>{for(let s of nD){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Dre(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},nD.map(t=>e[t])),null}function iD(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function wie(e){let[t,n]=(0,J.useState)(e===`system`?null:e);return(0,J.useEffect)(()=>{if(e!==`system`){n(e);return}let t=iD(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?iD()?.matches?`dark`:`light`:t}var aD=typeof document<`u`?document:null;function oD(e=null,t={target:aD,actInsideInputWithModifier:!0}){let[n,r]=(0,J.useState)(!1),i=(0,J.useRef)(!1),a=(0,J.useRef)(new Set([])),[o,s]=(0,J.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
15
|
+
`).replace(`
|
|
16
|
+
|
|
17
|
+
`,`
|
|
18
|
+
+`).split(`
|
|
19
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,J.useEffect)(()=>{let n=t?.target??aD,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&PT(e))return!1;let n=cD(e.code,s);if(a.current.add(e[n]),sD(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=cD(e.code,s);sD(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function sD(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function cD(e,t){return t.includes(e)?`code`:`key`}var Tie=()=>{let e=RE();return(0,J.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=wT(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return xT(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=ST(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function lD(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)uD(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function uD(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function dD(e,t){return lD(e,t)}function fD(e,t){return lD(e,t)}function pD(e,t){return{id:e,type:`select`,selected:t}}function mD(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(pD(a.id,e)))}return r}function hD({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function gD(e){return{id:e.id,type:`remove`}}var _D=yT(`React Flow`,`https://reactflow.dev/`);function vD(e,t,n={}){return Nre(e,t,{...n,onError:n.onError??_D})}var yD=e=>vre(e),bD=e=>Qw(e);function xD(e){return(0,J.forwardRef)(e)}var SD=typeof window<`u`?J.useLayoutEffect:J.useEffect;function CD(e){let[t,n]=(0,J.useState)(BigInt(0)),[r]=(0,J.useState)(()=>wD(()=>n(e=>e+BigInt(1))));return SD(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function wD(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var TD=(0,J.createContext)(null);function ED({children:e}){let t=RE(),n=CD((0,J.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=hD({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=CD((0,J.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(hD({items:s,lookup:o}))},[])),i=(0,J.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,Y.jsx)(TD.Provider,{value:i,children:e})}function DD(){let e=(0,J.useContext)(TD);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var OD=e=>!!e.panZoom;function kD(){let e=Tie(),t=RE(),n=DD(),r=LE(OD),i=(0,J.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=yD(e)?e:n.get(e.id),a=i.parentId?kT(i.position,i.measured,i.parentId,n,r):i.position;return fT({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&yD(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&bD(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Cre({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(gD);o?.(f),c(e)}if(m){let e=d.map(gD);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=_T(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=fT(s?r:a),l=gT(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=_T(e)?e:a(e);if(!r)return!1;let i=gT(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return yre(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Ere();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,J.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var AD=e=>e.selected,jD=typeof window<`u`?window:void 0;function MD({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=RE(),{deleteElements:r}=kD(),i=oD(e,{actInsideInputWithModifier:!1}),a=oD(t,{target:jD});(0,J.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(AD),edges:e.filter(AD)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,J.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function ND(e){let t=RE();(0,J.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=MT(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,zw.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var PD={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},FD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ID({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Ww.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=RE(),S=(0,J.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=LE(FD,NE),E=oD(f),D=(0,J.useRef)();ND(S);let O=(0,J.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,J.useEffect)(()=>{if(S.current){D.current=lie({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,J.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,Y.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:PD,children:m})}var LD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function RD(){let{userSelectionActive:e,userSelectionRect:t}=LE(LD,NE);return e&&t?(0,Y.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var zD=(e,t)=>n=>{n.target===t.current&&e?.(n)},BD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function VD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Gw.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,J.useRef)(0),_=RE(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=LE(BD,NE),C=y&&(e||v),w=(0,J.useRef)(null),T=(0,J.useRef)(),E=(0,J.useRef)(new Set),D=(0,J.useRef)(new Set),O=(0,J.useRef)(!1),k=(0,J.useRef)(!1),A=(0,J.useRef)({x:0,y:0}),j=(0,J.useRef)(!1),M=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},N=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},P=d?e=>d(e):void 0,F=e=>{k.current&&=(e.stopPropagation(),!1)},I=n=>{let{domNode:r,transform:i}=_.getState();if(T.current=r?.getBoundingClientRect(),!T.current)return;let a=n.target===w.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:s,y:c}=IT(n.nativeEvent,T.current),l=xT({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function L(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=ST(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(nT(a,m,i,n===Gw.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}AT(h,E.current)||c(mD(a,E.current,!0)),AT(g,D.current)||l(mD(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function R(){if(!i||!T.current)return;let[e,t]=cT(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(R);return}let{x:t,y:n}=A.current;L(t,n),g.current=requestAnimationFrame(R)})}let z=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};(0,J.useEffect)(()=>()=>z(),[]);let B=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=IT(e.nativeEvent,T.current);A.current={x:o,y:c};let l=ST({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,j.current||=(R(),!0),L(o,c)},V=e=>{if(!C){e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&M?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),z())},H=e=>{e.target?.releasePointerCapture?.(e.pointerId),z()},U=r===!0||Array.isArray(r)&&r.includes(0);return(0,Y.jsxs)(`div`,{className:Hy([`react-flow__pane`,{draggable:U,dragging:b,selection:e}]),onClick:C?void 0:zD(M,w),onContextMenu:zD(N,w),onWheel:zD(P,w),onPointerEnter:C?void 0:f,onPointerMove:C?B:p,onPointerUp:V,onPointerCancel:C?H:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:PD,children:[h,(0,Y.jsx)(RD,{})]})}function HD({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,zw.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function UD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=RE(),[c,l]=(0,J.useState)(!1),u=(0,J.useRef)();return(0,J.useEffect)(()=>{if(!t)return u.current=Yre({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{HD({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,J.useEffect)(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var WD=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function GD(){let e=RE();return(0,J.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=WD(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=bT(t,i));let{position:a,positionAbsolute:s}=rT({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var KD=(0,J.createContext)(null),Eie=KD.Provider;KD.Consumer;var qD=()=>(0,J.useContext)(KD),Die=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),JD=(0,J.createContext)(null);function Oie({children:e}){let t=LE(Die,NE);return(0,Y.jsx)(JD.Provider,{value:t,children:e})}function kie(){let e=(0,J.useContext)(JD);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var Aie={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},jie=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return Aie;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Uw.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Mie({type:e=`source`,position:t=Yw.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=RE(),_=qD(),{connectOnClick:v,noPanClassName:y,rfId:b}=kie(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=LE(jie(_,m,e),NE);_||g.getState().onError?.(`010`,zw.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(vD(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=FT(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();hE.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,Y.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Hy([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=NT(t.target),h=n||c,{connection:v,isValid:y}=hE.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var YD=(0,J.memo)(xD(Mie));function Nie({data:e,isConnectable:t,sourcePosition:n=Yw.Bottom}){return(0,Y.jsxs)(Y.Fragment,{children:[e?.label,(0,Y.jsx)(YD,{type:`source`,position:n,isConnectable:t})]})}function Pie({data:e,isConnectable:t,targetPosition:n=Yw.Top,sourcePosition:r=Yw.Bottom}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(YD,{type:`target`,position:n,isConnectable:t}),e?.label,(0,Y.jsx)(YD,{type:`source`,position:r,isConnectable:t})]})}function Fie(){return null}function Iie({data:e,isConnectable:t,targetPosition:n=Yw.Top}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(YD,{type:`target`,position:n,isConnectable:t}),e?.label]})}var XD={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ZD={input:Nie,default:Pie,output:Iie,group:Fie};function Lie(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Rie=e=>{let{width:t,height:n,x:r,y:i}=tT(e.nodeLookup,{filter:e=>!!e.selected});return{width:vT(t)?t:null,height:vT(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function zie({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=RE(),{width:i,height:a,transformString:o,userSelectionActive:s}=LE(Rie,NE),c=GD(),l=(0,J.useRef)(null);(0,J.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(UD({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,Y.jsx)(`div`,{className:Hy([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,Y.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(XD,e.key)&&(e.preventDefault(),c({direction:XD[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var QD=typeof window<`u`?window:void 0,Bie=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function $D({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:R}=LE(Bie,NE),z=oD(l,{target:QD}),B=oD(h,{target:QD}),V=B||w,H=B||b,U=u&&V!==!0,W=z||R||U;return MD({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,Y.jsx)(ID,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:H,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!z&&V,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:U,children:(0,Y.jsxs)(VD,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:V,autoPanOnSelection:T,isSelecting:!!W,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:U,children:[e,L&&(0,Y.jsx)(zie,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}$D.displayName=`FlowRenderer`;var Vie=(0,J.memo)($D),Hie=e=>t=>e?nT(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Uie(e){return LE((0,J.useCallback)(Hie(e),[e]),NE)}var Wie=e=>e.updateNodeInternals;function Gie(){let e=LE(Wie),[t]=(0,J.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,J.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Kie({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=RE(),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(e.sourcePosition),c=(0,J.useRef)(e.targetPosition),l=(0,J.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,J.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,J.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,J.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function qie({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=LE(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},NE),S=y.type||`default`,C=g?.[S]||ZD[S];C===void 0&&(v?.(`003`,zw.error003(S)),S=`default`,C=g?.default||ZD.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=RE(),k=OT(y),A=Kie({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=UD({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=GD();if(y.hidden)return null;let N=DT(y),P=Lie(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,R=i?e=>i(e,{...b.userNode}):void 0,z=a?e=>a(e,{...b.userNode}):void 0,B=o?e=>o(e,{...b.userNode}):void 0,V=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&HD({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},H=t=>{if(!(PT(t.nativeEvent)||m)){if(Vw.includes(t.key)&&T){let n=t.key===`Escape`;HD({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(XD,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:XD[t.key],factor:t.shiftKey?4:1})}}},U=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(nT(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,Y.jsx)(`div`,{className:Hy([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:R,onContextMenu:z,onClick:V,onDoubleClick:B,onKeyDown:D?H:void 0,tabIndex:D?0:void 0,onFocus:D?U:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${VE}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,Y.jsx)(Eie,{value:e,children:(0,Y.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var Jie=(0,J.memo)(qie),Yie=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function eO(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=LE(Yie,NE),a=Uie(e.onlyRenderVisibleElements),o=Gie();return(0,Y.jsx)(`div`,{className:`react-flow__nodes`,style:PD,children:a.map(a=>(0,Y.jsx)(Jie,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}eO.displayName=`NodeRenderer`;var Xie=(0,J.memo)(eO);function Zie(e){return LE((0,J.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Are({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),NE)}var Qie=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,Y.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},$ie=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,Y.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},tO={[Jw.Arrow]:Qie,[Jw.ArrowClosed]:$ie};function nO(e){let t=RE();return(0,J.useMemo)(()=>Object.prototype.hasOwnProperty.call(tO,e)?tO[e]:(t.getState().onError?.(`009`,zw.error009(e)),null),[e])}var rO=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=nO(t);return c?(0,Y.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,Y.jsx)(c,{color:n,strokeWidth:o})}):null},iO=({defaultColor:e,rfId:t})=>{let n=LE(e=>e.edges),r=LE(e=>e.defaultEdgeOptions),i=(0,J.useMemo)(()=>Rre(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,Y.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,Y.jsx)(`defs`,{children:i.map(e=>(0,Y.jsx)(rO,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};iO.displayName=`MarkerDefinitions`;var aO=(0,J.memo)(iO);function oO({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,J.useState)({x:1,y:0,width:0,height:0}),p=Hy([`react-flow__edge-textwrapper`,l]),m=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,Y.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,Y.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,Y.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}oO.displayName=`EdgeText`;var sO=(0,J.memo)(oO);function cO({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`path`,{...u,d:e,fill:`none`,className:Hy([`react-flow__edge-path`,u.className])}),l?(0,Y.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&vT(t)&&vT(n)?(0,Y.jsx)(sO,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function lO({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Yw.Left||e===Yw.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function uO({sourceX:e,sourceY:t,sourcePosition:n=Yw.Bottom,targetX:r,targetY:i,targetPosition:a=Yw.Top}){let[o,s]=lO({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=lO({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=RT({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function dO(e){return(0,J.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=uO({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,Y.jsx)(cO,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var fO=dO({isInternal:!1}),pO=dO({isInternal:!0});fO.displayName=`SimpleBezierEdge`,pO.displayName=`SimpleBezierEdgeInternal`;function mO(e){return(0,J.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Yw.Bottom,targetPosition:m=Yw.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=KT({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,Y.jsx)(cO,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var hO=mO({isInternal:!1}),gO=mO({isInternal:!0});hO.displayName=`SmoothStepEdge`,gO.displayName=`SmoothStepEdgeInternal`;function _O(e){return(0,J.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,Y.jsx)(hO,{...n,id:r,pathOptions:(0,J.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var vO=_O({isInternal:!1}),yO=_O({isInternal:!0});vO.displayName=`StepEdge`,yO.displayName=`StepEdgeInternal`;function bO(e){return(0,J.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=UT({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,Y.jsx)(cO,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var xO=bO({isInternal:!1}),SO=bO({isInternal:!0});xO.displayName=`StraightEdge`,SO.displayName=`StraightEdgeInternal`;function CO(e){return(0,J.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Yw.Bottom,targetPosition:s=Yw.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=VT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,Y.jsx)(cO,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var wO=CO({isInternal:!1}),TO=CO({isInternal:!0});wO.displayName=`BezierEdge`,TO.displayName=`BezierEdgeInternal`;var EO={default:TO,straight:SO,step:yO,smoothstep:gO,simplebezier:pO},DO={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},OO=(e,t,n)=>n===Yw.Left?e-t:n===Yw.Right?e+t:e,kO=(e,t,n)=>n===Yw.Top?e-t:n===Yw.Bottom?e+t:e,AO=`react-flow__edgeupdater`;function jO({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,Y.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Hy([AO,`${AO}-${s}`]),cx:OO(t,r,e),cy:kO(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function MO({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=RE(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;hE.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,Y.jsxs)(Y.Fragment,{children:[(e===!0||e===`source`)&&(0,Y.jsx)(jO,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,Y.jsx)(jO,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function NO({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=LE(t=>t.edgeLookup.get(e)),b=LE(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||EO[x];S===void 0&&(_?.(`011`,zw.error011(x)),x=`default`,S=h?.default||EO.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,J.useRef)(null),[D,O]=(0,J.useState)(!1),[k,A]=(0,J.useState)(!1),j=RE(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R}=LE((0,J.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return DO;let i=Lre({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=kre({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||DO,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),NE),z=(0,J.useMemo)(()=>y.markerStart?`url('#${ZT(y.markerStart,m)}')`:void 0,[y.markerStart,m]),B=(0,J.useMemo)(()=>y.markerEnd?`url('#${ZT(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let V=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},H=a?e=>{a(e,{...y})}:void 0,U=o?e=>{o(e,{...y})}:void 0,W=s?e=>{s(e,{...y})}:void 0,G=c?e=>{c(e,{...y})}:void 0,K=l?e=>{l(e,{...y})}:void 0;return(0,Y.jsx)(`svg`,{style:{zIndex:M},children:(0,Y.jsxs)(`g`,{className:Hy([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:V,onDoubleClick:H,onContextMenu:U,onMouseEnter:W,onMouseMove:G,onMouseLeave:K,onKeyDown:C?t=>{if(!v&&Vw.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${HE}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,Y.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:z,markerEnd:B,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,Y.jsx)(MO,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,setUpdateHover:O,setReconnecting:A})]})})}var PO=(0,J.memo)(NO),FO=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function IO({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=LE(FO,NE),b=Zie(t);return(0,Y.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,Y.jsx)(aO,{defaultColor:e,rfId:n}),b.map(e=>(0,Y.jsx)(PO,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}IO.displayName=`EdgeRenderer`;var LO=(0,J.memo)(IO),RO=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function zO({children:e}){let t=RE(),n=(0,J.useRef)(null),[r]=(0,J.useState)(()=>t.getState().transform);return SD(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=RO(r)))};return r(),t.subscribe(r)},[t]),(0,Y.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:RO(r)},children:e})}function BO(e){let t=kD(),n=(0,J.useRef)(!1);(0,J.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var VO=e=>e.panZoom?.syncViewport;function HO(e){let t=LE(VO),n=RE();return(0,J.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function UO(e){return e.connection.inProgress?{...e.connection,to:xT(e.connection.to,e.transform)}:{...e.connection}}function WO(e){return e?t=>e(UO(t)):UO}function GO(e){return LE(WO(e),NE)}var KO=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qO({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=LE(KO,NE);return a&&i&&c?(0,Y.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,Y.jsx)(`g`,{className:Hy([`react-flow__connection`,Zw(s)]),children:(0,Y.jsx)(JO,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var JO=({style:e,type:t=qw.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=GO();if(!i)return;if(n)return(0,Y.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Zw(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case qw.Bezier:[m]=VT(h);break;case qw.SimpleBezier:[m]=uO(h);break;case qw.Step:[m]=KT({...h,borderRadius:0});break;case qw.SmoothStep:[m]=KT(h);break;default:[m]=UT(h)}return(0,Y.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};JO.displayName=`ConnectionLine`;var YO={};function XO(e=YO){(0,J.useRef)(e),RE(),(0,J.useEffect)(()=>{},[e])}function ZO(){RE(),(0,J.useRef)(!1),(0,J.useEffect)(()=>{},[])}function QO({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:R,panOnDrag:z,autoPanOnSelection:B,onPaneClick:V,onPaneMouseEnter:H,onPaneMouseMove:U,onPaneMouseLeave:W,onPaneScroll:G,onPaneContextMenu:K,paneClickDistance:ee,nodeClickDistance:q,onEdgeContextMenu:te,onEdgeMouseEnter:ne,onEdgeMouseMove:re,onEdgeMouseLeave:ie,reconnectRadius:ae,onReconnect:oe,onReconnectStart:se,onReconnectEnd:ce,noDragClassName:le,noWheelClassName:ue,noPanClassName:de,disableKeyboardA11y:fe,nodeExtent:pe,rfId:me,viewport:he,onViewportChange:ge,nodesDraggable:_e}){return XO(e),XO(t),ZO(),BO(n),HO(he),(0,Y.jsx)(Vie,{onPaneClick:V,onPaneMouseEnter:H,onPaneMouseMove:U,onPaneMouseLeave:W,onPaneContextMenu:K,onPaneScroll:G,paneClickDistance:ee,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:z,autoPanOnSelection:B,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:le,noWheelClassName:ue,noPanClassName:de,disableKeyboardA11y:fe,onViewportChange:ge,isControlledViewport:!!he,children:(0,Y.jsxs)(zO,{children:[(0,Y.jsx)(LO,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:oe,onReconnectStart:se,onReconnectEnd:ce,onlyRenderVisibleElements:T,onEdgeContextMenu:te,onEdgeMouseEnter:ne,onEdgeMouseMove:re,onEdgeMouseLeave:ie,reconnectRadius:ae,defaultMarkerColor:M,noPanClassName:de,disableKeyboardA11y:fe,rfId:me}),(0,Y.jsx)(qO,{style:h,type:m,component:g,containerStyle:_}),(0,Y.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,Y.jsx)(Xie,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:q,onlyRenderVisibleElements:T,noPanClassName:de,noDragClassName:le,disableKeyboardA11y:fe,nodeExtent:pe,rfId:me,nodesDraggable:_e}),(0,Y.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}QO.displayName=`GraphView`;var $O=(0,J.memo)(QO),ek=yT(`React Flow`,`https://reactflow.dev/`),tk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Bw;sE(h,g,_);let{nodesInitialized:x}=nE(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=wT(tT(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Bw,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Uw.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,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:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...Kw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ek,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Hw,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>ME((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Sre({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...tk({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=nE(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();sE(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=Gre(e,n,r,i,a,o,l);d&&(Vre(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=YT(e,o.fromHandle,Yw.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=aE(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(dD(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(fD(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>pD(e,!0)));return}i(mD(r,new Set([...e]),!0)),a(mD(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>pD(e,!0)));return}a(mD(n,new Set([...e]))),i(mD(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(pD(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(pD(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,pD(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,pD(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(nE(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return Kre({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...Kw}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...tk()})}},Object.is);function rk({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,J.useState)(()=>nk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,Y.jsx)(FE,{value:m,children:(0,Y.jsx)(ED,{children:(0,Y.jsx)(Oie,{children:p})})})}function ik({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,J.useContext)(PE)?(0,Y.jsx)(Y.Fragment,{children:e}):(0,Y.jsx)(rk,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var ak={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function ok({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onBeforeDelete:I,connectionMode:L,connectionLineType:R=qw.Bezier,connectionLineStyle:z,connectionLineComponent:B,connectionLineContainerStyle:V,deleteKeyCode:H=`Backspace`,selectionKeyCode:U=`Shift`,selectionOnDrag:W=!1,selectionMode:G=Gw.Full,panActivationKeyCode:K=`Space`,multiSelectionKeyCode:ee=TT()?`Meta`:`Control`,zoomActivationKeyCode:q=TT()?`Meta`:`Control`,snapToGrid:te,snapGrid:ne,onlyRenderVisibleElements:re=!1,selectNodesOnDrag:ie,nodesDraggable:ae,autoPanOnNodeFocus:oe,nodesConnectable:se,nodesFocusable:ce,nodeOrigin:le=eD,edgesFocusable:ue,edgesReconnectable:de,elementsSelectable:fe=!0,defaultViewport:pe=tD,minZoom:me=.5,maxZoom:he=2,translateExtent:ge=Bw,preventScrolling:_e=!0,nodeExtent:ve,defaultMarkerColor:ye=`#b1b1b7`,zoomOnScroll:be=!0,zoomOnPinch:xe=!0,panOnScroll:Se=!1,panOnScrollSpeed:Ce=.5,panOnScrollMode:we=Ww.Free,zoomOnDoubleClick:Te=!0,panOnDrag:Ee=!0,onPaneClick:De,onPaneMouseEnter:Oe,onPaneMouseMove:ke,onPaneMouseLeave:Ae,onPaneScroll:je,onPaneContextMenu:Me,paneClickDistance:Ne=1,nodeClickDistance:Pe=0,children:Fe,onReconnect:Ie,onReconnectStart:Le,onReconnectEnd:Re,onEdgeContextMenu:ze,onEdgeDoubleClick:Be,onEdgeMouseEnter:Ve,onEdgeMouseMove:He,onEdgeMouseLeave:Ue,reconnectRadius:We=10,onNodesChange:Ge,onEdgesChange:Ke,noDragClassName:qe=`nodrag`,noWheelClassName:Je=`nowheel`,noPanClassName:Ye=`nopan`,fitView:Xe,fitViewOptions:Ze,connectOnClick:Qe,attributionPosition:$e,proOptions:et,defaultEdgeOptions:tt,elevateNodesOnSelect:nt=!0,elevateEdgesOnSelect:rt=!1,disableKeyboardA11y:it=!1,autoPanOnConnect:at,autoPanOnNodeDrag:ot,autoPanOnSelection:st=!0,autoPanSpeed:ct,connectionRadius:lt,isValidConnection:ut,onError:dt,style:ft,id:pt,nodeDragThreshold:mt,connectionDragThreshold:ht,viewport:gt,onViewportChange:_t,width:vt,height:yt,colorMode:bt=`light`,debug:xt,onScroll:St,ariaLabelConfig:Ct,zIndexMode:wt=`basic`,...Tt},Et){let Dt=pt||`1`,Ot=wie(bt),kt=(0,J.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),St?.(e)},[St]);return(0,Y.jsx)(`div`,{"data-testid":`rf__wrapper`,...Tt,onScroll:kt,style:{...ft,...ak},ref:Et,className:Hy([`react-flow`,i,Ot]),id:pt,role:`application`,children:(0,Y.jsxs)(ik,{nodes:e,edges:t,width:vt,height:yt,fitView:Xe,fitViewOptions:Ze,minZoom:me,maxZoom:he,nodeOrigin:le,nodeExtent:ve,zIndexMode:wt,children:[(0,Y.jsx)(Cie,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ae,autoPanOnNodeFocus:oe,nodesConnectable:se,nodesFocusable:ce,edgesFocusable:ue,edgesReconnectable:de,elementsSelectable:fe,elevateNodesOnSelect:nt,elevateEdgesOnSelect:rt,minZoom:me,maxZoom:he,nodeExtent:ve,onNodesChange:Ge,onEdgesChange:Ke,snapToGrid:te,snapGrid:ne,connectionMode:L,translateExtent:ge,connectOnClick:Qe,defaultEdgeOptions:tt,fitView:Xe,fitViewOptions:Ze,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Ye,nodeOrigin:le,rfId:Dt,autoPanOnConnect:at,autoPanOnNodeDrag:ot,autoPanSpeed:ct,onError:dt,connectionRadius:lt,isValidConnection:ut,selectNodesOnDrag:ie,nodeDragThreshold:mt,connectionDragThreshold:ht,onBeforeDelete:I,debug:xt,ariaLabelConfig:Ct,zIndexMode:wt}),(0,Y.jsx)($O,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:R,connectionLineStyle:z,connectionLineComponent:B,connectionLineContainerStyle:V,selectionKeyCode:U,selectionOnDrag:W,selectionMode:G,deleteKeyCode:H,multiSelectionKeyCode:ee,panActivationKeyCode:K,zoomActivationKeyCode:q,onlyRenderVisibleElements:re,defaultViewport:pe,translateExtent:ge,minZoom:me,maxZoom:he,preventScrolling:_e,zoomOnScroll:be,zoomOnPinch:xe,zoomOnDoubleClick:Te,panOnScroll:Se,panOnScrollSpeed:Ce,panOnScrollMode:we,panOnDrag:Ee,autoPanOnSelection:st,onPaneClick:De,onPaneMouseEnter:Oe,onPaneMouseMove:ke,onPaneMouseLeave:Ae,onPaneScroll:je,onPaneContextMenu:Me,paneClickDistance:Ne,nodeClickDistance:Pe,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Ie,onReconnectStart:Le,onReconnectEnd:Re,onEdgeContextMenu:ze,onEdgeDoubleClick:Be,onEdgeMouseEnter:Ve,onEdgeMouseMove:He,onEdgeMouseLeave:Ue,reconnectRadius:We,defaultMarkerColor:ye,noDragClassName:qe,noWheelClassName:Je,noPanClassName:Ye,rfId:Dt,disableKeyboardA11y:it,nodeExtent:ve,viewport:gt,onViewportChange:_t,nodesDraggable:ae}),(0,Y.jsx)($E,{onSelectionChange:k}),Fe,(0,Y.jsx)(qE,{proOptions:et,position:$e}),(0,Y.jsx)(WE,{rfId:Dt,disableKeyboardA11y:it})]})})}var sk=xD(ok),ck=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function lk({children:e}){let t=LE(ck);return t?(0,Zi.createPortal)(e,t):null}function uk(){let e=RE();return(0,J.useCallback)(t=>{let{domNode:n,updateNodeInternals:r}=e.getState(),i=Array.isArray(t)?t:[t],a=new Map;i.forEach(e=>{let t=n?.querySelector(`.react-flow__node[data-id="${e}"]`);t&&a.set(e,{id:e,nodeElement:t,force:!0})}),requestAnimationFrame(()=>r(a,{triggerFitView:!1}))},[])}zw.error014();function dk(e){return LE((0,J.useCallback)(t=>t.nodeLookup.get(e),[e]),NE)}function fk({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,Y.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Hy([`react-flow__background-pattern`,n,r])})}function pk({radius:e,className:t}){return(0,Y.jsx)(`circle`,{cx:e,cy:e,r:e,className:Hy([`react-flow__background-pattern`,`dots`,t])})}var mk;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(mk||={});var hk={[mk.Dots]:1,[mk.Lines]:1,[mk.Cross]:6},gk=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function _k({id:e,variant:t=mk.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,J.useRef)(null),{transform:f,patternId:p}=LE(gk,NE),m=r||hk[t],h=t===mk.Dots,g=t===mk.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,Y.jsxs)(`svg`,{className:Hy([`react-flow__background`,l]),style:{...c,...PD,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,Y.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,Y.jsx)(pk,{radius:y/2,className:u}):(0,Y.jsx)(fk,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,Y.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}_k.displayName=`Background`;var vk=(0,J.memo)(_k);function yk(){return(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,Y.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function bk(){return(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,Y.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function xk(){return(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,Y.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 Sk(){return(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Y.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 Ck(){return(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,Y.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 wk({children:e,className:t,...n}){return(0,Y.jsx)(`button`,{type:`button`,className:Hy([`react-flow__controls-button`,t]),...n,children:e})}var Tk=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ek({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=RE(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=LE(Tk,NE),{zoomIn:y,zoomOut:b,fitView:x}=kD();return(0,Y.jsxs)(GE,{className:Hy([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(wk,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,Y.jsx)(yk,{})}),(0,Y.jsx)(wk,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,Y.jsx)(bk,{})})]}),n&&(0,Y.jsx)(wk,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,Y.jsx)(xk,{})}),r&&(0,Y.jsx)(wk,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,Y.jsx)(Ck,{}):(0,Y.jsx)(Sk,{})}),u]})}Ek.displayName=`Controls`,(0,J.memo)(Ek);function Dk({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,Y.jsx)(`rect`,{className:Hy([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var Ok=(0,J.memo)(Dk),kk=e=>e.nodes.map(e=>e.id),Ak=e=>e instanceof Function?e:()=>e;function jk({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=Ok,onClick:o}){let s=LE(kk,NE),c=Ak(t),l=Ak(e),u=Ak(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,Y.jsx)(Y.Fragment,{children:s.map(e=>(0,Y.jsx)(Nk,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Mk({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=LE(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=DT(r);return{node:r,x:i,y:a,width:o,height:s}},NE);return!l||l.hidden||!OT(l)?null:(0,Y.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Nk=(0,J.memo)(Mk),Pk=(0,J.memo)(jk),Fk=200,Ik=150,Lk=e=>!e.hidden,Rk=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?mT(tT(e.nodeLookup,{filter:Lk}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},zk=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Bk=(e,t)=>zk(e.viewBB,t.viewBB)&&zk(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Vk=`react-flow__minimap-desc`;function Hk({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=RE(),S=(0,J.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=LE(Rk,Bk),j=e?.width??Fk,M=e?.height??Ik,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,L=F*M,R=b*F,z=C.x-(I-C.width)/2-R,B=C.y-(L-C.height)/2-R,V=I+R*2,H=L+R*2,U=`${Vk}-${T}`,W=(0,J.useRef)(0),G=(0,J.useRef)();W.current=F,(0,J.useEffect)(()=>{if(S.current&&E)return G.current=tie({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>W.current}),()=>{G.current?.destroy()}},[E]),(0,J.useEffect)(()=>{G.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let K=p?e=>{let[t,n]=G.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ee=m?(0,J.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,q=_??A[`minimap.ariaLabel`];return(0,Y.jsx)(GE,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*F:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Hy([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,Y.jsxs)(`svg`,{width:j,height:M,viewBox:`${z} ${B} ${V} ${H}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":U,ref:S,onClick:K,children:[q&&(0,Y.jsx)(`title`,{id:U,children:q}),(0,Y.jsx)(Pk,{onClick:ee,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,Y.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${z-R},${B-R}h${V+R*2}v${H+R*2}h${-V-R*2}z
|
|
20
|
+
M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Hk.displayName=`MiniMap`;var Uk=(0,J.memo)(Hk),Wk=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Gk={[SE.Line]:`right`,[SE.Handle]:`bottom-right`};function Kk({nodeId:e,position:t,variant:n=SE.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=qD(),y=typeof e==`string`?e:v,b=RE(),x=(0,J.useRef)(null),S=n===SE.Handle,C=LE((0,J.useCallback)(Wk(S&&p),[S,p]),NE),w=(0,J.useRef)(null),T=t??Gk[n];(0,J.useEffect)(()=>{if(!(!x.current||!y))return w.current||=mie({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=aE([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...kT({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]);let E=T.split(`-`);return(0,Y.jsx)(`div`,{className:Hy([`react-flow__resize-control`,`nodrag`,...E,n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,J.memo)(Kk);function qk(e){return`init`in e}function Jk(e){return typeof e.write==`function`}function eae(e){return!!e.onMount}function Yk(e){return`v`in e||`e`in e}function Xk(e){if(`e`in e)throw e.e;return e.v}function Zk(e){return typeof e?.then==`function`}function tae(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function Qk(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function $k(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function nae(e){return!!e.INTERNAL_onInit}var rae=(e,t,n,...r)=>n.read(...r),iae=(e,t,n,...r)=>n.write(...r),aae=(e,t,n)=>n.INTERNAL_onInit(t),oae=(e,t,n,r)=>n.onMount?.call(n,r),sae=(e,t,n)=>{var r;let i=e[0],a=i.get(n);if(!a){let o=e[6],s=e[9];a={d:new Map,p:new Set,n:0},i.set(n,a),(r=o.i)==null||r.call(o,n),nae(n)&&s(e,t,n)}return a},cae=(e,t)=>{let n=e[1],r=e[3],i=e[4],a=e[5],o=e[6],s=e[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},lae=(e,t)=>{let n=e[1],r=e[2],i=e[3],a=e[11],o=e[14],s=e[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o)){f.pop(),p.pop();continue}if(u.has(o)){r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();continue}u.add(o);for(let r of $k(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},uae=(e,t,n)=>{var r,i;let a=e[1],o=e[2],s=e[3],c=e[6],l=e[7],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],h=e[17],g=e[20],_=e[26],v=e[28],y=u(e,t,n),b=v[0];if(Yk(y)){if(a.has(n)&&o.get(n)!==y.n||y.m===b)return y.m=b,y;let r=!1;for(let[n,i]of y.d)if(p(e,t,n).n!==i){r=!0;break}if(!r)return y.m=b,y}let x=!0,S=new Set(y.d.keys()),C=()=>{for(let e of S)y.d.delete(e)},w=()=>{if(a.has(n)){let r=!s.size;h(e,t,n),r&&(f(e,t),d(e,t))}},T=r=>{var i;if(r===n){let n=u(e,t,r);if(!Yk(n)){if(qk(r))g(e,t,r,r.init);else throw Error(`no atom init`)}return Xk(n)}let o=p(e,t,r);try{return Xk(o)}finally{S.delete(r),y.d.set(r,o.n),Zk(y.v)&&Qk(n,y.v,o),a.has(n)&&((i=a.get(r))==null||i.t.add(n)),x||w()}},E,D,O={get signal(){return E||=new AbortController,E.signal},get setSelf(){return!D&&Jk(n)&&(D=(...r)=>{if(!x)try{return m(e,t,n,r)}finally{f(e,t),d(e,t)}}),D}},k=y.n,A=o.get(n)===k;try{let i=l(e,t,n,T,O);if(g(e,t,n,i),Zk(i)){_(e,t,i,()=>E?.abort());let n=()=>{C(),w()};i.then(n,n)}else C();return(r=c.r)==null||r.call(c,n),y.m=b,y}catch(e){if(tae(e))throw e;return delete y.v,y.e=e,++y.n,y.m=b,y}finally{x=!1,y.n!==k&&A&&(o.set(n,y.n),s.add(n),(i=c.c)==null||i.call(c,n))}},dae=(e,t,n)=>{let r=e[1],i=e[2],a=e[11],o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of $k(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},fae=(e,t,n,r)=>{let i=e[3],a=e[6],o=e[8],s=e[11],c=e[12],l=e[13],u=e[14],d=e[15],f=e[16],p=e[17],m=e[20],h=e[28],g=!0,_=n=>Xk(u(e,t,n)),v=(r,...o)=>{var u;let _=s(e,t,r);try{if(r===n){if(!qk(r))throw Error(`atom not writable`);let n=_.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==_.n&&(++h[0],i.add(r),d(e,t,r),(u=a.c)==null||u.call(a,r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},pae=(e,t,n)=>{var r;let i=e[1],a=e[3],o=e[6],s=e[11],c=e[15],l=e[18],u=e[19],d=s(e,t,n),f=i.get(n);if(f&&d.d.size>0){for(let[i,u]of d.d)if(!f.d.has(i)){let d=s(e,t,i);l(e,t,i).t.add(n),f.d.add(i),u!==d.n&&(a.add(i),c(e,t,i),(r=o.c)==null||r.call(o,i))}for(let r of f.d)d.d.has(r)||(f.d.delete(r),u(e,t,r)?.t.delete(n))}},mae=(e,t,n)=>{var r;let i=e[1],a=e[4],o=e[6],s=e[10],c=e[11],l=e[12],u=e[13],d=e[14],f=e[16],p=e[18],m=c(e,t,n),h=i.get(n);if(!h){d(e,t,n);for(let r of m.d.keys())p(e,t,r).t.add(n);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(n,h),Jk(n)&&eae(n)&&a.add(()=>{let r=!0,i=(...i)=>{try{return f(e,t,n,i)}finally{r||(u(e,t),l(e,t))}};try{let a=s(e,t,n,i);a&&(h.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),(r=o.m)==null||r.call(o,n)}return h},hae=(e,t,n)=>{var r;let i=e[1],a=e[5],o=e[6],s=e[11],c=e[19],l=s(e,t,n),u=i.get(n);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(n)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(n);for(let r of l.d.keys())c(e,t,r)?.t.delete(n);(r=o.u)==null||r.call(o,n);return}return u},gae=(e,t,n,r)=>{let i=e[11],a=e[27],o=i(e,t,n),s=`v`in o,c=o.v;if(Zk(r))for(let a of o.d.keys())Qk(n,r,i(e,t,a));o.v=r,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,Zk(c)&&a(e,t,c))},_ae=(e,t,n)=>{let r=e[14];return Xk(r(e,t,n))},vae=(e,t,n,...r)=>{let i=e[3],a=e[12],o=e[13],s=e[16],c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},yae=(e,t,n,r)=>{let i=e[12],a=e[13],o=e[18],s=e[19],c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},bae=(e,t,n,r)=>{let i=e[25],a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},xae=(e,t,n)=>{e[25].get(n)?.forEach(e=>e())},eA=new WeakMap;function Sae(e){let t=eA.get(e),n=t[24];return n?n(t,e):t}function Cae(...e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},rae,iae,aae,oae,sae,cae,lae,uae,dae,fae,pae,mae,hae,gae,_ae,vae,yae,void 0,new WeakMap,bae,xae,[0]].map((t,n)=>e[n]||t);eA.set(t,Object.freeze(n));let r=n[21],i=n[22],a=n[23];return t}var wae=0;function tA(e,t){let n=`atom${++wae}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=Tae,r.write=Eae),t&&(r.write=t),r}function Tae(e){return e(this)}function Eae(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var nA;function rA(){return nA?nA():Cae()}var iA;function Dae(){return iA||=rA(),iA}var aA=(0,J.createContext)(void 0);function oA(e){let t=(0,J.useContext)(aA);return e?.store||t||Dae()}function Oae({children:e,store:t}){let n=(0,J.useRef)(null);return t?(0,J.createElement)(aA.Provider,{value:t},e):(n.current===null&&(n.current=rA()),(0,J.createElement)(aA.Provider,{value:n.current},e))}var sA=e=>typeof e?.then==`function`,cA=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},kae=J.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(cA(e),e)}),lA=new WeakMap,uA=(e,t,n)=>{let r=Sae(e),i=r[26],a=lA.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();sA(t)?(lA.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),lA.set(t,a)),a};function dA(e,t){let{delay:n,unstable_promiseStatus:r=!J.use}=t||{},i=oA(t),[[a,o,s],c]=(0,J.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,J.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);sA(t)&&cA(uA(i,t,()=>i.get(e)))}catch{}if(typeof n==`number`){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
|
|
21
|
+
|
|
22
|
+
Migration guide:
|
|
23
|
+
|
|
24
|
+
Create a custom hook like the following.
|
|
25
|
+
|
|
26
|
+
function useAtomValueWithDelay<Value>(
|
|
27
|
+
atom: Atom<Value>,
|
|
28
|
+
options: { delay: number },
|
|
29
|
+
): Value {
|
|
30
|
+
const { delay } = options
|
|
31
|
+
const store = useStore(options)
|
|
32
|
+
const [value, setValue] = useState(() => store.get(atom))
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const unsub = store.sub(atom, () => {
|
|
35
|
+
setTimeout(() => setValue(store.get(atom)), delay)
|
|
36
|
+
})
|
|
37
|
+
return unsub
|
|
38
|
+
}, [store, atom, delay])
|
|
39
|
+
return value
|
|
40
|
+
}
|
|
41
|
+
`),setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,J.useDebugValue)(l),sA(l)){let t=uA(i,l,()=>i.get(e));return r&&cA(t),kae(t)}return l}function fA(e,t){let n=oA(t);return(0,J.useCallback)((...t)=>n.set(e,...t),[n,e])}function pA(e,t){return[dA(e,t),fA(e,t)]}var mA=(0,J.createContext)({});function hA(e){let t=(0,J.useRef)(null);return t.current===null&&(t.current=e()),t.current}var gA=typeof window<`u`?J.useLayoutEffect:J.useEffect,_A=(0,J.createContext)(null);function vA(e,t){e.indexOf(t)===-1&&e.push(t)}function yA(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var bA=(e,t,n)=>n>t?t:n<e?e:n,xA={},SA=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),CA=e=>typeof e==`object`&&!!e,wA=e=>/^0[^.\s]+$/u.test(e);function TA(e){let t;return()=>(t===void 0&&(t=e()),t)}var EA=e=>e,DA=(...e)=>e.reduce((e,t)=>n=>t(e(n))),OA=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},kA=class{constructor(){this.subscriptions=[]}add(e){return vA(this.subscriptions,e),()=>yA(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},AA=e=>e*1e3,jA=e=>e/1e3,MA=(e,t)=>t?1e3/t*e:0,NA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Aae=1e-7,jae=12;function Mae(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=NA(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Aae&&++s<jae);return o}function PA(e,t,n,r){if(e===t&&n===r)return EA;let i=t=>Mae(t,0,1,e,n);return e=>e===0||e===1?e:NA(i(e),t,r)}var FA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,IA=e=>t=>1-e(1-t),LA=PA(.33,1.53,.69,.99),RA=IA(LA),zA=FA(RA),BA=e=>e>=1?1:(e*=2)<1?.5*RA(e):.5*(2-2**(-10*(e-1))),VA=e=>1-Math.sin(Math.acos(e)),HA=IA(VA),UA=FA(VA),Nae=PA(.42,0,1,1),Pae=PA(0,0,.58,1),WA=PA(.42,0,.58,1),Fae=e=>Array.isArray(e)&&typeof e[0]!=`number`,GA=e=>Array.isArray(e)&&typeof e[0]==`number`,KA={linear:EA,easeIn:Nae,easeInOut:WA,easeOut:Pae,circIn:VA,circInOut:UA,circOut:HA,backIn:RA,backInOut:zA,backOut:LA,anticipate:BA},Iae=e=>typeof e==`string`,qA=e=>{if(GA(e)){e.length;let[t,n,r,i]=e;return PA(t,n,r,i)}return Iae(e)?(KA[e],`${e}`,KA[e]):e},JA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Lae(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Rae=40;function YA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=JA.reduce((e,t)=>(e[t]=Lae(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=xA.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Rae),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:JA.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<JA.length;t++)o[JA[t]].cancel(e)},state:i,steps:o}}var{schedule:XA,cancel:ZA,state:QA,steps:$A}=YA(typeof requestAnimationFrame<`u`?requestAnimationFrame:EA,!0),ej;function zae(){ej=void 0}var tj={now:()=>(ej===void 0&&tj.set(QA.isProcessing||xA.useManualTiming?QA.timestamp:performance.now()),ej),set:e=>{ej=e,queueMicrotask(zae)}},nj=e=>t=>typeof t==`string`&&t.startsWith(e),rj=nj(`--`),Bae=nj(`var(--`),ij=e=>Bae(e)?Vae.test(e.split(`/*`)[0].trim()):!1,Vae=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function aj(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var oj={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},sj={...oj,transform:e=>bA(0,1,e)},cj={...oj,default:1},lj=e=>Math.round(e*1e5)/1e5,uj=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Hae(e){return e==null}var Uae=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,dj=(e,t)=>n=>!!(typeof n==`string`&&Uae.test(n)&&n.startsWith(e)||t&&!Hae(n)&&Object.prototype.hasOwnProperty.call(n,t)),fj=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(uj);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},pj=e=>bA(0,255,e),mj={...oj,transform:e=>Math.round(pj(e))},hj={test:dj(`rgb`,`red`),parse:fj(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+mj.transform(e)+`, `+mj.transform(t)+`, `+mj.transform(n)+`, `+lj(sj.transform(r))+`)`};function gj(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var _j={test:dj(`#`),parse:gj,transform:hj.transform},vj=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yj=vj(`deg`),bj=vj(`%`),xj=vj(`px`),Sj=vj(`vh`),Cj=vj(`vw`),wj={...bj,parse:e=>bj.parse(e)/100,transform:e=>bj.transform(e*100)},Tj={test:dj(`hsl`,`hue`),parse:fj(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+bj.transform(lj(t))+`, `+bj.transform(lj(n))+`, `+lj(sj.transform(r))+`)`},Ej={test:e=>hj.test(e)||_j.test(e)||Tj.test(e),parse:e=>hj.test(e)?hj.parse(e):Tj.test(e)?Tj.parse(e):_j.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?hj.transform(e):Tj.transform(e),getAnimatableNone:e=>{let t=Ej.parse(e);return t.alpha=0,Ej.transform(t)}},Dj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Oj(e){return isNaN(e)&&typeof e==`string`&&(e.match(uj)?.length||0)+(e.match(Dj)?.length||0)>0}var kj=`number`,Aj=`color`,jj=`var`,Mj=`var(`,Nj="${}",Pj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Fj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Pj,e=>(Ej.test(e)?(r.color.push(a),i.push(Aj),n.push(Ej.parse(e))):e.startsWith(Mj)?(r.var.push(a),i.push(jj),n.push(e)):(r.number.push(a),i.push(kj),n.push(parseFloat(e))),++a,Nj)).split(Nj),indexes:r,types:i}}function Ij(e){return Fj(e).values}function Lj({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===kj?lj(r[a]):e===Aj?Ej.transform(r[a]):r[a]}return i}}function Rj(e){return Lj(Fj(e))}var zj=e=>typeof e==`number`?0:Ej.test(e)?Ej.getAnimatableNone(e):e,Bj=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:zj(e);function Vj(e){let t=Fj(e);return Lj(t)(t.values.map((e,n)=>Bj(e,t.split[n])))}var Hj={test:Oj,parse:Ij,createTransformer:Rj,getAnimatableNone:Vj};function Uj(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Wj({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Uj(s,r,e+1/3),a=Uj(s,r,e),o=Uj(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Gj(e,t){return n=>n>0?t:e}var Kj=(e,t,n)=>e+(t-e)*n,qj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jj=[_j,hj,Tj],Yj=e=>Jj.find(t=>t.test(e));function Xj(e){let t=Yj(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Tj&&(n=Wj(n)),n}var Zj=(e,t)=>{let n=Xj(e),r=Xj(t);if(!n||!r)return Gj(e,t);let i={...n};return e=>(i.red=qj(n.red,r.red,e),i.green=qj(n.green,r.green,e),i.blue=qj(n.blue,r.blue,e),i.alpha=Kj(n.alpha,r.alpha,e),hj.transform(i))},Qj=new Set([`none`,`hidden`]);function $j(e,t){return Qj.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function eM(e,t){return n=>Kj(e,t,n)}function tM(e){return typeof e==`number`?eM:typeof e==`string`?ij(e)?Gj:Ej.test(e)?Zj:aM:Array.isArray(e)?nM:typeof e==`object`?Ej.test(e)?Zj:rM:Gj}function nM(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>tM(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function rM(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=tM(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function iM(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var aM=(e,t)=>{let n=Hj.createTransformer(t),r=Fj(e),i=Fj(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Qj.has(e)&&!i.values.length||Qj.has(t)&&!r.values.length?$j(e,t):DA(nM(iM(r,i),i.values),n):(`${e}${t}`,Gj(e,t))};function oM(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Kj(e,t,n):tM(e)(e,t)}var sM=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>XA.update(t,e),stop:()=>ZA(t),now:()=>QA.isProcessing?QA.timestamp:tj.now()}},cM=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},lM=2e4;function uM(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function dM(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(uM(r),lM);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:jA(i)}}var fM={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function pM(e,t){return e*Math.sqrt(1-t*t)}var mM=12;function hM(e,t,n){let r=n;for(let n=1;n<mM;n++)r-=e(r)/t(r);return r}var gM=.001;function _M({duration:e=fM.duration,bounce:t=fM.bounce,velocity:n=fM.velocity,mass:r=fM.mass}){let i,a;fM.maxDuration;let o=1-t;o=bA(fM.minDamping,fM.maxDamping,o),e=bA(fM.minDuration,fM.maxDuration,jA(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=pM(t,o),c=Math.exp(-i);return gM-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=pM(t**2,o);return(-i(t)+gM>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=hM(i,a,s);if(e=AA(e),isNaN(c))return{stiffness:fM.stiffness,damping:fM.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var vM=[`duration`,`bounce`],yM=[`stiffness`,`damping`,`mass`];function bM(e,t){return t.some(t=>e[t]!==void 0)}function xM(e){let t={velocity:fM.velocity,stiffness:fM.stiffness,damping:fM.damping,mass:fM.mass,isResolvedFromDuration:!1,...e};if(!bM(e,yM)&&bM(e,vM)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*bA(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:fM.mass,stiffness:i,damping:a}}else{let n=_M({...e,velocity:0});t={...t,...n,mass:fM.mass},t.isResolvedFromDuration=!0}}return t}function SM(e=fM.visualDuration,t=fM.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=xM({...n,velocity:-jA(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=jA(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?fM.restSpeed.granular:fM.restSpeed.default,i||=v?fM.restDelta.granular:fM.restDelta.default;let y,b,x,S,C,w;if(h<1)x=pM(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>AA(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=AA(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=AA(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(uM(T),lM),t=cM(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}SM.applyToOptions=e=>{let t=dM(e,100,SM);return e.ease=t.ease,e.duration=AA(t.duration),e.type=`keyframes`,e};var CM=5;function wM(e,t,n){let r=Math.max(t-CM,0);return MA(n-e(r),t-r)}function TM({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=SM({keyframes:[f.value,m(f.value)],velocity:wM(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function EM(e,t,n){let r=[],i=n||xA.mix||oM,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=DA(Array.isArray(t)?t[n]||EA:t,a)),r.push(a)}return r}function DM(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=EM(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=OA(e[r],e[r+1],n);return s[r](i)};return n?t=>l(bA(e[0],e[a-1],t)):l}function OM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=OA(0,t,r);e.push(Kj(n,1,i))}}function kM(e){let t=[0];return OM(t,e.length-1),t}function AM(e,t){return e.map(e=>e*t)}function jM(e,t){return e.map(()=>t||WA).splice(0,e.length-1)}function MM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Fae(r)?r.map(qA):qA(r),a={done:!1,value:t[0]},o=DM(AM(n&&n.length===t.length?n:kM(t),e),t,{ease:Array.isArray(i)?i:jM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var NM=e=>e!==null;function PM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(NM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var FM={decay:TM,inertia:TM,tween:MM,keyframes:MM,spring:SM};function IM(e){typeof e.type==`string`&&(e.type=FM[e.type])}var LM=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},RM=e=>e/100,zM=class extends LM{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==tj.now()&&this.tick(tj.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;IM(e);let{type:t=MM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||MM;s!==MM&&typeof o[0]!=`number`&&(this.mixKeyframes=DA(RM,oM(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=uM(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=bA(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==TM&&(b.value=PM(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return jA(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+jA(e)}get time(){return jA(this.currentTime)}set time(e){e=AA(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return wM(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(tj.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=jA(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=sM,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(tj.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function BM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var VM=e=>e*180/Math.PI,HM=e=>WM(VM(Math.atan2(e[1],e[0]))),UM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:HM,rotateZ:HM,skewX:e=>VM(Math.atan(e[1])),skewY:e=>VM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},WM=e=>(e%=360,e<0&&(e+=360),e),GM=HM,KM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),JM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:KM,scaleY:qM,scale:e=>(KM(e)+qM(e))/2,rotateX:e=>WM(VM(Math.atan2(e[6],e[5]))),rotateY:e=>WM(VM(Math.atan2(-e[2],e[0]))),rotateZ:GM,rotate:GM,skewX:e=>VM(Math.atan(e[4])),skewY:e=>VM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function YM(e){return+!!e.includes(`scale`)}function XM(e,t){if(!e||e===`none`)return YM(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=JM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=UM,i=t}if(!i)return YM(t);let a=r[t],o=i[1].split(`,`).map(QM);return typeof a==`function`?a(o):o[a]}var ZM=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return XM(n,t)};function QM(e){return parseFloat(e.trim())}var $M=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],eN=new Set([...$M,`pathRotation`]),tN=e=>e===oj||e===xj,nN=new Set([`x`,`y`,`z`]),rN=$M.filter(e=>!nN.has(e));function iN(e){let t=[];return rN.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var aN={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>XM(t,`x`),y:(e,{transform:t})=>XM(t,`y`)};aN.translateX=aN.x,aN.translateY=aN.y;var oN=new Set,sN=!1,cN=!1,lN=!1;function uN(){if(cN){let e=Array.from(oN).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=iN(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}cN=!1,sN=!1,oN.forEach(e=>e.complete(lN)),oN.clear()}function dN(){oN.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(cN=!0)})}function fN(){lN=!0,dN(),uN(),lN=!1}var pN=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(oN.add(this),sN||(sN=!0,XA.read(dN),XA.resolveKeyframes(uN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}BM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),oN.delete(this)}cancel(){this.state===`scheduled`&&(oN.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},mN=e=>e.startsWith(`--`);function hN(e,t,n){mN(t)?e.style.setProperty(t,n):e.style[t]=n}var gN={};function _N(e,t){let n=TA(e);return()=>gN[t]??n()}var vN=_N(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),yN=_N(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),bN=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,xN={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:bN([0,.65,.55,1]),circOut:bN([.55,0,1,.45]),backIn:bN([.31,.01,.66,-.59]),backOut:bN([.33,1.53,.69,.99])};function SN(e,t){if(e)return typeof e==`function`?yN()?cM(e,t):`ease-out`:GA(e)?bN(e):Array.isArray(e)?e.map(e=>SN(e,t)||xN.easeOut):xN[e]}function CN(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=SN(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function wN(e){return typeof e==`function`&&`applyToOptions`in e}function TN({type:e,...t}){return wN(e)&&yN()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var EN=class extends LM{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=TN(e);this.animation=CN(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=PM(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),hN(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return jA(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+jA(e)}get time(){return jA(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=AA(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&vN()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),EA):r(this)}},DN={anticipate:BA,backInOut:zA,circInOut:UA};function ON(e){return e in DN}function kN(e){typeof e.ease==`string`&&ON(e.ease)&&(e.ease=DN[e.ease])}var AN=10,jN=class extends EN{constructor(e){kN(e),IM(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new zM({...a,autoplay:!1}),s=Math.max(AN,tj.now()-this.startTime),c=bA(0,AN,s-AN),l=o.sample(s).value,{name:u}=this.options;i&&u&&hN(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},MN=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Hj.test(e)||e===`0`)&&!e.startsWith(`url(`));function NN(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function PN(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=MN(i,t),s=MN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:NN(e)||(n===`spring`||wN(n))&&r}function FN(e){e.duration=0,e.type=`keyframes`}var IN=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),LN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function RN(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&LN.test(e[t]))return!0;return!1}var zN=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),BN=TA(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function VN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return BN()&&n&&(IN.has(n)||zN.has(n)&&RN(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var HN=40,UN=class extends LM{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tj.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||pN;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=tj.now();let u=!0;PN(e,i,a,o)||(u=!1,(xA.instantAnimations||!s)&&l?.(PM(e,n,t)),e[0]=e[e.length-1],FN(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>HN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&VN(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new jN({...d,element:p})}catch{m=new zM(d)}else m=new zM(d);m.finished.then(()=>{this.notifyFinished()}).catch(EA),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),fN()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function WN(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var GN=30,KN=e=>!isNaN(parseFloat(e)),qN={current:void 0},JN=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=tj.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=tj.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=KN(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new kA);let n=this.events[e].add(t);return e===`change`?()=>{n(),XA.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return qN.current&&qN.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=tj.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>GN)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,GN);return MA(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function YN(e,t){return new JN(e,t)}function XN(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ZN(e,t){let n=e?.[t]??e?.default??e;return n===e?n:XN(n,e)}var QN={type:`spring`,stiffness:500,damping:25,restSpeed:10},$N=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eP={type:`keyframes`,duration:.8},tP={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},nP=(e,{keyframes:t})=>t.length>2?eP:eN.has(e)?e.startsWith(`scale`)?$N(t[1]):QN:tP,rP=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function iP(e){for(let t in e)if(!rP.has(t))return!0;return!1}var aP=(e,t,n,r={},i,a)=>o=>{let s=ZN(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=AA(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};iP(s)||Object.assign(u,nP(e,u)),u.duration&&=AA(u.duration),u.repeatDelay&&=AA(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(FN(u),u.delay===0&&(d=!0)),(xA.instantAnimations||xA.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,FN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=PM(u.keyframes,s);if(e!==void 0){XA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new zM(u):new UN(u)},oP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function sP(e){let t=oP.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function cP(e,t,n=1){`${e}`;let[r,i]=sP(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return SA(e)?parseFloat(e):e}return ij(i)?cP(i,t,n+1):i}function lP(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function uP(e,t,n,r){if(typeof t==`function`){let[i,a]=lP(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=lP(r);t=t(n===void 0?e.custom:n,i,a)}return t}function dP(e,t,n){let r=e.getProps();return uP(r,t,n===void 0?r.custom:n,e)}var fP=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...$M]),pP=e=>Array.isArray(e);function mP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,YN(n))}function hP(e){return pP(e)?e[e.length-1]||0:e}function gP(e,t){let{transitionEnd:n={},transition:r={},...i}=dP(e,t)||{};i={...i,...n};for(let t in i)mP(e,t,hP(i[t]))}var _P=e=>!!(e&&e.getVelocity);function vP(e){return!!(_P(e)&&e.add)}function yP(e,t){let n=e.getValue(`willChange`);if(vP(n))return n.add(t);if(!n&&xA.WillChange){let n=new xA.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function bP(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var xP=`data-`+bP(`framerAppearId`);function SP(e){return e.props[xP]}function CP({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wP(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?XN(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&CP(f,t))continue;let o={delay:n,...ZN(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){XA.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=SP(e);if(n){let e=window.MotionHandoffAnimation(n,t,XA);e!==null&&(o.startTime=e,p=!0)}}yP(e,t);let m=l??e.shouldReduceMotion;r.start(aP(t,r,i,m&&fP.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>XA.update(()=>{o&&gP(e,o)});d.length?Promise.all(d).then(t):t()}return d}function TP(e,t,n={}){let r=dP(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(wP(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return EP(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function EP(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(TP(c,t,{...o,delay:n+(typeof r==`function`?0:r)+WN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function DP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>TP(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=TP(e,t,n);else{let i=typeof t==`function`?dP(e,t,n.custom):t;r=Promise.all(wP(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var OP={test:e=>e===`auto`,parse:e=>e},kP=e=>t=>t.test(e),AP=[oj,xj,bj,yj,Cj,Sj,OP],jP=e=>AP.find(kP(e));function MP(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||wA(e)}var NP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function PP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(uj)||[];if(!r)return e;let i=n.replace(r,``),a=+!!NP.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var FP=/\b([a-z-]*)\(.*?\)/gu,IP={...Hj,getAnimatableNone:e=>{let t=e.match(FP);return t?t.map(PP).join(` `):e}},LP={...Hj,getAnimatableNone:e=>{let t=Hj.parse(e);return Hj.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},RP={...oj,transform:Math.round},zP={borderWidth:xj,borderTopWidth:xj,borderRightWidth:xj,borderBottomWidth:xj,borderLeftWidth:xj,borderRadius:xj,borderTopLeftRadius:xj,borderTopRightRadius:xj,borderBottomRightRadius:xj,borderBottomLeftRadius:xj,width:xj,maxWidth:xj,height:xj,maxHeight:xj,top:xj,right:xj,bottom:xj,left:xj,inset:xj,insetBlock:xj,insetBlockStart:xj,insetBlockEnd:xj,insetInline:xj,insetInlineStart:xj,insetInlineEnd:xj,padding:xj,paddingTop:xj,paddingRight:xj,paddingBottom:xj,paddingLeft:xj,paddingBlock:xj,paddingBlockStart:xj,paddingBlockEnd:xj,paddingInline:xj,paddingInlineStart:xj,paddingInlineEnd:xj,margin:xj,marginTop:xj,marginRight:xj,marginBottom:xj,marginLeft:xj,marginBlock:xj,marginBlockStart:xj,marginBlockEnd:xj,marginInline:xj,marginInlineStart:xj,marginInlineEnd:xj,fontSize:xj,backgroundPositionX:xj,backgroundPositionY:xj,rotate:yj,pathRotation:yj,rotateX:yj,rotateY:yj,rotateZ:yj,scale:cj,scaleX:cj,scaleY:cj,scaleZ:cj,skew:yj,skewX:yj,skewY:yj,distance:xj,translateX:xj,translateY:xj,translateZ:xj,x:xj,y:xj,z:xj,perspective:xj,transformPerspective:xj,opacity:sj,originX:wj,originY:wj,originZ:xj,zIndex:RP,fillOpacity:sj,strokeOpacity:sj,numOctaves:RP},BP={...zP,color:Ej,backgroundColor:Ej,outlineColor:Ej,fill:Ej,stroke:Ej,borderColor:Ej,borderTopColor:Ej,borderRightColor:Ej,borderBottomColor:Ej,borderLeftColor:Ej,filter:IP,WebkitFilter:IP,mask:LP,WebkitMask:LP},VP=e=>BP[e],HP=new Set([IP,LP]);function UP(e,t){let n=VP(e);return HP.has(n)||(n=Hj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var WP=new Set([`auto`,`none`,`0`]);function GP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!WP.has(t)&&Fj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=UP(n,i)}var KP=class extends pN{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),ij(r))){let i=cP(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!fP.has(n)||e.length!==2)return;let[r,i]=e,a=jP(r),o=jP(i);if(aj(r)!==aj(i)&&aN[n]){this.needsMeasurement=!0;return}if(a!==o){if(tN(a)&&tN(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else aN[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||MP(e[t]))&&n.push(t);n.length&&GP(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=aN[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=aN[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},qP=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function JP(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var YP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function XP(e){return CA(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:ZP,cancel:Wae}=YA(queueMicrotask,!1),QP={x:!1,y:!1};function $P(){return QP.x||QP.y}function eF(e){return e===`x`||e===`y`?QP[e]?null:(QP[e]=!0,()=>{QP[e]=!1}):QP.x||QP.y?null:(QP.x=QP.y=!0,()=>{QP.x=QP.y=!1})}function tF(e,t){let n=JP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function nF(e){return!(e.pointerType===`touch`||$P())}function rF(e,t,n={}){let[r,i,a]=tF(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!nF(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var iF=(e,t)=>t?e===t||iF(e,t.parentElement):!1,aF=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,oF=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function sF(e){return oF.has(e.tagName)||e.isContentEditable===!0}var cF=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function lF(e){return cF.has(e.tagName)||e.isContentEditable===!0}var uF=new WeakSet;function dF(e){return t=>{t.key===`Enter`&&e(t)}}function fF(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var pF=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dF(()=>{if(uF.has(n))return;fF(n,`down`);let e=dF(()=>{fF(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fF(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function mF(e){return aF(e)&&!$P()}var hF=new WeakSet;function gF(e,t,n={}){let[r,i,a]=tF(e,n),o=e=>{let r=e.currentTarget;if(!mF(e)||hF.has(e))return;uF.add(r),n.stopPropagation&&hF.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),uF.has(r)&&uF.delete(r),mF(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||iF(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),XP(e)&&(e.addEventListener(`focus`,e=>pF(e,i)),!sF(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function _F(e){return CA(e)&&`ownerSVGElement`in e}var vF=new WeakMap,yF,bF=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_F(r)&&`getBBox`in r?r.getBBox()[t]:r[n],xF=bF(`inline`,`width`,`offsetWidth`),SF=bF(`block`,`height`,`offsetHeight`);function CF({target:e,borderBoxSize:t}){vF.get(e)?.forEach(n=>{n(e,{get width(){return xF(e,t)},get height(){return SF(e,t)}})})}function wF(e){e.forEach(CF)}function TF(){typeof ResizeObserver>`u`||(yF=new ResizeObserver(wF))}function EF(e,t){yF||TF();let n=JP(e);return n.forEach(e=>{let n=vF.get(e);n||(n=new Set,vF.set(e,n)),n.add(t),yF?.observe(e)}),()=>{n.forEach(e=>{let n=vF.get(e);n?.delete(t),n?.size||yF?.unobserve(e)})}}var DF=new Set,OF;function kF(){OF=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};DF.forEach(t=>t(e))},window.addEventListener(`resize`,OF)}function AF(e){return DF.add(e),OF||kF(),()=>{DF.delete(e),!DF.size&&typeof OF==`function`&&(window.removeEventListener(`resize`,OF),OF=void 0)}}function jF(e,t){return typeof e==`function`?AF(e):EF(e,t)}var MF={value:null,addProjectionMetrics:null};function NF(e){return _F(e)&&e.tagName===`svg`}var PF=[...AP,Ej,Hj],FF=e=>PF.find(kP(e)),IF=()=>({translate:0,scale:1,origin:0,originPoint:0}),LF=()=>({x:IF(),y:IF()}),RF=()=>({min:0,max:0}),zF=()=>({x:RF(),y:RF()}),BF=new WeakMap;function VF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function HF(e){return typeof e==`string`||Array.isArray(e)}var UF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],WF=[`initial`,...UF];function GF(e){return VF(e.animate)||WF.some(t=>HF(e[t]))}function KF(e){return!!(GF(e)||e.variants)}function qF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(_P(i))e.addValue(r,i);else if(_P(a))e.addValue(r,YN(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,YN(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var JF={current:null},YF={current:!1},XF=typeof window<`u`;function ZF(){if(YF.current=!0,XF){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>JF.current=e.matches;e.addEventListener(`change`,t),t()}else JF.current=!1}}var QF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],$F={};function eI(e){$F=e}function tI(){return $F}var nI=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=pN,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=tj.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,XA.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=GF(t),this.isVariantNode=KF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&_P(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,BF.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(YF.current||ZF(),this.shouldReduceMotion=JF.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ZA(this.notifyUpdate),ZA(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&IN.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new EN({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:AA(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=eN.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&XA.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in $F){let t=$F[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zF()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<QF.length;t++){let n=QF[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=qF(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=YN(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(SA(n)||wA(n))?n=parseFloat(n):!FF(n)&&Hj.test(t)&&(n=UP(e,t)),this.setBaseTarget(e,_P(n)?n.get():n)),_P(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=uP(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!_P(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new kA),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){ZP.render(this.render)}},rI=class extends nI{constructor(){super(...arguments),this.KeyframeResolver=KP}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;_P(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},iI=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function aI({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function sI(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cI(e){return e===void 0||e===1}function lI({scale:e,scaleX:t,scaleY:n}){return!cI(e)||!cI(t)||!cI(n)}function uI(e){return lI(e)||dI(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function dI(e){return fI(e.x)||fI(e.y)}function fI(e){return e&&e!==`0%`}function pI(e,t,n){return n+t*(e-n)}function mI(e,t,n,r,i){return i!==void 0&&(e=pI(e,i,r)),pI(e,n,r)+t}function hI(e,t=0,n=1,r,i){e.min=mI(e.min,t,n,r,i),e.max=mI(e.max,t,n,r,i)}function gI(e,{x:t,y:n}){hI(e.x,t.translate,t.scale,t.originPoint),hI(e.y,n.translate,n.scale,n.originPoint)}var _I=.999999999999,vI=1.0000000000001;function Gae(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(yI(e.x,-a.scroll.offset.x),yI(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,gI(e,o)),r&&uI(a.latestValues)&&SI(e,a.latestValues,a.layout?.layoutBox))}t.x<vI&&t.x>_I&&(t.x=1),t.y<vI&&t.y>_I&&(t.y=1)}function yI(e,t){e.min+=t,e.max+=t}function bI(e,t,n,r,i=.5){hI(e,t,n,Kj(e.min,e.max,i),r)}function xI(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function SI(e,t,n){let r=n??e;bI(e.x,xI(t.x,r.x),t.scaleX,t.scale,t.originX),bI(e.y,xI(t.y,r.y),t.scaleY,t.scale,t.originY)}function CI(e,t){return aI(sI(e.getBoundingClientRect(),t))}function Kae(e,t,n){let r=CI(e,n),{scroll:i}=t;return i&&(yI(r.x,i.offset.x),yI(r.y,i.offset.y)),r}var qae={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Jae=$M.length;function Yae(e,t,n){let r=``,i=!0;for(let a=0;a<Jae;a++){let o=$M[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=YP(s,zP[o]);if(!c){i=!1;let t=qae[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${YP(a,zP.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function wI(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(eN.has(e)){o=!0;continue}if(rj(e)){i[e]=n;continue}{let t=YP(n,zP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Yae(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function TI(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function EI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var DI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(xj.test(e))e=parseFloat(e);else return e}return`${EI(e,t.target.x)}% ${EI(e,t.target.y)}%`}},Xae={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Hj.parse(e);if(i.length>5)return r;let a=Hj.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Kj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},OI={borderRadius:{...DI,applyTo:[...qP]},borderTopLeftRadius:DI,borderTopRightRadius:DI,borderBottomLeftRadius:DI,borderBottomRightRadius:DI,boxShadow:Xae};function kI(e,{layout:t,layoutId:n}){return eN.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!OI[e]||e===`opacity`)}function AI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(_P(r[t])||i&&_P(i[t])||kI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Zae(e){return window.getComputedStyle(e)}var Qae=class extends rI{constructor(){super(...arguments),this.type=`html`,this.renderInstance=TI}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(eN.has(t))return this.projection?.isProjecting?YM(t):ZM(e,t);{let n=Zae(e),r=(rj(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return CI(e,t)}build(e,t,n){wI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return AI(e,t,n)}},$ae={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eoe={offset:`strokeDashoffset`,array:`strokeDasharray`};function toe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$ae:eoe;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var noe=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function jI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(wI(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of noe)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&toe(d,i,a,o,!1)}var MI=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),NI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function roe(e,t,n,r){TI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(MI.has(n)?n:bP(n),t.attrs[n])}function PI(e,t,n){let r=AI(e,t,n);for(let n in e)if(_P(e[n])||_P(t[n])){let t=$M.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ioe=class extends rI{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=zF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(eN.has(t)){let e=VP(t);return e&&e.default||0}return t=MI.has(t)?t:bP(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return PI(e,t,n)}build(e,t,n){jI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){roe(e,t,n,r)}mount(e){this.isSVGTag=NI(e.tagName),super.mount(e)}},aoe=WF.length;function FI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&FI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<aoe;n++){let r=WF[n],i=e.props[r];(HF(i)||i===!1)&&(t[r]=i)}return t}function II(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ooe=[...UF].reverse(),soe=UF.length;function coe(e){return t=>Promise.all(t.map(({animation:t,options:n})=>DP(e,t,n)))}function loe(e){let t=coe(e),n=RI(),r=!0,i=!1,a=t=>(n,r)=>{let i=dP(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=FI(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<soe;t++){let p=ooe[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=HF(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||VF(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=uoe(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=pP(t)&&pP(n)?!II(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=dP(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=WN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=dP(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=RI(),i=!0}}}function uoe(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!II(t,e):!1}function LI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function RI(){return{animate:LI(!0),whileInView:LI(),whileHover:LI(),whileTap:LI(),whileDrag:LI(),whileFocus:LI(),exit:LI()}}function zI(e,t){e.min=t.min,e.max=t.max}function BI(e,t){zI(e.x,t.x),zI(e.y,t.y)}function VI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var doe=.9999,foe=1.0001,poe=-.01,moe=.01;function HI(e){return e.max-e.min}function hoe(e,t,n){return Math.abs(e-t)<=n}function UI(e,t,n,r=.5){e.origin=r,e.originPoint=Kj(t.min,t.max,e.origin),e.scale=HI(n)/HI(t),e.translate=Kj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=doe&&e.scale<=foe||isNaN(e.scale))&&(e.scale=1),(e.translate>=poe&&e.translate<=moe||isNaN(e.translate))&&(e.translate=0)}function WI(e,t,n,r){UI(e.x,t.x,n.x,r?r.originX:void 0),UI(e.y,t.y,n.y,r?r.originY:void 0)}function GI(e,t,n,r=0){e.min=(r?Kj(n.min,n.max,r):n.min)+t.min,e.max=e.min+HI(t)}function goe(e,t,n,r){GI(e.x,t.x,n.x,r?.x),GI(e.y,t.y,n.y,r?.y)}function KI(e,t,n,r=0){let i=r?Kj(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+HI(t)}function qI(e,t,n,r){KI(e.x,t.x,n.x,r?.x),KI(e.y,t.y,n.y,r?.y)}function JI(e,t,n,r,i){return e-=t,e=pI(e,1/n,r),i!==void 0&&(e=pI(e,1/i,r)),e}function _oe(e,t=0,n=1,r=.5,i,a=e,o=e){if(bj.test(t)&&(t=parseFloat(t),t=Kj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Kj(a.min,a.max,r);e===a&&(s-=t),e.min=JI(e.min,t,n,s,i),e.max=JI(e.max,t,n,s,i)}function YI(e,t,[n,r,i],a,o){_oe(e,t[n],t[r],t[i],t.scale,a,o)}var voe=[`x`,`scaleX`,`originX`],yoe=[`y`,`scaleY`,`originY`];function XI(e,t,n,r){YI(e.x,t,voe,n?n.x:void 0,r?r.x:void 0),YI(e.y,t,yoe,n?n.y:void 0,r?r.y:void 0)}function ZI(e){return e.translate===0&&e.scale===1}function QI(e){return ZI(e.x)&&ZI(e.y)}function $I(e,t){return e.min===t.min&&e.max===t.max}function boe(e,t){return $I(e.x,t.x)&&$I(e.y,t.y)}function eL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function tL(e,t){return eL(e.x,t.x)&&eL(e.y,t.y)}function nL(e){return HI(e.x)/HI(e.y)}function rL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function iL(e){return[e(`x`),e(`y`)]}function xoe(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Soe=qP.length,aL=e=>typeof e==`string`?parseFloat(e):e,oL=e=>typeof e==`number`||xj.test(e);function Coe(e,t,n,r,i,a){i?(e.opacity=Kj(0,n.opacity??1,woe(r)),e.opacityExit=Kj(t.opacity??1,0,Toe(r))):a&&(e.opacity=Kj(t.opacity??1,n.opacity??1,r));for(let i=0;i<Soe;i++){let a=qP[i],o=sL(t,a),s=sL(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||oL(o)===oL(s)?(e[a]=Math.max(Kj(aL(o),aL(s),r),0),(bj.test(s)||bj.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Kj(t.rotate||0,n.rotate||0,r))}function sL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var woe=cL(0,.5,HA),Toe=cL(.5,.95,EA);function cL(e,t,n){return r=>r<e?0:r>t?1:n(OA(e,t,r))}function Eoe(e,t,n){let r=_P(e)?e:YN(e);return r.start(aP(``,r,t,n)),r.animation}function lL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Doe=(e,t)=>e.depth-t.depth,Ooe=class{constructor(){this.children=[],this.isDirty=!1}add(e){vA(this.children,e),this.isDirty=!0}remove(e){yA(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Doe),this.isDirty=!1,this.children.forEach(e)}};function koe(e,t){let n=tj.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(ZA(r),e(a-t))};return XA.setup(r,!0),()=>ZA(r)}function uL(e){return _P(e)?e.get():e}var Aoe=class{constructor(){this.members=[]}add(e){vA(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(yA(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(yA(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},dL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},fL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},pL=[``,`X`,`Y`,`Z`],joe=1e3,Moe=0;function mL(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=SP(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,XA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hL(r)}function gL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Moe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,MF.value&&(fL.nodes=fL.calculatedTargetDeltas=fL.calculatedProjections=0),this.nodes.forEach(Foe),this.nodes.forEach(Voe),this.nodes.forEach(Hoe),this.nodes.forEach(Ioe),MF.addProjectionMetrics&&MF.addProjectionMetrics(fL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ooe)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new kA),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=_F(t)&&!NF(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;XA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=koe(i,250),dL.hasAnimatedSinceResize&&(dL.hasAnimatedSinceResize=!1,this.nodes.forEach(yL)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||qoe,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!tL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ZN(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||yL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ZA(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Uoe),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Roe),this.nodes.forEach(_L);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(vL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(zoe),this.nodes.forEach(Boe),this.nodes.forEach(Noe),this.nodes.forEach(Poe)):this.nodes.forEach(vL),this.clearAllSnapshots();let e=tj.now();QA.delta=bA(0,1e3/60,e-QA.timestamp),QA.timestamp=e,QA.isProcessing=!0,$A.update.process(QA),$A.preRender.process(QA),$A.render.process(QA),QA.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ZP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Loe),this.sharedNodes.forEach(Woe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,XA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){XA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!HI(this.snapshot.measuredBox.x)&&!HI(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=zF(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!QI(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||uI(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Joe(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return zF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Yoe))){let{scroll:e}=this.root;e&&(yI(t.x,e.offset.x),yI(t.y,e.offset.y))}return t}removeElementScroll(e){let t=zF();if(BI(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&BI(t,e),yI(t.x,i.offset.x),yI(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||zF();BI(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(yI(r.x,-n.scroll.offset.x),yI(r.y,-n.scroll.offset.y)),uI(n.latestValues)&&SI(r,n.latestValues,n.layout?.layoutBox)}return uI(this.latestValues)&&SI(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=zF();BI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!uI(n.latestValues))continue;let r;n.instance&&(lI(n.latestValues)&&n.updateSnapshot(),r=zF(),BI(r,n.measurePageBox())),XI(t,n.latestValues,n.snapshot?.layoutBox,r)}return uI(this.latestValues)&&XI(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==QA.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=QA.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=zF(),this.targetWithTransforms=zF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),goe(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):BI(this.target,this.layout.layoutBox),gI(this.target,this.targetDelta)):BI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),MF.value&&fL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||lI(this.parent.latestValues)||dI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=zF(),this.relativeTargetOrigin=zF(),qI(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),BI(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===QA.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;BI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Gae(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=zF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(VI(this.prevProjectionDelta.x,this.projectionDelta.x),VI(this.prevProjectionDelta.y,this.projectionDelta.y)),WI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!rL(this.projectionDelta.x,this.prevProjectionDelta.x)||!rL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),MF.value&&fL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=LF(),this.projectionDelta=LF(),this.projectionDeltaWithTransform=LF()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=LF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=zF(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(Koe));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Kj(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Kj(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(bL(o.x,e.x,n),bL(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qI(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Goe(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&boe(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=zF(),BI(f,this.relativeTarget)),c&&(this.animationValues=a,Coe(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(ZA(this.pendingAnimation),void 0),this.pendingAnimation=XA.update(()=>{dL.hasAnimatedSinceResize=!0,this.motionValue||=YN(0),this.motionValue.jump(0,!1),this.currentAnimation=Eoe(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(joe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&TL(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||zF();let t=HI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=HI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}BI(t,n),SI(t,i),WI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Aoe),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&mL(`z`,e,r,this.animationValues);for(let t=0;t<pL.length;t++)mL(`rotate${pL[t]}`,e,r,this.animationValues),mL(`skew${pL[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=uL(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=uL(t?.pointerEvents)||``),this.hasProjected&&!uI(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=xoe(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in OI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=OI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?uL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(_L),this.root.sharedNodes.clear()}}}function Noe(e){e.updateLayout()}function Poe(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)iL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=HI(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;zI(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else TL(i,t.layoutBox,n)&&iL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=HI(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=LF();WI(o,n,t.layoutBox);let s=LF();a?WI(s,e.applyTransform(r,!0),t.measuredBox):WI(s,n,t.layoutBox);let c=!QI(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=zF();qI(s,t.layoutBox,i.layoutBox,o);let c=zF();qI(c,n,a.layoutBox,o),tL(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Foe(e){MF.value&&fL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ioe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Loe(e){e.clearSnapshot()}function _L(e){e.clearMeasurements()}function Roe(e){e.isLayoutDirty=!0,e.updateLayout()}function vL(e){e.isLayoutDirty=!1}function zoe(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Boe(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function yL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Voe(e){e.resolveTargetDelta()}function Hoe(e){e.calcProjection()}function Uoe(e){e.resetSkewAndRotation()}function Woe(e){e.removeLeadSnapshot()}function bL(e,t,n){e.translate=Kj(t.translate,0,n),e.scale=Kj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xL(e,t,n,r){e.min=Kj(t.min,n.min,r),e.max=Kj(t.max,n.max,r)}function Goe(e,t,n,r){xL(e.x,t.x,n.x,r),xL(e.y,t.y,n.y,r)}function Koe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var qoe={duration:.45,ease:[.4,0,.1,1]},SL=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),CL=SL(`applewebkit/`)&&!SL(`chrome/`)?Math.round:EA;function wL(e){e.min=CL(e.min),e.max=CL(e.max)}function Joe(e){wL(e.x),wL(e.y)}function TL(e,t,n){return e===`position`||e===`preserve-aspect`&&!hoe(nL(t),nL(n),.2)}function Yoe(e){return e!==e.root&&e.scroll?.wasRoot}var Xoe=gL({attachResizeListener:(e,t)=>lL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Zoe=e=>!e.isLayoutDirty&&e.willUpdate(!1);function Qoe(){let e=new Set,t=new WeakMap,n=()=>e.forEach(Zoe);return{add:r=>{e.add(r),t.set(r,r.addEventListener(`willUpdate`,n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}var EL={current:void 0},DL=gL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!EL.current){let e=new Xoe({});e.mount(window),e.setOptions({layoutScroll:!0}),EL.current=e}return EL.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),OL=(0,J.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function kL(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function $oe(...e){return t=>{let n=!1,r=e.map(e=>{let r=kL(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():kL(e[t],null)}}}}function ese(...e){return J.useCallback($oe(...e),e)}var tse=class extends J.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(XP(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=XP(e)&&e.offsetWidth||0,r=XP(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function nse({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,J.useId)(),s=(0,J.useRef)(null),c=(0,J.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,J.useContext)(OL),u=ese(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,J.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
42
|
+
[data-motion-pop-id="${o}"] {
|
|
43
|
+
position: absolute !important;
|
|
44
|
+
width: ${e}px !important;
|
|
45
|
+
height: ${u}px !important;
|
|
46
|
+
${_}px !important;
|
|
47
|
+
${v}px !important;
|
|
48
|
+
}
|
|
49
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,Y.jsx)(tse,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:J.cloneElement(e,{ref:u})})}var rse=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=hA(ise),d=(0,J.useId)(),f=(0,J.useRef)(n),p=(0,J.useRef)(r);gA(()=>{f.current=n,p.current=r});let m=!0,h=(0,J.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,J.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),J.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,Y.jsx)(nse,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,Y.jsx)(_A.Provider,{value:h,children:e})};function ise(){return new Map}function AL(e=!0){let t=(0,J.useContext)(_A);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,J.useId)();(0,J.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,J.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var jL=e=>e.key||``;function ML(e){let t=[];return J.Children.forEach(e,e=>{(0,J.isValidElement)(e)&&t.push(e)}),t}var ase=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=AL(o),f=(0,J.useMemo)(()=>ML(e),[e]),p=o&&!u?[]:f.map(jL),m=(0,J.useRef)(!0),h=(0,J.useRef)(f),g=hA(()=>new Map),_=(0,J.useRef)(new Set),[v,y]=(0,J.useState)(f),[b,x]=(0,J.useState)(f);gA(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=jL(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=jL(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(ML(e)),y(f),null}let{forceRender:C}=(0,J.useContext)(mA);return(0,Y.jsx)(Y.Fragment,{children:b.map(e=>{let v=jL(e),y=o&&!u?!1:f===b||p.includes(v);return(0,Y.jsx)(rse,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},ose=(0,J.createContext)(null);function sse(){let e=(0,J.useRef)(!1);return gA(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function cse(){let e=sse(),[t,n]=(0,J.useState)(0),r=(0,J.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,J.useCallback)(()=>XA.postRender(r),[r]),t]}var NL=e=>e===!0,lse=e=>NL(e===!0)||e===`id`,PL=({children:e,id:t,inherit:n=!0})=>{let r=(0,J.useContext)(mA),i=(0,J.useContext)(ose),[a,o]=cse(),s=(0,J.useRef)(null),c=r.id||i;s.current===null&&(lse(n)&&c&&(t=t?c+`-`+t:c),s.current={id:t,group:NL(n)&&r.group||Qoe()});let l=(0,J.useMemo)(()=>({...s.current,forceRender:a}),[o]);return(0,Y.jsx)(mA.Provider,{value:l,children:e})},FL=(0,J.createContext)({strict:!1}),IL={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},LL=!1;function use(){if(LL)return;let e={};for(let t in IL)e[t]={isEnabled:e=>IL[t].some(t=>!!e[t])};eI(e),LL=!0}function RL(){return use(),tI()}function dse(e){let t=RL();for(let n in e)t[n]={...t[n],...e[n]};eI(t)}var fse=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function zL(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||fse.has(e)}var pse=c({default:()=>BL}),BL,mse=o((()=>{throw BL={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),VL=e=>!zL(e);function hse(e){typeof e==`function`&&(VL=t=>t.startsWith(`on`)?!zL(t):e(t))}try{hse((mse(),d(pse)).default)}catch{}function gse(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(_P(e[i])||(VL(i)||n===!0&&zL(i)||!t&&!zL(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var HL=(0,J.createContext)({});function _se(e,t){if(GF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||HF(t)?t:void 0,animate:HF(n)?n:void 0}}return e.inherit===!1?{}:t}function vse(e){let{initial:t,animate:n}=_se(e,(0,J.useContext)(HL));return(0,J.useMemo)(()=>({initial:t,animate:n}),[UL(t),UL(n)])}function UL(e){return Array.isArray(e)?e.join(` `):e}var WL=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function GL(e,t,n){for(let r in t)!_P(t[r])&&!kI(r,n)&&(e[r]=t[r])}function yse({transformTemplate:e},t){return(0,J.useMemo)(()=>{let n=WL();return wI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function bse(e,t){let n=e.style||{},r={};return GL(r,n,e),Object.assign(r,yse(e,t)),r}function xse(e,t){let n={},r=bse(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var KL=()=>({...WL(),attrs:{}});function Sse(e,t,n,r){let i=(0,J.useMemo)(()=>{let n=KL();return jI(n,t,NI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};GL(t,e.style,e),i.style={...t,...i.style}}return i}var Cse=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function qL(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Cse.indexOf(e)>-1||/[A-Z]/u.test(e))}function wse(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??qL(e)?Sse:xse)(t,r,i,e),c=gse(t,typeof e==`string`,a),l=e===J.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,J.useMemo)(()=>_P(u)?u.get():u,[u]);return(0,J.createElement)(e,{...l,children:d})}function Tse({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ese(n,r,i,e),renderState:t()}}function Ese(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=uL(a[e]);let{initial:o,animate:s}=e,c=GF(e),l=KF(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!VF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=uP(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JL=e=>(t,n)=>{let r=(0,J.useContext)(HL),i=(0,J.useContext)(_A),a=()=>Tse(e,t,r,i);return n?a():hA(a)},Dse=JL({scrapeMotionValuesFromProps:AI,createRenderState:WL}),Ose=JL({scrapeMotionValuesFromProps:PI,createRenderState:KL}),kse=Symbol.for(`motionComponentSymbol`);function Ase(e,t,n){let r=(0,J.useRef)(n);(0,J.useInsertionEffect)(()=>{r.current=n});let i=(0,J.useRef)(null);return(0,J.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var YL=(0,J.createContext)({});function XL(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function jse(e,t,n,r,i,a){let{visualElement:o}=(0,J.useContext)(HL),s=(0,J.useContext)(FL),c=(0,J.useContext)(_A),l=(0,J.useContext)(OL),u=l.reducedMotion,d=l.skipAnimations,f=(0,J.useRef)(null),p=(0,J.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,J.useContext)(YL);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&Mse(f.current,n,i,h);let g=(0,J.useRef)(!1);(0,J.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[xP],v=(0,J.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return gA(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,J.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function Mse(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ZL(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&XL(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ZL(e){if(e)return e.options.allowProjection===!1?ZL(e.parent):e.projection}function QL(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&dse(r);let a=n?n===`svg`:qL(e),o=a?Ose:Dse;function s(n,s){let c,l={...(0,J.useContext)(OL),...n,layoutId:Nse(n)},{isStatic:u}=l,d=vse(n),f=o(n,u);if(!u&&typeof window<`u`){Pse(l,r);let t=Fse(l);c=t.MeasureLayout,d.visualElement=jse(e,f,l,i,t.ProjectionNode,a)}return(0,Y.jsxs)(HL.Provider,{value:d,children:[c&&d.visualElement?(0,Y.jsx)(c,{visualElement:d.visualElement,...l}):null,wse(e,n,Ase(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,J.forwardRef)(s);return c[kse]=e,c}function Nse({layoutId:e}){let t=(0,J.useContext)(mA).id;return t&&e!==void 0?t+`-`+e:e}function Pse(e,t){(0,J.useContext)(FL).strict}function Fse(e){let{drag:t,layout:n}=RL();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Ise(e,t){if(typeof Proxy>`u`)return QL;let n=new Map,r=(n,r)=>QL(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,QL(a,void 0,e,t)),n.get(a))})}var Lse=(e,t)=>t.isSVG??qL(e)?new ioe(t):new Qae(t,{allowProjection:e!==J.Fragment}),Rse=class extends iI{constructor(e){super(e),e.animationState||=loe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();VF(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},zse=0,Bse={animation:{Feature:Rse},exit:{Feature:class extends iI{constructor(){super(...arguments),this.id=zse++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=dP(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function $L(e){return{point:{x:e.pageX,y:e.pageY}}}var Vse=e=>t=>aF(t)&&e(t,$L(t));function eR(e,t,n,r){return lL(e,t,Vse(n),r)}var tR=({current:e})=>e?e.ownerDocument.defaultView:null,nR=(e,t)=>Math.abs(e-t);function Hse(e,t){let n=nR(e.x,t.x),r=nR(e.y,t.y);return Math.sqrt(n**2+r**2)}var rR=new Set([`auto`,`scroll`]),iR=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=aR(this.lastRawMoveEventInfo,this.transformPagePoint));let e=sR(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Hse(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=QA;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=aR(t,this.transformPagePoint),XA.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=sR(e.type===`pointercancel`?this.lastMoveEventInfo:aR(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!aF(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=aR($L(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=QA;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,sR(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=DA(eR(this.contextWindow,`pointermove`,this.handlePointerMove,d),eR(this.contextWindow,`pointerup`,this.handlePointerUp,d),eR(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(rR.has(e.overflowX)||rR.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),XA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ZA(this.updatePoint)}};function aR(e,t){return t?{point:t(e.point)}:e}function oR(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sR({point:e},t){return{point:e,delta:oR(e,cR(t)),offset:oR(e,Use(t)),velocity:Wse(t,.1)}}function Use(e){return e[0]}function cR(e){return e[e.length-1]}function Wse(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=cR(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>AA(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>AA(t)*2&&(r=e[1]);let a=jA(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Gse(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Kj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Kj(n,e,r.max):Math.min(e,n)),e}function lR(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Kse(e,{top:t,left:n,bottom:r,right:i}){return{x:lR(e.x,n,i),y:lR(e.y,t,r)}}function uR(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function qse(e,t){return{x:uR(e.x,t.x),y:uR(e.y,t.y)}}function Jse(e,t){let n=.5,r=HI(e),i=HI(t);return i>r?n=OA(t.min,t.max-r,e.min):r>i&&(n=OA(e.min,e.max-i,t.min)),bA(0,1,n)}function Yse(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var dR=.35;function Xse(e=dR){return e===!1?e=0:e===!0&&(e=dR),{x:fR(e,`left`,`right`),y:fR(e,`top`,`bottom`)}}function fR(e,t,n){return{min:pR(e,t),max:pR(e,n)}}function pR(e,t){return typeof e==`number`?e:e[t]||0}var Zse=new WeakMap,Qse=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zF(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor($L(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=eF(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),iL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(bj.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=HI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&XA.update(()=>i(e,t),!1,!0),yP(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=ece(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&XA.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new iR(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:tR(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&XA.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!hR(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Gse(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&XL(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Kse(n.layoutBox,e):!1,this.elastic=Xse(t),r!==this.constraints&&!XL(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&iL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Yse(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!XL(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Kae(n,r.root,this.visualElement.getTransformPagePoint()),a=qse(r.layout.layoutBox,i);if(t){let e=t(oI(a));this.hasMutatedConstraints=!!e,e&&(a=aI(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=iL(o=>{if(!hR(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return yP(this.visualElement,e),n.start(aP(e,n,0,t,this.visualElement,!1))}stopAnimation(){iL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){iL(t=>{let{drag:n}=this.getProps();if(!hR(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Kj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!XL(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};iL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Jse({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),iL(t=>{if(!hR(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Kj(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Zse.set(this.visualElement,this);let e=this.visualElement.current,t=eR(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&lF(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();XL(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=$se(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),XA.read(r);let o=lL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(iL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=dR,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function mR(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function $se(e,t,n){let r=jF(e,mR(n)),i=jF(t,mR(n));return()=>{r(),i()}}function hR(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ece(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var tce=class extends iI{constructor(e){super(e),this.removeGroupControls=EA,this.removeListeners=EA,this.controls=new Qse(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||EA}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},gR=e=>(t,n)=>{e&&XA.update(()=>e(t,n),!1,!0)},nce=class extends iI{constructor(){super(...arguments),this.removePointerDownListener=EA}onPointerDown(e){this.session=new iR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tR(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:gR(e),onStart:gR(t),onMove:gR(n),onEnd:(e,t)=>{delete this.session,r&&XA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=eR(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_R=!1,rce=class extends J.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_R&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),dL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_R=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||XA.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),ZP.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_R=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function vR(e){let[t,n]=AL(),r=(0,J.useContext)(mA);return(0,Y.jsx)(rce,{...e,layoutGroup:r,switchLayoutGroup:(0,J.useContext)(YL),isPresent:t,safeToRemove:n})}var ice={pan:{Feature:nce},drag:{Feature:tce,ProjectionNode:DL,MeasureLayout:vR}};function yR(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&XA.postRender(()=>i(t,$L(t)))}var ace=class extends iI{mount(){let{current:e}=this.node;e&&(this.unmount=rF(e,(e,t)=>(yR(this.node,t,`Start`),e=>yR(this.node,e,`End`))))}unmount(){}},oce=class extends iI{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=DA(lL(this.node.current,`focus`,()=>this.onFocus()),lL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function bR(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&XA.postRender(()=>i(t,$L(t)))}var sce=class extends iI{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=gF(e,(e,t)=>(bR(this.node,t,`Start`),(e,{success:t})=>bR(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},xR=new WeakMap,SR=new WeakMap,cce=e=>{let t=xR.get(e.target);t&&t(e)},lce=e=>{e.forEach(cce)};function uce({root:e,...t}){let n=e||document;SR.has(n)||SR.set(n,{});let r=SR.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(lce,{root:e,...t})),r[i]}function dce(e,t,n){let r=uce(t);return xR.set(e,n),r.observe(e),()=>{xR.delete(e),r.unobserve(e)}}var fce={some:0,all:1},pce=class extends iI{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:fce[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=dce(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(mce(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function mce({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var hce={inView:{Feature:pce},tap:{Feature:sce},focus:{Feature:oce},hover:{Feature:ace}},gce={layout:{ProjectionNode:DL,MeasureLayout:vR}},_ce=Ise({...Bse,...hce,...ice,...gce},Lse);function CR(){!YF.current&&ZF();let[e]=(0,J.useState)(JF.current);return e}var wR=_ce,TR=J.createContext(void 0);function ER(e){let t=J.useContext(TR);if(!e&&t===void 0)throw Error(Rg(27));return t}var DR=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),vce={"data-starting-style":``},yce={"data-ending-style":``},OR={transitionStatus(e){return e===`starting`?vce:e===`ending`?yce:null}},kR=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=DR.startingStyle]=`startingStyle`,e[e.endingStyle=DR.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),bce={"data-popup-open":``},xce={"data-popup-open":``,"data-pressed":``},Sce={"data-open":``},Cce={"data-closed":``},wce={"data-anchor-hidden":``},AR={open(e){return e?bce:null}},jR={open(e){return e?xce:null}},MR={open(e){return e?Sce:Cce},anchorHidden(e){return e?wce:null}},NR={...MR,...OR},PR=function(e){return e.nestedDrawers=`--nested-drawers`,e.height=`--drawer-height`,e.frontmostHeight=`--drawer-frontmost-height`,e.swipeMovementX=`--drawer-swipe-movement-x`,e.swipeMovementY=`--drawer-swipe-movement-y`,e.snapPointOffset=`--drawer-snap-point-offset`,e.swipeStrength=`--drawer-swipe-strength`,e}({}),FR=function(e){return e.swipeProgress=`--drawer-swipe-progress`,e}({}),Tce=J.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=ER(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return e_(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:NR,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[FR.swipeProgress]:`0`,[PR.swipeStrength]:`1`}},o],enabled:a||!l})}),IR=`none`,LR=`trigger-press`,RR=`trigger-hover`,zR=`trigger-focus`,Ece=`outside-press`,BR=`item-press`,VR=`close-press`,HR=`clear-press`,UR=`input-change`,WR=`input-clear`,GR=`input-press`,KR=`focus-out`,qR=`escape-key`,Dce=`close-watcher`,JR=`list-navigation`,YR=`keyboard`,XR=`pointer`,ZR=`cancel-open`,QR=`sibling-open`,Oce=`disabled`,$R=`imperative-action`,ez=`swipe`,kce=`window-resize`;function tz(e,t,n,r){let i=!1,a=!1,o=r??Qg;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Ace(e,t,n){let r=n??Qg;return{reason:e,event:t??new Event(`base-ui`),...r}}var nz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=ER(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ug({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,tz(VR,e.nativeEvent))}return e_(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),jce=`data-drawer-content`,rz=0;function Mce(e,t=`mui`){let[n,r]=J.useState(e),i=e||n;return J.useEffect(()=>{n??(rz+=1,r(`${t}-${rz}`))},[n,t]),i}var iz=xg.useId;function az(e,t){if(iz!==void 0){let n=iz();return e??(t?`${t}-${n}`:n)}return Mce(e,t)}function oz(e){return az(e,`base-ui`)}var sz=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ER(),c=oz(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),e_(`p`,e,{ref:t,props:[{id:c},o]})}),Nce=J.createContext(void 0);function cz(){return J.useContext(Nce)}function lz(e){J.useEffect(e,Zg)}var uz=0,dz=class e{static create(){return new e}currentId=uz;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=uz,t()},e)}isStarted(){return this.currentId!==uz}clear=()=>{this.currentId!==uz&&(clearTimeout(this.currentId),this.currentId=uz)};disposeEffect=()=>this.clear};function fz(){let e=Cg(dz.create).current;return lz(e.disposeEffect),e}function Pce(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Fce,platform:Ice,maxTouchPoints:Lce}=Pce(),pz=Fce.toLowerCase(),mz=Ice.toLowerCase(),hz=/^i(os$|p)/.test(mz)||mz===`macintel`&&Lce>1,gz=`android`,_z=mz===gz||pz.includes(gz),vz=!hz&&mz.startsWith(`mac`);mz.startsWith(`win`),!_z&&/^(linux|chrome os)/.test(mz);var Rce=vz||hz,yz=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),bz=!yz&&pz.includes(`firefox`);!yz&&pz.includes(`chrom`);var xz=Rce,Sz=/jsdom|happydom/.test(pz);function Cz(e){e.preventDefault(),e.stopPropagation()}function zce(e){return`nativeEvent`in e}function wz(e){return e.pointerType===``&&e.isTrusted?!0:_z&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Tz(e){return Sz?!1:!_z&&e.width===0&&e.height===0||_z&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ez(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Bce(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Vce=`data-base-ui-focusable`,Hce=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Dz=`ArrowLeft`,Oz=`ArrowRight`,Uce=`ArrowUp`,Wce=`ArrowDown`;function kz(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Az(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&og(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function jz(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Mz(e,t){if(!ig(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Az(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Nz(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Gce(e){return e.matches(`html,body`)}function Pz(e){return ag(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Fz(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Hce}`)!=null}function Iz(e){return e?e.getAttribute(`role`)===`combobox`&&Pz(e):!1}function Kce(e){if(!e||Sz)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Lz(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Rz(e,t){return t!=null&&!Ez(t)?0:typeof e==`function`?e():e}function zz(e,t,n){let r=Rz(e,n);return typeof r==`number`?r:r?.[t]}function Bz(e){return typeof e==`function`?e():e}function Vz(e,t){return t||e===`click`||e===`mousedown`}function Hz(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Uz=J.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new dz,currentIdRef:{current:null},currentContextRef:{current:null}});function Wz(e,t){e.current=t.current}function Gz(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=J.useRef(n),a=J.useRef(n),o=J.useRef(null),s=J.useRef(null),c=fz();return Tg(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:zz(i.current,`open`),close:zz(n,`close`)}},[n,o,i,a]),(0,Y.jsx)(Uz.Provider,{value:J.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Kz(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=J.useContext(Uz),[f,p]=J.useState(!1),m=J.useRef(n);return Tg(()=>{m.current=n},[n]),Tg(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Tg(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:zz(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,tz(IR))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Tg(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,Wz(o,c),d.clear()}},[l,a,o,i,c,d]),J.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function qz(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Jz(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Yz(e){let t=Cg(Xz,e).current;return t.next=e,Tg(t.effect),t}function Xz(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Zz=null;globalThis.requestAnimationFrame;var Qz=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},$z=class e{static create(){return new e}static request(e){return Qz.request(e)}static cancel(e){return Qz.cancel(e)}currentId=Zz;request(e){this.cancel(),this.currentId=Qz.request(()=>{this.currentId=Zz,e()})}cancel=()=>{this.currentId!==Zz&&(Qz.cancel(this.currentId),this.currentId=Zz)};disposeEffect=()=>this.cancel};function eB(){let e=Cg($z.create).current;return lz(e.disposeEffect),e}var tB={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},nB={...tB,position:`fixed`,top:0,left:0},rB={...tB,position:`absolute`},iB=J.forwardRef(function(e,t){let[n,r]=J.useState();Tg(()=>{xz&&yz&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:nB,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),aB=Math.min,oB=Math.max,sB=Math.round,cB=Math.floor,lB=e=>({x:e,y:e}),uB={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function dB(e,t,n){return oB(e,aB(t,n))}function fB(e,t){return typeof e==`function`?e(t):e}function pB(e){return e.split(`-`)[0]}function mB(e){return e.split(`-`)[1]}function hB(e){return e===`x`?`y`:`x`}function gB(e){return e===`y`?`height`:`width`}function _B(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function vB(e){return hB(_B(e))}function yB(e,t,n){n===void 0&&(n=!1);let r=mB(e),i=vB(e),a=gB(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=OB(o)),[o,OB(o)]}function bB(e){let t=OB(e);return[xB(e),t,xB(t)]}function xB(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var SB=[`left`,`right`],CB=[`right`,`left`],wB=[`top`,`bottom`],TB=[`bottom`,`top`];function EB(e,t,n){switch(e){case`top`:case`bottom`:return n?t?CB:SB:t?SB:CB;case`left`:case`right`:return t?wB:TB;default:return[]}}function DB(e,t,n,r){let i=mB(e),a=EB(pB(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(xB)))),a}function OB(e){let t=pB(e);return uB[t]+e.slice(t.length)}function kB(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function AB(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:kB(e)}function jB(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function MB(e,t,n){return Math.floor(e/t)!==n}function NB(e,t){return t<0||t>=e.length}function PB(e,t){return IB(e.current,{disabledIndices:t})}function FB(e,t){return IB(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function IB(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&RB(e,a,r));return a}function LB(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!RB(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=cB(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!RB(e,r,s))return r}};d&&Cz(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=IB(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=IB(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}NB(e,f)&&(f=u)}if(n===`both`){let n=cB(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Cz(t),u%o===o-1?r&&(f=IB(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=IB(e,{startingIndex:u,disabledIndices:s}),r&&MB(f,o,n)&&(f=IB(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),MB(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Cz(t),u%o===0?r&&(f=IB(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=IB(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&MB(f,o,n)&&(f=IB(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),MB(f,o,n)&&(f=u));let c=cB(l/o)===n;NB(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:IB(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function RB(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!BB(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function zB(e){return e.visibility===`hidden`||e.visibility===`collapse`}function BB(e,t=e?hg(e):null){return!e||!e.isConnected||!t||zB(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var VB=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function HB(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return og(n)?n.host:null}function UB(e){for(let t of Array.from(e.children))if(eg(t)===`summary`)return t;return null}function WB(e,t){let n=UB(t);return!!n&&(e===n||Az(n,e))}function GB(e){let t=e?eg(e):``;return e!=null&&e.matches(VB)&&(t!==`summary`||e.parentElement!=null&&eg(e.parentElement)===`details`&&UB(e.parentElement)===e)&&(t!==`details`||UB(e)==null)&&(t!==`input`||e.type!==`hidden`)}function KB(e){if(!GB(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=HB(t)){let n=t!==e,r=eg(t)===`slot`;if(t.hasAttribute(`inert`)||n&&eg(t)===`details`&&!t.open&&!WB(e,t)||t.hasAttribute(`hidden`)||!r&&!qB(t,n))return!1}return!0}function qB(e,t){let n=hg(e);return t?n.display!==`none`:BB(e,n)}function JB(e){let t=e.tabIndex;if(t<0){let t=eg(e);if(t===`details`||t===`audio`||t===`video`||ag(e)&&e.isContentEditable)return 0}return t}function YB(e){if(eg(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function XB(e,t){let n=YB(e);if(!n)return!0;let r=t.find(e=>{let t=YB(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=YB(e);return t?.name===n.name&&t.form===n.form})===n}function ZB(e){if(ag(e)&&eg(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return ag(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function QB(e,t){ZB(e).forEach(e=>{GB(e)&&t.push(e),QB(e,t)})}function $B(e,t,n){ZB(e).forEach(e=>{ag(e)&&e.matches(t)&&n.push(e),$B(e,t,n)})}function eV(e){return KB(e)&&JB(e)>=0}function tV(e){let t=[];return QB(e,t),t.filter(KB)}function nV(e){let t=tV(e);return t.filter(e=>JB(e)>=0&&XB(e,t))}function rV(e,t){let n=nV(e),r=n.length;if(r===0)return;let i=kz(Vg(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function iV(e){return rV(Vg(e).body,1)||e}function aV(e){return rV(Vg(e).body,-1)||e}function oV(e,t){if(!e)return null;let n=nV(Vg(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function sV(e){return oV(e,1)}function cV(e){return oV(e,-1)}function lV(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Az(n,r)}function uV(e){nV(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function dV(e){let t=[];$B(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function fV(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...fV(e,t.id,n)])}function pV(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function mV(e){return`data-base-ui-${e}`}var hV=0;function gV(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(hV);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),Xg;let o=requestAnimationFrame(a);return hV=o,()=>{hV===o&&(cancelAnimationFrame(o),hV=0)}}var _V={inert:new WeakMap,"aria-hidden":new WeakMap},vV=`data-base-ui-inert`,yV={inert:new WeakSet,"aria-hidden":new WeakSet},bV=new WeakMap,xV=0;function SV(e){return yV[e]}function CV(e){return e?og(e)?e.host:CV(e.parentNode):null}var wV=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=CV(t);return e.contains(n)?n:null}).filter(e=>e!=null),TV=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},EV=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{eg(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function DV(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=wV(t,e),l=i?EV(t,TV(c),new Set(c)):[],u=[],d=[];if(a){let e=_V[a],n=SV(a);s=n,o=e;let r=wV(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);EV(t,TV(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(bV.get(e)||0)+1;bV.set(e,t),d.push(e),t===1&&e.setAttribute(vV,``)}),xV+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(bV.get(e)||0)-1;bV.set(e,t),t||e.removeAttribute(vV)}),--xV,xV||(_V.inert=new WeakMap,_V[`aria-hidden`]=new WeakMap,yV.inert=new WeakSet,yV[`aria-hidden`]=new WeakSet,bV=new WeakMap)}}function OV(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Vg(e[0]).body;return DV(e,a,n,r,{mark:i})}var kV={style:{transition:`none`}},AV=`data-base-ui-click-trigger`,jV=`data-base-ui-swipe-ignore`,MV=`data-swipe-ignore`,NV=`[${jV}]`;`${MV}`;var PV={fallbackAxisSide:`none`},FV={fallbackAxisSide:`end`},IV={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},LV=J.createContext(null),RV=()=>J.useContext(LV),zV=mV(`portal`);function BV(e={}){let{ref:t,container:n,componentProps:r=Qg,elementProps:i}=e,a=az(),o=RV()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=Z(e=>{e!==null&&u(e)}),f=J.useRef(null);Tg(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(rg(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=e_(`div`,r,{ref:[t,d],props:[{id:a,[zV]:``},i]}),m=s&&p?Zi.createPortal(p,s):null;return{node:l,nodeId:J.isValidElement(p)?p.props.id:void 0,subtree:m}}var VV=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=BV({container:o,ref:t,componentProps:e,elementProps:s}),d=J.useRef(null),f=J.useRef(null),p=J.useRef(null),m=J.useRef(null),[h,g]=J.useState(null),_=J.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;J.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&lV(e)&&(e.type===`focusin`?_.current&&=(dV(c),!1):(uV(c),_.current=!0))}return Jz(qz(c,`focusin`,e,!0),qz(c,`focusout`,e,!0))},[c,v]),Tg(()=>{!c||y!==!0||!_.current||(dV(c),_.current=!1)},[y,c]);let x=J.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,Y.jsxs)(J.Fragment,{children:[u,(0,Y.jsxs)(LV.Provider,{value:x,children:[b&&c&&(0,Y.jsx)(iB,{"data-type":`outside`,ref:d,onFocus:e=>{lV(e,c)?p.current?.focus():aV(h?h.domReference:null)?.focus()}}),b&&c&&(0,Y.jsx)(`span`,{"aria-owns":l,style:IV}),c&&Zi.createPortal(a,c),b&&c&&(0,Y.jsx)(iB,{"data-type":`outside`,ref:f,onFocus:e=>{lV(e,c)?m.current?.focus():(iV(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,tz(`focus-out`,e.nativeEvent)))}})]})]})});function HV(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var UV=class{nodesRef={current:[]};events=HV();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},WV=J.createContext(null),GV=J.createContext(null),KV=()=>J.useContext(WV)?.id||null,qV=e=>{let t=J.useContext(GV);return e??t};function JV(e){let t=az(),n=qV(e),r=KV();return Tg(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function YV(e){let{children:t,id:n}=e,r=KV();return(0,Y.jsx)(WV.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function XV(e){let{children:t,externalTree:n}=e,r=Cg(()=>n??new UV).current;return(0,Y.jsx)(GV.Provider,{value:r,children:t})}function ZV(e){return e==null?e:`current`in e?e.current:e}function QV(e,t){let n=tg(jz(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var $V=20,eH=[];function tH(){eH=eH.filter(e=>e.deref()?.isConnected)}function nH(e){tH(),e&&eg(e)!==`body`&&(eH.push(new WeakRef(e)),eH.length>$V&&(eH=eH.slice(-20)))}function rH(){return tH(),eH[eH.length-1]?.deref()}function iH(e){return e?eV(e)?e:nV(e)[0]||e:null}function aH(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=tV(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return eV(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function oH(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Z(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Iz(_)&&S,w=Yz(i),T=Yz(a),E=Yz(l),D=Yz(g),O=qV(p),k=RV(),A=J.useRef(!1),j=J.useRef(!1),M=J.useRef(!1),N=J.useRef(null),P=J.useRef(``),F=J.useRef(``),I=J.useRef(null),L=J.useRef(null),R=Gg(I,f,k?.beforeInsideRef),z=Gg(L,k?.afterInsideRef),B=fz(),V=fz(),H=eB(),U=k!=null,W=Lz(v),G=Z((e=W)=>e?nV(e):[]),K=Z(()=>m?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Az(W,kz(Vg(W)))&&G().length===0&&!C&&Cz(e)}return qz(Vg(W),`keydown`,e)},[r,W,s,C,G]),J.useEffect(()=>{if(r||!g)return;let e=Vg(W);function t(){M.current=!1}function n(e){let t=jz(e),n=K(),r=Az(v,t)||Az(_,t)||Az(k?.portalNode,t)||n.some(e=>e===t||Az(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,V.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return Jz(qz(e,`pointerdown`,n,!0),qz(e,`pointerup`,t,!0),qz(e,`pointercancel`,t,!0),qz(e,`keydown`,i,!0),t)},[r,v,_,W,g,k,V,K]),J.useEffect(()=>{if(r||!c)return;let e=Vg(W);function t(){j.current=!0,V.start(0,()=>{j.current=!1})}function n(e){let t=jz(e);eV(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=jz(t);s&&n==null&&i!=null&&Az(v,i)&&nH(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=K(),f=n?.hasAttribute(mV(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,ZV(d),ZV(u)].includes(n),p=!(Az(_,n)||Az(v,n)||Az(n,v)||Az(k?.portalNode,n)||l.some(e=>e===n||Az(e,n))||c.hasMatchingElement(e=>Az(e,n))||f||O&&(fV(O.nodesRef.current,a).find(e=>Az(e.context?.elements.floating,n)||Az(e.context?.elements.domReference,n))||pV(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Lz(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&aH(W),o&&r!==_&&!BB(i)&&kz(e)===e.body){if(ag(W)&&(W.focus(),o===`popup`)){H.request(()=>{W.focus()});return}let e=G(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;ag(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==rH())&&(A.current=!0,h.setOpen(!1,tz(KR,t)))})}function a(){M.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=ag(_)?_:null;if(!(!v&&!l))return Jz(l&&qz(l,`focusout`,i),l&&qz(l,`pointerdown`,t),v&&qz(v,`focusin`,n),v&&qz(v,`focusout`,i),v&&k&&qz(v,`focusout`,a,!0))},[r,_,v,W,s,O,k,h,c,o,G,C,x,b,B,V,H,u,d,K]),J.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${mV(`portal`)}]`)||[]),t=(O?pV(O.nodesRef.current,x()):[]).find(e=>Iz(e.context?.elements.domReference||null))?.context?.elements.domReference,n=OV([v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...K(),t,ZV(d),ZV(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=OV([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,K]),Tg(()=>{if(!g||r||!ag(W))return;P.current=``,F.current=``;let e=Vg(W),t=kz(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||Az(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():ZV(r),o||=a();let s=Az(W,kz(e));gV(o,{preventScroll:o===W,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=kz(e);return!(t!==o&&Az(W,t))}})})},[r,g,W,G,w,E,D]),Tg(()=>{if(r||!W)return;let e=Vg(W),t=kz(e),n=E.current==null;nH(t);function i(e){if(e.open||(P.current=QV(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(wz(e.nativeEvent)||Tz(e.nativeEvent))A.current=!1;else{let e=!1;Vg(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&eg(t)!==`body`?t:null,s=n?o||a:a||o;return s||=rH()||null,typeof i==`boolean`?s:ZV(i)||s||null}return()=>{y.off(`openchange`,i);let t=kz(e),n=K(),r=Az(v,t)||n.some(e=>e===t||Az(e,t))||O&&fV(O.nodesRef.current,x(),!1).some(e=>Az(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=iH(c),i=typeof o!=`boolean`;if(o&&!A.current&&ag(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,W,T,E,y,O,_,x,K]),Tg(()=>{if(!yz||g||!v)return;let e=kz(Vg(v));!ag(e)||!Pz(e)||Az(v,e)&&e.blur()},[g,v]),Tg(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Tg(()=>{if(!(r||!W))return aH(W),()=>{queueMicrotask(tH)}},[r,W]);let ee=!r&&(!s||!C)&&(U||s);return(0,Y.jsxs)(J.Fragment,{children:[ee&&(0,Y.jsx)(iB,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=G();gV(e[e.length-1])}else k?.portalNode&&(A.current=!1,lV(e,k.portalNode)?iV(_)?.focus():ZV(d??k.beforeOutsideRef)?.focus())}}),n,ee&&(0,Y.jsx)(iB,{"data-type":`inside`,ref:z,onFocus:e=>{s?gV(G()[0]):k?.portalNode&&(c&&(A.current=!0),lV(e,k.portalNode)?aV(_)?.focus():ZV(u??k.afterOutsideRef)?.focus())}})]})}function sH(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=LR}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=J.useRef(void 0),f=eB(),p=fz(),m=J.useMemo(()=>{function e(e,t,n,r){let i=tz(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=Ez(e.pointerType,!0)&&Tz(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||Ez(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=jz(o);if(Pz(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}Ez(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return J.useMemo(()=>n?{reference:m}:Qg,[n,m])}function cH(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function lH(e){return e!=null&&e.clientX!=null}function uH(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=J.useRef(!1),u=J.useRef(null),[d,f]=J.useState(),[p,m]=J.useState([]),h=Z(e=>{i.set(`positionReference`,e)}),g=Z((e,t,n)=>{l.current||c.current.openEvent&&!lH(c.current.openEvent)||i.set(`positionReference`,cH(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Z(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=Ez(d)?o:a;J.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=tg(o);function r(t){let n=jz(t);Az(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||lH(c.current.openEvent)?u.current=qz(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),J.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),J.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),J.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=J.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return J.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function dH(){return!1}function fH(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function pH(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=dH,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=qV(c),m=Z(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Z(()=>a),{escapeKey:v,outsidePress:y}=fH(s),b=J.useRef(!1),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),w=J.useRef(``),T=J.useRef(null),E=fz(),D=fz(),O=Z(()=>{D.clear(),f.current.insideReactTree=!1}),k=Z(e=>{let t=f.current.floatingContext?.nodeId;return(p?fV(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=Z(e=>Nz(e,l.select(`floatingElement`))||Nz(e,l.select(`domReferenceElement`))),j=Z(e=>{o()&&l.setOpen(!1,tz(LR,e.nativeEvent))}),M=Z(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=tz(qR,zce(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),N=Z(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=Z(e=>{if(!u||!n||e.button!==0)return;let t=jz(e.nativeEvent);Az(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),F=Z(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});J.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new dz,t=new dz;function i(){e.clear(),C.current=!0}function a(){e.start(yz?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&fV(p.nodesRef.current,t).some(t=>Nz(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=jz(e),r=`[${mV(`inert`)}]`,i=ig(n)?n.getRootNode():null,a=Array.from((og(i)?i:Vg(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Az(e,n))))return;let s=ig(n)?n:null;for(;s&&!mg(s);){let e=_g(s);if(mg(e)||!ig(e))break;s=e}if(!(a.length&&ig(n)&&!Gce(n)&&!Az(n,l.select(`floatingElement`))&&a.every(e=>!Az(s,e)))){if(ag(n)&&!(`touches`in e)){let t=mg(n),r=hg(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,tz(Ece,e)),O())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=jz(e);if(!n)return;let r=qz(n,e.type,()=>{t(e),r()})}function I(e){w.current=`touch`,F(e,P)}function L(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function R(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function z(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function B(e){F(e,z)}function V(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function H(e){F(e,V)}let U=Vg(d),W=Jz(r&&Jz(qz(U,`keydown`,M),qz(U,`compositionstart`,i),qz(U,`compositionend`,a)),g&&Jz(qz(U,`click`,L,!0),qz(U,`pointerdown`,L,!0),qz(U,`pointerup`,R,!0),qz(U,`pointercancel`,R,!0),qz(U,`mousedown`,L,!0),qz(U,`mouseup`,R,!0),qz(U,`touchstart`,I,!0),qz(U,`touchmove`,B,!0),qz(U,`touchend`,H,!0)));return()=>{W(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let I=J.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),L=J.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,F]);return J.useMemo(()=>n?{reference:I,floating:L,trigger:I}:{},[n,I,L])}function mH(e,t,n){let{reference:r,floating:i}=e,a=_B(t),o=vB(t),s=gB(o),c=pB(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=mB(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function hH(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=fB(t,e),p=AB(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=jB(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=jB(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var gH=50,_H=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:hH},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=mH(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<gH&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=mH(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},vH=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=fB(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=pB(r),_=_B(o),v=pB(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[OB(o)]:bB(o)),x=p!==`none`;!d&&x&&b.push(...DB(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=yB(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===_B(t)||T.every(e=>_B(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=_B(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},yH=new Set([`left`,`top`]);async function bH(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pB(n),s=mB(n),c=_B(n)===`y`,l=yH.has(o)?-1:1,u=a&&c?-1:1,d=fB(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var xH=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await bH(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},SH=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=fB(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=_B(i),p=hB(f),m=u[p],h=u[f],g=(e,t)=>dB(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},CH=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=fB(e,t),u={x:n,y:r},d=_B(i),f=hB(d),p=u[f],m=u[d],h=fB(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=yH.has(pB(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},wH=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=fB(e,t),c=await i.detectOverflow(t,s),l=pB(n),u=mB(n),d=_B(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=aB(p-c[m],g),y=aB(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*oB(c.left,c.right):S=p-2*oB(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function TH(e){let t=hg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ag(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=sB(n)!==a||sB(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function EH(e){return ig(e)?e:e.contextElement}function DH(e){let t=EH(e);if(!ag(t))return lB(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=TH(t),o=(a?sB(n.width):n.width)/r,s=(a?sB(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var OH=lB(0);function kH(e){let t=tg(e);return!pg()||!t.visualViewport?OH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AH(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tg(e)}function jH(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=EH(e),o=lB(1);t&&(r?ig(r)&&(o=DH(r)):o=DH(e));let s=AH(a,n,r)?kH(a):lB(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=tg(a),t=ig(r)?tg(r):r,n=e,i=bg(n);for(;i&&t!==n;){let e=DH(i),t=i.getBoundingClientRect(),r=hg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=tg(i),i=bg(n)}}return jB({width:u,height:d,x:c,y:l})}function MH(e,t){let n=gg(e).scrollLeft;return t?t.left+n:jH(ng(e)).left+n}function NH(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-MH(e,n),y:n.top+t.scrollTop}}function PH(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ng(r),s=t?lg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=lB(1),u=lB(0),d=ag(r);if((d||!a)&&((eg(r)!==`body`||sg(o))&&(c=gg(r)),d)){let e=jH(r);l=DH(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?NH(o,c):lB(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function FH(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function IH(e){let t=gg(e),n=e.ownerDocument.body,r=oB(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=oB(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+MH(e),o=-t.scrollTop;return hg(n).direction===`rtl`&&(a+=oB(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var LH=25;function RH(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tg(e),a=ng(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!pg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(MH(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=LH&&(s-=o)}return{width:s,height:c,x:l,y:u}}function zH(e,t){let n=jH(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=DH(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function BH(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=RH(e,n,t);else if(t===`document`)r=IH(ng(e));else if(ig(t))r=zH(t,n);else{let n=kH(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jB(r)}function VH(e,t){let n=t.get(e);if(n)return n;let r=yg(e,[],!1).filter(e=>ig(e)&&eg(e)!==`body`),i=null,a=hg(e).position===`fixed`,o=a?_g(e):e;for(;ig(o)&&!mg(o);){let e=hg(o),t=fg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=_g(o)}return t.set(e,r),r}function HH(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?lg(t)?[]:VH(t,this._c):[].concat(n),r],o=BH(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=BH(t,a[e],i);s=oB(n.top,s),c=aB(n.right,c),l=aB(n.bottom,l),u=oB(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function UH(e){let{width:t,height:n}=TH(e);return{width:t,height:n}}function WH(e,t,n){let r=ag(t),i=ng(t),a=n===`fixed`,o=jH(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=lB(0);if((r||!a)&&((eg(t)!==`body`||sg(i))&&(s=gg(t)),r)){let e=jH(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=MH(i));let l=i&&!r&&!a?NH(i,s):lB(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function GH(e){return hg(e).position===`static`}function KH(e,t){if(!ag(e)||hg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ng(e)===n&&(n=n.ownerDocument.body),n}function qH(e,t){let n=tg(e);if(lg(e))return n;if(!ag(e)){let t=_g(e);for(;t&&!mg(t);){if(ig(t)&&!GH(t))return t;t=_g(t)}return n}let r=KH(e,t);for(;r&&cg(r)&&GH(r);)r=KH(r,t);return r&&mg(r)&&GH(r)&&!fg(r)?n:r||Lee(e)||n}var JH=async function(e){let t=this.getOffsetParent||qH,n=this.getDimensions,r=await n(e.floating);return{reference:WH(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function YH(e){return hg(e).direction===`rtl`}var XH={convertOffsetParentRelativeRectToViewportRelativeRect:PH,getDocumentElement:ng,getClippingRect:HH,getOffsetParent:qH,getElementRects:JH,getClientRects:FH,getDimensions:UH,getScale:DH,isElement:ig,isRTL:YH};function ZH(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QH(e,t,n){let r=null,i,a=ng(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=cB(d),h=cB(a.clientWidth-(u+f)),g=cB(a.clientHeight-(d+p)),_=cB(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:oB(0,aB(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ZH(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=tg(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function $H(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=EH(e),u=i||a?[...l?yg(l):[],...t?yg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?QH(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?jH(e):null;c&&g();function g(){let t=jH(e);h&&!ZH(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var eU=xH,tU=SH,nU=vH,rU=wH,iU=CH,aU=(e,t,n)=>{let r=new Map,i=n??{},a={...XH,...i.platform,_c:r};return _H(e,t,{...i,platform:a})},oU=typeof document<`u`?J.useLayoutEffect:function(){};function sU(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sU(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!sU(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function cU(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lU(e,t){let n=cU(e);return Math.round(t*n)/n}function uU(e){let t=J.useRef(e);return oU(()=>{t.current=e}),t}function dU(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);sU(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=uU(c),D=uU(i),O=uU(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),aU(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!sU(w.current,t)&&(w.current=t,Zi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);oU(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);oU(()=>(A.current=!0,()=>{A.current=!1}),[]),oU(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=lU(M.floating,u.x),r=lU(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...cU(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var fU=(e,t)=>{let n=eU(e);return{name:n.name,fn:n.fn,options:[e,t]}},pU=(e,t)=>{let n=tU(e);return{name:n.name,fn:n.fn,options:[e,t]}},mU=(e,t)=>({fn:iU(e).fn,options:[e,t]}),hU=(e,t)=>{let n=nU(e);return{name:n.name,fn:n.fn,options:[e,t]}},gU=(e,t)=>{let n=rU(e);return{name:n.name,fn:n.fn,options:[e,t]}},_U=[],vU=void 0;function yU(){return vU}function bU(e){_U.push(e)}function xU(e){let t=(t,n)=>{let r=Cg(CU).current,i;try{vU=r;for(let e of _U)e.before(r);i=e(t,n);for(let e of _U)e.after(r);r.didInitialize=!0}finally{vU=void 0}return i};return t.displayName=e.displayName||e.name,t}function SU(e){return J.forwardRef(xU(e))}function CU(){return{didInitialize:!1}}var wU=Pi(),TU=Jg(19)?DU:OU;function $(e,t,n,r,i){return TU(e,t,n,r,i)}function EU(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,wU.useSyncExternalStore)(e.subscribe,a,a)}bU({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,wU.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function DU(e,t,n,r,i){let a=yU();if(!a)return EU(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function OU(e,t,n,r,i){return(0,Ii.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var kU=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return $(this,e,t,n,r)}},AU=class extends kU{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;Tg(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Tg(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Tg(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;Tg(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),$(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=Z(t??Xg);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},jU={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},MU=class extends AU{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:HV(),nested:n,triggerElements:i},jU),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Bce(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function NU(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=J.useRef(null);r===void 0&&f.current===null&&(f.current=new MU({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Tg(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ig(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function PU(e,t=!1,n=!1){let[r,i]=J.useState(e&&t?`idle`:void 0),[a,o]=J.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Tg(()=>{if(!e&&a&&r!==`ending`&&n){let e=$z.request(()=>{i(`ending`)});return()=>{$z.cancel(e)}}},[e,a,r,n]),Tg(()=>{if(!e||t)return;let n=$z.request(()=>{i(void 0)});return()=>{$z.cancel(n)}},[t,e]),Tg(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=$z.request(()=>{i(`idle`)});return()=>{$z.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function FU(e,t=!1){let n=eB();return Z((r,i=null)=>{n.cancel();let a=ZV(e);if(a==null)return;let o=a,s=()=>{Zi.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function IU(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Z(i),o=FU(r,n);J.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var LU={tabIndex:-1,[Vce]:``};function RU(e){return t=>t!==`touch`||e.current}function zU(e,t=!1){let n=az(),r=KV()!=null,i=Cg(()=>e(n,r)).current;return NU({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function BU({handle:e,store:t}){return Tg(()=>e.attachStore(t),[e,t]),null}function VU(e,t){let n=J.useRef(null),r=J.useRef(null);return J.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function HU(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function UU(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function WU(e,t,n,r={}){let i=n.reason,a=i===RR,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=UU(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),HU(i,t,n.trigger,c()),e.update(i)};a?Zi.flushSync(l):l()}function GU(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=VU(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=J.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Tg(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function KU(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`);Tg(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=tz(IR);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function qU(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=PU(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Z(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return IU({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function JU(e,t){e.useSyncedValues(t),Tg(()=>()=>{e.update({activeTriggerProps:Qg,inactiveTriggerProps:Qg,popupProps:Qg})},[e])}function YU(e,t){Tg(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Tg(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var XU=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function ZU(){return new MU({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new XU,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function QU(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:ZU(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Qg,inactiveTriggerProps:Qg,popupProps:Qg}}function $U(e,t,n=!1){return new MU({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var eW=e=>e.triggerIdProp??e.activeTriggerId,tW=e=>e.openProp??e.open,nW=e=>(e.popupElement?.id??e.floatingId)||void 0;function rW(e,t){return t!==void 0&&tW(e)&&eW(e)===t}function iW(e,t){return rW(e,t)?!0:t!==void 0&&tW(e)&&eW(e)==null&&e.triggerCount===1}var aW={open:tW,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:eW,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:nW,isTriggerActive:(e,t)=>t!==void 0&&eW(e)===t,isOpenedByTrigger:(e,t)=>rW(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&eW(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>iW(e,t)?nW(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function oW(e){let t=J.useCallback(t=>e===void 0?Xg:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,wU.useSyncExternalStore)(t,n,()=>e?.serverStore)}function sW(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=az(),a=KV()!=null,o=Cg(()=>new MU({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new XU,floatingId:i,syncOnly:!1,nested:a})).current;return Tg(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ig(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function cW(e){return lW(e,e.rootContext)}function lW(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=J.useState(null),[d,f]=J.useState(void 0),[p,m]=J.useState(void 0),h=J.useRef(null),g=qV(r),_=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=dU({...e,elements:{..._,...l&&{reference:l}}}),y=ig(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=J.useCallback(e=>{let t=ig(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=J.useCallback(e=>{(ig(e)||e===null)&&(h.current=e,f(e)),(ig(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!ig(e))&&v.refs.setReference(e)},[v.refs,f]),C=J.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=J.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=J.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=J.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Tg(()=>{o&&(h.current=o)},[o]),Tg(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),J.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var uW=vz&&yz;function dW(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=J.useRef(!1),c=J.useRef(null),l=J.useRef(!0),u=fz();J.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=tg(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&ag(e)&&e===kz(Vg(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return Jz(qz(t,`blur`,r),uW&&qz(t,`keydown`,a,!0),uW&&qz(t,`pointerdown`,o,!0))},[i,n]),J.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);ig(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=J.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=jz(t.nativeEvent);if(ig(a)){if(uW&&!t.relatedTarget){if(!l.current&&!Pz(a))return}else if(!Kce(a))return}let o=Mz(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,tz(zR,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,tz(zR,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=ig(n)&&n.hasAttribute(mV(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=kz(Vg(e));!n&&t===e||Az(o.current.floatingContext?.refs.floating.current,t)||Az(e,t)||a||Mz(n??t,i.context.triggerElements)||i.setOpen(!1,tz(zR,r))})}}},[o,r,i,u]);return J.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var fW=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new dz,this.restTimeout=new dz,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},pW=new WeakMap;function mW(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&pW.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),pW.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function hW(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=pW.get(n);a&&a!==e&&mW(a),mW(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,pW.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function gW(e){let t=e.context.dataRef.current,n=Cg(()=>t.hoverInteractionState??fW.create()).current;return t.hoverInteractionState||=n,lz(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function _W(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=qV(),d=KV(),f=gW(a),p=fz(),m=Z(()=>Vz(l.current.openEvent?.type,f.interactedInside)),h=Z(()=>Hz(l.current.openEvent?.type)),g=Z(()=>{mW(f)});Tg(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),J.useEffect(()=>g,[g]),Tg(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&ig(c)&&s){let e=c,t=s,n=Vg(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return hW(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),J.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&fV(u.nodesRef.current,d).length>0)}function t(e){let t=zz(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,tz(RR,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=jz(e);if(!Fz(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Mz(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&ig(o)&&fV(u.nodesRef.current,r,!1).some(e=>Az(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,tz(RR,t)),u.events.emit(`floating.closed`,t)})}let y=s;return Jz(y&&qz(y,`mouseenter`,c),y&&qz(y,`mouseleave`,_),y&&qz(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var vW={current:null};function yW(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=vW,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=qV(l),y=gW(h),b=J.useRef(!1),x=Yz(i),S=Yz(r),C=Yz(o),w=Yz(n),T=Yz(p),E=Yz(f),D=Z(()=>Vz(g.current.openEvent?.type,y.interactedInside)),O=Z(()=>T.current?.()!==!1),k=Z((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Az(e,t);if(!ig(n))return!1;let i=n;return r.hasMatchingElement(e=>Az(e,i))&&(!e||!Az(e,i))}),A=Z(()=>{y.handler&&=(Vg(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Z(()=>{mW(y)});return u&&(y.handleCloseOptions=x.current?.__options),J.useEffect(()=>A,[A]),J.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===RR,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),J.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=zz(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,tz(RR,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,tz(RR,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!ig(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Ez(y.pointerType))return;let t=Bz(C.current),n=zz(S.current,`open`,y.pointerType),r=jz(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(ig(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Az(e,r)){s=e;break}}ig(i)&&ig(o)&&!h.context.triggerElements.hasElement(i)&&Az(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&ig(s)&&ig(o)&&Az(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,tz(RR,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,tz(RR,e,s))}):g&&O()&&h.setOpen(!0,tz(RR,e,s)))}function i(t){if(D()){j();return}A();let n=Vg(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Mz(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!Az(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Az(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?qz(t,`mouseout`,o):void 0;return s?Jz(qz(t,`mousemove`,r,{once:!0}),qz(t,`mouseenter`,r),qz(t,`mouseleave`,i),l):Jz(qz(t,`mouseenter`,r),qz(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),J.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Ez(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;hW(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Bz(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,tz(RR,t,n))}y.pointerType===`touch`?Zi.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var bW=`Escape`;function xW(e){return yz&&e.movementX===0&&e.movementY===0}function SW(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function CW(e,t){return SW(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function wW(e,t,n){return SW(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function TW(e,t,n){return SW(t,n?e===Dz:e===Oz,e===Wce)}function EW(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===bW:SW(t,n?e===Oz:e===Dz,e===Uce)}function DW(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=Lz(T),k=Iz(E),A=Yz(O),j=KV(),M=qV(b),N=J.useRef(f),P=J.useRef(o??-1),F=J.useRef(null),I=J.useRef(!0),L=Z(e=>{i(P.current===-1?null:P.current,e)}),R=J.useRef(!!T),z=J.useRef(w),B=J.useRef(!1),V=J.useRef(!1),H=J.useRef(null),U=Yz(h),W=Yz(w),G=Yz(o),K=Yz(y),ee=eB(),q=eB(),te=Z(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):H.current=gV(e,{sync:B.current,preventScroll:!0})}let t=n.current[P.current],r=V.current;t&&e(t),(B.current?e=>e():e=>ee.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),se&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Tg(()=>{D.current.orientation=g},[D,g]),Tg(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(V.current=!0,L())):R.current&&(P.current=-1,L()))},[a,w,T,o,L]),Tg(()=>{if(a){if(!w){B.current=!1;return}if(T){if(r==null){if(B.current=!1,G.current!=null)return;if(R.current&&(P.current=-1,te()),(!z.current||!R.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>q.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||wW(F.current,g,u)||l?PB(n):FB(n),F.current=null,L())};t()}}else NB(n.current,r)||(P.current=r,te(),V.current=!1)}}},[a,w,T,r,G,l,n,g,u,L,te,q]),Tg(()=>{if(!a||T||!M||d||!R.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=kz(Vg(E??t??null)),r=e.some(e=>e.context&&Az(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Tg(()=>{z.current=w,R.current=!!T}),Tg(()=>{w||(F.current=null,N.current=f)},[w,f]);let ne=r!=null,re=Z(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),ie=Z(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ae=Z(()=>PB(n,U.current)),oe=Z(e=>{if(I.current=!1,B.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(l&&EW(e.key,g,u,S)){CW(e.key,ie())||Cz(e),C.setOpen(!1,tz(JR,e.nativeEvent)),ag(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=PB(n,h),i=FB(n,h);if(k||(e.key===`Home`&&(Cz(e),P.current=r,L(e)),e.key===`End`&&(Cz(e),P.current=i,L(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,L(e)),g===`both`)return}if(CW(e.key,g)){if(Cz(e),w&&!d&&kz(e.currentTarget.ownerDocument)===e.currentTarget){P.current=wW(e.key,g,u)?r:i,L(e);return}wW(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(B.current=!1,P.current=r):P.current=IB(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,IB(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(B.current=!1,P.current=i):P.current=IB(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,IB(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),NB(n.current,P.current)&&(P.current=-1),L(e)}}),se=J.useMemo(()=>({onFocus(e){B.current=!0,re(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){xW(e)||(B.current=!0,V.current=!1,p&&re(e))},onPointerLeave(e){if(!W.current||!I.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&K.current&&(H.current?.(),H.current=null,P.current=-1,L(e),!d)){let e=A.current,t=kz(Vg(e));e&&Az(e,t)&&e.focus({preventScroll:!0})}}}),[re,W,A,p,n,L,K,d]),ce=J.useMemo(()=>d&&w&&ne&&{"aria-activedescendant":`${v}-${r}`},[d,w,ne,v,r]),le=J.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...k?{}:ce,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=jz(e.nativeEvent);if(t&&!Az(A.current,t))return;Cz(e),C.setOpen(!1,tz(KR,e.nativeEvent)),ag(E)&&E.focus();return}oe(e)},onPointerMove(e){xW(e)||(I.current=!0)}}),[ce,oe,A,g,k,C,w,d,E]),ue=J.useMemo(()=>{function e(e){C.setOpen(!0,tz(JR,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&wz(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&Tz(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=TW(t.key,ie(),u),a=CW(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return oe(t);if(!(!n&&!m&&r)){if(o){let e=CW(t.key,ie());F.current=l&&e?null:t.key}if(l){i&&(Cz(t),n?(P.current=ae(),L(t)):e(t));return}a&&(G.current!=null&&(P.current=G.current),Cz(t),!n&&m?e(t):oe(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[oe,f,ae,l,L,C,m,g,ie,u,G,d]),de=J.useMemo(()=>({...ce,...ue}),[ce,ue]);return J.useMemo(()=>a?{reference:de,floating:le,item:se,trigger:ue}:{},[a,de,le,ue,se])}function OW(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=fz(),m=J.useRef(``),h=J.useRef(u??i??-1),g=J.useRef(null),_=Z(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!BB(n)||n?.matches(`:disabled`)?!1:o==null||!RB(Zg,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Cz(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Cz(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=Z(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);Az(n,t)||Az(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Tg(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=J.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return J.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var kW=.1,AW=kW*kW,jW=.5;function MW(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function NW(e,t,n,r,i,a,o,s,c,l){let u=!1;return MW(e,t,n,r,i,a)&&(u=!u),MW(e,t,i,a,o,s)&&(u=!u),MW(e,t,o,s,c,l)&&(u=!u),MW(e,t,c,l,n,r)&&(u=!u),u}function PW(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function FW(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function IW(e={}){let{blockPointerEvents:t=!1}=e,n=new dz,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*AW;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=jz(r),g=r.type===`mouseleave`,_=Az(u,h),v=Az(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ig(r.relatedTarget)&&Az(u,r.relatedTarget))return;function y(){return!!(s&&fV(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=FW(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=FW(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=FW(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=FW(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!PW(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?jW/2:jW*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+jW+1,o=C||T?S.bottom-jW:S.top,s=C?T?S.bottom-jW:S.top:S.bottom-jW;M=NW(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?jW/2:jW*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-jW,o=C||T?S.top+jW:S.bottom,s=C?T?S.top+jW:S.bottom:S.top+jW;M=NW(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?jW/2:jW*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+jW+1,o=w||E?S.right-jW:S.left,s=w?E?S.right-jW:S.left:S.right-jW;M=NW(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?jW/2:jW*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-jW,o=w||E?S.left+jW:S.right,s=w?E?S.left+jW:S.right:S.left+jW;M=NW(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var LW=function(e){return e[e.open=kR.open]=`open`,e[e.closed=kR.closed]=`closed`,e[e.startingStyle=kR.startingStyle]=`startingStyle`,e[e.endingStyle=kR.endingStyle]=`endingStyle`,e.expanded=`data-expanded`,e.nestedDrawerOpen=`data-nested-drawer-open`,e.nestedDrawerSwiping=`data-nested-drawer-swiping`,e.swipeDismiss=`data-swipe-dismiss`,e.swipeDirection=`data-swipe-direction`,e.swiping=`data-swiping`,e}({}),RW=J.createContext(void 0);function zW(){let e=J.useContext(RW);if(e===void 0)throw Error(Rg(26));return e}var BW=`ArrowUp`,VW=`ArrowDown`,HW=`ArrowLeft`,UW=`ArrowRight`,WW=new Set([BW,VW,HW,UW,`Home`,`End`]),GW=`Shift`,KW=[GW,`Control`,`Alt`,`Meta`];function qW(e){return ag(e)&&e.tagName===`INPUT`}function JW(e){return!!(qW(e)&&e.selectionStart!=null||ag(e)&&e.tagName===`TEXTAREA`)}function YW(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=XW(e,t,`left`),a=ZW(e),o=ZW(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=XW(e,t,`top`),r=ZW(e),i=ZW(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function XW(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function ZW(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var QW=J.createContext(void 0);function $W(e){let t=J.useContext(QW);if(e!==!0&&t===void 0)throw Error(Rg(90));return t}function eG(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function tG(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function nG(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?eG(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function rG(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function iG(){let e=ER(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=$W(),a=e.useState(`viewportElement`),[o,s]=J.useState(0),[c,l]=J.useState(16),u=Z(()=>{let e=Vg(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});Tg(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=J.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=nG(t,o,c);if(n===null)return null;let r=eG(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:J.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=nG(n,o,c);if(r===null)return;let a=eG(r,0,t);return d[rG(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var aG=J.createContext(null);function oG(){return J.useContext(aG)}var sG=!1;function cG(){sG||=(typeof CSS<`u`&&`registerProperty`in CSS&&([PR.swipeMovementX,PR.swipeMovementY,PR.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:FR.swipeProgress,initialValue:`0`},{name:PR.swipeStrength,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var lG={...NR,expanded(e){return e?{[LW.expanded]:``}:null},nestedDrawerOpen(e){return e?{[LW.nestedDrawerOpen]:``}:null},nestedDrawerSwiping(e){return e?{[LW.nestedDrawerSwiping]:``}:null},swipeDirection(e){return{[LW.swipeDirection]:e}},swiping(e){return e?{[LW.swiping]:``}:null}},uG=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=ER(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:d,hasNestedDrawer:f,nestedSwiping:p,nestedSwipeProgressStore:m,onPopupHeightChange:h,notifyParentFrontmostHeight:g,notifyParentHasNestedDrawer:_}=$W(),v=c.useState(`descriptionElementId`),y=c.useState(`disablePointerDismissal`),b=c.useState(`floatingRootContext`),x=c.useState(`popupProps`),S=c.useState(`modal`),C=c.useState(`mounted`),w=c.useState(`nested`),T=c.useState(`nestedOpenDrawerCount`),E=c.useState(`transitionStatus`),D=c.useState(`open`),O=c.useState(`openMethod`),k=c.useState(`titleElementId`),A=c.useState(`role`),j=b.useState(`floatingId`),M=s.id??j,N=oG();zW();let{snapPoints:P,activeSnapPoint:F,activeSnapPointOffset:I}=iG(),L=T>0,R=N?.swiping??!1,z=N?.swipeStrength??null,[B,V]=J.useState(0),H=J.useRef(0),U=Z(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(H.current>0&&d>H.current&&t>H.current)return;if(H.current>0&&f){let e=H.current;V(e),h(e);return}let n=t;n!==H.current&&(H.current=n,V(n),h(n))});Tg(()=>{if(!C){H.current=0,V(0),h(0);return}let e=l.current;if(!e||(cG(),U(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(U);return t.observe(e),()=>{t.disconnect()}},[U,C,L,h,l]),Tg(()=>{let e=()=>{let e=l.current;if(!e)return;let t=m.getSnapshot();t>0?e.style.setProperty(FR.swipeProgress,`${t}`):e.style.setProperty(FR.swipeProgress,`0`)};e();let t=m.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(FR.swipeProgress,`0`)}},[m,l]),Tg(()=>{if(D)return g?.(d),()=>{g?.(0)}},[d,D,g]),Tg(()=>{if(_)return _(D||E===`ending`),()=>{_(!1)}},[_,D,E]),IU({open:D,ref:l,onComplete(){D&&c.context.onOpenChangeComplete?.(!0)}});let W=o===void 0?l:o,G=c.useStateSetter(`popupElement`),K={open:D,nested:w,transitionStatus:E,expanded:F===1,nestedDrawerOpen:L,nestedDrawerSwiping:p,swipeDirection:u,swiping:R},ee;B&&!(!f&&E!==`ending`)&&(ee=`${B}px`);let q=P&&P.length>0&&(u===`down`||u===`up`),te=null;q&&I!==null&&(te=u===`up`?-I:I);let ne=N?N.getDragStyles():Qg;if(q&&u===`down`){let e=I??0,t=Number.parseFloat(String(ne[PR.swipeMovementY]));ne=R&&Number.isFinite(t)?{...ne,transform:void 0,[PR.swipeMovementY]:`${tG(e,t)}px`}:{...ne,transform:void 0}}let re=e_(`div`,e,{state:K,props:[x,{id:M,"aria-labelledby":k,"aria-describedby":v,role:A,...LU,hidden:!C,onKeyDown(e){WW.has(e.key)&&e.stopPropagation()},style:{...ne,[FR.swipeProgress]:`0`,[PR.nestedDrawers]:T,[PR.height]:ee,[PR.snapPointOffset]:typeof te==`number`?`${te}px`:`0px`,[PR.frontmostHeight]:d?`${d}px`:void 0,[PR.swipeStrength]:typeof z==`number`&&Number.isFinite(z)&&z>0?`${z}`:`1`}},s],ref:[t,l,G],stateAttributesMapping:lG});return(0,Y.jsx)(oH,{context:b,openInteractionType:O,disabled:!C,closeOnFocusOut:!y,initialFocus:W,returnFocus:a,modal:S!==!1,restoreFocus:`popup`,children:re})});function dG(e){return Jg(19)?e:e?`true`:void 0}var fG=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),pG=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=ER(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Y.jsx)(RW.Provider,{value:n,children:(0,Y.jsxs)(VV,{ref:t,...r,children:[a&&o===!0&&(0,Y.jsx)(fG,{ref:i.context.internalBackdropRef,inert:dG(!s)}),e.children]})}):null}),mG=pG;function hG({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(t);return[i?e:a,J.useCallback(e=>{i||o(e)},[])]}var gG={},_G={},vG=``;function yG(e,t){return sg(e)?e:t}function bG(e,t,n){return/hidden|clip/.test(e.getComputedStyle(yG(t,n)).overflowY)}function xG(e){if(typeof document>`u`)return!1;let t=Vg(e);return tg(t).innerWidth-t.documentElement.clientWidth>0}function SG(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Vg(e),n=t.documentElement,r=t.body,i=yG(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function CG(e){let t=Vg(e),n=t.documentElement,r=t.body,i=yG(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function wG(e){let t=Vg(e),n=t.documentElement,r=t.body,i=tg(n),a=0,o=0,s=!1,c=$z.create();if(yz&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,gG={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vG=n.style.scrollBehavior,_G={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=yG(n,r);if(s=SG(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,gG),Object.assign(r.style,_G),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=vG)}function d(){u(),c.request(l)}l();let f=qz(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var TG=new class{lockCount=0;restore=null;timeoutLock=dz.create();timeoutUnlock=dz.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Vg(e),n=t.documentElement,r=t.body,i=tg(n);if(bG(i,n,r)){let t=new i.MutationObserver(()=>{bG(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=hz||!xG(e);this.restore=a?CG(e):wG(e)}};function EG(e=!0,t=null){Tg(()=>{if(e)return TG.acquire(t)},[e,t])}function DG({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=J.useState(0),[u,d]=J.useState(0),f=c===0,p=pH(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=jz(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Az(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return EG(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Tg(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),JU(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var OG={...aW,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},kG=class extends AU{constructor(e,t,n){let r=new XU,i=AG(e,r,t,n);super(i,jG(r),OG)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};HU(n,e,t.trigger),this.update(n)}};function AG(e,t,n,r=!1){let i={...QU(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=$U(t,n,r),i}function jG(e){return{popupRef:J.createRef(),backdropRef:J.createRef(),internalBackdropRef:J.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function MG(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=ER(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=zU((e,t)=>new kG({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);YU(b,x),KU(b);let{forceUnmount:w}=qU(x,b);J.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,tz($R))}),[w,b]);let T=x||S;return(0,Y.jsxs)(TR.Provider,{value:b,children:[u&&(0,Y.jsx)(BU,{handle:u,store:b}),T&&(0,Y.jsx)(DG,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var NG,PG;function FG(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:p=!1,snapPoints:m,snapPoint:h,defaultSnapPoint:g,onSnapPointChange:_}=e,v=$W(!0),y=v?.onNestedSwipeProgressChange,b=v?.onNestedFrontmostHeightChange,x=v?.onNestedSwipingChange,S=v?.onNestedDrawerPresenceChange,[C,w]=J.useState(0),[T,E]=J.useState(0),[D,O]=J.useState(!1),[k,A]=J.useState(!1),[j]=J.useState(IG),M=g===void 0?m?.[0]??null:g,N=h!==void 0,[P,F]=hG({controlled:h,default:M,name:`Drawer`,state:`snapPoint`}),I=J.useRef(!1),L=J.useRef(!1),R=Z((e,t)=>{let n=t??tz(`none`);_?.(e,n),!n.isCanceled&&F(e)}),z=J.useMemo(()=>N||!m||m.length===0?P:P===null||!m.some(e=>Object.is(e,P))?M:P,[P,N,M,m]),B=Z(e=>{w(e),!I.current&&e>0&&E(e)}),V=Z(e=>{if(e>0){I.current=!0,E(e);return}I.current=!1,C>0&&E(C)}),H=Z(e=>{O(e)}),U=Z(e=>{j.set(e),y?.(e)}),W=Z(e=>{A(e),x?.(e)}),G=Z((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&m&&m.length>0&&R(M,tz(t.reason,t.event,t.trigger))}),K=J.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:L,snapToSequentialPoints:p,snapPoints:m,activeSnapPoint:z,setActiveSnapPoint:R,frontmostHeight:T,popupHeight:C,hasNestedDrawer:D,nestedSwiping:k,nestedSwipeProgressStore:j,onNestedDrawerPresenceChange:H,onPopupHeightChange:B,onNestedFrontmostHeightChange:V,onNestedSwipingChange:W,onNestedSwipeProgressChange:U,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:y,notifyParentHasNestedDrawer:S}),[z,T,D,k,j,S,y,x,b,H,V,U,W,B,C,R,m,p,L,f]),ee=MG(`drawer`,{open:n,defaultOpen:r,onOpenChange:G,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:typeof t==`function`?e=>(0,Y.jsxs)(J.Fragment,{children:[NG||=(0,Y.jsx)(LG,{}),t(e)]}):(0,Y.jsxs)(J.Fragment,{children:[PG||=(0,Y.jsx)(LG,{}),t]})});return(0,Y.jsx)(QW.Provider,{value:K,children:ee})}function IG(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function LG(){let e=cz(),t=ER(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),o=t.useState(`popupElement`),s=a===0;return Tg(()=>{if(r)return()=>{r(t)}},[r,t]),Tg(()=>{n?.(t,i)},[i,n,t]),J.useEffect(()=>{if(!i||!s||!_z)return;let e=tg(o).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,tz(Dce,e))}let r=new e,a=qz(r,`close`,n);return()=>{a(),r.destroy()}},[t,s,i,o]),null}function RG(e,t=!1){let{overflowY:n}=hg(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function zG(e,t=!1){let{overflowX:n}=hg(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function BG(e,t,n=!1){return t===`vertical`?RG(e,n):zG(e,n)}function VG(e,t,n){let r=e;for(;ag(r)&&r!==t&&!mg(r);){for(let e of n)if(BG(r,e))return!0;r=_g(r)}return!1}function HG(e,t,n=`vertical`,r=!1){let i=ag(e)?e:null;for(;ag(i)&&i!==t&&!mg(i);){if(BG(i,n,r))return i;i=_g(i)}return BG(t,n,r)?t:null}function UG(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}var WG=40,GG=10,KG=1,qG=50,JG=16,YG=80,XG=`button,a,input,select,textarea,label,[role="button"]`;function ZG(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function QG(e){let t=tg(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}function $G(e){return Number.isFinite(e)&&e>0?e:null}function eK(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function tK(e){return e%2==1}function nK(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function rK(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:i,canStart:a,ignoreSelectorWhenTouch:o=!0,ignoreScrollableAncestors:s=!1,swipeThreshold:c,onDismiss:l,onProgress:u,onCancel:d,onSwipeStart:f,onRelease:p,onSwipingChange:m,trackDrag:h=!0}=e,g=XG,_=n.length===1?n[0]:void 0,v=Math.max(0,typeof c==`number`?c:WG),y=n.includes(`left`),b=n.includes(`right`),x=n.includes(`up`),S=n.includes(`down`),C=y||b,w=x||S,T=J.useMemo(()=>{let e=[];return w&&e.push(`vertical`),C&&e.push(`horizontal`),e},[C,w]),[E,D]=J.useState(void 0),[O,k]=J.useState(!1),[A,j]=J.useState(!1),M=J.useRef({x:0,y:0}),N=J.useRef({x:0,y:0}),P=J.useRef(null),F=J.useRef({x:0,y:0,scale:1}),I=J.useRef(void 0),L=J.useRef(0),R=J.useRef(!1),z=J.useRef({x:0,y:0}),B=J.useRef(null),V=J.useRef(!1),H=J.useRef(!1),U=J.useRef(null),W=J.useRef(!1),G=J.useRef(!1),K=J.useRef({width:0,height:0}),ee=J.useRef(0),q=J.useRef(v),te=J.useRef(null),ne=J.useRef(null),re=J.useRef(null),ie=J.useRef({x:0,y:0}),ae=J.useRef(null),oe=J.useRef(!1),se=J.useRef(null),ce=Z(e=>{oe.current!==e&&(oe.current=e,k(e),m?.(e))});function le(e){if(!e)return;let t=r.current,n=te.current;if(!t||!n)return;let i=n({element:t,direction:e});q.current=Math.max(0,i)}let ue=Z((e,t)=>{let n=Number.isFinite(e)?eG(e,0,1):0,r=n!==ee.current,i=!1;if(t){let e=ae.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}!r&&!i||(ee.current=n,t?ae.current=t:r&&(ae.current=null),u?.(n,t))}),de=Z(e=>{let t=r.current;if(!h||!t){e||(se.current=null);return}let n=t.style,a=se.current;e?(a||(se.current=[n.transition,n.transform]),n.transition=`none`):a&&([n.transition,n.transform]=a,se.current=null);let o=N.current,s=F.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=eK(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function fe(e,t){if(t===null)return;let n=re.current;if(n&&t>n.time){let r=Math.max(t-n.time,JG);ie.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}re.current={x:e.x,y:e.y,time:t}}let pe=J.useCallback(()=>{D(void 0),ce(!1),j(!1),ue(0),q.current=v,te.current=null,M.current={x:0,y:0},N.current={x:0,y:0},F.current={x:0,y:0,scale:1},I.current=void 0,L.current=0,R.current=!1,z.current={x:0,y:0},B.current=null,V.current=!1,P.current=null,H.current=!1,U.current=null,W.current=!1,G.current=!1,K.current={width:0,height:0},ne.current=null,re.current=null,ie.current={x:0,y:0},ae.current=null,de(!1)},[ce,v,de,ue]);function me(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function he(e){return`touches`in e||e.pointerType===`touch`}function ge(e,t){let n=r.current?.getRootNode();return UG(n,e.x,e.y)??jz(t)}function _e(e,t){return C&&!w?HG(e,t,`horizontal`):w&&!C?HG(e,t,`vertical`):HG(e,t,`vertical`)??HG(e,t,`horizontal`)}function ve(e,t,n){W.current=!1;let i=he(e),a=ge(t,e.nativeEvent),l=Vg(r.current).body,u=i&&l?_e(a,l):null,d=n?.ignoreScrollableTarget??!1;if(u&&!d||(W.current=!!(u&&d),a&&a.closest(g)&&(!i||o)))return!1;let p=r.current;if(s&&p&&a&&T.length>0&&!(n?.ignoreScrollableAncestors??!1)&&VG(a,p,T))return!1;if(R.current=!1,I.current=void 0,L.current=0,M.current=t,ne.current=$G(e.timeStamp),z.current=t,P.current=t,q.current=v,te.current=typeof c==`function`?c:null,p){K.current={width:p.offsetWidth,height:p.offsetHeight},le(_);let t=QG(p);F.current=t,N.current={x:t.x,y:t.y},fe({x:t.x,y:t.y},ne.current),`touches`in e||nK(p,e.pointerId,`setPointerCapture`)}return f?.(e.nativeEvent),ce(!0),B.current=null,V.current=!0,ue(0),de(!0),!0}function ye(){be(),W.current=!1,P.current=null}function be(){H.current=!1,U.current=null}function xe(e){if(ye(),!oe.current)return;ce(!1),B.current=null;let t=F.current;N.current={x:t.x,y:t.y},D(void 0),G.current=!1,de(!1);let n=r.current;n&&nK(n,e.pointerId,`releasePointerCapture`),ue(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(e.nativeEvent)}function Se(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:C?r(e,y,b):n(e),y:w?r(t,x,S):n(t)}}function Ce(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i,i=Math.abs(t),a=Math.abs(n);return w&&n!==0&&(!C||a>=i)?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,S,x):C&&t!==0&&(!w||i>a)?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,b,y):null}let we=Z(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=me(e);n&&(H.current=!0,U.current=n,W.current=!1,G.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:_}))&&ve(e,n)&&be())});function Te(e,n,r){if(!t||!oe.current)return;let i=jz(e.nativeEvent);if(he(e)&&!W.current){let t=e.currentTarget;if(_e(i,t))return}if(`touches`in e||e.preventDefault(),V.current&&(V.current=!1,h)){M.current=n;let t=$G(e.timeStamp);t!==null&&(ne.current=t)}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>z.current.y||c>0&&o<z.current.y)&&(z.current={x:z.current.x,y:o}),(s<0&&a>z.current.x||s>0&&a<z.current.x)&&(z.current={x:a,y:z.current.y});let l=a-M.current.x,u=o-M.current.y,d=o-z.current.y,f=a-z.current.x,p=B.current;p===null&&C&&w&&Math.sqrt(l*l+u*u)>=KG&&(p=Math.abs(l)>Math.abs(u)?`horizontal`:`vertical`,B.current=p);let m;if(!I.current)p===`vertical`?u>0?m=`down`:u<0&&(m=`up`):p===`horizontal`?l>0?m=`right`:l<0&&(m=`left`):m=Math.abs(l)>=Math.abs(u)?l>0?`right`:`left`:u>0?`down`:`up`,m&&(m===`left`&&y||m===`right`&&b||m===`up`&&x||m===`down`&&S)&&(I.current=m,L.current=ZG(m,l,u),D(m),le(m));else{let e=I.current,t=ZG(e,f,d);t>q.current?(R.current=!1,D(e)):!(y&&b)&&!(x&&S)&&L.current-t>=GG&&(R.current=!0)}let g=Se(l,u),v=F.current.x,T=F.current.y;p===`horizontal`?C&&(v+=g.x):(p===`vertical`||C&&(v+=g.x),w&&(T+=g.y));let E=N.current,O=v!==E.x||T!==E.y;N.current={x:v,y:T},O&&de(!0),fe({x:v,y:T},$G(e.timeStamp));let k=v-F.current.x,A=T-F.current.y,j={deltaX:k,deltaY:A,direction:I.current},P=0,H=_??I.current;if(H){let e=H===`left`||H===`right`?K.current.width:K.current.height,t=F.current.scale||1,n=ZG(H,k,A);e>0&&t>0&&n>0&&(P=n/(e*t))}ue(P,j)}let Ee=Z(e=>{if(!t)return;let i=N.current,a=F.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:I.current};if(!oe.current){ye(),ue(0,c);return}ce(!1),B.current=null,ye(),G.current=!1;let u=r.current;u&&(`touches`in e||nK(u,e.pointerId,`releasePointerCapture`));let d=o,f=s,m=ne.current,h=$G(e.timeStamp),g=m!==null&&h!==null&&h>m?h-m:0,v=g>0?Math.max(g,qG):0,y=v>0?d/v:0,b=v>0?f/v:0,x=ie.current.x,S=ie.current.y,C=re.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=YG){let t=Math.max(e,JG),n=i.x-C.x,r=i.y-C.y,a=n/t,o=r/t;a!==0&&(x=a),o!==0&&(S=o)}else x=0,S=0}let w=p?.({event:e.nativeEvent,direction:I.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(R.current&&!T){N.current={x:a.x,y:a.y},D(void 0),de(!1),ue(0,c);return}let E=!1,O;if(T)E=w,O=I.current??_;else for(let e of n)if(ZG(e,d,f)>q.current){E=!0,O=e;break}E&&O?(D(O),j(!0),de(!1),l?.(e.nativeEvent,{direction:O})):(N.current={x:a.x,y:a.y},D(void 0),de(!1),ue(0,c))}),De=Z(e=>{let t=me(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=tK(e.buttons);if(t&&(G.current=!0),e.buttons!==0&&!t){xe(e);return}if(e.buttons===0&&G.current){if(!oe.current){Ee(e);return}n=!0}}if(!O&&H.current){if(!he(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){ye();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:_})){let n=U.current,i=!1;if(he(e)){let a=r.current;if(n&&a){let r=ge(t,e.nativeEvent),o=Vg(a).body,s=o?_e(r,o):null;if(s&&(Az(a,s)||Az(s,a))){let e=Ce(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}ve(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(be(),M.current=n,z.current=n,P.current=n,V.current=!1):(be(),W.current=!1))}}let i=P.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};P.current=t,Te(e,t,o),n&&!(`touches`in e)&&Ee(e)}),Oe=Z((e,t)=>{De({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),ke=J.useCallback(()=>{let e=oe.current,t=N.current,n=F.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!A?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?eK(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[A,i]);return{swiping:O,swipeDirection:E,dragDismissed:A,getPointerProps:J.useCallback(()=>t?{onPointerDown:we,onPointerMove:De,onPointerUp:Ee,onPointerCancel:Ee}:{},[t,Ee,De,we]),getTouchProps:J.useCallback(()=>t?{onTouchStart:we,onTouchMove:De,onTouchEnd:Ee,onTouchCancel:Ee}:{},[t,Ee,De,we]),moveNative:Oe,getDragStyles:ke,reset:pe}}var iK=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=ER(),c=oz(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),e_(`h2`,e,{ref:t,props:[{id:c},o]})}),aK=iK;function oK(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function sK(e,t){let n=J.useRef(e),r=Z(t);Tg(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function cK(e,t){let{onClick:n,onPointerDown:r}=oK(Z((n,r)=>{(typeof e==`function`?e():e)||t(r||(hz?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function lK(e){let[t,n]=J.useState(null),r=cK(e,n);return sK(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var uK={...MR,...OR,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},dK=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=zW(),c=ER(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return e_(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:uK,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),fK=J.createContext(void 0);function pK(){return J.useContext(fK)}var mK=10,hK=.5,gK=.5,_K=300,vK=4,yK=.2,bK=4,xK=80,SK=360,CK=.1,wK=6,TK=2,EK=`[${jce}]`,DK=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=ER(),c=s.context.popupRef,l=s.context.backdropRef,{swipeDirection:u,notifyParentSwipingChange:d,notifyParentSwipeProgressChange:f,frontmostHeight:p,snapToSequentialPoints:m,swipeAreaActiveRef:h}=$W(),g=cz(),{snapPoints:_,resolvedSnapPoints:v,activeSnapPoint:y,activeSnapPointOffset:b,setActiveSnapPoint:x,popupHeight:S}=iG(),C=s.useState(`open`),w=s.useState(`mounted`),T=s.useState(`nested`),E=s.useState(`nestedOpenDrawerCount`),D=s.useState(`viewportElement`),O=s.useState(`popupElement`),k=g?.visualStateStore,A=E>0,j=u===`left`||u===`right`?`horizontal`:`vertical`,M=j===`vertical`,N=M?`horizontal`:`vertical`,[P,F]=J.useState(null),I=J.useRef(void 0),L=J.useRef(null),R=eB(),z=J.useRef(!1),B=J.useRef(!1),V=J.useRef(``),H=J.useRef(!1),U=J.useRef(!1),W=J.useRef(null),G=pK(),K=J.useMemo(()=>{if(!_||_.length<2||v.length<2||u!==`down`&&u!==`up`)return null;let e=v.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[v,_,u]),ee=J.useMemo(()=>!K||b===null?null:eG((b-K.minOffset)/K.range,0,1),[b,K]),q=J.useMemo(()=>_&&_.length>0&&(u===`down`||u===`up`)?u===`down`?[`down`,`up`]:[`up`,`down`]:[u],[_,u]),te=Z(e=>{c.current?.toggleAttribute(LW.swipeDismiss,e),l.current?.toggleAttribute(LW.swipeDismiss,e)}),ne=Z(()=>{te(!1),c.current?.removeAttribute(DR.endingStyle),F(null)}),re=Z(()=>{B.current&&(B.current=!1,d?.(!1))}),ie=Z((e,t,n)=>{let r=C&&!T&&t,i=r?e:0,a=C&&t?e:0;n&&f&&(f(a),a<=0&&re()),k?.set({swipeProgress:i,frontmostHeight:i>0?p:0});let o=l.current;if(!o)return;let s=r&&i>0;o.style.setProperty(FR.swipeProgress,s?`${i}`:`0`),s&&p>0?o.style.setProperty(PR.height,`${p}px`):o.style.removeProperty(PR.height)});function ae(e,t,n,r,i,a,o,s){let c=jK(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&_&&_.length>0?b??0:0)+ZG(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=ZG(t,o,s),f=Math.abs(d)>0?d:ZG(t,i,a);return f<=yK?null:CK+(eG(u/eG(f,yK,bK),xK,SK)-xK)/280*.9}function oe(e){if(B.current||!e)return;let t=ZG(e.direction??u,e.deltaX,e.deltaY);Math.abs(t)<mK||(B.current=!0,d?.(!0))}let se=rK({enabled:w&&!A,directions:q,elementRef:s.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:PR.swipeMovementX,y:PR.swipeMovementY},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=c.current,n=Vg(t).getSelection?.();if(!n||n.isCollapsed)return;let r=ig(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=ig(n.focusNode)?n.focusNode:n.focusNode?.parentElement;!Az(t,r)&&!Az(t,i)||n.removeAllRanges()},onSwipingChange(e){z.current=e,OK(s.context.backdropRef.current,e),!e&&!f&&re()},swipeThreshold({element:e,direction:t}){return MK(e,t)},canStart(e,t){let n=s.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=UG(n.getRootNode(),e.x,e.y);if(!i||!Az(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&IK(r,n))},onProgress(e,t){oe(t);let n=!!(_&&_.length>0);if(z.current&&u===`down`&&n&&t){let e=s.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(PR.swipeMovementY,`${tG(b??0,t.deltaY)}px`))}let r=e;if(K&&S>0){let e=b??K.minOffset;t&&Number.isFinite(t.deltaY)?r=(e=>eG((e-K.minOffset)/K.range,0,1))(eG(e+t.deltaY,0,S)):ee!==null&&(r=ee)}ie(r,!0,!0)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:c}){let l=s.context.popupRef.current;if(!l){ne();return}let d=l;function f(e){re(),te(!0),d.style.removeProperty(`transition`),d.setAttribute(DR.endingStyle,``),Zi.flushSync(()=>{F(ae(d,e,t,n,i,a,o,c))})}if(!_||_.length===0){if(!r){ne();return}let e=ZG(r,t,n);if(e<=0)return ne(),!1;if(ZG(r,i,a)>=hK)return f(r),!0;let o=e>MK(d,r);return o?f(r):ne(),o}if(u!==`down`&&u!==`up`){ne();return}if(!S)return ne(),!1;if(v.length===0){ne();return}let p=u===`down`?n:-n,h=Math.sign(p),g=u===`down`?c:-c,C=u===`down`?a:-a,w=g;if(h!==0&&Math.abs(p)>=mK){let e=Math.sign(w);e!==0&&e!==h&&(w=C)}let T=b??0,E=eG(T+p,0,S),D=Math.abs(w)>=gK?eG(w,-4,vK)*_K:0,O=m?E:eG(E+D,0,S),k=tz(ez,e),A=()=>(I.current=y,x(null,k),f(u),!0);if(m){let e=[...v].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=rG(t,T),r=e[rG(t,O)],i=Math.sign(w),a=h!==0&&i!==0&&i===h&&Math.abs(w)>=gK,o=O;if(a){let t=eG(n+h,0,e.length-1);if(t!==n){let n=e[t];(h>0?O<n.offset:O>n.offset)&&(r=n,o=n.offset)}else if(h>0)return A()}return Math.abs(o-S)<Math.abs(o-r.offset)?A():(x(r.value,k),ne(),!1)}if(w>=hK&&p>0)return A();let j=v[rG(v.map(e=>e.offset),O)];return Math.abs(O-S)<Math.abs(O-j.offset)?A():(x(j.value,k),ne(),!1)},onDismiss(e){k?.set({swipeProgress:0,frontmostHeight:0});let t=s.context.backdropRef.current;t&&(t.style.setProperty(FR.swipeProgress,`0`),t.style.removeProperty(PR.height));let n=tz(ez,e);if(s.setOpen(!1,n),n.isCanceled){let t=I.current;t!==void 0&&x(t,tz(ez,e)),I.current=void 0,L.current?.(),ne();return}if(s.select(`open`)){let t=e;R.request(()=>{if(s.select(`open`)){let e=I.current;e!==void 0&&x(e,tz(ez,t)),I.current=void 0,ne(),L.current?.()}else I.current=void 0});return}I.current=void 0,te(!0)}}),ce=se.getPointerProps(),le=se.getTouchProps(),{moveNative:ue,reset:de}=se;L.current=de,J.useEffect(()=>{let e=D??O;if(!e)return;let t=e,n=Vg(t);function r(e,r,i){let a=M?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||IK(n,t)||!C||!w||A||BK(r,e,i,M))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),ue(e,t);return}if(!VK(o,j)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=WK(o,j,u,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),ue(e,t))}function i(e){if(G?.onTouchMove(e),U.current)return;let t=W.current,n=e.touches[0];!n||!t||(r(e,t,n),zK(t,n))}return qz(n,`touchmove`,i,{passive:!1,capture:!0})},[w,A,C,O,M,j,u,ue,D,G]),Tg(()=>{!K||se.swiping||ie(!C||T?0:ee??0,!0,!1)},[ie,p,T,f,C,ee,K,se.swiping,s,k]),Tg(()=>{if(f)return C||f(0),()=>{f(0)}},[f,C]),Tg(()=>{C&&(h.current||de(),ne())},[ne,C,de,h]),Tg(()=>{let e=l.current;return()=>{k?.set({swipeProgress:0,frontmostHeight:0}),OK(e,!1);let t=l.current;t!==e&&OK(t,!1),re()}},[l,re,k]);let fe=J.useMemo(()=>({swiping:se.swiping,getDragStyles:se.getDragStyles,swipeStrength:P??null,setSwipeDismissed:te}),[te,se.getDragStyles,se.swiping,P]);function pe(e){U.current=e,W.current=null}function me(){pe(!1),V.current=``,H.current=!1}function he(e){return V.current=``,e.pointerType!==`touch`}return(0,Y.jsx)(dK,{ref:t,className:r,style:i,render:n,...Og(o,{onPointerDown(e){if(V.current=e.pointerType,H.current=e.pointerType===`pen`,!C||!w||A)return;let t=UG(e.currentTarget.getRootNode(),e.clientX,e.clientY);kK(t)||AK(t)||e.pointerType!==`touch`&&ce.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&ce.onPointerMove?.(e)},onPointerUp(e){he(e)&&ce.onPointerUp?.(e)},onPointerCancel(e){he(e)&&ce.onPointerCancel?.(e)},onTouchStart(e){if(V.current===`pen`&&H.current){H.current=!1,pe(!1);return}if(!C||!w||A){pe(!1);return}let t=e.touches[0];if(!t)return;if(RK(e)){pe(!1);return}let n=e.currentTarget,r=UG(n.getRootNode(),t.clientX,t.clientY),i=jz(e.nativeEvent),a=ig(i)?i:n;if(!Az(n,a)){pe(!0);return}if(G?.onTouchStart(e),kK(r)){pe(!0);return}U.current=!1;let o=HG(a,n,j),s=HG(a,n,N)!=null,c=null;o&&(c=UK(o,j,u)?null:!1),W.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:c,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},le.onTouchStart?.(e)},onTouchEnd(e){G?.onTouchEnd(e),me(),le.onTouchEnd?.(e)},onTouchCancel(e){G?.onTouchCancel(),me(),le.onTouchCancel?.(e)},"data-nested-dialog-open":void 0}),children:(0,Y.jsx)(aG.Provider,{value:fe,children:a})})});function OK(e,t){e?.toggleAttribute(LW.swiping,t)}function kK(e){return!!e?.closest(NV)}function AK(e){return!!e?.closest(EK)}function jK(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function MK(e,t){return Math.max(jK(e,t)*.5,mK)}function NK(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function PK(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function FK(e,t){let n=ig(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=ig(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||Az(t,n)||Az(t,r)}function IK(e,t){let n=kz(e);if(n&&Az(t,n)&&PK(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:FK(r,t)}function LK(e,t){return e.composedPath().some(e=>NK(e,t))}function RK(e){return LK(e.nativeEvent,tg(e.currentTarget))}function zK(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function BK(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=wK&&s>o+TK?(e.preserveNativeCrossAxisScroll=!0,!0):o>=wK?(e.drawerAxisAttributed=!0,!1):!0}function VK(e,t){return HK(e,t).max>0}function HK(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function UK(e,t,n){let r=GK(n,t),{offset:i,max:a}=HK(e,t);return r?i<=0:i>=a}function WK(e,t,n,r){return(GK(n,t)?r>0:r<0)&&UK(e,t,n)}function GK(e,t){return t===`vertical`?e===`down`:e===`right`}var KK=J.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=ER(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return e_(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:NR,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),qK=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=ER(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);zW(),IU({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?RU(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=e_(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...LU,hidden:!m,onKeyDown(e){WW.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:uK});return(0,Y.jsx)(oH,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function JK(e){return MG(`dialog`,e)}function YK(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(JK,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function XK(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(pG,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function ZK(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(nz,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function QK(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(KK,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $K(e){let t=(0,X.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(QK,{}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=c);let l;t[8]===o?l=t[9]:(l=o&&(0,Y.jsxs)(nz,{"data-slot":`dialog-close`,render:(0,Y.jsx)(pv,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Y.jsx)(my,{}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=l);let u;return t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==l?(u=(0,Y.jsxs)(XK,{children:[s,(0,Y.jsxs)(qK,{"data-slot":`dialog-content`,className:c,...i,children:[n,l]})]}),t[10]=n,t[11]=i,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}function eq(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tq(e){let t=(0,X.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a!==void 0&&a,s;t[5]===r?s=t[6]:(s=Q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=s);let c;t[7]===o?c=t[8]:(c=o&&(0,Y.jsx)(nz,{render:(0,Y.jsx)(pv,{variant:`outline`}),children:`Close`}),t[7]=o,t[8]=c);let l;return t[9]!==n||t[10]!==i||t[11]!==s||t[12]!==c?(l=(0,Y.jsxs)(`div`,{"data-slot":`dialog-footer`,className:s,...i,children:[n,c]}),t[9]=n,t[10]=i,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function nq(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(iK,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rq(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(sz,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function iq(e){let t=(0,X.c)(3),n=(0,J.useRef)(e),r;t[0]===e?r=t[1]:(r=()=>{n.current=e},t[0]=e,t[1]=r),(0,J.useInsertionEffect)(r);let i;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(...e)=>{let t=e;return n.current(...t)},t[2]=i):i=t[2],i}function aq(e,t,n,r){let i=(0,X.c)(10),a=r?.enabled??!0,o=r?.capture??!1,s=r?.deferAttach??!1,c;i[0]===n?c=i[1]:(c=e=>n(e),i[0]=n,i[1]=c);let l=iq(c),u,d;i[2]!==o||i[3]!==s||i[4]!==a||i[5]!==l||i[6]!==e||i[7]!==t?(u=()=>{if(!a)return;let n=e=>l(e);if(!s)return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o);let r=setTimeout(()=>{e.addEventListener(t,n,o)},0);return()=>{clearTimeout(r),e.removeEventListener(t,n,o)}},d=[e,t,a,o,s,l],i[2]=o,i[3]=s,i[4]=a,i[5]=l,i[6]=e,i[7]=t,i[8]=u,i[9]=d):(u=i[8],d=i[9]),(0,J.useEffect)(u,d)}function oq(e,t){let n=(0,X.c)(7),r;n[0]===t?r=n[1]:(r=()=>t(),n[0]=t,n[1]=r);let i=iq(r),a;n[2]===i?a=n[3]:(a=()=>{i()},n[2]=i,n[3]=a);let o;n[4]!==e||n[5]!==i?(o=[e,i],n[4]=e,n[5]=i,n[6]=o):o=n[6],(0,J.useEffect)(a,o)}function sq(e,t){let n=(0,X.c)(7),r;n[0]===t?r=n[1]:(r=()=>t(),n[0]=t,n[1]=r);let i=iq(r),a;n[2]===i?a=n[3]:(a=()=>{let e=setTimeout(()=>i(),0);return()=>clearTimeout(e)},n[2]=i,n[3]=a);let o;n[4]!==e||n[5]!==i?(o=[e,i],n[4]=e,n[5]=i,n[6]=o):o=n[6],(0,J.useEffect)(a,o)}function cq(e,t){let n=(0,X.c)(4),[r,i]=(0,J.useState)(e),a,o;return n[0]!==t||n[1]!==e?(a=()=>{let n=setTimeout(()=>i(e),t);return()=>clearTimeout(n)},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,J.useEffect)(a,o),r}function lq(e,t){let n=(0,X.c)(6),r;n[0]===e?r=n[1]:(r=()=>e(),n[0]=e,n[1]=r);let i=iq(r),a,o;n[2]!==t||n[3]!==i?(a=()=>{if(t===null)return;let e=setInterval(()=>i(),t);return()=>clearInterval(e)},o=[t,i],n[2]=t,n[3]=i,n[4]=a,n[5]=o):(a=n[4],o=n[5]),(0,J.useEffect)(a,o)}function uq(e){let t=(0,X.c)(1),{intervalMs:n,enabled:r}=e,[i,a]=(0,J.useState)(dq),o;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>a(Date.now()),t[0]=o):o=t[0],lq(o,r?n:null),i}function dq(){return Date.now()}function fq(e,t){let n=(0,X.c)(4),[r,i]=(0,J.useState)(0),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!t){i(0);return}let n=e.current?.offsetHeight??0;n>0&&i(n)},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,J.useLayoutEffect)(a,o),r}var pq=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]`;function mq(e){return Array.from(e.querySelectorAll(pq)).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement)}function hq(e,t){let n=(0,X.c)(8),r=(0,J.useRef)(null),i,a;n[0]!==t||n[1]!==e?(i=()=>{let n=t?e.current:null;return n&&(r.current=document.activeElement instanceof HTMLElement?document.activeElement:null,n.contains(document.activeElement)||(mq(n)[0]??n).focus()),()=>{r.current?.focus(),r.current=null}},a=[e,t],n[0]=t,n[1]=e,n[2]=i,n[3]=a):(i=n[2],a=n[3]),(0,J.useEffect)(i,a);let o;n[4]===e?o=n[5]:(o=t=>{let n=e.current;if(t.key!==`Tab`||!n)return;let r=mq(n);if(r.length===0){t.preventDefault();return}let i=r[0],a=r.at(-1),o=document.activeElement;n.contains(o)?t.shiftKey&&o===i?(t.preventDefault(),a?.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus()):(t.preventDefault(),(t.shiftKey?a:i)?.focus())},n[4]=e,n[5]=o);let s=iq(o),c;n[6]===t?c=n[7]:(c={enabled:t},n[6]=t,n[7]=c),aq(document,`keydown`,s,c)}var gq=`48rem`,_q;function vq(){if(!_q){let e=getComputedStyle(document.documentElement).getPropertyValue(`--breakpoint-md`).trim();_q=window.matchMedia(`(min-width: ${e||gq})`)}return _q}function yq(e){let t=vq();return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function bq(){return!vq().matches}function xq(){return(0,J.useSyncExternalStore)(yq,bq)}var Sq=(0,J.createContext)(null);function Cq(){return`overlay-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function wq(e,t,n){return{id:Cq(),component:e,props:t??{},options:n??{}}}function Tq(e){let t=(0,X.c)(13),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,J.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(e,t,n)=>{let r=wq(e,t,n);return a(e=>{for(let t of e)t.options.onClose?.();return[r]}),r.id},t[1]=o):o=t[1];let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t,n)=>{let r=wq(e,t,n);return a(e=>[...e,r]),r.id},t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a(Dq)},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(e,t,n)=>{let r=wq(e,t,n);return a(e=>e.length===0?[r]:(e.at(-1)?.options.onClose?.(),[...e.slice(0,-1),r])),r.id},t[4]=f):f=t[4];let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{a(Eq)},t[5]=m):m=t[5];let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{a(t=>{let n=t.findIndex(t=>t.id===e);if(n===-1)return t;for(let e=n;e<t.length;e++)t[e].options.onClose?.();return t.slice(0,n)})},t[6]=g):g=t[6];let _=g,v=i.length>0,y;t[7]!==i||t[8]!==v?(y={stack:i,open:s,push:l,pop:d,replace:p,closeAll:h,close:_,hasOverlays:v,depth:i.length},t[7]=i,t[8]=v,t[9]=y):y=t[9];let b=y,x;return t[10]!==n||t[11]!==b?(x=(0,Y.jsx)(Sq.Provider,{value:b,children:n}),t[10]=n,t[11]=b,t[12]=x):x=t[12],x}function Eq(e){for(let t of e)t.options.onClose?.();return[]}function Dq(e){return e.length<=1?(e[0]?.options.onClose?.(),[]):(e.at(-1)?.options.onClose?.(),e.slice(0,-1))}function Oq(){let e=(0,J.useContext)(Sq);if(!e)throw Error(`useOverlay must be used within an OverlayProvider`);return e}function kq(e){let t=(0,X.c)(8),{stack:n}=Oq(),r;t[0]===e?r=t[1]:(r=t=>t.id===e,t[0]=e,t[1]=r);let i=n.findIndex(r),a=i===0,o=i===n.length-1,s=i>0,c;return t[2]!==i||t[3]!==n.length||t[4]!==a||t[5]!==o||t[6]!==s?(c={index:i,isFirst:a,isLast:o,depth:n.length,showBackButton:s},t[2]=i,t[3]=n.length,t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}var Aq={type:`spring`,stiffness:400,damping:35,mass:.8},jq={type:`spring`,stiffness:350,damping:30,mass:.8},Mq={hidden:{opacity:0,scale:.95},visible:{opacity:1,scale:1,transition:{type:`spring`,stiffness:400,damping:30}},exit:{opacity:0,scale:.95,transition:{duration:.15,ease:[.4,0,1,1]}}};function Nq(e,t){return e?`0%`:t?`-35%`:`100%`}function Pq(){let e=(0,X.c)(22),{stack:t,closeAll:n,pop:r}=Oq(),i=CR(),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=t.length>0,c=t,l=c.length-1,u=fq(a,s),d;e[0]===t?d=e[1]:(d=t.at(-1),e[0]=t,e[1]=d);let f=d,p;e[2]===i?p=e[3]:(p=i?{duration:.01}:Aq,e[2]=i,e[3]=p);let m=p,h;e[4]!==n||e[5]!==f?.options.closeOnBackdropClick?(h=()=>{f?.options.closeOnBackdropClick!==!1&&n()},e[4]=n,e[5]=f?.options.closeOnBackdropClick,e[6]=h):h=e[6],f?.options.closeOnBackdropClick;let g=h,_;e[7]!==f?.options.closeOnEscape||e[8]!==r?(_=e=>{e.key===`Escape`&&f?.options.closeOnEscape!==!1&&r()},e[7]=f?.options.closeOnEscape,e[8]=r,e[9]=_):_=e[9],f?.options.closeOnEscape;let v=_,y;if(e[10]===s?y=e[11]:(y={enabled:s},e[10]=s,e[11]=y),aq(document,`keydown`,v,y),hq(o,s),!s)return null;let b;e[12]!==l||e[13]!==f||e[14]!==g||e[15]!==s||e[16]!==u||e[17]!==c||e[18]!==m?(b=s&&(0,Y.jsx)(YK,{modal:!1,open:!0,children:(0,Y.jsxs)(XK,{keepMounted:!0,children:[(0,Y.jsx)(wR.div,{animate:{opacity:1},className:`fixed inset-0 z-50 bg-foreground/60`,exit:{opacity:0},initial:{opacity:0},onClick:g,transition:{duration:.2}}),(0,Y.jsx)(wR.div,{animate:`visible`,"aria-labelledby":f?`overlay-title-${f.id}`:void 0,"aria-modal":`true`,className:`fixed top-1/2 left-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 px-4`,exit:`exit`,initial:`hidden`,ref:o,role:`dialog`,variants:Mq,children:(0,Y.jsx)(PL,{children:(0,Y.jsx)(wR.div,{className:`relative flex max-h-[calc(100dvh-2rem)] flex-col overflow-hidden rounded-xl border bg-card shadow-lg ring-1 ring-border`,layout:`position`,style:{minHeight:u>0?u:`auto`},transition:Aq,children:(0,Y.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,ref:a,children:c.map((e,t)=>{let n=t===l,r=t<l,i=n&&c.length>1?{x:`100%`,scale:1,opacity:1}:!1;return(0,Y.jsx)(wR.div,{animate:{x:Nq(n,r),scale:n?1:.94,opacity:+!!n},"aria-hidden":!n,className:Q(`w-full`,n?`relative flex min-h-0 flex-col`:`pointer-events-none absolute inset-0`),initial:i,transition:m,children:(0,Y.jsx)(e.component,{overlayId:e.id,...e.props})},e.id)})})})})})]})}),e[12]=l,e[13]=f,e[14]=g,e[15]=s,e[16]=u,e[17]=c,e[18]=m,e[19]=b):b=e[19];let x;return e[20]===b?x=e[21]:(x=(0,Y.jsx)(ase,{children:b}),e[20]=b,e[21]=x),x}function Fq(){let e=(0,X.c)(39),{stack:t,closeAll:n,pop:r}=Oq(),i=CR(),a=(0,J.useRef)(null),o=t.length>0,s=t,c=s.length-1,l=fq(a,o),u;e[0]===t?u=e[1]:(u=t.at(-1),e[0]=t,e[1]=u);let d=u,f;e[2]===i?f=e[3]:(f=i?{duration:.01}:Aq,e[2]=i,e[3]=f);let p=f,m;e[4]!==d?.options.closeOnEscape||e[5]!==r?(m=e=>{e.key===`Escape`&&d?.options.closeOnEscape!==!1&&r()},e[4]=d?.options.closeOnEscape,e[5]=r,e[6]=m):m=e[6],d?.options.closeOnEscape;let h=m,g;e[7]===o?g=e[8]:(g={enabled:o},e[7]=o,e[8]=g),aq(document,`keydown`,h,g);let _;e[9]===n?_=e[10]:(_=e=>{e||n()},e[9]=n,e[10]=_);let v;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Y.jsx)(Tce,{className:`fixed inset-0 z-50 bg-black opacity-[calc(0.6*(1-var(--drawer-swipe-progress)))] transition-opacity duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)] data-swiping:duration-0 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] motion-reduce:transition-none`}),e[11]=v):v=e[11];let y=d?`overlay-title-${d.id}`:void 0,b;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=Q(`flex max-h-[90vh] w-full flex-col outline-none`,`rounded-t-xl border-t bg-card shadow-lg`,`pb-[env(safe-area-inset-bottom,0px)]`,`[transform:translateY(var(--drawer-swipe-movement-y))] transition-transform duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]`,`data-swiping:select-none data-starting-style:[transform:translateY(calc(100%+2px))] data-ending-style:[transform:translateY(calc(100%+2px))] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] motion-reduce:transition-none`),e[12]=b):b=e[12];let x=d?.options.title||`Overlay`,S;e[13]===x?S=e[14]:(S=(0,Y.jsx)(aK,{className:`sr-only`,children:x}),e[13]=x,e[14]=S);let C;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Y.jsx)(`div`,{className:`mx-auto mt-3 h-1.5 w-12 shrink-0 rounded-full bg-muted-foreground/20`}),e[15]=C):C=e[15];let w=l>0?l:`auto`,T;e[16]===w?T=e[17]:(T={minHeight:w},e[16]=w,e[17]=T);let E;if(e[18]!==c||e[19]!==s||e[20]!==p){let t;e[22]!==c||e[23]!==s.length||e[24]!==p?(t=(e,t)=>{let n=t===c,r=t<c,i=n&&s.length>1?{x:`100%`,scale:1,opacity:1}:!1;return(0,Y.jsx)(wR.div,{animate:{x:Nq(n,r),scale:n?1:.94,opacity:+!!n},"aria-hidden":!n,className:Q(`w-full`,n?`relative`:`pointer-events-none absolute inset-0`),initial:i,transition:p,children:(0,Y.jsx)(e.component,{overlayId:e.id,...e.props})},e.id)},e[22]=c,e[23]=s.length,e[24]=p,e[25]=t):t=e[25],E=s.map(t),e[18]=c,e[19]=s,e[20]=p,e[21]=E}else E=e[21];let D;e[26]===E?D=e[27]:(D=(0,Y.jsx)(`div`,{className:`relative`,ref:a,children:E}),e[26]=E,e[27]=D);let O;e[28]!==T||e[29]!==D?(O=(0,Y.jsx)(PL,{children:(0,Y.jsx)(wR.div,{className:`relative flex-1 overflow-hidden`,layout:`position`,style:T,transition:jq,children:D})}),e[28]=T,e[29]=D,e[30]=O):O=e[30];let k;e[31]!==O||e[32]!==y||e[33]!==S?(k=(0,Y.jsxs)(mG,{children:[v,(0,Y.jsx)(DK,{className:`fixed inset-0 z-50 flex items-end justify-center`,children:(0,Y.jsxs)(uG,{"aria-labelledby":y,className:b,children:[S,C,O]})})]}),e[31]=O,e[32]=y,e[33]=S,e[34]=k):k=e[34];let A;return e[35]!==o||e[36]!==k||e[37]!==_?(A=(0,Y.jsx)(FG,{onOpenChange:_,open:o,children:k}),e[35]=o,e[36]=k,e[37]=_,e[38]=A):A=e[38],A}function Iq(){let e=(0,X.c)(2);if(xq()){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(Fq,{}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(Pq,{}),e[1]=t):t=e[1],t}function Lq(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(Iq,{}),e[0]=t):t=e[0],t}var Rq=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},zq=[`light`,`dark`],Bq=`(prefers-color-scheme: dark)`,Vq=typeof window>`u`,Hq=J.createContext(void 0),Uq={setTheme:e=>{},themes:[]},Wq=()=>J.useContext(Hq)??Uq,Gq=e=>J.useContext(Hq)?J.createElement(J.Fragment,null,e.children):J.createElement(qq,{...e}),Kq=[`light`,`dark`],qq=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=Kq,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=J.useState(()=>Yq(i,o)),[m,h]=J.useState(()=>f===`system`?Zq():f),g=c?Object.values(c):a,_=J.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Zq());let a=c?c[i]:i,l=t?Xq(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=zq.includes(o)?o:null,t=zq.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=J.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=J.useCallback(t=>{let r=Zq(t);h(r),f===`system`&&n&&!e&&_(`system`)},[f,e]);J.useEffect(()=>{let e=window.matchMedia(Bq);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),J.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),J.useEffect(()=>{_(e??f)},[e,f]);let b=J.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return J.createElement(Hq.Provider,{value:b},J.createElement(Jq,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Jq=J.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return J.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Rq.toString()})(${u})`}})}),Yq=(e,t)=>{if(Vq)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Xq=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Zq=e=>(e||=window.matchMedia(Bq),e.matches?`dark`:`light`);function Qq(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Y.jsx)(Gq,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var $q={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},eJ=e=>e===`light`||e===`dark`||e===`system`?e:`system`,tJ=e=>{let t=(0,X.c)(9),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Wq(),i=r===void 0?`system`:r,a;t[2]===i?a=t[3]:(a=eJ(i),t[2]=i,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={success:(0,Y.jsx)(Av,{className:`size-4`}),info:(0,Y.jsx)(qv,{className:`size-4`}),warning:(0,Y.jsx)(fy,{className:`size-4`}),error:(0,Y.jsx)(ry,{className:`size-4`}),loading:(0,Y.jsx)(Zv,{className:`size-4 animate-spin`})},t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[5]=s):s=t[5];let c;return t[6]!==n||t[7]!==a?(c=(0,Y.jsx)(hne,{theme:a,className:`toaster group`,icons:o,style:$q,toastOptions:s,...n}),t[6]=n,t[7]=a,t[8]=c):c=t[8],c},nJ=rA(),rJ={condition:`Condition`,wait:`Wait`,eventSplit:`Event Split`};function iJ(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function aJ(e,t,n){return iJ(e,t)??n}function oJ(e,t){let n=iJ(e,t)?.trim();return n&&n.length>0?n:void 0}function sJ(e){if(!(!e||e.data.type!==`action`))return iJ(e.data.config,`actionType`)}function cJ(e){return e===rJ.wait}function lJ(e){return!e||e.data.type!==`action`?!1:cJ(sJ(e))}function uJ(e){return lJ(e)&&iJ(e?.data.config,`waitMode`)===`event`}function dJ(e){return e?.data.type===`lifecycle`}function fJ(e){return!e||e.data.type!==`action`?!1:sJ(e)===rJ.condition}function pJ(e){return!e||e.data.type!==`action`?!1:sJ(e)===rJ.eventSplit}function mJ(e,t){return Ny(e,t)?.integration}function hJ(e,t,n){let r=iJ(t.data.config,`actionType`);if(!r)return t;let i=mJ(e,r);if(!i)return t;let a=iJ(t.data.config,`integrationId`);if(a&&n.some(e=>e.id===a))return t;let o=n.filter(e=>e.type===i);return o.length===1?_J(t,o[0].id):o.length===0&&a?_J(t,void 0):t}function gJ(e,t,n){let r=!1,i=t.map(t=>{let i=hJ(e,t,n);return i!==t&&(r=!0),i});return r?i:t}function _J(e,t){return{...e,data:{...e.data,config:{...e.data.config,integrationId:t}}}}function vJ(e){return Array.isArray(e)?e:e==null?[]:[e]}var yJ=class extends Error{constructor(...e){super(...e),this.name=`AbortError`}};function bJ(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}function xJ(e){return!e||typeof e!=`object`?!1:`next`in e&&typeof e.next==`function`&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==`function`}var SJ=Symbol.asyncDispose??Symbol.for(`asyncDispose`),CJ=class{isDone=!1;isExecuteComplete=!1;cleanup;next;constructor(e,t){this.cleanup=t,this.next=bJ(async()=>{if(this.isDone)return{done:!0,value:void 0};let t;try{let t=await e();return t.done&&(this.isDone=!0),t}catch(e){throw t={value:e},this.isDone=!0,e}finally{this.isDone&&!this.isExecuteComplete&&(this.isExecuteComplete=!0,await this.cleanup(t?{kind:`error`,error:t.value}:{kind:`success`}))}})}async return(e){return this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`})),{done:!0,value:e}}async throw(e){throw this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`,error:e})),e}async[SJ](){this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`}))}[Symbol.asyncIterator](){return this}};function wJ(e){if(e)return JSON.parse(e)}function TJ(e){return JSON.stringify(e)}function EJ(e){if(!e)return!1;let t=typeof e;return t===`object`||t===`function`}var DJ=new WeakMap;function OJ(e,t,{bind:n=!0}={}){let r=Reflect.get(e,t);if(!n||typeof r!=`function`)return r;let i=DJ.get(r);i||DJ.set(r,i=new WeakMap);let a=i.get(e);return a||i.set(e,a=r.bind(e)),a}function kJ(e){try{return decodeURIComponent(e)}catch{return e}}function AJ(e){return e[0]??{}}var jJ=`orpc`;function MJ(e){return e instanceof Error&&e.name.includes(`Abort`)}function NJ(e){let t;return()=>{if(t)return t.result;let n=e();return t={result:n},n}}function PJ(e){return`/${e.map(encodeURIComponent).join(`/`)}`}var FJ=2,IJ=Symbol.for(`ORPC_OPENTELEMETRY_CONFIG`);function LJ(){return globalThis[IJ]}function RJ(e){let t=LJ()?.tracer;if(!t)return;let{name:n,context:r,...i}=typeof e==`string`?{name:e}:e;return t.startSpan(n,i,r)}function zJ(e,t){if(!e)return;let n=BJ(t);e.recordException(n),MJ(t)||e.setStatus({code:FJ,message:n.message})}function BJ(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};return`code`in e&&(typeof e.code==`string`||typeof e.code==`number`)&&(t.code=e.code),t}return{message:String(e)}}async function VJ(e,t){let n=LJ()?.tracer;if(!n)return t();typeof e==`string`&&(e={name:e});let r=async e=>{try{return await t(e)}catch(t){throw zJ(e,t),t}finally{e.end()}};return e.context?n.startActiveSpan(e.name,e,e.context,r):n.startActiveSpan(e.name,e,r)}async function HJ(e,t){let n=LJ();if(!e||!n)return t();let r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}function UJ(e,{runWith:t,mapResult:n,mapError:r,onError:i,onFinish:a}){t??=e=>e();let o;return new CJ(async()=>{try{let r;try{r=await t(()=>e.next()),o=r.done}catch(e){throw o=!0,e}return n?await n(r):r}catch(e){throw await i?.(e),r?await r(e):e}},async n=>{try{if(!o)try{await t(async()=>e.return?.())}catch(e){throw await i?.(e),e}}finally{await a?.()}})}function WJ(e,t){let n=NJ(()=>RJ(e));return UJ(t,{runWith:e=>HJ(n(),e),mapResult(e){return n()?.addEvent(e.done?`completed`:`yielded`),e},onError(e){zJ(n(),e)},onFinish(){n()?.end()}})}function GJ(e,...t){return typeof e==`function`?e(...t):e}function KJ(e,t){return new Proxy(typeof e==`function`?t:e,{get(n,r){return OJ(r in t?t:GJ(e),r)},has(n,r){return Reflect.has(t,r)||Reflect.has(GJ(e),r)}})}function qJ(e){return EJ(e)?Object.getPrototypeOf(e)?.constructor:null}function JJ(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function YJ(e,t){let n=e;for(let e of t){if(!EJ(n)||!Object.hasOwn(n,e))return;n=n[e]}return n}var XJ=(()=>{let e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})();function ZJ(e){let t=new XJ,n=e;for(;n&&n!==Object.prototype;){for(let r of Object.getOwnPropertyNames(n)){if(r===`constructor`||r in t)continue;let n=e[r];typeof n==`function`&&(t[r]=n.bind(e))}for(let r of Object.getOwnPropertySymbols(n)){if(r in t)continue;let n=e[r];typeof n==`function`&&(t[r]=n.bind(e))}n=Object.getPrototypeOf(n)}return t}function QJ(e,t,n){if(!e?.length)return n(t);let r=(t,i)=>{let a=e[i];return a?a({...t,next:(e=t)=>r(e,i+1)}):n(t)};return r(t,0)}function $J(e){let t=e.length,n=new Map;for(let r=0;r<t;r++){let t=e[r],i=n.get(t.name);i===void 0?n.set(t.name,[r]):i.push(r)}let r=Array.from({length:t},()=>new Set);for(let i=0;i<t;i++){let t=e[i],a=t.before;if(a!==void 0)for(let e of a){let t=n.get(e);if(t!==void 0)for(let e of t){let t=r[e];t!==void 0&&t.add(i)}}let o=t.after;if(o!==void 0){let e=r[i];if(e!==void 0)for(let t of o){let r=n.get(t);if(r!==void 0)for(let t of r)e.add(t)}}}let i=[],a=new Set,o=new Set;function s(t){if(o.has(t))return;if(a.has(t)){let n=e[t],r=n===void 0?`unknown`:n.name;throw Error(`Circular dependency detected involving plugin "${r}"`)}a.add(t);let n=r[t];if(n!==void 0)for(let e of n)s(e);a.delete(t),o.add(t);let c=e[t];c!==void 0&&i.push(c)}for(let e=0;e<t;e++)s(e);return i}var eY=class extends TypeError{},tY=class extends TypeError{},nY=class extends Error{constructor(e,t={}){super(t?.message??`Error Event`,t),this.data=e}},rY=/\r\n|[\n\r]/,iY=/(?:\r\n|\r(?!\n)|\n)(?:\r\n|\r(?!\n)|\n)/,aY=/^\s/;function oY(e){let t=e.split(rY),n={};for(let e of t){let t=e.indexOf(`:`),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t+1).replace(aY,``);if(t===0)n.comments??=[],n.comments.push(i);else if(r===`data`)n.data===void 0?n.data=i:n.data+=`
|
|
50
|
+
${i}`;else if(r===`event`)n.event=i;else if(r===`id`)n.id=i;else if(r===`retry`){let e=Number.parseInt(i);Number.isInteger(e)&&e>=0&&e.toString()===i&&(n.retry=e)}}return n}var sY=class{constructor(e){this.onEvent=e}incomplete=``;trailingCR=!1;feed(e){this.trailingCR&&e.startsWith(`
|
|
51
|
+
`)&&(e=e.slice(1)),this.trailingCR=e.endsWith(`\r`),this.incomplete+=e;let t=this.incomplete.split(iY);this.incomplete=t.pop();for(let e of t){let t=oY(e);this.onEvent(t)}}end(){if(this.incomplete)throw new tY(`Event Stream ended before complete`)}},cY=class extends TransformStream{constructor(){let e;super({start(t){e=new sY(e=>{t.enqueue(e)})},transform(t){e.feed(t)},flush(){e.end()}})}},lY=/\r\n|[\n\r]/;function uY(e){return lY.test(e)}function dY(e){if(uY(e))throw new eY(`Event's id must not contain a carriage return or newline character`)}function fY(e){if(uY(e))throw new eY(`Event's event must not contain a carriage return or newline character`)}function pY(e){if(!Number.isInteger(e)||e<0)throw new eY(`Event's retry must be a integer and >= 0`)}function mY(e){if(uY(e))throw new eY(`Event's comment must not contain a carriage return or newline character`)}function hY(e){let t=``;if(e!==void 0){let n=e.split(lY);for(let e of n)t+=`data: ${e}
|
|
52
|
+
`}return t}function gY(e){let t=``;for(let n of e??[])mY(n),t+=`: ${n}
|
|
53
|
+
`;return t}function _Y(e){let t=``;return t+=gY(e.comments),e.event!==void 0&&(fY(e.event),t+=`event: ${e.event}
|
|
54
|
+
`),e.retry!==void 0&&(pY(e.retry),t+=`retry: ${e.retry}
|
|
55
|
+
`),e.id!==void 0&&(dY(e.id),t+=`id: ${e.id}
|
|
56
|
+
`),t+=hY(e.data),t+=`
|
|
57
|
+
`,t}var vY=Symbol.for(`STANDARDSERVER_EVENT_META`),yY=Symbol.for(`STANDARDSERVER_EVENT_SOURCE`);function bY(e,t){let n;if(t.id!==void 0&&(dY(t.id),n??={},n.id=t.id),t.retry!==void 0&&(pY(t.retry),n??={},n.retry=t.retry),t.comments!==void 0){for(let e of t.comments)mY(e);n??={},n.comments=t.comments}return n?new Proxy(e,{get(e,t,r){return t===yY?e:t===vY?n:OJ(e,t)}}):e}function xY(e){if(!EJ(e))return[e,void 0];let t=e[vY];return[e[yY]??e,t]}function SY(e){if(EJ(e))return e[vY]}function CY(e){return`inline; filename="${e.replace(/[^\x20-\x7E]/g,`_`).replace(/"/g,`\\"`)}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}function wY(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==`string`)return kJ(t[2]);let n=e.match(/filename="((?:\\"|[^"])*)"/i);if(n&&typeof n[1]==`string`)return n[1].replace(/\\"/g,`"`)}function TY(e,t){let n={...e};for(let e in t)Array.isArray(t[e])?n[e]=[...vJ(n[e]),...t[e]]:t[e]!==void 0&&(n[e]=Array.isArray(n[e])?[...n[e],t[e]]:n[e]===void 0?t[e]:[n[e],t[e]]);return n}function EY(e){let t=e.indexOf(`#`),n=e.indexOf(`?`),r=n!==-1&&(t===-1||n<t),i=r?n:t===-1?e.length:t,a=t===-1?e.length:t;return[e.slice(0,i),r?e.slice(n,a):void 0,t===-1?void 0:e.slice(t)]}var DY={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_SUPPORTED:405,NOT_ACCEPTABLE:406,TIMEOUT:408,CONFLICT:409,GONE:410,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,UNSUPPORTED_MEDIA_TYPE:415,UNPROCESSABLE_CONTENT:422,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},OY,kY=class e extends Error{static{let t=Symbol.for(`ORPC_ERROR_CONSTRUCTORS`);globalThis[t]??=new WeakSet,OY=globalThis[t],OY.add(e)}name=`ORPCError`;defined=!1;inferable=!1;code;data;constructor(e,...t){let n=AJ(t),r=n.message??e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `);super(r,n),this.code=e,this.data=n.data}toJSON(){return{defined:this.defined,inferable:this.inferable,code:this.code,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(!OY.has(this))return super[Symbol.hasInstance](e);let t=qJ(e);return t&&OY.has(t)?!0:super[Symbol.hasInstance](e)}};function AY(e){return e instanceof kY?e:new kY(`INTERNAL_SERVER_ERROR`,{cause:e})}function jY(e){if(!JJ(e))return!1;let t=[`defined`,`inferable`,`code`,`message`,`data`];return!Object.keys(e).some(e=>!t.includes(e))&&`defined`in e&&typeof e.defined==`boolean`&&`inferable`in e&&typeof e.inferable==`boolean`&&`code`in e&&typeof e.code==`string`&&`message`in e&&typeof e.message==`string`}function MY(e,t={}){let n=new kY(e.code,{...e,...t});return n.defined=e.defined,n.inferable=e.inferable,n}function NY(e,{mapResult:t,mapError:n,...r}){return UJ(e,{...r,mapResult:t&&(async e=>{let n=await t(e);if(n.value!==e.value){let t=SY(e.value);if(t&&EJ(n.value))return{done:n.done,value:bY(n.value,t)}}return n}),mapError:n&&(async e=>{let t=await n(e);if(t!==e){let n=SY(e);if(n&&EJ(t))return bY(t,n)}return t})})}var PY=/^\/(.*)\/([a-z]*)$/,FY={undefined:{condition(e){return e===void 0},serialize(){return null},deserialize(){},isTerminal:!0},bigint:{condition(e){return typeof e==`bigint`},serialize(e){return e.toString()},deserialize(e){return BigInt(e)},isTerminal:!0},date:{condition(e){return e instanceof Date},serialize(e){return Number.isNaN(e.getTime())?null:e.toISOString()},deserialize(e){return new Date(e??`Invalid Date`)},isTerminal:!0},nan:{condition(e){return typeof e==`number`&&Number.isNaN(e)},serialize(){return null},deserialize(){return NaN},isTerminal:!0},url:{condition(e){return e instanceof URL},serialize(e){return e.toString()},deserialize(e){return new URL(e)},isTerminal:!0},regexp:{condition(e){return e instanceof RegExp},serialize(e){return e.toString()},deserialize(e){let[,t,n]=e.match(PY);return new RegExp(t,n)},isTerminal:!0},set:{condition(e){return e instanceof Set},serialize(e){return Array.from(e)},deserialize(e){return new Set(e)}},map:{condition(e){return e instanceof Map},serialize(e){return Array.from(e.entries())},deserialize(e){return new Map(e)}}},IY=class{handlers;omitUndefinedProperties;constructor(e={}){this.handlers={...FY,...e.handlers},this.omitUndefinedProperties=e.omitUndefinedProperties!==!1}serialize(e){let[t,n,r,i]=this.serializeValue(e,[],[],[],[]),a=n.length===0?void 0:n;return r.length===0?{json:t,meta:a}:{json:t,meta:a,maps:r,blobs:i}}serializeValue(e,t,n,r,i){for(let a in this.handlers){let o=this.handlers[a];if(o&&o.condition(e)){let s=o.serialize(e);if(o.isTerminal)return n.push([a,...t]),[s,n,r,i];let c=this.serializeValue(s,t,n,r,i);return n.push([a,...t]),c}}if(e instanceof Blob)return r.push(t),i.push(e),[e,n,r,i];if(Array.isArray(e))return[e.map((e,a)=>this.serializeValue(e,[...t,a],n,r,i)[0]),n,r,i];if(JJ(e)){let a={};for(let o in e){let s=e[o];(o!==`toJSON`||typeof s!=`function`)&&(s===void 0&&this.omitUndefinedProperties||(a[o]=this.serializeValue(s,[...t,o],n,r,i)[0]))}return[a,n,r,i]}return[e,n,r,i]}deserialize(e){let t={data:e.json};return e.blobs?.length&&e.maps.forEach((n,r)=>{let i=t,a=`data`;n.forEach(e=>{if(i=i[a],a=e,!Object.hasOwn(i,a))throw Error(`Security error: Invalid serialized data. Segment "${a}" does not exist.`)}),i[a]=e.blobs[r]}),e.meta?.forEach(e=>{let n=e[0],r=t,i=`data`;for(let t=1;t<e.length;t++)if(r=r[i],i=e[t],!Object.hasOwn(r,i))throw Error(`Security error: Invalid serialized data. Segment "${i}" does not exist.`);r[i]=this.handlers[n].deserialize(r[i])}),t.data}},LY=class{jsonSerializer;defaultSerializeOptions;constructor(e={}){this.jsonSerializer=new IY(e),this.defaultSerializeOptions=e.serialize}serialize(e,t={}){return e===void 0||e instanceof ReadableStream||e instanceof Blob?e:xJ(e)?NY(e,{mapResult:e=>e.value===void 0?e:{done:e.done,value:this.serializeValue(e.value,t)},mapError:e=>new nY(this.serializeValue(AY(e).toJSON(),{...t,useFormDataForBlobFields:!1}),{cause:e})}):this.serializeValue(e,t)}serializeValue(e,t){let n=t.useFormDataForBlobFields??this.defaultSerializeOptions?.useFormDataForBlobFields??!0,{json:r,meta:i,maps:a,blobs:o}=this.jsonSerializer.serialize(e);if(!n||!o?.length)return{json:r,meta:i};let s=new FormData;return s.set(`data`,TJ({json:r,meta:i,maps:a})),o.forEach((e,t)=>{s.set(t.toString(),e)}),s}deserialize(e){return e===void 0||e instanceof ReadableStream||e instanceof Blob?e:xJ(e)?NY(e,{mapResult:e=>e.value===void 0?e:{done:e.done,value:this.deserializeValue(e.value)},mapError:e=>{if(!(e instanceof nY))return e;let t=this.deserializeValue(e.data);return jY(t)?MY(t,{cause:e}):new nY(t,{cause:e})}}):this.deserializeValue(e)}deserializeValue(e){if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e);let t=JSON.parse(e.get(`data`)),n=[];for(let[t,r]of e)r instanceof Blob&&(n[Number(t)]=r);return this.jsonSerializer.deserialize({...t,blobs:n})}},RY=new Set([`then`,`bind`,`valueOf`,`toString`,`toJSON`]);function zY(e){return{...e,context:e.context??{}}}function BY(e){return[e[0],zY(e[1]??{})]}function VY(e,{path:t=[],...n}={}){return new Proxy((...r)=>{let[i,a]=BY(r);return QJ([...vJ(n.interceptors),...vJ(n.scoped?.interceptors)],{...a,input:i,path:t},({path:t,input:n,...r})=>e.call(t,n,r))},{get(r,i){if(typeof i!=`string`||RY.has(i))return OJ(r,i);let a=n.scoped===void 0?void 0:n.scoped[i];return VY(e,{...n,path:[...t,i],scoped:a})}})}function HY(e){let t=(e?.pipeThrough(new TextDecoderStream).pipeThrough(new cY))?.getReader(),n=!1;return new CJ(async()=>{for(;;){if(t===void 0)return{done:!0,value:void 0};let{done:e,value:r}=await t.read();if(e){if(n)throw new yJ(`Stream was cancelled`);return{done:!0,value:void 0}}switch(r.event){case`message`:{let e=wJ(r.data);return EJ(e)&&(e=bY(e,r)),{done:!1,value:e}}case`error`:{let e=new nY(wJ(r.data));throw e=bY(e,r),e}case`close`:{let e=wJ(r.data);return EJ(e)&&(e=bY(e,r)),{done:!0,value:e}}}}},async e=>{e.kind===`cancelled`&&(n=!0),await t?.cancel()})}function UY(e,t={}){let n=t.keepAlive?.enabled??!0,r=t.keepAlive?.interval??15e3,i=t.keepAlive?.comment??``,a=t.initialComment?.enabled??!0,o=t.initialComment?.comment??``,s=t.emptyCloseEventEnabled??!0,c=!1,l;return new ReadableStream({start(e){a&&e.enqueue(_Y({comments:[o]}))},async pull(t){try{n&&(l=setInterval(()=>{t.enqueue(_Y({comments:[i]}))},r));let a=await e.next();if(clearInterval(l),c)return;let[o,u]=xY(a.value);if(!a.done||o!==void 0||u!==void 0||s){let e=a.done?`close`:`message`;t.enqueue(_Y({...u,event:e,data:TJ(o)}))}a.done&&t.close()}catch(e){if(clearInterval(l),c)return;e instanceof nY?(t.enqueue(_Y({...SY(e),event:`error`,data:TJ(e.data)})),t.close()):t.error(e)}},async cancel(){c=!0,clearInterval(l),await e.return?.()}}).pipeThrough(new TextEncoderStream)}async function WY(e,t){let n=t?.hint??e.headers.get(`standard-server`),r=e.headers.get(`content-type`)?.split(`;`)[0]?.trim(),i=e.headers.get(`content-length`);if(n!==`none`&&(n!==null||r!==void 0||i!==`0`&&i!==null)&&(n!==null||e.body!==null)){if(e.bodyUsed)throw TypeError(`Failed to read body: body stream already read`);if(n===`json`||n===null&&r===`application/json`)return wJ(await e.text());if(n===`form-data`||n===null&&r===`multipart/form-data`)return await e.formData();if(n===`url-search-params`||n===null&&r===`application/x-www-form-urlencoded`){let t=await e.text();return new URLSearchParams(t)}if(n===`event-stream`||n===null&&r===`text/event-stream`)return HY(e.body);if(n===`file`||n===null&&i!==null){let t=e.headers.get(`content-disposition`),n=t===null?void 0:wY(t),r=await e.blob();return new File([r],n??`blob`,{type:r.type})}return e.body??new ReadableStream({start(e){e.close()}})}}function GY(e,t,n={}){return t={...t},e instanceof ReadableStream?(t[`standard-server`]??=`octet-stream`,t[`content-type`]??=`application/octet-stream`,[e,t]):e instanceof Blob?(t[`standard-server`]??=`file`,t[`content-type`]=e.type,t[`content-disposition`]??=CY(e instanceof File?e.name:`blob`),Number.isFinite(e.size)?(t[`content-length`]=e.size.toString(),[e,t]):[e.stream(),t]):(t[`standard-server`]=void 0,t[`content-length`]=void 0,e===void 0?(t[`content-type`]=void 0,[void 0,t]):e instanceof FormData||e instanceof URLSearchParams?(t[`content-type`]=void 0,[e,t]):xJ(e)?(t[`content-type`]=`text/event-stream`,[UY(e,n.eventStream),t]):(t[`content-type`]=`application/json`,[TJ(e),t]))}function KY(e){let t={};return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):t[n]===void 0?t[n]=e:t[n]=[t[n],e]}),t}function qY(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.append(n,r);return t}function JY(e){return{resolveBody:t=>WY(e,{hint:t}),status:e.status,get headers(){let t=KY(e.headers);return Object.defineProperty(this,"headers",{value:t,writable:!0}),t},set headers(e){Object.defineProperty(this,"headers",{value:e,writable:!0})}}}var YY=class{name=`~composite`;plugins;constructor(e=[]){this.plugins=$J(e)}init(e){for(let t of this.plugins)t.init&&(e=t.init(e));return e}},XY=class{constructor(e,t,n={}){this.codec=e,this.transport=t,n=new YY(n.plugins).init(n),this.interceptors=n.interceptors,this.transportInterceptors=n.transportInterceptors}interceptors;transportInterceptors;call(e,t,n){return VJ(`${jJ}.${e.join(`/`)}`,r=>(r?.setAttribute(`rpc.system`,jJ),r?.setAttribute(`rpc.method`,e.join(`.`)),xJ(t)&&(t=KJ(t,WJ(`consume_async_iterator_object_input`,t))),QJ(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{let i=LJ(),a,o=i?.trace.getActiveSpan()??r;o&&i&&(a=i.trace.setSpan(i.context.active(),o));let s=await VJ({name:`encode_input`,context:a},()=>this.codec.encodeInput(t,e,n));if(a&&i?.propagation){let e={...s.headers};i.propagation.inject(a,e),s={...s,headers:e}}let c=await QJ(this.transportInterceptors,{...n,path:e,request:s},({path:e,request:t,...n})=>{let r,a=i?.trace.getActiveSpan()??o;return a&&i&&(r=i.trace.setSpan(i.context.active(),a)),VJ({name:`send_request`,context:r},()=>this.transport.send(t,e,n))}),l=await VJ({name:`decode_response`,context:a},()=>this.codec.decodeResponse(c,e,n));if(l.kind===`error`)throw l.error;let u=l.output;return xJ(u)?KJ(u,WJ(`consume_async_iterator_object_output`,u)):u})))}},ZY=/\/$/,QY=class{baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;serializer;constructor(e){this.baseUrl=e.url??`/`,this.maxUrlLength=e.maxUrlLength??2083,this.fallbackMethod=e.fallbackMethod??`POST`,this.expectedMethod=e.method??this.fallbackMethod,this.headers=e.headers??{},this.serializer=e.serializer??new LY}async encodeInput(e,t,n){let r=$Y(await GJ(this.headers,n,t,e));n.lastEventId!==void 0&&(r=TY(r,{"last-event-id":n.lastEventId}));let i=await GJ(this.expectedMethod,n,t,e),[a,o,s]=EY(await GJ(this.baseUrl,n,t,e)),c=`${a.replace(ZY,``)}${PJ(t)}`,l=this.serializer.serialize(e);if(i===`GET`&&!(l instanceof Blob)&&!(l instanceof ReadableStream)&&!(l instanceof FormData)&&!xJ(l)){let a=await GJ(this.maxUrlLength,n,t,e),u=new URLSearchParams(o);u.append(`data`,TJ(l)??``);let d=`${c}?${u}${s??``}`;if(d.length<=a)return{body:void 0,method:i,headers:r,url:d,signal:n.signal}}return{url:`${c}${o??``}${s??``}`,method:i===`GET`?this.fallbackMethod:i,headers:r,body:l,signal:n.signal}}async decodeResponse(e){let t=e.status<400,n=await e.resolveBody(),r=await(async()=>{try{return this.serializer.deserialize(n)}catch(e){throw Error(`Invalid RPC response format.`,{cause:e})}})();return t?{kind:`output`,output:r}:jY(r)?{kind:`error`,error:MY(r)}:{kind:`error`,error:new kY(`MALFORMED_ORPC_ERROR_RESPONSE`,{data:{headers:e.headers,status:e.status,body:r}})}}};function $Y(e){return typeof e.forEach==`function`?KY(e):e}var eX=class{constructor(e=[]){this.plugins=e,this.plugins=$J(e)}name=`~composite/fetch-link-transport`;initFetchLinkTransportOptions(e){for(let t of this.plugins)t.initFetchLinkTransportOptions&&(e=t.initFetchLinkTransportOptions(e));return e}},tX=NJ(()=>{try{let e;return new Request(`https://example.com`,{method:`POST`,body:new ReadableStream,get duplex(){return e=`half`,`half`}}),e}catch{return}}),nX=class{origin;fetch;toFetchRequestOptions;fetchInterceptors;constructor(e){e=new eX(e.plugins).initFetchLinkTransportOptions(e),this.origin=e.origin,this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e.toFetchRequest,this.fetchInterceptors=e.fetchInterceptors}async send(e,t,n){let r=await GJ(this.origin,n,t);r?.endsWith(`/`)&&(r=r.slice(0,-1));let i=`${r??``}${e.url}`,[a,o]=GY(e.body,e.headers,this.toFetchRequestOptions),s={body:a,headers:qY(o),method:e.method,signal:n.signal,redirect:`manual`};if(a instanceof ReadableStream){let e=tX();e!==void 0&&(s.duplex=e)}return JY(await QJ(this.fetchInterceptors,{...n,url:i,path:t,init:s},({url:e,path:t,init:n,...r})=>this.fetch(e,n,r,t)))}},rX=class extends XY{constructor(e){let t=new QY(e),n=new nX(e);super(t,n,e)}};function iX(e){return e==null}function aX(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];t(o,a)||(n[a]=o)}return n}function oX(e){if(typeof e==`string`)return e.trim()||void 0}function sX(e){return Array.isArray(e)?e.flatMap(e=>{let t=oX(e);return t?[t]:[]}):[]}function cX(e,t=`Request failed`){let n=oX(e);if(n)return n;if(typeof e!=`object`||!e)return t;let r=e,i=oX(r.error)??oX(r.message)??oX(r.details)??t;if(r.code===`integration_validation_failed`){let e=sX(r.invalidIntegrationIds);if(e.length>0)return`${i} (invalid integration IDs: ${e.join(`, `)})`}return i}var lX=s(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function uX(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var dX=uX;typeof Object.assign==`function`&&(dX=Object.assign);function fX(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function pX(e){return typeof e==`object`&&!!e}function mX(e){let t;for(t in e)return!1;return!0}function hX(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function gX(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function _X(e){return!(!pX(e)||e.attributes&&!Array.isArray(e.attributes))}function vX(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function yX(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function bX(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var xX=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},SX=class e extends xX{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},CX=class e extends xX{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},wX=class e extends xX{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function TX(e,t){this.key=e,this.attributes=t,this.clear()}TX.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function EX(e,t){this.key=e,this.attributes=t,this.clear()}EX.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function DX(e,t){this.key=e,this.attributes=t,this.clear()}DX.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function OX(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}OX.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},OX.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},OX.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},OX.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var kX=0,AX=1,jX=2,MX=3;function NX(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===kX){if(s=e._nodes.get(r),!s)throw new CX(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===MX){if(i=``+i,c=e._edges.get(i),!c)throw new CX(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new CX(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new CX(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===AX?c.source:c.target,l=i,u=a}return[s,l,u]}function PX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);return a.attributes[o]}}function FX(e,t,n){e.prototype[t]=function(e,r){let[i]=NX(this,t,n,e,r);return i.attributes}}function IX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function LX(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=NX(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function RX(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=NX(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new SX(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function zX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function BX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);if(!pX(o))throw new SX(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function VX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);if(!pX(o))throw new SX(`Graph.${t}: provided attributes are not a plain object.`);return dX(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function HX(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=NX(this,t,n,e,r,i);if(typeof o!=`function`)throw new SX(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var UX=[{name:e=>`get${e}Attribute`,attacher:PX},{name:e=>`get${e}Attributes`,attacher:FX},{name:e=>`has${e}Attribute`,attacher:IX},{name:e=>`set${e}Attribute`,attacher:LX},{name:e=>`update${e}Attribute`,attacher:RX},{name:e=>`remove${e}Attribute`,attacher:zX},{name:e=>`replace${e}Attributes`,attacher:BX},{name:e=>`merge${e}Attributes`,attacher:VX},{name:e=>`update${e}Attributes`,attacher:HX}];function WX(e){UX.forEach(function({name:t,attacher:n}){n(e,t(`Node`),kX),n(e,t(`Source`),AX),n(e,t(`Target`),jX),n(e,t(`Opposite`),MX)})}function GX(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function KX(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=fX(this,i,a,n),!r)throw new CX(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function qX(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function JX(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=fX(this,o,s,n),!a)throw new CX(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function YX(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=fX(this,o,s,n),!a)throw new CX(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new SX(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function XX(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function ZX(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!pX(r))throw new SX(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function QX(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!pX(r))throw new SX(`Graph.${t}: provided attributes are not a plain object.`);return dX(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function $X(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new wX(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new wX(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=fX(this,a,o,n),!i)throw new CX(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new wX(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new CX(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new SX(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var eZ=[{name:e=>`get${e}Attribute`,attacher:GX},{name:e=>`get${e}Attributes`,attacher:KX},{name:e=>`has${e}Attribute`,attacher:qX},{name:e=>`set${e}Attribute`,attacher:JX},{name:e=>`update${e}Attribute`,attacher:YX},{name:e=>`remove${e}Attribute`,attacher:XX},{name:e=>`replace${e}Attributes`,attacher:ZX},{name:e=>`merge${e}Attributes`,attacher:QX},{name:e=>`update${e}Attributes`,attacher:$X}];function tZ(e){eZ.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var nZ=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function rZ(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function iZ(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function aZ(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function oZ(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function sZ(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function cZ(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function lZ(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function uZ(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function dZ(e,t){if(e.size===0)return bX();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function fZ(e,t,n,r,i,a){let o=t?iZ:rZ,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function pZ(e,t,n,r){let i=[];return fZ(!1,e,t,n,r,function(e){i.push(e)}),i}function mZ(e,t,n){let r=bX();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=yX(r,aZ(n.in))),t!==`in`&&n.out!==void 0&&(r=yX(r,aZ(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=yX(r,aZ(n.undirected))),r}function hZ(e,t,n,r,i,a,o){let s=n?sZ:oZ,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function gZ(e,t,n,r,i){let a=[];return hZ(!1,e,t,n,r,i,function(e){a.push(e)}),a}function _Z(e,t,n,r){let i=bX();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=yX(i,cZ(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=yX(i,cZ(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=yX(i,cZ(n.undirected,r))),i}function vZ(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return lZ(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new CX(`Graph.${n}: could not find the "${e}" node in the graph.`);return pZ(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new CX(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.${n}: could not find the "${t}" target node in the graph.`);return gZ(r,this.multi,i,a,t)}throw new SX(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function yZ(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r===`mixed`||this.type===`mixed`||r===this.type){if(arguments.length===1)return n=e,uZ(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new CX(`Graph.${a}: could not find the "${e}" node in the graph.`);return fZ(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new CX(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.${a}: could not find the "${t}" target node in the graph.`);return hZ(!1,r,this.multi,i,o,t,n)}throw new SX(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new SX(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new SX(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function bZ(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,uZ(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new CX(`Graph.${a}: could not find the "${e}" node in the graph.`);return fZ(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new CX(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.${a}: could not find the "${t}" target node in the graph.`);return hZ(!0,r,this.multi,i,o,t,n)}throw new SX(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function xZ(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return bX();if(!arguments.length)return dZ(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.${a}: could not find the "${e}" node in the graph.`);return mZ(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.${a}: could not find the "${t}" target node in the graph.`);return _Z(r,i,n,t)}throw new SX(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function SZ(e){nZ.forEach(t=>{vZ(e,t),yZ(e,t),bZ(e,t),xZ(e,t)})}var CZ=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function wZ(){this.A=null,this.B=null}wZ.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},wZ.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function TZ(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function EZ(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return TZ(e,null,r,r.undirected,i);if(typeof n==`string`)return TZ(e,null,r,r[n],i)}let a=new wZ,o;if(t!==`undirected`){if(n!==`out`){if(o=TZ(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=TZ(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=TZ(e,a,r,r.undirected,i),e&&o))return o}function DZ(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return EZ(!1,e,t,n,function(e){r.push(e)}),r}function OZ(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function kZ(e,t,n){if(e!==`mixed`){if(e===`undirected`)return OZ(null,n,n.undirected);if(typeof t==`string`)return OZ(null,n,n[t])}let r=bX(),i=new wZ;return e!==`undirected`&&(t!==`out`&&(r=yX(r,OZ(i,n,n.in))),t!==`in`&&(r=yX(r,OZ(i,n,n.out)))),e!==`directed`&&(r=yX(r,OZ(i,n,n.undirected))),r}function AZ(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new CX(`Graph.${n}: could not find the "${e}" node in the graph.`);return DZ(r===`mixed`?this.type:r,i,t)}}function jZ(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new CX(`Graph.${a}: could not find the "${e}" node in the graph.`);EZ(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new SX(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function MZ(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new CX(`Graph.${o}: could not find the "${e}" node in the graph.`);return EZ(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function NZ(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return bX();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new CX(`Graph.${a}: could not find the "${e}" node in the graph.`);return kZ(r===`mixed`?this.type:r,i,t)}}function PZ(e){CZ.forEach(t=>{AZ(e,t),jZ(e,t),MZ(e,t),NZ(e,t)})}function FZ(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function IZ(e,t){let n={key:e};return mX(t.attributes)||(n.attributes=dX({},t.attributes)),n}function LZ(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return mX(n.attributes)||(r.attributes=dX({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function RZ(e){if(!pX(e))throw new SX(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new SX(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!pX(e.attributes)||e.attributes===null))throw new SX(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function zZ(e){if(!pX(e))throw new SX(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new SX(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new SX(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!pX(e.attributes)||e.attributes===null))throw new SX(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new SX(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var BZ=vX(),VZ=new Set([`directed`,`undirected`,`mixed`]),HZ=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),UZ=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],WZ={allowSelfLoops:!0,multi:!1,type:`mixed`};function GZ(e,t,n){if(n&&!pX(n))throw new SX(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new wX(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function KZ(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function qZ(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new wX(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new wX(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!pX(s))throw new SX(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new wX(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new CX(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new CX(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new wX(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new wX(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new OX(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function JZ(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new wX(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new wX(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new SX(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!pX(s))throw new SX(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new wX(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new wX(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else dX(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new wX(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=KZ(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=KZ(e,o,{}),g=!0),f=new OX(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function YZ(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var XZ=class e extends lX.EventEmitter{constructor(e){if(super(),e=dX({},WZ,e),typeof e.multi!=`boolean`)throw new SX(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!VZ.has(e.type))throw new SX(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new SX(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?TX:e.type===`directed`?EX:DX;hX(this,`NodeDataClass`,t);let n=`geid_`+BZ()+`_`,r=0;hX(this,`_attributes`,{}),hX(this,`_nodes`,new Map),hX(this,`_edges`,new Map),hX(this,`_directedSize`,0),hX(this,`_undirectedSize`,0),hX(this,`_directedSelfLoopCount`,0),hX(this,`_undirectedSelfLoopCount`,0),hX(this,`_edgeKeyGenerator`,()=>{let e;do e=n+r++;while(this._edges.has(e));return e}),hX(this,`_options`,e),HZ.forEach(e=>hX(this,e,this[e])),gX(this,`order`,()=>this._nodes.size),gX(this,`size`,()=>this._edges.size),gX(this,`directedSize`,()=>this._directedSize),gX(this,`undirectedSize`,()=>this._undirectedSize),gX(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),gX(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),gX(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),gX(this,`multi`,this._options.multi),gX(this,`type`,this._options.type),gX(this,`allowSelfLoops`,this._options.allowSelfLoops),gX(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new SX(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new SX(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new SX(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new wX(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new CX(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new wX(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new CX(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new wX(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new CX(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`directed`&&t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new CX(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new CX(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new CX(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new CX(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new CX(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return GZ(this,e,t).key}mergeNode(e,t){if(t&&!pX(t))throw new SX(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(dX(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new SX(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new CX(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do YZ(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do YZ(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do YZ(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=fX(this,e,n,this.type),!t)throw new CX(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new CX(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return YZ(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new wX(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new wX(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=fX(this,e,t,`directed`);if(!n)throw new CX(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return YZ(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new wX(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new wX(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=fX(this,e,t,`undirected`);if(!n)throw new CX(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return YZ(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new SX(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!pX(e))throw new SX(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!pX(e))throw new SX(`Graph.mergeAttributes: provided attributes are not a plain object.`);return dX(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new SX(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new SX(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!_X(t))throw new SX(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new SX(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!_X(t))throw new SX(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new SX(`Graph.forEachAdjacencyEntry: expecting a callback.`);FZ(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new SX(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);FZ(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new SX(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);FZ(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new SX(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);FZ(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new SX(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new SX(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new SX(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new SX(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new SX(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new SX(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new SX(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new SX(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=IZ(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=LZ(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!pX(t))throw new SX(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!pX(t.attributes))throw new SX(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new SX(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],RZ(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new SX(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],zZ(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(dX({},this._options,t));return n.replaceAttributes(dX({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=dX({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new wX(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new wX(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new wX(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,qZ(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,dX({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!HZ.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,hX(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(XZ.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=XZ.prototype.inspect),UZ.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?qZ:JZ;e.generateKey?XZ.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:XZ.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),WX(XZ),tZ(XZ),SZ(XZ),PZ(XZ);var ZZ=class extends XZ{constructor(e){let t=dX({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new SX(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new SX(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},QZ=class extends XZ{constructor(e){let t=dX({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new SX(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new SX(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},$Z=class extends XZ{constructor(e){let t=dX({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new SX(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},eQ=class extends XZ{constructor(e){let t=dX({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new SX(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new SX(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},tQ=class extends XZ{constructor(e){let t=dX({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new SX(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new SX(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function nQ(e){e.from=function(t,n){let r=new e(dX({},t.options,n));return r.import(t),r}}nQ(XZ),nQ(ZZ),nQ(QZ),nQ($Z),nQ(eQ),nQ(tQ),XZ.Graph=XZ,XZ.DirectedGraph=ZZ,XZ.UndirectedGraph=QZ,XZ.MultiGraph=$Z,XZ.MultiDirectedGraph=eQ,XZ.MultiUndirectedGraph=tQ,XZ.InvalidArgumentsGraphError=SX,XZ.NotFoundGraphError=CX,XZ.UsageGraphError=wX;var rQ=_h([`newest-wins`,`first-wins`,`unlimited`]),iQ=uh({startEvents:ph(Bh),cancelEvents:ph(Bh),concurrency:rQ,allowManualStart:nh(ch),correlationPaths:nh(dh(oh,Bh))}),aQ={startEvents:[],cancelEvents:[],concurrency:`unlimited`,allowManualStart:!0},oQ=Wh(iQ);function sQ(e){return oQ(e?.lifecycleRules)}function cQ(e){return(sQ(e)?.cancelEvents.length??0)>0}function lQ(e){return e.rules.correlationPaths?.[e.eventName]??e.declaredPath}function uQ(e){return e.startEvents.length>0||e.allowManualStart===!0}function dQ(e){return e===void 0||e.allowManualStart===!0}var fQ={valid:!0},pQ=e=>({valid:!1,error:e});function mQ(e){return`No Event named "${e}" is defined. Choose an Event this app declares, or ask whoever defines them to add it.`}function hQ(e){return e.concurrency!==`unlimited`||e.cancelEvents.length>0}function gQ(e){let{rules:t,catalog:n,eventName:r,role:i}=e;if(!(i===`start`&&!hQ(t)))return{eventName:r,role:i,declaredPath:My(n,r)?.correlationPath,suppliedPath:t.correlationPaths?.[r]}}function _Q(e){let{rules:t,catalog:n}=e,r=t.startEvents.map(e=>gQ({rules:t,catalog:n,eventName:e,role:`start`})),i=t.cancelEvents.map(e=>gQ({rules:t,catalog:n,eventName:e,role:`cancel`}));return Ga([...r,...i])}function vQ(e){if(!e.correlationPaths)return e;let t=new Set(e.cancelEvents);if(hQ(e))for(let n of e.startEvents)t.add(n);let n=Object.fromEntries(Object.entries(e.correlationPaths).filter(([e])=>t.has(e)));return{...e,correlationPaths:Object.keys(n).length>0?n:void 0}}function yQ(e){let{rules:t,catalog:n}=e,r=t.startEvents.find(e=>t.cancelEvents.includes(e));if(r)return pQ(`Event "${r}" cannot both start and cancel runs of this workflow. Give it one role, or start on one Event and cancel on another.`);let i=[...t.startEvents,...t.cancelEvents];for(let e of i)if(!My(n,e))return pQ(mQ(e));let a=_Q({rules:t,catalog:n}).find(e=>!lQ({rules:t,eventName:e.eventName,declaredPath:e.declaredPath}));return a?pQ(bQ(a.eventName)):uQ(t)?fQ:pQ(`Nothing can start this workflow. Add a Start Event, or allow manual starts.`)}function bQ(e){return`Event "${e}" declares no Correlation Path. Enter the payload path holding the value that identifies the entity, or ask whoever defined the Event to declare it.`}var xQ=Wh(Rh);function SQ(e){return xQ(e)??null}function CQ(e){let t=SQ(e);return typeof t==`object`&&t&&!Array.isArray(t)?t:null}var wQ=dh(oh,Rh),TQ=uh({byEvent:nh(dh(oh,wQ)),manual:nh(wQ)}),EQ=Wh(TQ);function DQ(e){return EQ(e?.testPayloads)}function OQ(e,t){return t?e?.byEvent?.[t]:e?.manual}var kQ=uh({lifecycleRules:nh(iQ),testPayloads:nh(TQ)}).annotate({message:`Lifecycle config must be an object`}),AQ={label:oh,description:nh(oh),enabled:nh(ch)},jQ=fh(uh({...AQ,type:rh(`lifecycle`),config:nh(kQ)}),Hh),MQ=gh([uh({actionType:rh(rJ.condition),condition:nh(gh([oh,ch])),conditionModel:nh(oh),integrationId:nh(oh)}).annotate({message:`Condition config must be an object`}),fh(uh({actionType:rh(rJ.wait),integrationId:nh(oh),waitDelayTimingMode:nh(oh),waitMode:nh(_h([`delay`,`event`])),waitFor:nh(ih),waitTimeout:nh(oh),waitTimeoutBehavior:nh(oh),waitDuration:nh(oh),waitUntil:nh(oh),waitOffset:nh(oh),waitGateMode:nh(oh),waitAllowedHoursMode:nh(oh),waitAllowedStartTime:nh(oh),waitAllowedEndTime:nh(oh),waitTimezone:nh(oh)}),Hh).annotate({message:`Wait config must be an object`}),uh({actionType:rh(rJ.eventSplit),integrationId:nh(oh)}).annotate({message:`Event Split config must be an object`}),fh(uh({actionType:nh(Bh.check(Sh(e=>e===rJ.condition||e===rJ.wait||e===rJ.eventSplit?`Built-in action configs use their own schema arm`:!0))),integrationId:nh(oh)}),Hh)]).annotate({message:`Action config must be an object`}),NQ=fh(uh({...AQ,type:rh(`action`),config:nh(MQ)}),Hh),PQ=fh(uh({...AQ,type:rh(`add`),config:nh(dh(oh,ih))}),Hh),FQ=uh({entryNodeIds:nh(Uh(Bh)),exitNodeId:nh(Bh),outletHandle:nh(rh(`true`))}).annotate({message:`Group config must be an object`}),IQ=gh([jQ,NQ,PQ,fh(uh({...AQ,type:rh(`group`),config:nh(FQ)}),Hh)]).annotate({message:`Node data needs a type of "lifecycle", "action", "add", or "group"`}),LQ=fh(uh({id:Bh,type:nh(_h([`lifecycle`,`action`,`add`,`group`])),parentId:nh(Bh),width:nh(Eh),height:nh(Eh),position:nh(uh({x:Eh,y:Eh})),data:IQ}),Hh),RQ=fh(uh({id:Bh,source:Bh,target:Bh,sourceHandle:nh(vh(Bh)),targetHandle:nh(vh(Bh)),data:nh(dh(oh,ih))}),Hh),zQ=uh({key:Bh,attributes:LQ}),BQ=uh({key:Bh,source:Bh,target:Bh,attributes:RQ,undirected:nh(rh(!1))}),VQ=uh({attributes:nh(dh(oh,ih)),options:nh(uh({allowSelfLoops:nh(ch),multi:nh(ch),type:nh(_h([`directed`,`undirected`,`mixed`]))})),nodes:Uh(zQ),edges:Uh(BQ)}),HQ={allowSelfLoops:!1,multi:!1,type:`directed`},UQ=$m(VQ,Vh);Qm(VQ,{...Vh,errors:`all`});var WQ=$m(LQ,Vh);Qm(LQ,Vh);var GQ=$m(RQ,Vh);function KQ(e){let t={label:e.label,type:e.type};return e.description!==void 0&&(t.description=e.description),typeof e.config==`object`&&e.config!==null&&!Array.isArray(e.config)&&(t.config={...e.config}),e.enabled!==void 0&&(t.enabled=e.enabled),t}function qQ(e){let t=WQ(e),n={id:t.id,type:t.type,position:t.position??{x:0,y:0},data:KQ(t.data)};return t.parentId!==void 0&&(n.parentId=t.parentId),t.width!==void 0&&(n.width=t.width),t.height!==void 0&&(n.height=t.height),n}function JQ(e){let t=GQ(e);return{id:t.id,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle,data:t.data}}function YQ(e){let t=qQ(e.attributes);if(e.key!==t.id)throw Error(`Node key '${e.key}' must match node attribute id '${t.id}'`);return t}function XQ(e){let t=JQ(e.attributes);if(e.key!==t.id)throw Error(`Edge key '${e.key}' must match edge attribute id '${t.id}'`);if(e.source!==t.source||e.target!==t.target)throw Error(`Edge '${e.key}' source/target must match edge attributes`);return t}function ZQ(e){let t=new ZZ({allowSelfLoops:HQ.allowSelfLoops,multi:HQ.multi});e.attributes&&t.replaceAttributes(e.attributes);for(let n of e.nodes)t.mergeNode(n.id,{...n,data:KQ(n.data)});for(let n of e.edges){let e=[n.source,n.target].filter(e=>!t.hasNode(e));if(e.length>0)throw Error(`Edge '${n.id}' names ${e.join(` and `)}, which the graph has no node for`);t.mergeEdgeWithKey(n.id,n.source,n.target,n)}return QQ(t.export())}function QQ(e){return UQ(e)}function $Q(e){let t=QQ(e);return{nodes:t.nodes.map(YQ),edges:t.edges.map(XQ)}}var e$=`animated`;function t$(e){let{status:t,issues:n,...r}=e.data,i={id:e.id,position:e.position,data:r,type:e.type};return typeof e.width==`number`&&(i.width=e.width),typeof e.height==`number`&&(i.height=e.height),e.measured&&typeof e.measured.width==`number`&&typeof e.measured.height==`number`&&(i.measured={width:e.measured.width,height:e.measured.height}),typeof e.parentId==`string`&&e.parentId.length>0&&(i.parentId=e.parentId),i}function n$(e){return e.filter(e=>e.type!==`add`).map(t$)}function r$(e){let{displayLabel:t,inactive:n,...r}=e.data??{};return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,data:Object.keys(r).length>0?r:void 0}}function i$(e){let t={id:e.id,position:e.position,type:e.type,width:e.width,height:e.height,measured:e.measured,data:{...e.data}};return e.parentId&&(t.parentId=e.parentId,t.extent=`parent`,t.draggable=!1,t.connectable=!1),t}function a$(e){return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle??void 0,targetHandle:e.targetHandle??void 0,data:e.data}}function o$(e){return ZQ({nodes:n$(e.nodes),edges:e.edges.map(r$)})}var s$=class extends Error{constructor(e,t){super(t),this.status=e,this.name=`ApiError`}},c$=`/api/rpc`,l$=`http://localhost:3000`;function u$(){let e=typeof globalThis.location?.origin==`string`?globalThis.location.origin.trim():``;if(!(!e||e===`null`))return e}function d$(){let e={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_RPC_URL;return typeof e==`string`?e:void 0}function f$(e={}){let t=e.rpcUrl??d$();if(t){let n=t.trim();if(n.length>0)try{return new URL(n).toString()}catch{let t=e.origin?.trim()||u$()||l$;try{return new URL(n,t).toString()}catch{return new URL(n,l$).toString()}}}let n=`${xy()}${c$}`,r=e.origin?.trim()||u$()||l$;try{return new URL(n,r).toString()}catch{return new URL(n,l$).toString()}}function p$(e){let t=new URL(e);return{origin:t.origin,pathWithQuery:`/${t.pathname.slice(1)}${t.search}`}}var m$=DY,h$=p$(f$()),g$=VY(new rX({origin:h$.origin,url:h$.pathWithQuery,fetch:(e,t)=>globalThis.fetch(e,t),interceptors:[async e=>{try{return await e.next()}catch(e){throw e instanceof s$?e:e instanceof kY?new s$(m$[e.code]??500,cX(e.data??e.message)):e instanceof Error?new s$(500,e.message||`Request failed`):new s$(500,`Request failed`)}}]}));function _$(e){let t=$Q(e.graph);return{...e,nodes:t.nodes.map(i$),edges:t.edges.map(a$)}}function v$(e){return e.graph?e.graph:o$({nodes:e.nodes??[],edges:e.edges??[]})}var y$={update:(e,t)=>{let n=t.graph!==void 0||t.nodes!==void 0&&t.edges!==void 0?v$({graph:t.graph,nodes:t.nodes,edges:t.edges}):void 0;return g$.workflow.update({workflowId:e,...aX({name:t.name,description:t.description,graph:n,mode:t.mode},iX)}).then(_$)}},b$=class{constructor(e=[]){this.plugins=e,this.plugins=$J(e)}name=`~composite`;init(e){for(let t of this.plugins)t.init&&(e=t.init(e));return e}initProcedureOptions(e,t){for(let n of this.plugins)n.initProcedureOptions&&(t=n.initProcedureOptions(e,t));return t}};function x$(e,t={}){return[...t.prefix===void 0?[]:[t.prefix],e,{...t.input===void 0?{}:{input:t.input},...t.type===void 0?{}:{type:t.type},...t.fnOptions===void 0?{}:{fnOptions:t.fnOptions}}]}function S$(e){return async t=>{let n=await e(t),r;for await(let e of n)t.signal?.throwIfAborted(),r={chunk:e},t.client.setQueryData(t.queryKey,e);if(!r)throw TypeError(`Live query for ${TJ(t.queryKey)} did not yield any data. Ensure the query function returns an AsyncIterable with at least one chunk.`);return r.chunk}}var C$=class{constructor(e,t){this.path=e,this.options=t}key(e={}){return x$(this.path,{...e,prefix:this.options.prefix})}};function w$(e,{refetchMode:t=`reset`,maxChunks:n=1/0}={}){return async r=>{let i=r.client.getQueryCache().find({queryKey:r.queryKey,exact:!0}),a=!!i&&i.state.data!==void 0;a&&(t===`reset`?i.setState({status:`pending`,data:void 0,error:null,fetchStatus:`fetching`}):r.client.setQueryData(r.queryKey,(e=[])=>T$(e,n)));let o=[],s=await e(r),c=!a||t!==`replace`;r.client.setQueryData(r.queryKey,(e=[])=>T$(e,n));for await(let e of s){if(r.signal.aborted)throw r.signal.reason;o.push(e),o=T$(o,n),c&&r.client.setQueryData(r.queryKey,(t=[])=>T$([...t,e],n))}c||r.client.setQueryData(r.queryKey,o);let l=r.client.getQueryData(r.queryKey);return l?T$(l,n):o}}function T$(e,t){return e.length<=t?e:e.slice(e.length-t)}var E$=Symbol.for(`ORPC_TANSTACK_QUERY_OPERATION_CONTEXT`),D$=[`queryInterceptors`,`streamedInterceptors`,`liveInterceptors`,`infiniteInterceptors`,`mutationInterceptors`],O$=[`queryKey`,`queryOptions`,`streamedKey`,`streamedOptions`,`liveKey`,`liveOptions`,`infiniteKey`,`infiniteOptions`,`mutationKey`,`mutationOptions`];function k$(e){if(!EJ(e))return!1;for(let t in e)if(e[t]!==void 0){if(t===`prefix`){if(typeof e[t]!=`string`)return!1}else if(D$.includes(t)){if(!Array.isArray(e[t])||e[t].some(e=>typeof e!=`function`))return!1}else if(O$.includes(t)&&!EJ(e[t]))return!1}return!0}function A$(e,t){if(typeof e!=`function`&&typeof t!=`function`)return{...e,...t};let n=typeof e==`function`?e:t=>({...e,...t}),r=typeof t==`function`?t:e=>({...t,...e});return e=>r(n(e))}function j$(e,t){let n={...e,...t};for(let r of D$){let i=e[r],a=t[r];i&&a&&(n[r]=[...i,...a])}for(let r of O$){let i=e[r],a=t[r];i&&a&&(n[r]=A$(i,a))}return n}var M$=class extends C${call;constructor(e,t,n={}){super(e,n),this.call=t}queryKey(...e){let t=AJ(e);return typeof this.options.queryKey==`function`?t=this.options.queryKey(t):this.options.queryKey&&(t={...this.options.queryKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`query`,input:t.input})}queryOptions(...e){let t=AJ(e);typeof this.options.queryOptions==`function`?t=this.options.queryOptions(t):this.options.queryOptions&&(t={...this.options.queryOptions,...t});let n=this.queryKey(t);return{...t,queryKey:n,queryFn:e=>QJ(this.options.queryInterceptors,{path:this.path,context:{[E$]:{key:n,type:`query`},...t.context},input:t.input,fnContext:e},({context:e,input:n,fnContext:r})=>{if(n===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(r):this.call(n,{signal:r.signal,context:e})}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}streamedKey(...e){let t=AJ(e);return typeof this.options.streamedKey==`function`?t=this.options.streamedKey(t):this.options.streamedKey&&(t={...this.options.streamedKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`streamed`,input:t.input,fnOptions:t.queryFnOptions})}streamedOptions(...e){let t=AJ(e);typeof this.options.streamedOptions==`function`?t=this.options.streamedOptions(t):this.options.streamedOptions&&(t={...this.options.streamedOptions,...t});let n=this.streamedKey(t);return{...t,queryKey:n,queryFn:e=>QJ(vJ(this.options.streamedInterceptors),{path:this.path,context:{[E$]:{key:n,type:`streamed`},...t.context},input:t.input,fnContext:e},({context:e,fnContext:n,input:r})=>{if(r===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(n):w$(async t=>{let n=await this.call(r,{signal:t.signal,context:e});if(!xJ(n))throw Error(`streamedQuery requires an AsyncIteratorObject output`);return n},t.queryFnOptions)(n)}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}liveKey(...e){let t=AJ(e);return typeof this.options.liveKey==`function`?t=this.options.liveKey(t):this.options.liveKey&&(t={...this.options.liveKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`live`,input:t.input})}liveOptions(...e){let t=AJ(e);typeof this.options.liveOptions==`function`?t=this.options.liveOptions(t):this.options.liveOptions&&(t={...this.options.liveOptions,...t});let n=this.liveKey(t);return{...t,queryKey:n,queryFn:e=>QJ(vJ(this.options.liveInterceptors),{path:this.path,context:{[E$]:{key:n,type:`live`},...t.context},input:t.input,fnContext:e},({fnContext:e,input:n,context:r})=>{if(n===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(e):S$(async e=>{let t=await this.call(n,{signal:e.signal,context:r});if(!xJ(t))throw Error(`liveQuery requires an AsyncIteratorObject output`);return t})(e)}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}infiniteKey(e){return typeof this.options.infiniteKey==`function`?e=this.options.infiniteKey(e):this.options.infiniteKey&&(e={...this.options.infiniteKey,...e}),e.queryKey??x$(this.path,{prefix:this.options.prefix,type:`infinite`,input:e.input===B?B:e.input(e.initialPageParam)})}infiniteOptions(e){typeof this.options.infiniteOptions==`function`?e=this.options.infiniteOptions(e):this.options.infiniteOptions&&(e={...this.options.infiniteOptions,...e});let t=this.infiniteKey(e);return{...e,queryKey:t,queryFn:n=>QJ(vJ(this.options.infiniteInterceptors),{path:this.path,context:{[E$]:{key:t,type:`infinite`},...e.context},input:e.input===B?B:e.input(n.pageParam),fnContext:n},({context:t,input:n,fnContext:r})=>{if(n===B||e.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return e.queryFn?e.queryFn(r):this.call(n,{signal:r.signal,context:t})}),...e.input===B||e.queryFn===B?{enabled:!1}:{}}}mutationKey(e={}){return typeof this.options.mutationKey==`function`?e=this.options.mutationKey(e):this.options.mutationKey&&(e={...this.options.mutationKey,...e}),e.mutationKey??x$(this.path,{prefix:this.options.prefix,type:`mutation`})}mutationOptions(...e){let t=AJ(e);typeof this.options.mutationOptions==`function`?t=this.options.mutationOptions(t):this.options.mutationOptions&&(t={...this.options.mutationOptions,...t});let n=this.mutationKey(t);return{...t,mutationKey:n,mutationFn:(e,r)=>QJ(vJ(this.options.mutationInterceptors),{path:this.path,context:{[E$]:{key:n,type:`mutation`},...t.context},fnContext:r,input:e},({input:e,fnContext:n,context:r})=>t.mutationFn?t.mutationFn(e,n):this.call(e,{context:r}))}}};function N$(e,t={}){let n=new b$(t.plugins);return t=n.init(t),P$(e,t,n)}function P$(e,t,n){let r=vJ(t.path),i=typeof e==`function`&&(t.scoped===void 0||k$(t.scoped))?ZJ(new M$(r,e,n.initProcedureOptions(r,j$({prefix:t.prefix,queryInterceptors:t.queryInterceptors,streamedInterceptors:t.streamedInterceptors,liveInterceptors:t.liveInterceptors,infiniteInterceptors:t.infiniteInterceptors,mutationInterceptors:t.mutationInterceptors},t.scoped??{})))):ZJ(new C$(r,t));return new Proxy(i,{get(i,a){let o=OJ(i,a),s=e[a];if(typeof a!=`string`||RY.has(a)||!EJ(s))return o;let c=P$(s,{...t,path:[...r,a],scoped:YJ(t.scoped,[a])},n);return typeof o==`function`?new Proxy(o,{get(e,t){return typeof t!=`string`||RY.has(t)?OJ(e,t):OJ(c,t)}}):c}})}var F$=N$(g$),I$=()=>F$.integration.getAll.queryOptions({input:{}}),L$=()=>F$.workflow.getAll.queryOptions({input:{}});function R$(e){return{isPublished:!!e.publishedVersionId,hasUnpublishedChanges:e.hasUnpublishedChanges}}function z$(e){return F$.workflow.getById.queryOptions({input:{workflowId:e},select:R$,staleTime:1/0})}function B$(e){return e.invalidateQueries({queryKey:F$.workflow.getAll.key()})}function V$(e,t){e.setQueryData(F$.workflow.getById.queryKey({input:{workflowId:t.id}}),e=>e&&{...e,hasUnpublishedChanges:t.hasUnpublishedChanges,updatedAt:t.updatedAt??e.updatedAt,...t.publishedVersionId===void 0?{}:{publishedVersionId:t.publishedVersionId}})}function H$(e){return Promise.all([e.invalidateQueries({queryKey:F$.workflow.getExecutions.key()}),e.invalidateQueries({queryKey:F$.workflow.getExecutionsGlobal.key()})])}function U$(e){return e.invalidateQueries({queryKey:F$.integration.getAll.key()})}var W$=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,G$=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=W$[n[e]&63];return t};function K$(e,t){return!t||e?.[t.field]===t.equals}function q$(e,t){return t.filter(t=>K$(e,t.showWhen))}var J$=/\{\{@([^:{}]+):([^{}]+)\}\}/g;function Y$(e){let[t,n,r]=e,i=r.indexOf(`.`);return{raw:t,nodeId:n,nodeLabel:i===-1?r:r.slice(0,i),fieldPath:i===-1?``:r.slice(i+1),start:e.index,end:e.index+t.length}}function X$(e){let t=new RegExp(J$.source,`g`),n=[],r=t.exec(e);for(;r!==null;)n.push(Y$(r)),r=t.exec(e);return n}function Z$(e){let t=[],n=0;for(let r of X$(e))r.start>n&&t.push({kind:`literal`,text:e.slice(n,r.start)}),t.push({kind:`token`,token:r}),n=r.end;return n<e.length&&t.push({kind:`literal`,text:e.slice(n)}),t}function Q$(e){let t=e.fieldPath?`.${e.fieldPath}`:``;return`{{@${e.nodeId}:${e.nodeLabel}${t}}}`}function $$(e,t){if(typeof e==`string`)return e1(e,t);if(Array.isArray(e)){let n=!1,r=e.map(e=>{let r=$$(e,t);return r!==e&&(n=!0),r});return n?r:e}if(typeof e==`object`&&e){let n=!1,r={};for(let[i,a]of Object.entries(e)){let e=$$(a,t);e!==a&&(n=!0),r[i]=e}return n?r:e}return e}function e1(e,t){let n=!1,r=Z$(e).map(e=>{if(e.kind===`literal`)return e.text;let r=t(e.token);return r===void 0||r===e.token.raw?e.token.raw:(n=!0,r)}).join(``);return n?r:e}var t1=/\[(\d+)\]/g,n1=/^([^[]*)((?:\[\d+\])*)$/;function r1(e){let t=[];for(let n of e.split(`.`)){let e=n.trim();if(!e)return null;let r=n1.exec(e);if(!r)return null;let i=r[1];if(i.includes(`]`))return null;i&&t.push({kind:`key`,key:i});for(let n of e.matchAll(t1)){let e=Number(n[1]);if(!Number.isSafeInteger(e))return null;t.push({kind:`index`,index:e})}}return t.length>0?t:null}function i1(e){return e===`true`||e===`false`?e:null}function a1(e){let t=i1(e);return t===`true`?`True`:t===`false`?`False`:null}function o1(e){return e===rJ.condition}function s1(e){return fJ(e)}function c1(e){return e?.data.type===`group`}function l1(e){let t=e?.data.config?.entryNodeIds;return Array.isArray(t)?t.filter(e=>typeof e==`string`&&e.length>0):[]}function u1(e){return iJ(e?.data.config,`exitNodeId`)}function d1(e){return iJ(e?.data.config,`outletHandle`)===`true`?`true`:void 0}function f1(e){return`${e.source}\0${e.sourceHandle??``}`}function p1(e,t){let n=e(t.source);return n!==void 0&&n===e(t.target)}function m1(e,t){return e.has(t.source)&&e.has(t.target)}function h1(e,t,n,r){let i=new Map(e.map(e=>[e.id,e])),a=[];for(let e of n){let t=i.get(e);if(!t)return{ok:!1,error:`Select at least two steps`};let n=j1(t,r);if(n)return{ok:!1,error:n};a.push(t)}if(a.length<2)return{ok:!1,error:`Select at least two steps`};let o=new Set(a.map(e=>e.id)),s=t.filter(e=>m1(o,e)),c=new Map,l=new Map;for(let e of o)c.set(e,0),l.set(e,0);for(let e of s)c.set(e.target,(c.get(e.target)??0)+1),l.set(e.source,(l.get(e.source)??0)+1);let u=a.filter(e=>(c.get(e.id)??0)===0),d=a.filter(e=>(l.get(e.id)??0)===0);if(u.length===0)return{ok:!1,error:`Needs an entry step`};if(d.length!==1)return{ok:!1,error:`Needs exactly one exit step`};let f=d[0];if(!f)return{ok:!1,error:`Needs exactly one exit step`};let p=u.map(e=>e.id);if(M1(p,s,o).size!==o.size)return{ok:!1,error:`Needs a connected lookup group`};for(let e of p)if(!M1([e],s,o).has(f.id))return{ok:!1,error:`Needs a connected lookup group`};let m=new Set(p),h=new Set;for(let e of t){let t=o.has(e.source),n=o.has(e.target);if(t!==n){if(n&&!m.has(e.target))return{ok:!1,error:`Needs an entry step`};if(t&&e.source!==f.id)return{ok:!1,error:`Needs exactly one exit step`};if(t&&e.source===f.id){let t=i1(e.sourceHandle);if(fJ(f)&&t===`false`)return{ok:!1,error:`Condition False cannot leave the group`}}n&&m.has(e.target)&&h.add(f1(e))}}return h.size>1?{ok:!1,error:`Parallel lookups must share the same incoming step`}:{ok:!0,entryIds:p,exitId:f.id,memberIds:N1(o,s,p)}}function g1(e,t){let n=e.find(e=>e.id===t);return c1(n)?u1(n)??t:t}function _1(e){let t=g1(e.nodes,e.sourceId),n=new Set(e.edges.filter(t=>t.id!==e.excludeEdgeId).map(e=>`${f1(e)}\0${e.target}`)),r=[];for(let i of v1(e.nodes,e.targetId)){let a=`${f1({source:t,sourceHandle:e.sourceHandle})}\0${i}`;n.has(a)||r.push({source:t,target:i,sourceHandle:e.sourceHandle})}return r}function v1(e,t){let n=e.find(e=>e.id===t);if(!c1(n))return[t];let r=l1(n);return r.length>0?r:[t]}function y1(e,t,n){let r=t.find(e=>e.id===n);if(!r)return[];let i=e.find(e=>e.id===r.target),a=i?.parentId?e.find(e=>e.id===i.parentId):void 0;if(!c1(a))return[n];let o=new Set(l1(a));return o.has(r.target)?t.filter(e=>e.source===r.source&&(e.sourceHandle??``)===(r.sourceHandle??``)&&o.has(e.target)).map(e=>e.id):[n]}function b1(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Map,i=new Map;for(let t of e){if(!c1(t))continue;for(let e of l1(t))r.set(e,t.id);let e=u1(t);e&&i.set(e,t.id)}let a=e=>n.get(e)?.parentId,o=!1,s=t.map(e=>{if(p1(a,e))return e;let t=e,n=a(e.source);n&&i.get(e.source)===n&&(t={...t,source:n});let s=a(e.target);return s&&r.get(e.target)===s&&(t={...t,target:s}),o||=t!==e,t});return P1(o?s:t)}function x1(e,t){let n=new Map(e.map(e=>[e.id,e]));return b1(e,t).filter(e=>!n.get(e.source)?.parentId&&!n.get(e.target)?.parentId)}function S1(e,t){let n=new Set(t),r=new Map(e.map(e=>[e.id,e]));for(let i of t){let t=r.get(i);if(t){if(c1(t)){for(let t of e)t.parentId===i&&n.add(t.id);continue}if(t.parentId){n.add(t.parentId);for(let r of e)r.parentId===t.parentId&&n.add(r.id)}}}return n}function C1(e,t){return e.filter(e=>e.parentId===t).map(e=>e.id)}function w1(e){let t=new Map;for(let n of e){if(!n.parentId)continue;let e=(t.get(n.parentId)??!0)&&n.data.enabled===!1;t.set(n.parentId,e)}let n=new Set;for(let[e,r]of t)r&&n.add(e);return n}function T1(e){if(!e.some(e=>c1(e))||E1(e))return e;let t=[],n=[],r=[];for(let i of e)c1(i)?t.push(i):i.parentId?n.push(i):r.push(i);return[...r,...t,...n]}function E1(e){let t=`rest`;for(let n of e){let e=c1(n)?`groups`:n.parentId?`children`:`rest`;if(e!==t){if(t===`rest`&&e===`groups`){t=`groups`;continue}if(t===`groups`&&e===`children`){t=`children`;continue}return!1}}return!0}function D1(e){let t=new Map;for(let n of e)n.parentId&&t.set(n.parentId,(t.get(n.parentId)??0)+1);return e.filter(e=>c1(e)&&(t.get(e.id)??0)<2).map(e=>e.id)}function O1(e,t,n){let r=N1(new Set(e),t,n),i=new Map;for(let t of e)i.set(t,[]);for(let e of t)i.get(e.target)?.push(e.source);let a=new Map;for(let e of r){let t=(i.get(e)??[]).filter(e=>a.has(e)).map(e=>a.get(e)??0);a.set(e,t.length===0?0:Math.max(...t)+1)}let o=new Map;return r.map(e=>{let t=a.get(e)??0,n=o.get(t)??0;return o.set(t,n+1),{id:e,row:t,column:n}})}function k1(e){return e.length===0?{rows:1,columns:1}:{rows:Math.max(...e.map(e=>e.row+1)),columns:Math.max(...e.map(e=>e.column+1))}}function A1(e,t,n){let r=O1(e,t,n);return{slots:r,bounds:k1(r)}}function j1(e,t){if(e.data.type===`lifecycle`||e.data.type===`add`)return`Only lookup and Condition steps can be grouped`;if(c1(e)||e.parentId)return`Already in a group`;if(e.data.type!==`action`)return`Only lookup and Condition steps can be grouped`;let n=sJ(e);return n?lJ(e)?`Wait cannot be grouped`:pJ(e)?`Event Split cannot be grouped`:Ny(t,n)?.sideEffect?`A step that changes something outside the workflow stays outside the frame`:null:`Every step needs an action`}function M1(e,t,n){let r=new Map;for(let e of t){let t=r.get(e.source)??[];t.push(e.target),r.set(e.source,t)}let i=new Set,a=[...e];for(;a.length>0;){let e=a.pop();if(!(!e||i.has(e)||!n.has(e))){i.add(e);for(let t of r.get(e)??[])a.push(t)}}return i}function N1(e,t,n){let r=new Map,i=new Map;for(let t of e)r.set(t,0),i.set(t,[]);for(let n of t)!e.has(n.source)||!e.has(n.target)||(r.set(n.target,(r.get(n.target)??0)+1),i.get(n.source)?.push(n.target));let a=n.filter(t=>e.has(t)),o=[],s=new Set;for(;a.length>0;){let e=a.shift();if(!(!e||s.has(e))){s.add(e),o.push(e);for(let t of i.get(e)??[]){let e=(r.get(t)??1)-1;r.set(t,e),e===0&&a.push(t)}}}for(let t of e)s.has(t)||o.push(t);return o}function P1(e){let t=new Set,n=[];for(let r of e){let e=`${r.source}\0${r.sourceHandle??``}\0${r.target}\0${r.targetHandle??``}`;t.has(e)||(t.add(e),n.push(r))}return n.length===e.length?e:n}function F1(e){return e.data.type!==`lifecycle`&&e.type!==`add`}function I1(e,t){let n=e.find(e=>e.id===t);return!n||!F1(n)?new Set:n.selected?S1(e,new Set(e.filter(e=>e.selected&&F1(e)).map(e=>e.id))):S1(e,new Set([n.id]))}function L1(e){let t=e.nodes.filter(t=>F1(t)?e.nodeIds?e.nodeIds.has(t.id):!!t.selected:!1);if(t.length===0)return null;let n=S1(e.nodes,new Set(t.map(e=>e.id))),r=e.nodes.filter(e=>n.has(e.id)),i=e.edges.filter(e=>n.has(e.source)&&n.has(e.target));return{nodes:r.map(V1),edges:i.map(H1)}}function R1(e,t){let n=t.createId??G$,r=new Map;for(let t of e.nodes)r.set(t.id,n());let i=new Set(e.nodes.map(e=>e.id));return{nodes:e.nodes.map(e=>{let n=e.parentId,a=typeof n==`string`&&i.has(n),o=a?B1(r,n):void 0;return{...e,id:B1(r,e.id),parentId:o,position:a?e.position:{x:e.position.x+t.offset.x,y:e.position.y+t.offset.y},selected:!0,dragging:!1,data:{...e.data,config:U1(W1(e.data.config,r),r,e)}}}),edges:e.edges.map(e=>({...e,id:n(),source:B1(r,e.source),target:B1(r,e.target),selected:!0}))}}function z1(e,t){let n=new Set(e.map(e=>e.id)),r=e.filter(e=>!e.parentId||!n.has(e.parentId)),i=r.map(e=>e.position.x),a=r.map(e=>e.position.y);return{x:t.x-Math.min(...i),y:t.y-Math.min(...a)}}function B1(e,t){let n=e.get(t);if(n===void 0)throw Error(`cloneSelection expected extractCopyableSelection output`);return n}function V1(e){return{...i$(t$(e)),selected:!1,dragging:!1}}function H1(e){return{...a$(r$(e)),selected:!1}}function U1(e,t,n){if(!e||!c1(n))return e;let r={...e},i=Array.isArray(e.entryNodeIds)?e.entryNodeIds.map(e=>typeof e==`string`?t.get(e):void 0).filter(e=>typeof e==`string`):[],a=typeof e.exitNodeId==`string`?t.get(e.exitNodeId):void 0;return i.length>0&&(r.entryNodeIds=i),a&&(r.exitNodeId=a),r}function W1(e,t){return e&&$$(e,e=>{let n=t.get(e.nodeId);if(n)return Q$({nodeId:n,nodeLabel:e.nodeLabel,fieldPath:e.fieldPath})})}var G1=Ay(`workflow`,`save`),K1=tA(null),q1=tA(``),J1=tA(`private`),Y1=tA(`live`),X1=tA(!0),Z1=tA(!1),Q1=tA(null),$1=tA(!1),e0=tA(!1),t0=tA(null),n0=tA(null),r0=tA(y$);function i0(){jy.invalidateQueries({queryKey:F$.workflow.getAll.key(),refetchType:`none`})}var a0=tA(1e3),o0=tA(()=>({timeoutId:null,pending:[],failedPatches:new Map,renames:new Map,nextRenameRequestId:0,isFlushing:!1}));function s0(e){return e instanceof Error?e:Error(`Failed to save workflow`,{cause:e})}function c0(e){let{nodes:t,edges:n,...r}=e;return t&&n?{...r,nodes:t.filter(e=>e.type!==`add`),edges:n}:r}var l0=tA(null,async(e,t,n,r)=>{t(e0,!0),t(n0,null);let i=e(K1);if(!i)return null;let a=e(o0),o=async()=>{if(!a.isFlushing){a.isFlushing=!0,t($1,!0);try{for(;a.pending.length>0;){let n=a.pending.shift();if(!n)break;let r;try{let i=await e(r0).update(n.workflowId,c0(n.patch));r={ok:!0,workflow:i};let o=a.renames.get(n.workflowId);o&&(o.confirmedName=i.name),t(n0,null),i0(),V$(jy,i),e(K1)===n.workflowId&&t(t0,new Date),!a.pending.some(e=>e.workflowId===n.workflowId)&&!a.failedPatches.has(n.workflowId)&&e(K1)===n.workflowId&&t(e0,!1)}catch(e){let i=s0(e);r={ok:!1,error:i},t(n0,i);let o=a.pending.find(e=>e.workflowId===n.workflowId);o?o.patch={...n.patch,...o.patch}:a.failedPatches.set(n.workflowId,{...a.failedPatches.get(n.workflowId),...n.patch}),G1.error(`Save failed`,{workflowId:n.workflowId,error:e})}for(let e of n.waiters)e(r)}}finally{a.isFlushing=!1,t($1,!1)}}},s=new Promise(e=>{let t=a.failedPatches.get(i),r=t?{...t,...n}:n;a.failedPatches.delete(i);let o=a.pending.at(-1);if(o?.workflowId===i){o.patch={...o.patch,...r},o.waiters.push(e);return}a.pending.push({workflowId:i,patch:r,waiters:[e]})});return a.timeoutId&&=(clearTimeout(a.timeoutId),null),r?.immediate?(await o(),await s):(a.timeoutId=setTimeout(()=>{a.timeoutId=null,o().catch(e=>{G1.error(`Save flush failed`,{error:e})})},e(a0)),await s)});function qce(e,t,n){let r=e.failedPatches.get(t);if(r?.name!==n)return;let{name:i,...a}=r;Object.keys(a).length===0?e.failedPatches.delete(t):e.failedPatches.set(t,a)}var Jce=tA(null,async(e,t,n)=>{let r=e(q1),i=e(K1),a=e(o0),o=++a.nextRenameRequestId,s=i?a.renames.get(i):void 0;i&&(s?(s.activeCount+=1,s.latestRequestId=o):(s={activeCount:1,latestRequestId:o,confirmedName:r},a.renames.set(i,s))),t(q1,n);let c=await t(l0,{name:n},{immediate:!0});return c?.ok===!1?(e(K1)===i&&e(q1)===n&&s?.latestRequestId===o&&t(q1,s.confirmedName),i&&qce(a,i,n),i&&s&&--s.activeCount===0&&a.renames.delete(i),c.error):(i&&s&&--s.activeCount===0&&a.renames.delete(i),null)}),Yce=tA(null,async(e,t,n)=>await t(l0,{mode:n},{immediate:!0})),u0=`sidebar-width`,d0=`sidebar-collapsed`,Xce=31536e3,Zce=20,Qce=50,$ce=30;function f0(e){if(!(typeof document>`u`))return document.cookie.split(`; `).find(t=>t.startsWith(`${e}=`))?.split(`=`)[1]}function p0(e,t){document.cookie=`${e}=${t}; path=/; max-age=${Xce}`}function ele(){let e=Number.parseFloat(f0(u0)??``);return e>=Zce&&e<=Qce?e:$ce}var m0=tA(`properties`),h0=tA(!1),g0=tA(f0(d0)===`true`),tle=tA(e=>e(g0),(e,t,n)=>{let r=typeof n==`function`?n(e(g0)):n;t(g0,r),p0(d0,String(r))}),_0=tA(ele()),nle=tA(e=>e(_0),(e,t,n)=>{t(_0,n),p0(u0,String(n))});function v0(e){return`min(max(calc((100vw - 2 * var(--editor-inset, 0px)) * ${e} / 100), 320px), 460px)`}function rle(){let e=Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue(`--editor-inset`));return window.innerWidth-(Number.isFinite(e)?e:0)*2}var y0=tA(!1),b0=tA(!1),x0=tA(e=>e(m0)===`runs`&&e(X1)?`runs`:`properties`),S0=tA(null),C0=tA(e=>e(x0)===`runs`?e(S0):null,(e,t,n)=>{t(S0,n)});function ile(e){let t=new Map;for(let n of e.edges){let e=t.get(n.source);e?e.push(n.target):t.set(n.source,[n.target])}let n=[];for(let r of e.startIds)n.push(...t.get(r)??[]);let r=new Set;for(;n.length>0;){let e=n.pop();!e||r.has(e)||(r.add(e),n.push(...t.get(e)??[]))}return r}var w0=`started`,T0=`canceled`;function ale(e){return e===`started`||e===`canceled`}var E0={nodeIds:new Set,outletEdgeIds:new Set};function ole(e){let t=sle(e),n=e.nodes.filter(e=>e.data.enabled===!1).map(e=>e.id);if(t.length===0&&n.length===0)return E0;let r=new Set(t.map(e=>e.target)),i=[...r,...n];for(let t of ile({startIds:i,edges:e.edges}))r.add(t);return cle(e.nodes,r),r.size===0?E0:{nodeIds:r,outletEdgeIds:new Set(t.map(e=>e.id))}}function sle(e){let t=e.nodes.filter(e=>e.data.type===`lifecycle`);if(t.length===0||t.some(e=>cQ(e.data.config)))return[];let n=new Set(t.map(e=>e.id));return e.edges.filter(e=>n.has(e.source)&&e.sourceHandle===`canceled`)}function cle(e,t){let n=new Map;for(let r of e){if(!r.parentId)continue;let e=t.has(r.id);n.set(r.parentId,(n.get(r.parentId)??!0)&&e)}for(let[e,r]of n)r&&t.add(e)}var D0=`payload`,lle=`event`,ule=`$event.name`;function dle(e){return e===`within_next`||e===`more_than_from_now`||e===`less_than_ago`||e===`more_than_ago`}function fle(e){return e===`before`||e===`after`}function O0(e){return dle(e.operator)}function k0(e){return fle(e.operator)}function ple(e){return e===`is_set`||e===`is_not_set`}function A0(e){return ple(e.operator)}function j0(e,t=`rule`){return e.type===`timestamp`?{id:t,field:e.path,fieldType:`timestamp`,operator:`within_next`,amount:1,unit:`days`}:e.type===`number`?{id:t,field:e.path,fieldType:`number`,operator:`equals`,value:0}:e.type===`boolean`?{id:t,field:e.path,fieldType:`boolean`,operator:`is_true`}:{id:t,field:e.path,fieldType:`string`,operator:`equals`,value:``}}function mle(e,t){let n=!1,r=e.groups.map(e=>({...e,conditions:e.conditions.map(e=>{let r=t.get(e.field);return!r||r.type===e.fieldType?e:(n=!0,j0(r,e.id))})}));return n?{...e,groups:r}:e}function M0(e,t){return{version:2,groupLogic:`and`,groups:[{id:t?.groupId??`group`,logic:`and`,conditions:[j0(e,t?.conditionId??`rule`)]}]}}var N0=[{value:`and`,label:`AND`},{value:`or`,label:`OR`}],P0=[{value:`within_next`,label:`is within the next`},{value:`more_than_from_now`,label:`is more than from now`},{value:`less_than_ago`,label:`is less than ago`},{value:`more_than_ago`,label:`is more than ago`},{value:`before`,label:`is before`},{value:`after`,label:`is after`}],F0=[{value:`minutes`,label:`minutes`},{value:`hours`,label:`hours`},{value:`days`,label:`days`},{value:`weeks`,label:`weeks`}],I0=[{value:`equals`,label:`equals`},{value:`not_equals`,label:`does not equal`},{value:`contains`,label:`contains`}],L0=[{value:`equals`,label:`equals`},{value:`not_equals`,label:`does not equal`},{value:`greater_than`,label:`is greater than`},{value:`greater_or_equal`,label:`is greater than or equal`},{value:`less_than`,label:`is less than`},{value:`less_or_equal`,label:`is less than or equal`}],R0=[{value:`is_true`,label:`is true`},{value:`is_false`,label:`is false`}],z0=[{value:`is_set`,label:`is set`},{value:`is_not_set`,label:`is not set`}],hle=RegExp(`^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|(?:[+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$`),B0=oh.check(Th(hle)).pipe(bh(Fh,Bf)),gle=kee(B0);Aee(B0);var _le=Nee(B0);function V0(e){return Lc(gle(e.trim()))}function vle(e){return _le(e)}function H0(e){return oh.annotate({message:e}).pipe(bh(oh,If())).check(Mh(1).annotate({message:e})).annotateKey({messageMissingKey:e})}function U0(e,t){return e.annotate({message:t}).annotateKey({messageMissingKey:t})}function W0(e){return{id:H0(`Condition id is required`),field:H0(`Condition field is required`),fieldType:rh(e)}}function G0(e,t){return uh({...W0(e),operator:U0(_h([`is_set`,`is_not_set`]),t)})}var K0=`Timestamp operator is invalid`,q0=`Timestamp amount must be a positive integer`,J0=`Timestamp absolute operators require a valid date-time`,Y0=`String operator is invalid`,X0=`Number operator is invalid`,Z0=`Number conditions require a finite numeric value`,Q0=`Boolean operator is invalid`;function yle(e){return V0(e)!==null}var ble=[uh({...W0(`timestamp`),operator:U0(_h([`within_next`,`more_than_from_now`,`less_than_ago`,`more_than_ago`]),K0),amount:U0(sh,q0).check(Dh().annotate({message:q0}),jh().annotate({message:q0}),Ah(0).annotate({message:q0})),unit:U0(_h([`minutes`,`hours`,`days`,`weeks`]),`Timestamp unit is invalid`)}),uh({...W0(`timestamp`),operator:U0(_h([`before`,`after`]),K0),dateTime:oh.annotate({message:J0}).pipe(bh(oh,If())).check(Sh(e=>yle(e)?void 0:J0)).annotateKey({messageMissingKey:J0})}),G0(`timestamp`,K0),uh({...W0(`string`),operator:U0(_h([`equals`,`not_equals`,`contains`]),Y0),value:U0(oh,`String conditions require a text value`)}),G0(`string`,Y0),uh({...W0(`number`),operator:U0(_h([`equals`,`not_equals`,`greater_than`,`greater_or_equal`,`less_than`,`less_or_equal`]),X0),value:U0(sh,Z0).check(Dh().annotate({message:Z0}))}),G0(`number`,X0),uh({...W0(`boolean`),operator:U0(_h([`is_true`,`is_false`]),Q0)}),G0(`boolean`,Q0)],xle=dh(oh,ih).annotate({message:`Condition must be an object`}).pipe(bh(gh(ble).annotate({message:`Condition field type is invalid`}))),$0=`Each group must contain at least one condition`,Sle=uh({id:H0(`Group id is required`),logic:U0(_h([`and`,`or`]),`Group logic is invalid`),conditions:U0(mh(ph(xle)),$0).check(Mh(1).annotate({message:$0}))}).annotate({message:`Group must be an object`}),e2=`Condition model must contain at least one group`,Cle=Qm(uh({version:U0(rh(2),`Condition model version must be 2`),groupLogic:U0(_h([`and`,`or`]),`Condition model group logic is invalid`),groups:U0(mh(ph(Sle)),e2).check(Mh(1).annotate({message:e2}))}).annotate({message:`Condition model must be an object`})),wle=uf();function Tle(e){let t=e.path?.at(-1);if(t!=null)return typeof t==`object`?t.key:t}function Ele(e){return(e.find(e=>Tle(e)!==`operator`)??e[0])?.message}function t2(e){let t=e;if(typeof e==`string`){let n=e.trim();if(!n)return{valid:!1,error:`Condition model is empty`};try{t=JSON.parse(n)}catch{return{valid:!1,error:`Condition model must be valid JSON`}}}let n=Cle(t);if(Hc(n)){let{issues:e}=wle(n.failure.issue);return{valid:!1,error:Ele(e)??`Condition model is invalid`}}return{valid:!0,model:n.success}}function n2(e){return JSON.stringify(e)}function r2(e){return JSON.stringify(e)}function i2(e){return e===`and`||e===`or`}function Dle(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)&&e>0}function Ole(e){return e===`minutes`||e===`hours`||e===`days`||e===`weeks`}function kle(e){return V0(e)!==null}function Ale(e){switch(e){case`equals`:return`==`;case`not_equals`:return`!=`;case`greater_than`:return`>`;case`greater_or_equal`:return`>=`;case`less_than`:return`<`;case`less_or_equal`:return`<=`;default:return`==`}}function jle(e,t){if(O0(e)){let n=e.amount;if(!Dle(n))return{valid:!1,error:`Timestamp amount must be a positive integer`,incomplete:!0};if(!Ole(e.unit))return{valid:!1,error:`Timestamp unit is invalid`};let r=e.unit;return e.operator===`within_next`?{valid:!0,expression:`${t} > now && ${t} < now + ${r}(${n})`}:e.operator===`more_than_from_now`?{valid:!0,expression:`${t} > now + ${r}(${n})`}:e.operator===`less_than_ago`?{valid:!0,expression:`${t} > now - ${r}(${n})`}:{valid:!0,expression:`${t} < now - ${r}(${n})`}}if(!kle(e.dateTime))return{valid:!1,error:`Timestamp absolute operators require a valid date-time`,incomplete:!0};let n=r2(e.dateTime.trim());return e.operator===`before`?{valid:!0,expression:`${t} < date(${n})`}:{valid:!0,expression:`${t} > date(${n})`}}function Mle(e,t){if(!e.value.trim())return{valid:!1,error:`Text conditions require a value`,incomplete:!0};let n=r2(e.value);return e.operator===`equals`?{valid:!0,expression:`${t} == ${n}`}:e.operator===`not_equals`?{valid:!0,expression:`${t} != ${n}`}:{valid:!0,expression:`${t}.contains(${n})`}}function Nle(e,t){return Number.isFinite(e.value)?{valid:!0,expression:`${t} ${Ale(e.operator)} ${e.value}`}:{valid:!1,error:`Number conditions require a finite numeric value`,incomplete:!0}}function Ple(e,t){return e.operator===`is_true`?{valid:!0,expression:`${t} == true`}:{valid:!0,expression:`${t} == false`}}function Fle(e){return/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}function Ile(e){let t=r1(e);if(!t)return null;if(t.every(e=>e.kind===`key`&&Fle(e.key))){let e=t.map(e=>e.key);return{field:`${D0}.${e.join(`.`)}`,presence:e.map((t,n)=>`has(${D0}.${e.slice(0,n+1).join(`.`)})`).join(` && `)}}let n=D0,r=[];for(let e of t)if(e.kind===`key`){let t=r2(e.key);r.push(`${t} in ${n}`),n=`${n}[${t}]`}else r.push(`size(${n}) > ${e.index}`),n=`${n}[${e.index}]`;return{field:n,presence:r.join(` && `)}}function Lle(e,t){return e.operator===`is_set`?{valid:!0,expression:t}:{valid:!0,expression:`!(${t})`}}function a2(e,t){return e.fieldType===`timestamp`?jle(e,t):e.fieldType===`string`?Mle(e,t):e.fieldType===`number`?Nle(e,t):Ple(e,t)}function Rle(e){let t=`${lle}.name`;return A0(e)?{valid:!0,expression:e.operator===`is_set`?`${t} != null`:`${t} == null`}:a2(e,t)}function o2(e){let t=e.field.trim();if(!t)return{valid:!1,error:`Condition field is required`};if(t===`$event.name`)return Rle(e);let n=Ile(t);if(!n)return{valid:!1,error:`Condition field path is invalid`};let{field:r,presence:i}=n;if(A0(e))return Lle(e,i);let a=a2(e,r);return a.valid?{valid:!0,expression:`${i} && (${a.expression})`}:a}function zle(e){if(e.conditions.length===0)return{valid:!1,error:`Each group must contain at least one condition`};let t=[];for(let n of e.conditions){let e=o2(n);if(!e.valid)return e;t.push(`(${e.expression})`)}let n=e.logic===`and`?` && `:` || `;return{valid:!0,expression:t.join(n)}}function s2(e){if(!i2(e.groupLogic))return{valid:!1,error:`Condition model group logic is invalid`};if(e.groups.length===0)return{valid:!1,error:`Condition model must contain at least one group`};let t=[];for(let n of e.groups){if(!i2(n.logic))return{valid:!1,error:`Group logic is invalid`};let e=zle(n);if(!e.valid)return e;t.push(`(${e.expression})`)}let n=e.groupLogic===`and`?` && `:` || `;return{valid:!0,expression:t.join(n)}}function Ble(e){let t=t2(e);return t.valid?s2(t.model):{valid:!1,error:t.error}}var c2=uh({event:Bh,match:nh(oh)}),Vle=mh(ph(c2)).check(Mh(1)),Hle=uh({waitMode:nh(_h([`delay`,`event`])),waitFor:nh(Vle),waitTimeout:nh(oh),waitTimeoutBehavior:nh(_h([`continue`,`skip`])),waitDuration:nh(oh),waitUntil:nh(oh),waitOffset:nh(oh),waitGateMode:nh(_h([`off`,`require_actual_wait`])),waitAllowedHoursMode:nh(oh),waitAllowedStartTime:nh(oh),waitAllowedEndTime:nh(oh),waitTimezone:nh(oh)}),l2={waitDuration:{type:`duration`,required:!0,owner:{mode:`delay`,timing:`duration`}},waitUntil:{type:`timestamp`,required:!0,owner:{mode:`delay`,timing:`until`}},waitOffset:{type:`duration`,required:!1,owner:{mode:`delay`,timing:`until`}},waitTimeout:{type:`duration`,required:!0,owner:{mode:`event`}}},u2=[`waitDuration`,`waitUntil`,`waitOffset`,`waitTimeout`];function d2(e){let t=e.waitDelayTimingMode;return t===`until`||t===`duration`?t:typeof e.waitUntil==`string`&&e.waitUntil.trim()?`until`:`duration`}function Ule(e){let t=e.waitMode===`event`?`event`:`delay`,n=d2(e);return u2.filter(e=>{let{owner:r}=l2[e];return r.mode===`event`?t===`event`:t===`delay`&&r.timing===n})}function f2(e){let t=new Set(Ule(e));return u2.filter(e=>!t.has(e))}Qm(Hle);var Wle=Wh(mh(ph(c2)));function p2(e){return Wle(e?.waitFor)??[]}var Gle=/^([01]\d|2[0-3]):([0-5]\d)$/;function m2(e){return typeof e==`string`&&e.trim()===`daily_window`?`daily_window`:`off`}function h2(e){if(typeof e!=`string`)return null;let t=e.trim(),n=Gle.exec(t);if(!n)return null;let[,r,i]=n;return r&&i?Number.parseInt(r,10)*60+Number.parseInt(i,10):null}function Kle(e){let t=[],n=typeof e.mode==`string`?e.mode.trim():m2(e.mode);if(n.length>0&&n!==`off`&&n!==`daily_window`)return t.push({field:`mode`,message:`Allowed-hours mode must be either "off" or "daily_window".`}),t;if(n!==`daily_window`)return t;let r=h2(e.startTime);r===null&&t.push({field:`start`,message:`Allowed-hours start must use HH:MM (24-hour) format.`});let i=h2(e.endTime);return i===null&&t.push({field:`end`,message:`Allowed-hours end must use HH:MM (24-hour) format.`}),r!==null&&i!==null&&r>=i&&t.push({field:`window`,message:`Allowed-hours start must be earlier than end (same-day window only).`}),t}function qle(e){return e.type===`group`&&`fields`in e&&Array.isArray(e.fields)}function g2(e){return e==null||typeof e==`string`&&e.trim().length===0}function Jle(e){let t=[];for(let n of e){if(qle(n)){t.push(...n.fields);continue}t.push(n)}return t}function Yle(e){let{config:t,configFields:n}=e;return Jle(n).filter(e=>e.required===!0&&K$(t,e.showWhen)&&g2(t[e.key])).map(e=>({fieldKey:e.key,fieldLabel:e.label}))}function Xle(e){return oX(e.waitMode)===`event`?`event`:`delay`}function Zle(e){if(Xle(e)===`event`){let t=[];p2(e).length===0&&t.push({fieldKey:`waitFor`,fieldLabel:`Wait for these events`});for(let n of p2(e)){let e=oX(n.match);if(!e)continue;let r=Ble(e);!r.valid&&r.incomplete&&t.push({fieldKey:`waitFor`,fieldLabel:`Match value for "${n.event}"`})}return g2(e.waitTimeout)&&t.push({fieldKey:`waitTimeout`,fieldLabel:`Stop waiting after`}),t}let t=[];if(d2(e)===`until`?g2(e.waitUntil)&&t.push({fieldKey:`waitUntil`,fieldLabel:`Wait until this date/time`}):g2(e.waitDuration)&&t.push({fieldKey:`waitDuration`,fieldLabel:`Wait for (duration)`}),oX(e.waitAllowedHoursMode)===`daily_window`){let n=oX(e.waitAllowedStartTime);(!n||h2(n)===null)&&t.push({fieldKey:`waitAllowedStartTime`,fieldLabel:`Window start (HH:MM)`});let r=oX(e.waitAllowedEndTime);(!r||h2(r)===null)&&t.push({fieldKey:`waitAllowedEndTime`,fieldLabel:`Window end (HH:MM)`}),g2(e.waitTimezone)&&t.push({fieldKey:`waitTimezone`,fieldLabel:`Timezone`})}return t}function Qle(e){let{actionType:t,config:n}=e;switch(t){case rJ.condition:return g2(n.condition)?[{fieldKey:`condition`,fieldLabel:`Condition`}]:[];case rJ.wait:return Zle(n);default:return[]}}function _2(e){let{node:t,actionType:n,actionLabel:r}=e;return oX(t.data.label)||r||n||t.id}function $le(e){let{node:t,resolveActionByType:n}=e;if(t.data.type!==`action`||t.data.enabled===!1)return null;let r=t.data.config??{},i=oX(r.actionType);if(!i)return{nodeId:t.id,nodeLabel:_2({node:t}),missingFields:[{fieldKey:`actionType`,fieldLabel:`Action`}]};let a=n(i),o=Qle({actionType:i,config:r}),s=a?Yle({config:r,configFields:a.configFields??[]}):[],c=[...o,...s];return c.length===0?null:{nodeId:t.id,nodeLabel:_2({node:t,actionType:i,actionLabel:a?.label}),missingFields:c}}function eue(e){let{nodes:t,resolveActionByType:n}=e;return t.map(e=>$le({node:e,resolveActionByType:n})).filter(e=>e!==null)}function v2(e){return e.type===`group`}function tue(e){let t=[];for(let n of e)v2(n)?t.push(...n.fields):t.push(n);return t}function nue(e){return t=>Ny(e,t)}function y2(e){return oX(e.node.data.label)||(e.actionLabel?e.actionLabel:e.actionType?e.actionType:e.node.id)}function rue(e){return eue({nodes:e.nodes,resolveActionByType:nue(e.catalog)}).flatMap(e=>e.missingFields.map(t=>({kind:`missing_required_field`,severity:`blocking`,nodeId:e.nodeId,nodeLabel:e.nodeLabel,fieldKey:t.fieldKey,fieldLabel:t.fieldLabel,message:`Node "${e.nodeLabel}" is missing required field "${t.fieldLabel}"`})))}function iue(e){let t=new Set(e.integrations.map(e=>e.id)),n=[];for(let r of e.nodes){if(r.data.type!==`action`||r.data.enabled===!1)continue;let i=oJ(r.data.config,`actionType`);if(!i)continue;let a=Ny(e.catalog,i),o=a?.integration;if(!o)continue;let s=oJ(r.data.config,`integrationId`);if(s&&t.has(s))continue;let c=Py(e.catalog,o)?.label??o,l=y2({node:r,actionLabel:a?.label,actionType:i});n.push({kind:`missing_integration`,severity:`blocking`,nodeId:r.id,nodeLabel:l,integrationType:o,integrationLabel:c,message:`Node "${l}" needs a ${c} connection`})}return n}function aue(e){return typeof e==`string`?X$(e).map(e=>({nodeId:e.nodeId,displayText:e.fieldPath?`${e.nodeLabel}.${e.fieldPath}`:e.nodeLabel})):[]}function b2(e,t=``){let n=[];for(let[r,i]of Object.entries(e)){let e=t?`${t}.${r}`:r;if(typeof i==`string`){for(let t of aue(i))n.push({field:e,...t});continue}if(typeof i==`object`&&i&&!Array.isArray(i)){let t={...i};n.push(...b2(t,e))}}return n}function oue(e){let t=new Set(e.nodes.map(e=>e.id)),n=[];for(let r of e.nodes){if(r.data.enabled===!1)continue;let i=r.data.config;if(!i||typeof i!=`object`)continue;let a=b2(i).filter(e=>!t.has(e.nodeId));if(a.length===0)continue;let o=oJ(i,`actionType`),s=o?Ny(e.catalog,o):void 0,c=s?tue(s.configFields):[],l=y2({node:r,actionLabel:s?.label,actionType:o});for(let e of a){let t=c.find(t=>t.key===e.field)?.label??e.field;n.push({kind:`broken_reference`,severity:`warning`,nodeId:r.id,nodeLabel:l,fieldKey:e.field,fieldLabel:t,referencedNodeId:e.nodeId,displayText:e.displayText,message:`Node "${l}" references missing step in ${t}`})}}return n}function x2(e){return[...rue(e),...iue(e),...oue(e)]}function S2(e){return e.some(e=>e.severity===`blocking`)}function C2(e){let t=new Map,n=new Map,r=new Map;for(let i of e)switch(i.kind){case`missing_required_field`:{let e=t.get(i.nodeId);if(e){e.missingFields.push({fieldKey:i.fieldKey,fieldLabel:i.fieldLabel});break}t.set(i.nodeId,{nodeId:i.nodeId,nodeLabel:i.nodeLabel,missingFields:[{fieldKey:i.fieldKey,fieldLabel:i.fieldLabel}]});break}case`broken_reference`:{let e=n.get(i.nodeId);if(e){e.brokenReferences.push({fieldKey:i.fieldKey,fieldLabel:i.fieldLabel,referencedNodeId:i.referencedNodeId,displayText:i.displayText});break}n.set(i.nodeId,{nodeId:i.nodeId,nodeLabel:i.nodeLabel,brokenReferences:[{fieldKey:i.fieldKey,fieldLabel:i.fieldLabel,referencedNodeId:i.referencedNodeId,displayText:i.displayText}]});break}case`missing_integration`:{let e=r.get(i.integrationType);if(e){e.nodeNames.includes(i.nodeLabel)||e.nodeNames.push(i.nodeLabel);break}r.set(i.integrationType,{integrationType:i.integrationType,integrationLabel:i.integrationLabel,nodeNames:[i.nodeLabel]});break}default:throw Error(`Unhandled workflow issue`)}return{missingRequiredFields:Array.from(t.values()),missingIntegrations:Array.from(r.values()),brokenReferences:Array.from(n.values())}}var w2=[],T2=tA(w2),sue=tA(e=>{let t=Ka(e(T2),e=>e.nodeId),n=new Map(Object.entries(t).map(([e,t])=>{let n=due(t),r=E2.get(e);return[e,r&&cue(r,n)?r:n]}));return E2=n,n}),E2=new Map;function cue(e,t){return e.severity===t.severity&&e.messages.length===t.messages.length&&e.messages.every((e,n)=>e===t.messages[n])}var lue=tA(e=>S2(e(T2))),uue=new Map;function due(e){return{severity:e.some(e=>e.severity===`blocking`)?`blocking`:`warning`,messages:e.map(e=>e.message)}}function fue(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.kind===r.kind&&e.nodeId===r.nodeId&&e.message===r.message})}function D2(e=192){return{width:e,height:112}}function O2(e,t){let n=Math.max(e,1),r=Math.max(t,1);return{width:12+n*188+(n-1)*24+12,height:48+r*56+(r-1)*40+12}}var pue=132;function k2(e){return e>1?e*pue:192}var A2=`size-5`,mue=324/212,hue=200/96;function gue(e){let t=h1(e.nodes,e.edges,e.selectedIds,e.catalog);if(!t.ok)return null;let n=new Map(e.nodes.map(e=>[e.id,e])),r=t.memberIds.map(e=>{let t=n.get(e);if(!t)throw Error(`groupSelection expected analyzeGroupableSelection ids`);return t}),i={x:Math.min(...r.map(e=>e.position.x)),y:Math.min(...r.map(e=>e.position.y))},a=new Set(t.memberIds),o=e.edges.filter(e=>m1(a,e)),{slots:s,bounds:c}=A1(t.memberIds,o,t.entryIds),l=O2(c.columns,c.rows),u=(e.createId??G$)(),d=L2(s,c.columns),f=n.get(t.exitId),p={id:u,type:`group`,position:i,width:l.width,height:l.height,style:{width:l.width,height:l.height},selected:!0,data:{label:`Group`,type:`group`,config:{entryNodeIds:t.entryIds,exitNodeId:t.exitId,...fJ(f)?{outletHandle:`true`}:{}}}},m=r.some(e=>e.data.enabled===!1),h=r.map(e=>z2(m?{...e,data:{...e.data,enabled:!1}}:e,u,R2(d,e.id)));return{nodes:T1([...e.nodes.filter(e=>!a.has(e.id)).map(e=>({...e,selected:!1})),p,...h]),edges:Sue({edges:e.edges,entryIds:t.entryIds,createEdgeId:e.createEdgeId??G$}),analysis:t}}function j2(e,t){let n=e.find(e=>e.id===t);return!n||!c1(n)?e:T1(e.flatMap(e=>e.id===t?[]:e.parentId===t?[wue(e,Cue(n,e))]:[e]))}function _ue(e,t){let n=new Map;for(let t of e){if(!t.parentId)continue;let e=n.get(t.parentId)??[];e.push(t),n.set(t.parentId,e)}if(n.size===0)return e;let r=new Map,i=new Map;for(let[a,o]of n){let n=e.find(e=>e.id===a),s=o.map(e=>e.id),c=new Set(s),{slots:l,bounds:u}=A1(s,t.filter(e=>m1(c,e)),l1(n));i.set(a,O2(u.columns,u.rows));let d=L2(l,u.columns);for(let e of o)r.set(e.id,z2(e,a,R2(d,e.id)))}return e.map(e=>{if(c1(e)){let t=i.get(e.id);return t?{...e,width:t.width,height:t.height,style:{...e.style,width:t.width,height:t.height}}:e}return r.get(e.id)??e})}var M2=new WeakMap;function vue(e,t){let n=new Map(e.map(e=>[e.id,e.parentId])),r=e=>n.get(e),i=!1,a=t.map(e=>{if(!p1(r,e))return e;i=!0;let t=M2.get(e);if(t)return t;let n={...e,selectable:!1,deletable:!1,focusable:!1};return M2.set(e,n),n});return i?a:t}function N2(e){let t=e;for(let e of D1(t))t=j2(t,e);return t}function P2(e){let t=new Set(e.filter(e=>c1(e)).map(e=>e.id));return e.some(e=>e.parentId&&!t.has(e.parentId))?`Ungroup the frame before deleting a step inside it`:null}function F2(e){let t=P2(e);return t&&wy.error(t),t}function I2(e){return!!(e&&(c1(e)||e.parentId))}function yue(e,t){let n=new Set([t]);if(c1(e.find(e=>e.id===t)))for(let r of C1(e,t))n.add(r);return n}function bue(e,t,n){let r=new Set;for(let i of n)if(i.type===`remove`)for(let n of y1(e,t,i.id))r.add(n);return r.size===0?n:[...n.filter(e=>e.type!==`remove`),...[...r].map(e=>({type:`remove`,id:e}))]}function xue(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>n.has(e.source)&&n.has(e.target));return r.length===t.length?t:r}function Sue(e){let{edges:t,entryIds:n,createEdgeId:r}=e,i=new Set(n),a=t.filter(e=>i.has(e.target)),o=[],s=new Set;for(let e of a){let t=f1(e);s.has(t)||(s.add(t),o.push(e))}if(o.length!==1)return t;let c=o[0];if(!c)return t;let l=f1(c),u=new Set(t.filter(e=>f1(e)===l).map(e=>e.target)),d=[];for(let e of n)u.has(e)||d.push({id:r(),source:c.source,target:e,sourceHandle:c.sourceHandle,targetHandle:c.targetHandle});return d.length===0?t:[...t,...d]}function L2(e,t){let n=new Map;for(let t of e)n.set(t.row,(n.get(t.row)??0)+1);let r=new Map;for(let i of e){let e=(t-(n.get(i.row)??1))*212/2;r.set(i.id,{x:12+e+i.column*212,y:48+i.row*96})}return r}function R2(e,t){let n=e.get(t);if(!n)throw Error(`Group layout has no slot for member '${t}'`);return n}function z2(e,t,n){return{...e,parentId:t,extent:`parent`,draggable:!1,connectable:!1,selected:!1,width:188,height:56,position:n}}function Cue(e,t){if(typeof e.width!=`number`)throw Error(`Group '${e.id}' has no width to ungroup around`);let n=e.position.x+e.width/2,r=e.position.x+t.position.x+94,i=t.position.y-36-12;return{x:n+(r-n)*mue-96,y:e.position.y+i*hue}}function wue(e,t){let{extent:n,parentId:r,...i}=e;return{...i,draggable:!0,connectable:!0,width:192,height:112,position:t}}var B2=tA([]),V2=tA([]),H2=tA(null),U2=tA(e=>e(x0)===`runs`?e(H2):null,(e,t,n)=>{t(H2,n===null?null:{nodes:T1(n.nodes),edges:n.edges})}),W2=tA(null),G2=tA(null),K2=tA([]),q2=tA([]);function J2(e){return e(U2)===null}function Y2(e,t){let n={nodes:e(B2),edges:e(V2)};t(K2,[...e(K2),n].slice(-50)),t(q2,[])}function X2(e,t,n){t(l0,{nodes:e(B2),edges:e(V2)},n)}var Z2=tA(null,(e,t,n)=>{if(!J2(e))return!1;let r=e(B2),i=n.selectedIds??new Set(r.filter(e=>e.selected).map(e=>e.id)),a=gue({nodes:r,edges:e(V2),selectedIds:i,catalog:n.catalog});return a?(Y2(e,t),t(B2,a.nodes),t(V2,a.edges),t(W2,a.nodes.find(e=>c1(e)&&e.selected)?.id??null),t(G2,null),X2(e,t,{immediate:!0}),!0):!1}),Q2=tA(null,(e,t,n)=>{if(!J2(e))return!1;let r=e(B2),i=r.find(e=>e.id===n),a=c1(i)?n:i?.parentId;if(!a)return!1;let o=j2(r,a);return o!==r&&(Y2(e,t),t(B2,o),t(W2,null),t(G2,null),X2(e,t,{immediate:!0}),!0)}),Tue=tA(null,(e,t,n)=>{if(!J2(e))return!1;let r=e(B2),i=new Set(C1(r,n.groupId));return i.size!==0&&(Y2(e,t),t(B2,r.map(e=>i.has(e.id)?{...e,data:{...e.data,enabled:n.enabled}}:e)),X2(e,t),!0)}),Eue=tA(null,(e,t,n)=>{if(!J2(e))return;let r=e(B2),i=d1(r.find(e=>e.id===n.source))??n.sourceHandle,a=e(V2),o=_1({nodes:r,edges:a,sourceId:n.source,targetId:n.target,sourceHandle:i}).map((e,t)=>({...n,id:t===0?n.id:G$(),source:e.source,target:e.target,sourceHandle:e.sourceHandle}));o.length!==0&&(Y2(e,t),t(V2,[...a,...o]),X2(e,t,{immediate:!0}))}),$2=tA(null,(e,t,n)=>{if(!J2(e))return;let r=e(V2),i=new Set(y1(e(B2),r,n));if(i.size===0)return;let a=r.filter(e=>!i.has(e.id));a.length!==r.length&&(Y2(e,t),t(V2,a),e(G2)&&i.has(e(G2)??``)&&t(G2,null),X2(e,t,{immediate:!0}))}),e4=tA(e=>e(B2)),t4=tA(e=>e(V2)),n4=tA(new Map),r4=tA(e=>e(U2)!==null),i4=tA(e=>e(b0)||e(r4)),a4=tA(e=>ole({nodes:e(U2)?.nodes??e(B2),edges:e(U2)?.edges??e(V2)})),Due={opacity:.5},o4=new WeakMap,Oue=tA(e=>{let t=e(U2),n=t?.nodes??e(B2),r=e(n4),{nodeIds:i}=e(a4),a=T1(n),o=w1(n),s=t?uue:e(sue);if(r.size===0&&i.size===0&&o.size===0&&s.size===0)return a;let c=r.size>0;return a.map(e=>{let t=o.has(e.id),n=i.has(e.id)&&!t&&e.data.enabled!==!1,a=s.get(e.id);if(!(c||t||n||a))return e;let l=c?r.get(e.id)??`idle`:void 0,u=o4.get(e);if(u&&u.status===l&&u.disabledFrame===t&&u.muted===n&&u.issues===a)return u.painted;let d={...e,data:{...e.data,...l?{status:l}:{},...t?{enabled:!1}:{},...a?{issues:a}:{}}},f=n?{...d,style:{...d.style,...Due}}:d;return o4.set(e,{status:l,disabledFrame:t,muted:n,issues:a,painted:f}),f})}),kue=tA(e=>{let t=e(U2)?.nodes??e(B2),n=vue(t,b1(t,e(U2)?.edges??e(V2))),{nodeIds:r,outletEdgeIds:i}=e(a4);return r.size===0?n:n.map(e=>r.has(e.target)?{...e,data:{...e.data,inactive:!0,...i.has(e.id)?{displayLabel:`No Cancel Event`}:{}}}:e)}),s4=tA(null),c4=tA(null),l4=tA(!1),Aue=tA(null,(e,t,n)=>{t(B2,T1(n.nodes)),t(V2,n.edges),t(K2,[]),t(q2,[]),t(W2,null),t(G2,null),t(s4,null),t(e0,!1),t(T2,w2)}),jue=tA(null,(e,t,n)=>{t(Aue,{nodes:n.nodes.map(e=>({...e,selected:!1})),edges:n.edges}),t(n4,new Map),t(U2,null),t(C0,null),t(K1,n.id),t(q1,n.name),t(t0,null),t(J1,n.visibility??`private`),t(Y1,n.mode??`live`),t(X1,n.isOwner!==!1),t(Z1,!1),t(Q1,null)}),Mue=tA(null,(e,t,n)=>{if(!J2(e))return;let r=e(B2),i=gJ(n.catalog,r,n.integrations);i!==r&&(t(B2,i),X2(e,t))}),Nue=tA(null,(e,t)=>{J2(e)&&Y2(e,t)}),Pue=tA(null,(e,t)=>{J2(e)&&(t(B2,e(B2).map(e=>({...e,selected:!1}))),t(V2,e(V2).map(e=>({...e,selected:!1}))),t(W2,null),t(G2,null))}),Fue=tA(null,(e,t,n)=>{J2(e)&&(t(B2,e(B2).map(e=>({...e,selected:e.id===n}))),t(W2,n),t(G2,null))}),Iue=tA(null,(e,t,n)=>{if(!J2(e))return;let r=e(B2),i=n.filter(e=>e.type!==`remove`||r.find(t=>t.id===e.id)?.data.type!==`lifecycle`),a=i.some(e=>e.type===`remove`),o=i.some(e=>e.type===`position`&&e.dragging===!0),s=i.some(e=>e.type===`position`&&e.dragging===!1);o&&!e(l4)&&(Y2(e,t),t(l4,!0)),s&&t(l4,!1);let c=N2(dD(i,r));if(t(B2,c),a){let n=xue(c,e(V2));t(V2,n);let r=e(G2);r&&!n.some(e=>e.id===r)&&t(G2,null)}let l=c.find(e=>e.selected);if(l){t(W2,l.id),t(G2,null);let n=e(s4);n&&n!==l.id&&t(s4,null)}else if(e(W2)){let n=e(W2);c.find(e=>e.id===n)||t(W2,null),t(s4,null)}a?X2(e,t,{immediate:!0}):s&&X2(e,t)}),Lue=tA(null,(e,t,n)=>{if(!J2(e))return;let r=n.some(e=>e.type===`remove`),i=e(V2),a=fD(bue(e(B2),i,n),i);t(V2,a);let o=a.find(e=>e.selected);if(o)t(G2,o.id),t(W2,null);else if(e(G2)){let n=e(G2);a.find(e=>e.id===n)||t(G2,null)}r&&X2(e,t,{immediate:!0})});function u4(e,t,n){let r=n.nodes.map(e=>({...e,selected:!0})),i=n.edges.map(e=>({...e,selected:!0}));Y2(e,t),t(B2,T1([...e(B2).map(e=>({...e,selected:!1})),...r])),t(V2,[...e(V2).map(e=>({...e,selected:!1})),...i]),t(W2,r[0].id),t(G2,null);let a=r.length===1?r[0]:void 0;a?.data.type===`action`&&!a.data.config?.actionType?t(s4,a.id):t(s4,null),X2(e,t,{immediate:!0})}function d4(e,t){let n=e(B2);return L1({nodes:n,edges:e(V2),nodeIds:t?I1(n,t):void 0})}var f4=tA(null,(e,t,n)=>{J2(e)&&u4(e,t,{nodes:[n],edges:[]})}),Rue=tA(e=>e(c4)!==null),p4=tA(null,(e,t,n)=>{let r=d4(e,n);return r?(t(c4,{selection:r,pasteCount:0}),!0):!1}),m4=tA(null,(e,t,n)=>{if(!J2(e))return!1;let r=e(c4);if(!r)return!1;let i=r.pasteCount+1,a=n?z1(r.selection.nodes,n):{x:48*i,y:48*i};return t(c4,{...r,pasteCount:i}),u4(e,t,R1(r.selection,{offset:a})),!0}),h4=tA(null,(e,t,n)=>{if(!J2(e))return!1;let r=d4(e,n);return r?(u4(e,t,R1(r,{offset:{x:48,y:48}})),!0):!1}),zue=tA(null,(e,t,n)=>{J2(e)&&(Y2(e,t),t(B2,n),X2(e,t,{immediate:!0}))}),g4=tA(null,(e,t,{id:n,data:r})=>{if(!J2(e))return;let i=e(B2);Y2(e,t);let a=i.find(e=>e.id===n)?.data.label,o=r.label,s=o!==void 0&&a!==o;t(B2,i.map(e=>{if(e.id===n)return{...e,data:{...e.data,...r}};if(s&&a){let t=Bue(e.data.config||{},n,a,o);if(t!==e.data.config)return{...e,data:{...e.data,config:t}}}return e})),X2(e,t)});function Bue(e,t,n,r){return $$(e,e=>{if(e.nodeId===t&&e.nodeLabel===n)return Q$({nodeId:t,nodeLabel:r,fieldPath:e.fieldPath})})}var _4=tA(null,(e,t,n)=>{if(!J2(e))return;let r=e(B2),i=r.find(e=>e.id===n);if(i?.data.type===`lifecycle`||i&&F2([i]))return;Y2(e,t);let a=yue(r,n);t(B2,N2(r.filter(e=>!a.has(e.id)))),t(V2,e(V2).filter(e=>!a.has(e.source)&&!a.has(e.target))),e(W2)&&a.has(e(W2)??``)&&t(W2,null),X2(e,t,{immediate:!0})}),Vue=tA(null,(e,t)=>{if(!J2(e))return;let n=e(B2),r=e(V2),i=n.filter(e=>e.selected);if(F2(i))return;let a=new Set(i.filter(e=>e.data.type!==`lifecycle`).map(e=>e.id));for(let e of n)e.parentId&&a.has(e.parentId)&&a.add(e.id);let o=N2(n.filter(e=>e.data.type===`lifecycle`||!a.has(e.id))),s=new Set(r.filter(e=>e.selected).flatMap(e=>y1(n,r,e.id))),c=r.filter(e=>!s.has(e.id)&&!a.has(e.source)&&!a.has(e.target));(o.length!==n.length||c.length!==r.length)&&(Y2(e,t),t(B2,o),t(V2,c),t(W2,null),t(G2,null),X2(e,t,{immediate:!0}))}),Hue=tA(null,(e,t)=>{if(!J2(e))return;let n=e(B2),r=n.filter(e=>e.data.type===`lifecycle`);(r.length!==n.length||e(V2).length!==0)&&(Y2(e,t),t(B2,r),t(V2,[]),t(W2,null),t(G2,null),X2(e,t,{immediate:!0}))}),v4=tA(null,(e,t)=>{if(!J2(e))return;let n=e(K2),r=n.at(-1);r&&(t(q2,[...e(q2),{nodes:e(B2),edges:e(V2)}]),t(K2,n.slice(0,-1)),t(B2,r.nodes),t(V2,r.edges),X2(e,t,{immediate:!0}))}),y4=tA(null,(e,t)=>{if(!J2(e))return;let n=e(q2),r=n.at(-1);r&&(t(K2,[...e(K2),{nodes:e(B2),edges:e(V2)}]),t(q2,n.slice(0,-1)),t(B2,r.nodes),t(V2,r.edges),X2(e,t,{immediate:!0}))}),Uue=tA(e=>e(K2).length>0),Wue=tA(e=>e(q2).length>0),Gue=tA(null,(e,t)=>{t(U2,null),t(n4,new Map)}),Kue=tA(null,(e,t)=>{t(n4,new Map)}),b4=tA(null,(e,t,n)=>{if(n.length===0)return;let r=e(n4),i=new Map(r),a=!1;for(let{nodeId:e,status:t}of n)r.get(e)!==t&&(i.set(e,t),a=!0);a&&t(n4,i)}),x4=`The workflow could not be loaded. Try again.`;function que(e){return e instanceof s$&&e.status===404?{notFound:!0,message:null}:{notFound:!1,message:x4}}function Jue(e){return e?`runs`:null}var Yue=[`pending`,`running`,`waiting`,`completed`,`canceled`,`superseded`,`failed`],Xue=[`pending`,`running`,`waiting`];function S4(e){return Xue.some(t=>t===e)}function Zue(e){return{supersededCount:e.supersededCount,refusedStarts:e.refusedStarts.map(e=>({...e,createdAt:new Date(e.createdAt)})),executions:e.items.map(e=>({...e,startedAt:new Date(e.startedAt),waitingAt:e.waitingAt?new Date(e.waitingAt):null,cancelledAt:e.cancelledAt?new Date(e.cancelledAt):null,completedAt:e.completedAt?new Date(e.completedAt):null}))}}function Que(e){return{logs:C4(e),waits:e.waits.map(e=>({...e,waitUntil:e.waitUntil?new Date(e.waitUntil):null})),execution:{...$ue(e.execution),workflowVersionId:e.execution.workflowVersionId}}}function $ue(e){return{id:e.id,workflowId:e.workflowId,status:ede(e.status),startSource:e.startSource,runMode:e.runMode,startEventName:e.startEventName,entityValue:e.entityValue,workflowRunId:null,startedAt:new Date(e.startedAt),waitingAt:null,cancelledAt:null,completedAt:e.completedAt?new Date(e.completedAt):null,duration:e.duration,error:e.error}}function ede(e){for(let t of Yue)if(t===e)return t;return`failed`}function tde(e){return ode(C4(e))}function nde(e){return{workflowId:e.execution.workflowId,workflowVersionId:e.execution.workflowVersionId}}function rde(e){let t=new Date(e.execution.startedAt);return{id:e.execution.id,startedAt:Number.isNaN(t.getTime())?null:t}}function ide(e){return e.events.map(e=>({...e,createdAt:new Date(e.createdAt)}))}function C4(e){return sde(e.logs.map(e=>({id:e.id,nodeId:e.nodeId,nodeName:e.nodeName,nodeType:e.nodeType,status:e.status,startedAt:new Date(e.startedAt),completedAt:e.completedAt?new Date(e.completedAt):null,duration:e.duration,input:e.input,output:e.output,error:e.error})),e.execution.status)}function ade(e){return new Date(e.startedAt).getTime()}function ode(e){let t={};for(let n of e){let e=t[n.nodeId];e?.startedAt!==void 0&&ade(n)<new Date(e.startedAt).getTime()||(t[n.nodeId]={nodeId:n.nodeId,nodeName:n.nodeName,nodeType:n.nodeType,status:n.status,input:n.input,output:n.output,startedAt:n.startedAt,completedAt:n.completedAt})}return t}function sde(e,t){return t!==`canceled`&&t!==`superseded`?e:e.map(e=>e.status===`pending`||e.status===`running`?{...e,status:`cancelled`,error:e.error||`Run cancelled before step completion`}:e)}var cde=ha(`/workflows/$workflowId`);function lde(){let e=(0,X.c)(19),t=dA(K1),[n,r]=pA(C0),i=fA(U2),a=fA(Kue),{executionId:o}=cde.useSearch(),s;e[0]===o?s=e[1]:(s=F$.workflow.getExecutionLogs.queryOptions({input:{executionId:o??``},select:nde}),e[0]=o,e[1]=s);let c=o!==void 0,l;e[2]!==s||e[3]!==c?(l={...s,enabled:c,staleTime:0},e[2]=s,e[3]=c,e[4]=l):l=e[4];let u=Ze(l),d=u.data?.workflowVersionId,f;e[5]===d?f=e[6]:(f=F$.workflow.getVersionGraph.queryOptions({input:{versionId:d??``},select:dde}),e[5]=d,e[6]=f);let p=d!==void 0,m;e[7]!==f||e[8]!==p?(m={...f,enabled:p,staleTime:1/0},e[7]=f,e[8]=p,e[9]=m):m=e[9];let h=Ze(m),g=u.data,_=h.data,v=g!==void 0&&_!==void 0&&g.workflowId===t,y;e[10]!==t||e[11]!==g||e[12]!==o||e[13]!==_||e[14]!==a||e[15]!==n||e[16]!==i||e[17]!==r?(y=()=>{if(o===void 0){r(null),i(null);return}if(n!==o&&a(),r(o),g===void 0||_===void 0||g.workflowId!==t){i(null);return}let e=$Q(_);i({nodes:e.nodes.map(ude),edges:e.edges.map(a$)})},e[10]=t,e[11]=g,e[12]=o,e[13]=_,e[14]=a,e[15]=n,e[16]=i,e[17]=r,e[18]=y):y=e[18],oq(o===void 0?`closed`:v?`ready:${o}:${t}`:`open:${o}:${t??``}`,y)}function ude(e){return{...i$(e),selected:!1}}function dde(e){return e.graph}function fde(){return lde(),null}function w4(e){let t=(0,X.c)(8),{action:n}=e,r=n.disabled||n.loading,i=n.variant??`default`,a;t[0]===n.loading?a=t[1]:(a=n.loading&&(0,Y.jsx)(Zv,{className:`mr-2 size-4 animate-spin`}),t[0]=n.loading,t[1]=a);let o;return t[2]!==n.label||t[3]!==n.onClick||t[4]!==r||t[5]!==i||t[6]!==a?(o=(0,Y.jsxs)(pv,{disabled:r,onClick:n.onClick,variant:i,children:[a,n.label]}),t[2]=n.label,t[3]=n.onClick,t[4]=r,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function pde(e){let t=(0,X.c)(17),{actions:n,className:r,children:i}=e;if(i){let e;t[0]===r?e=t[1]:(e=Q(`flex flex-col-reverse gap-2 p-6 pt-4 sm:flex-row sm:justify-end`,r),t[0]=r,t[1]=e);let n;return t[2]!==i||t[3]!==e?(n=(0,Y.jsx)(`div`,{className:e,children:i}),t[2]=i,t[3]=e,t[4]=n):n=t[4],n}if(!n||n.length===0)return null;let a,o,s;if(t[5]!==n||t[6]!==r){let e=n.filter(yde),i=n.filter(vde),c=n.filter(_de),l=e.length>0,u=i.length>0||c.length>0,d=l&&u?`sm:justify-between`:`sm:justify-end`;t[10]!==r||t[11]!==d?(a=Q(`flex flex-col-reverse gap-2 p-6 pt-4 sm:flex-row`,d,r),t[10]=r,t[11]=d,t[12]=a):a=t[12],o=l&&(0,Y.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:e.map(gde)}),s=u&&(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[i.map(hde),c.map(mde)]}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s}else a=t[7],o=t[8],s=t[9];let c;return t[13]!==a||t[14]!==o||t[15]!==s?(c=(0,Y.jsxs)(`div`,{className:a,children:[o,s]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}function mde(e){return(0,Y.jsx)(w4,{action:e},e.label)}function hde(e){return(0,Y.jsx)(w4,{action:e},e.label)}function gde(e){return(0,Y.jsx)(w4,{action:e},e.label)}function _de(e){return!e.variant||e.variant==="default"||e.variant===`destructive`}function vde(e){return e.variant===`outline`||e.variant===`secondary`}function yde(e){return e.variant===`ghost`}function bde(e){let t=(0,X.c)(27),{title:n,description:r,showBackButton:i,showCloseButton:a,onBack:o,onClose:s,className:c,overlayId:l}=e,u=a===void 0||a,{pop:d,closeAll:f}=Oq(),p=i??!1,m;t[0]!==o||t[1]!==d?(m=()=>{o?o():d()},t[0]=o,t[1]=d,t[2]=m):m=t[2];let h=m,g;t[3]!==f||t[4]!==s?(g=()=>{s?s():f()},t[3]=f,t[4]=s,t[5]=g):g=t[5];let _=g,v;t[6]===c?v=t[7]:(v=Q(`relative flex flex-col gap-1.5 p-6 pb-0`,c),t[6]=c,t[7]=v);let y;t[8]!==h||t[9]!==p?(y=p&&(0,Y.jsx)(pv,{"aria-label":`Go back`,className:`ml-[-8px] size-8 shrink-0`,onClick:h,size:`icon`,variant:`ghost`,children:(0,Y.jsx)(Dv,{className:`size-5`})}),t[8]=h,t[9]=p,t[10]=y):y=t[10];let b;t[11]!==l||t[12]!==n?(b=n&&(0,Y.jsx)(`h2`,{className:`flex-1 font-semibold text-base leading-none`,id:l?`overlay-title-${l}`:void 0,children:n}),t[11]=l,t[12]=n,t[13]=b):b=t[13];let x;t[14]!==_||t[15]!==u?(x=u&&(0,Y.jsx)(pv,{"aria-label":`Close`,className:`absolute top-4 right-4 size-8 shrink-0 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,onClick:_,size:`icon`,variant:`ghost`,children:(0,Y.jsx)(my,{className:`size-4`})}),t[14]=_,t[15]=u,t[16]=x):x=t[16];let S;t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,Y.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2`,children:[y,b,x]}),t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20];let C;t[21]===r?C=t[22]:(C=r&&(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[21]=r,t[22]=C);let w;return t[23]!==v||t[24]!==S||t[25]!==C?(w=(0,Y.jsxs)(`div`,{className:v,children:[S,C]}),t[23]=v,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}function T4(e){let t=(0,X.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({overlayId:n,showBackButton:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showBackButton:a}=kq(n),o=i??a,s;return t[4]!==n||t[5]!==r||t[6]!==o?(s=(0,Y.jsx)(bde,{...r,overlayId:n,showBackButton:o}),t[4]=n,t[5]=r,t[6]=o,t[7]=s):s=t[7],s}function E4(e){let t=(0,X.c)(15),{overlayId:n,title:r,description:i,actions:a,children:o,className:s}=e,c;t[0]===s?c=t[1]:(c=Q(`flex min-h-0 flex-col`,s),t[0]=s,t[1]=c);let l;t[2]!==i||t[3]!==n||t[4]!==r?(l=(r||i)&&(0,Y.jsx)(T4,{description:i,overlayId:n,title:r}),t[2]=i,t[3]=n,t[4]=r,t[5]=l):l=t[5];let u;t[6]===o?u=t[7]:(u=o&&(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:o}),t[6]=o,t[7]=u);let d;t[8]===a?d=t[9]:(d=(0,Y.jsx)(pde,{actions:a}),t[8]=a,t[9]=d);let f;return t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,Y.jsxs)(`div`,{className:c,children:[l,u,d]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function D4(e){let t=(0,X.c)(31),{overlayId:n,title:r,message:i,confirmLabel:a,cancelLabel:o,confirmVariant:s,destructive:c,onConfirm:l,onCancel:u}=e,d=r===void 0?`Confirm`:r,f=a===void 0?`Confirm`:a,p=o===void 0?`Cancel`:o,m=s===void 0?`default`:s,h=c!==void 0&&c,{pop:g}=Oq(),_;t[0]!==u||t[1]!==g?(_=()=>{u?.(),g()},t[0]=u,t[1]=g,t[2]=_):_=t[2];let v=_,y;t[3]!==l||t[4]!==g?(y=async()=>{await l(),g()},t[3]=l,t[4]=g,t[5]=y):y=t[5];let b=y,x;t[6]!==p||t[7]!==v?(x={label:p,variant:`outline`,onClick:v},t[6]=p,t[7]=v,t[8]=x):x=t[8];let S=h?`destructive`:m,C;t[9]!==f||t[10]!==b||t[11]!==S?(C={label:f,variant:S,onClick:b},t[9]=f,t[10]=b,t[11]=S,t[12]=C):C=t[12];let w;t[13]!==C||t[14]!==x?(w=[x,C],t[13]=C,t[14]=x,t[15]=w):w=t[15];let T=w,E;t[16]===h?E=t[17]:(E=h&&(0,Y.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-destructive/10`,children:(0,Y.jsx)(fy,{className:`size-5 text-destructive`})}),t[16]=h,t[17]=E);let D=h&&`pt-2`,O;t[18]===D?O=t[19]:(O=Q(`text-muted-foreground text-sm`,D),t[18]=D,t[19]=O);let k;t[20]!==i||t[21]!==O?(k=(0,Y.jsx)(`p`,{className:O,children:i}),t[20]=i,t[21]=O,t[22]=k):k=t[22];let A;t[23]!==E||t[24]!==k?(A=(0,Y.jsxs)(`div`,{className:`flex gap-4`,children:[E,k]}),t[23]=E,t[24]=k,t[25]=A):A=t[25];let j;return t[26]!==T||t[27]!==n||t[28]!==A||t[29]!==d?(j=(0,Y.jsx)(E4,{actions:T,overlayId:n,title:d,children:A}),t[26]=T,t[27]=n,t[28]=A,t[29]=d,t[30]=j):j=t[30],j}var O4={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},k4={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},xde={disabled:!1,...k4},A4={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},j4={invalid:void 0,name:void 0,validityData:{state:O4,errors:[],error:``,value:``,initialValue:null},setValidityData:Xg,disabled:void 0,setTouched:Xg,setDirty:Xg,setFilled:Xg,setFocused:Xg,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:xde,registerFieldControl:Xg,validation:{getValidationProps:(e,t=Qg)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Xg,getInputControl:()=>null,commit:async()=>{},change:Xg}},M4=J.createContext(j4);function N4(e=!0){let t=J.useContext(M4);if(t.setValidityData===Xg&&!e)throw Error(Rg(28));return t}var Sde=J.createContext(void 0);function Cde(e=!1){let t=J.useContext(Sde);if(!t&&!e)throw Error(Rg(86));return t}var wde=J.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Xg,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function P4(){return J.useContext(wde)}var Tde=J.createContext({controlId:void 0,registerControlId:Xg,labelId:void 0,setLabelId:Xg,messageIds:[],setMessageIds:Xg,getDescriptionProps:e=>e});function F4(){return J.useContext(Tde)}function I4(e,t,n,r=!0,i){let[a,o]=J.useState(),s=oz(i?`${i}-label`:void 0),c=e??t??a;return Tg(()=>{let i=e||t||!r?void 0:Ede(n.current,s);a!==i&&o(i)}),c}function Ede(e,t){let n=Dde(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Dde(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function L4(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=F4(),o=oz(t),s=n?i:void 0,c=Cg(()=>Symbol()),l=J.useRef(!1),u=J.useRef(t!=null),d=Z(()=>{!l.current||a===Xg||(l.current=!1,a(c.current,void 0))});return Tg(()=>{if(a===Xg)return;let e;if(n){let n=r?.current;e=ig(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),J.useEffect(()=>d,[d]),i??o}Object.keys(O4);function Ode(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}var kde=J.createContext({disabled:!1});function R4(){return J.useContext(kde)}function z4(e,t,n,r,i=!0,a){let{registerFieldControl:o}=N4(),s=Cg(()=>Symbol());Tg(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Tg(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Ade=J.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=N4(),{clearErrors:C}=P4(),w=h||s,T=m??a,E={...p,disabled:w},{labelId:D}=F4(),O=L4({id:i});Tg(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let k=J.useRef(null);Tg(()=>{u&&k.current===kz(Vg(k.current))&&y(!0)},[u,y]);let[A]=hG({controlled:o,default:l,name:`FieldControl`,state:`value`}),j=o!==void 0,M=j?A:void 0,N=Z(()=>S.inputRef.current?.value);return z4(S.inputRef,O,M,N,!w,a),e_(`input`,e,{ref:[t,k],state:E,props:[{id:O,disabled:w,name:T,ref:S.inputRef,"aria-labelledby":D,autoFocus:u,...j?{value:M}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,tz(IR,e.nativeEvent)),_(t!==(v.initialValue??``)),b(t!==``),e.nativeEvent.defaultPrevented||(C(T),S.change(t))},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},f,e=>S.getValidationProps(w,e)],stateAttributesMapping:A4})}),jde=J.forwardRef(function(e,t){return(0,Y.jsx)(Ade,{ref:t,...e})});function B4(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Q(`h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Y.jsx)(jde,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function V4(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`label`,{"data-slot":`label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Mde={database:Rv};function H4(e){let t=(0,X.c)(14),{integration:n,className:r}=e,i=r===void 0?`h-3 w-3`:r,a=by(),o=Mde[n];if(o){let e;t[0]===i?e=t[1]:(e=Q(`text-foreground`,i),t[0]=i,t[1]=e);let n;return t[2]!==o||t[3]!==e?(n=(0,Y.jsx)(o,{className:e}),t[2]=o,t[3]=e,t[4]=n):n=t[4],n}let s=a[n];if(s){let e=s.icon,n;t[5]===i?n=t[6]:(n=Q(`text-foreground`,i),t[5]=i,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,Y.jsx)(e,{className:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}let c;t[10]===i?c=t[11]:(c=Q(`text-foreground`,i),t[10]=i,t[11]=c);let l;return t[12]===c?l=t[13]:(l=(0,Y.jsx)(jv,{className:c}),t[12]=c,t[13]=l),l}function U4(e){return Object.keys(aX(e,e=>!e||e.length===0)).length>0}function W4(e){e.status===`success`?wy.success(e.message||`Connection successful`):wy.error(e.message||`Connection failed`)}function Nde(e){return e.integrations.toSorted((e,t)=>e.label.localeCompare(t.label))}var Pde=(e,t)=>Py(e,t)?.label??t;function Fde(e){let t=(0,X.c)(36),{overlayId:n,onSuccess:r}=e,i=vy(),{push:a}=Oq(),[o,s]=(0,J.useState)(``),c=xq(),l,u,d,f,p,m,h,g;if(t[0]!==i||t[1]!==c||t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==o){let e=o.trim().toLowerCase(),_=Nde(i).filter(t=>!e||t.label.toLowerCase().includes(e)),v;t[14]!==r||t[15]!==a?(v=e=>{a(G4,{type:e,onSuccess:r})},t[14]=r,t[15]=a,t[16]=v):v=t[16];let y=v;l=E4,m=n,h=`Add Connection`,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Select a service to connect`}),t[17]=g):g=t[17],f=`space-y-3`;let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(cy,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[18]=b):b=t[18];let x=!c,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>s(e.target.value),t[19]=S):S=t[19],t[20]!==o||t[21]!==x?(p=(0,Y.jsxs)(`div`,{className:`relative`,children:[b,(0,Y.jsx)(B4,{autoFocus:x,className:`pl-9`,onChange:S,placeholder:`Search services...`,value:o})]}),t[20]=o,t[21]=x,t[22]=p):p=t[22],u=`max-h-[300px] space-y-1 overflow-y-auto`,d=_.length===0?(0,Y.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`No services found`}):_.map(e=>(0,Y.jsxs)(`button`,{className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-muted/50`,onClick:()=>y(e.type),type:`button`,children:[(0,Y.jsx)(H4,{className:`size-5 shrink-0`,integration:e.type}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[` `,`- `,e.description]})]})]},e.type)),t[0]=i,t[1]=c,t[2]=r,t[3]=n,t[4]=a,t[5]=o,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[23]!==u||t[24]!==d?(_=(0,Y.jsx)(`div`,{className:u,children:d}),t[23]=u,t[24]=d,t[25]=_):_=t[25];let v;t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,Y.jsxs)(`div`,{className:f,children:[p,_]}),t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29];let y;return t[30]!==l||t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==v?(y=(0,Y.jsxs)(l,{overlayId:m,title:h,children:[g,v]}),t[30]=l,t[31]=m,t[32]=h,t[33]=g,t[34]=v,t[35]=y):y=t[35],y}function Ide(e){let t=(0,X.c)(18),{fieldId:n,label:r,configKey:i,placeholder:a,helpText:o,helpLink:s,value:c,onChange:l}=e,u;t[0]!==n||t[1]!==r?(u=(0,Y.jsx)(V4,{htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=u):u=t[2];let d;t[3]!==i||t[4]!==l?(d=e=>l(i,e.target.value),t[3]=i,t[4]=l,t[5]=d):d=t[5];let f;t[6]!==n||t[7]!==a||t[8]!==d||t[9]!==c?(f=(0,Y.jsx)(B4,{className:`flex-1`,id:n,onChange:d,placeholder:a,type:`password`,value:c}),t[6]=n,t[7]=a,t[8]=d,t[9]=c,t[10]=f):f=t[10];let p;t[11]!==s||t[12]!==o?(p=(o||s)&&(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[o,s&&(0,Y.jsx)(`a`,{className:`underline hover:text-foreground`,href:s.url,rel:`noopener noreferrer`,target:`_blank`,children:s.text})]}),t[11]=s,t[12]=o,t[13]=p):p=t[13];let m;return t[14]!==u||t[15]!==f||t[16]!==p?(m=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[u,f,p]}),t[14]=u,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}function G4(e){let t=(0,X.c)(62),{overlayId:n,type:r,onSuccess:i}=e,a=vy(),{push:o,closeAll:s}=Oq(),c=Ie(),[l,u]=(0,J.useState)(``),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={},t[0]=d):d=t[0];let[f,p]=(0,J.useState)(d),m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=(e,t)=>{p(n=>({...n,[e]:t}))},t[1]=m):m=t[1];let h=m,g;t[2]!==s||t[3]!==i||t[4]!==c?(g=F$.integration.create.mutationOptions({onSuccess:async e=>{wy.success(`Connection created`),await U$(c),i?.(e.id),s()},meta:{errorMessage:`Failed to save connection`}}),t[2]=s,t[3]=i,t[4]=c,t[5]=g):g=t[5];let _=Qe(g),v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=F$.integration.testCredentials.mutationOptions({meta:{errorShownByCaller:!0}}),t[6]=v):v=t[6];let y=Qe(v),b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=F$.integration.testCredentials.mutationOptions({onSuccess:W4}),t[7]=b):b=t[7];let x=Qe(b),S;t[8]!==a||t[9]!==r?(S=Py(a,r),t[8]=a,t[9]=r,t[10]=S):S=t[10];let C=S,w=C?.credentialFields,T=C?.hasTest===!0,E=_.isPending||y.isPending,D;t[11]!==f||t[12]!==_||t[13]!==l||t[14]!==r?(D=()=>{_.mutate({name:l.trim(),type:r,config:f})},t[11]=f,t[12]=_,t[13]=l,t[14]=r,t[15]=D):D=t[15];let O=D,k;t[16]!==o||t[17]!==O?(k=e=>{o(D4,{title:`Connection Test Failed`,message:`${e}\n\nDo you want to save anyway?`,confirmLabel:`Save Anyway`,onConfirm:O})},t[16]=o,t[17]=O,t[18]=k):k=t[18];let A=k,j;t[19]!==f||t[20]!==T||t[21]!==A||t[22]!==O||t[23]!==y||t[24]!==r?(j=async()=>{if(!U4(f)){wy.error(`Please enter credentials`);return}if(!T){O();return}try{let e=await y.mutateAsync({type:r,config:f});if(e.status===`error`){A(`The test failed: ${e.message}`);return}}catch(e){let t=e;A(t instanceof Error?t.message:`Failed to test connection`);return}O()},t[19]=f,t[20]=T,t[21]=A,t[22]=O,t[23]=y,t[24]=r,t[25]=j):j=t[25];let M=j,N;t[26]!==f||t[27]!==x||t[28]!==r?(N=()=>{if(!U4(f)){wy.error(`Please enter credentials first`);return}x.mutate({type:r,config:f})},t[26]=f,t[27]=x,t[28]=r,t[29]=N):N=t[29];let P=N,F;t[30]!==f||t[31]!==w?(F=()=>w?Object.entries(w).map(e=>{let[t,n]=e;return n.type===`password`?(0,Y.jsx)(Ide,{configKey:t,fieldId:t,helpLink:n.helpLink,helpText:n.helpText,label:n.label,onChange:h,placeholder:n.placeholder,value:f[t]||``},t):(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:t,children:n.label}),(0,Y.jsx)(B4,{id:t,onChange:e=>h(t,e.target.value),placeholder:n.placeholder,type:n.type,value:f[t]||``}),(n.helpText||n.helpLink)&&(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[n.helpText,n.helpLink&&(0,Y.jsx)(`a`,{className:`underline hover:text-foreground`,href:n.helpLink.url,rel:`noopener noreferrer`,target:`_blank`,children:n.helpLink.text})]})]},t)}):null,t[30]=f,t[31]=w,t[32]=F):F=t[32];let I=F,L;t[33]!==P||t[34]!==T||t[35]!==E||t[36]!==x?(L=T?[{label:`Test`,variant:`outline`,onClick:P,loading:x.isPending,disabled:E}]:[],t[33]=P,t[34]=T,t[35]=E,t[36]=x,t[37]=L):L=t[37];let R;t[38]!==M||t[39]!==E?(R={label:`Create`,onClick:M,loading:E},t[38]=M,t[39]=E,t[40]=R):R=t[40];let z;t[41]!==L||t[42]!==R?(z=[...L,R],t[41]=L,t[42]=R,t[43]=z):z=t[43];let B;t[44]!==a||t[45]!==r?(B=Pde(a,r),t[44]=a,t[45]=r,t[46]=B):B=t[46];let V=`Add ${B}`,H;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Y.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Enter your credentials`}),t[47]=H):H=t[47];let U;t[48]===I?U=t[49]:(U=I(),t[48]=I,t[49]=U);let W;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Y.jsx)(V4,{htmlFor:`name`,children:`Label (Optional)`}),t[50]=W):W=t[50];let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>u(e.target.value),t[51]=G):G=t[51];let K;t[52]===l?K=t[53]:(K=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[W,(0,Y.jsx)(B4,{id:`name`,onChange:G,placeholder:`e.g. Production, Personal, Work`,value:l})]}),t[52]=l,t[53]=K);let ee;t[54]!==U||t[55]!==K?(ee=(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[U,K]}),t[54]=U,t[55]=K,t[56]=ee):ee=t[56];let q;return t[57]!==n||t[58]!==z||t[59]!==V||t[60]!==ee?(q=(0,Y.jsxs)(E4,{actions:z,overlayId:n,title:V,children:[H,ee]}),t[57]=n,t[58]=z,t[59]=V,t[60]=ee,t[61]=q):q=t[61],q}var Lde=(e,t)=>e?.label??t;function Rde(e){let t=(0,X.c)(35),{fieldId:n,label:r,configKey:i,placeholder:a,helpText:o,helpLink:s,value:c,onChange:l}=e,[u,d]=(0,J.useState)(!1),f=xq(),p=c.length>0;if(!(u||p)){let e;t[0]!==n||t[1]!==r?(e=(0,Y.jsx)(V4,{htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=e):e=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsxs)(`div`,{className:`flex h-9 flex-1 items-center gap-2 rounded-md border bg-muted/30 px-3`,children:[(0,Y.jsx)(Tv,{className:`size-4 text-success`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Configured`})]}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>d(!0),t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,(0,Y.jsxs)(pv,{onClick:a,type:`button`,variant:`outline`,children:[(0,Y.jsx)(iy,{className:`mr-1.5 size-3`}),`Change`]})]}),t[5]=o):o=t[5];let s;return t[6]===e?s=t[7]:(s=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[e,o]}),t[6]=e,t[7]=s),s}let m;t[8]!==n||t[9]!==r?(m=(0,Y.jsx)(V4,{htmlFor:n,children:r}),t[8]=n,t[9]=r,t[10]=m):m=t[10];let h=u&&!f,g;t[11]!==i||t[12]!==l?(g=e=>l(i,e.target.value),t[11]=i,t[12]=l,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==a||t[16]!==h||t[17]!==g||t[18]!==c?(_=(0,Y.jsx)(B4,{autoFocus:h,className:`flex-1`,id:n,onChange:g,placeholder:a,type:`password`,value:c}),t[14]=n,t[15]=a,t[16]=h,t[17]=g,t[18]=c,t[19]=_):_=t[19];let v;t[20]!==i||t[21]!==p||t[22]!==u||t[23]!==l?(v=(u||p)&&(0,Y.jsx)(pv,{onClick:()=>{l(i,``),d(!1)},size:`icon`,type:`button`,variant:`ghost`,children:(0,Y.jsx)(my,{className:`size-4`})}),t[20]=i,t[21]=p,t[22]=u,t[23]=l,t[24]=v):v=t[24];let y;t[25]!==_||t[26]!==v?(y=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,v]}),t[25]=_,t[26]=v,t[27]=y):y=t[27];let b;t[28]!==s||t[29]!==o?(b=(o||s)&&(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[o,s&&(0,Y.jsx)(`a`,{className:`underline hover:text-foreground`,href:s.url,rel:`noopener noreferrer`,target:`_blank`,children:s.text})]}),t[28]=s,t[29]=o,t[30]=b):b=t[30];let x;return t[31]!==m||t[32]!==y||t[33]!==b?(x=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[m,y,b]}),t[31]=m,t[32]=y,t[33]=b,t[34]=x):x=t[34],x}function K4(e){let t=(0,X.c)(83),{overlayId:n,integration:r,onSuccess:i,onDelete:a}=e,{push:o,closeAll:s}=Oq(),c=Ie(),[l,u]=(0,J.useState)(r.name),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={},t[0]=d):d=t[0];let[f,p]=(0,J.useState)(d),m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=(e,t)=>{p(n=>({...n,[e]:t}))},t[1]=m):m=t[1];let h=m,g;t[2]!==s||t[3]!==i||t[4]!==c?(g=F$.integration.update.mutationOptions({onSuccess:async()=>{wy.success(`Connection updated`),await U$(c),i?.(),s()},meta:{errorMessage:`Failed to update connection`}}),t[2]=s,t[3]=i,t[4]=c,t[5]=g):g=t[5];let _=Qe(g),v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=F$.integration.testCredentials.mutationOptions({meta:{errorShownByCaller:!0}}),t[6]=v):v=t[6];let y=Qe(v),b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=F$.integration.testCredentials.mutationOptions({onSuccess:W4}),t[7]=b):b=t[7];let x=Qe(b),S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=F$.integration.testConnection.mutationOptions({onSuccess:W4}),t[8]=S):S=t[8];let C=Qe(S),w=vy(),T,E,D,O,k;if(t[9]!==w||t[10]!==s||t[11]!==f||t[12]!==r||t[13]!==l||t[14]!==a||t[15]!==n||t[16]!==o||t[17]!==y||t[18]!==x||t[19]!==C||t[20]!==_){let e=Py(w,r.type),i=e?.credentialFields,c=e?.hasTest===!0,u=_.isPending||y.isPending,d=x.isPending||C.isPending,p;t[26]!==f||t[27]!==r.id||t[28]!==l||t[29]!==_?(p=()=>{_.mutate({integrationId:r.id,name:l.trim(),config:U4(f)?f:void 0})},t[26]=f,t[27]=r.id,t[28]=l,t[29]=_,t[30]=p):p=t[30];let m=p,g;t[31]!==o||t[32]!==m?(g=e=>{o(D4,{title:`Connection Test Failed`,message:`${e}\n\nDo you want to save anyway?`,confirmLabel:`Save Anyway`,onConfirm:m})},t[31]=o,t[32]=m,t[33]=g):g=t[33];let v=g,b;t[34]!==f||t[35]!==c||t[36]!==r.type||t[37]!==v||t[38]!==m||t[39]!==y?(b=async()=>{if(!(U4(f)&&c)){m();return}try{let e=await y.mutateAsync({type:r.type,config:f});if(e.status===`error`){v(`The test failed: ${e.message}`);return}}catch(e){let t=e;v(t instanceof Error?t.message:`Failed to test connection`);return}m()},t[34]=f,t[35]=c,t[36]=r.type,t[37]=v,t[38]=m,t[39]=y,t[40]=b):b=t[40];let S=b,A;t[41]!==f||t[42]!==r.id||t[43]!==r.type||t[44]!==x||t[45]!==C?(A=()=>{if(U4(f)){x.mutate({type:r.type,config:f});return}C.mutate({integrationId:r.id})},t[41]=f,t[42]=r.id,t[43]=r.type,t[44]=x,t[45]=C,t[46]=A):A=t[46];let j=A,M;t[47]!==s||t[48]!==r||t[49]!==a||t[50]!==o?(M=()=>{o(q4,{integration:r,onDismiss:s,onSuccess:a})},t[47]=s,t[48]=r,t[49]=a,t[50]=o,t[51]=M):M=t[51];let N=M;E=()=>i?Object.entries(i).map(e=>{let[t,n]=e;return n.type===`password`?(0,Y.jsx)(Rde,{configKey:t,fieldId:t,helpLink:n.helpLink,helpText:n.helpText,label:n.label,onChange:h,placeholder:n.placeholder,value:f[t]||``},t):(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:t,children:n.label}),(0,Y.jsx)(B4,{id:t,onChange:e=>h(t,e.target.value),placeholder:n.placeholder,type:n.type,value:f[t]||``}),(n.helpText||n.helpLink)&&(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[n.helpText,n.helpLink&&(0,Y.jsx)(`a`,{className:`underline hover:text-foreground`,href:n.helpLink.url,rel:`noopener noreferrer`,target:`_blank`,children:n.helpLink.text})]})]},t)}):null,T=E4;let P=u||d,F;t[52]!==N||t[53]!==P?(F={label:`Delete`,variant:`ghost`,onClick:N,disabled:P},t[52]=N,t[53]=P,t[54]=F):F=t[54];let I;t[55]!==j||t[56]!==c||t[57]!==u||t[58]!==d?(I=c?[{label:`Test`,variant:`outline`,onClick:j,loading:d,disabled:u}]:[],t[55]=j,t[56]=c,t[57]=u,t[58]=d,t[59]=I):I=t[59];let L;t[60]!==S||t[61]!==u?(L={label:`Update`,onClick:S,loading:u},t[60]=S,t[61]=u,t[62]=L):L=t[62],t[63]!==F||t[64]!==I||t[65]!==L?(O=[F,...I,L],t[63]=F,t[64]=I,t[65]=L,t[66]=O):O=t[66],k=n,D=Lde(e,r.type),t[9]=w,t[10]=s,t[11]=f,t[12]=r,t[13]=l,t[14]=a,t[15]=n,t[16]=o,t[17]=y,t[18]=x,t[19]=C,t[20]=_,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k}else T=t[21],E=t[22],D=t[23],O=t[24],k=t[25];let A=`Edit ${D}`,j;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Y.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Update your connection credentials`}),t[67]=j):j=t[67];let M;t[68]===E?M=t[69]:(M=E(),t[68]=E,t[69]=M);let N;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(V4,{htmlFor:`name`,children:`Label (Optional)`}),t[70]=N):N=t[70];let P;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>u(e.target.value),t[71]=P):P=t[71];let F;t[72]===l?F=t[73]:(F=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[N,(0,Y.jsx)(B4,{id:`name`,onChange:P,placeholder:`e.g. Production, Personal, Work`,value:l})]}),t[72]=l,t[73]=F);let I;t[74]!==M||t[75]!==F?(I=(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[M,F]}),t[74]=M,t[75]=F,t[76]=I):I=t[76];let L;return t[77]!==T||t[78]!==A||t[79]!==I||t[80]!==O||t[81]!==k?(L=(0,Y.jsxs)(T,{actions:O,overlayId:k,title:A,children:[j,I]}),t[77]=T,t[78]=A,t[79]=I,t[80]=O,t[81]=k,t[82]=L):L=t[82],L}function q4(e){let t=(0,X.c)(19),{overlayId:n,integration:r,onDismiss:i,onSuccess:a}=e,{pop:o}=Oq(),s=i??o,c=Ie(),l;t[0]!==s||t[1]!==a||t[2]!==c?(l=F$.integration.delete.mutationOptions({onSuccess:async()=>{wy.success(`Connection deleted`),s(),await U$(c),a?.()},meta:{errorMessage:`Failed to delete connection`}}),t[0]=s,t[1]=a,t[2]=c,t[3]=l):l=t[3];let u=Qe(l),d;t[4]===o?d=t[5]:(d={label:`Cancel`,variant:`outline`,onClick:o},t[4]=o,t[5]=d);let f;t[6]!==u||t[7]!==r?(f=()=>u.mutate({integrationId:r.id}),t[6]=u,t[7]=r,t[8]=f):f=t[8];let p;t[9]!==u.isPending||t[10]!==f?(p={label:`Delete`,variant:`destructive`,onClick:f,loading:u.isPending},t[9]=u.isPending,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=[d,p],t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Are you sure you want to delete this connection? Workflows using it will fail until a new one is configured.`}),t[15]=h):h=t[15];let g;return t[16]!==n||t[17]!==m?(g=(0,Y.jsx)(E4,{actions:m,overlayId:n,title:`Delete Connection`,children:h}),t[16]=n,t[17]=m,t[18]=g):g=t[18],g}function J4(){let e=(0,X.c)(4),t=Ie(),n=vy(),r=fA(Mue),i;return e[0]!==n||e[1]!==t||e[2]!==r?(i=async()=>{r({integrations:await t.fetchQuery(I$()),catalog:n})},e[0]=n,e[1]=t,e[2]=r,e[3]=i):i=e[3],i}function Y4(e){let t=(0,X.c)(23),{displayName:n,selected:r,className:i,disabled:a,onSelect:o,onEdit:s}=e,c=a&&`cursor-not-allowed opacity-50`,l;t[0]!==i||t[1]!==c?(l=Q(i,c),t[0]=i,t[1]=c,t[2]=l):l=t[2];let u;t[3]===r?u=t[4]:(u=r?(0,Y.jsx)(Tv,{className:`size-4 shrink-0 text-success`}):(0,Y.jsx)(Nv,{className:`size-4 shrink-0 text-muted-foreground`}),t[3]=r,t[4]=u);let d;t[5]===n?d=t[6]:(d=(0,Y.jsx)(`span`,{className:`truncate`,children:n}),t[5]=n,t[6]=d);let f;t[7]!==a||t[8]!==o||t[9]!==r||t[10]!==u||t[11]!==d?(f=(0,Y.jsxs)(`button`,{"aria-checked":r,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,disabled:a,onClick:o,role:`radio`,type:`button`,children:[u,d]}),t[7]=a,t[8]=o,t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===s?p=t[14]:(p=e=>{e.stopPropagation(),s()},t[13]=s,t[14]=p);let m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(iy,{className:`size-3`}),t[15]=m):m=t[15];let h;t[16]!==a||t[17]!==p?(h=(0,Y.jsx)(pv,{className:`size-6 shrink-0`,disabled:a,onClick:p,size:`icon`,variant:`ghost`,children:m}),t[16]=a,t[17]=p,t[18]=h):h=t[18];let g;return t[19]!==l||t[20]!==f||t[21]!==h?(g=(0,Y.jsxs)(`div`,{className:l,children:[f,h]}),t[19]=l,t[20]=f,t[21]=h,t[22]=g):g=t[22],g}function zde(e){let t=(0,X.c)(68),{integrationType:n,value:r,onChange:i,onOpenSettings:a,disabled:o,onAddConnection:s}=e,c=vy(),{push:l}=Oq(),u=J4(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=I$(),t[0]=d):d=t[0];let{data:f,isPending:p}=Ze(d),m;t[1]===f?m=t[2]:(m=f===void 0?[]:f,t[1]=f,t[2]=m);let h=m,g;if(t[3]!==h||t[4]!==n){let e;t[6]===n?e=t[7]:(e=e=>e.type===n,t[6]=n,t[7]=e),g=h.filter(e),t[3]=h,t[4]=n,t[5]=g}else g=t[5];let _=g,v;t[8]!==i||t[9]!==u?(v=async e=>{await u(),i(e)},t[8]=i,t[9]=u,t[10]=v):v=t[10];let y=v,b;t[11]!==y||t[12]!==n||t[13]!==l?(b=()=>{l(G4,{type:n,onSuccess:y})},t[11]=y,t[12]=n,t[13]=l,t[14]=b):b=t[14];let x=b,S;t[15]!==l||t[16]!==u?(S=e=>{l(K4,{integration:e,onSuccess:u,onDelete:u})},t[15]=l,t[16]=u,t[17]=S):S=t[17];let C=S,w;t[18]!==s||t[19]!==x?(w=()=>{s?s():x()},t[18]=s,t[19]=x,t[20]=w):w=t[20];let T=w;if(p){let e;return t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`flex flex-col gap-1`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,Y.jsx)(`div`,{className:`size-4 shrink-0 animate-pulse rounded-full bg-muted`}),(0,Y.jsx)(`div`,{className:`h-4 flex-1 animate-pulse rounded bg-muted`}),(0,Y.jsx)(`div`,{className:`size-6 shrink-0 animate-pulse rounded bg-muted`})]})}),t[21]=e):e=t[21],e}let E;t[22]!==c||t[23]!==n?(E=Py(c,n),t[22]=c,t[23]=n,t[24]=E):E=t[24];let D=E?.label||n,O;t[25]===D?O=t[26]:(O=e=>e.name||`${D} API Key`,t[25]=D,t[26]=O);let k=O;if(_.length===0){let e;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(fy,{className:`size-4`}),t[27]=e):e=t[27];let n;t[28]===D?n=t[29]:(n=(0,Y.jsxs)(`span`,{className:`flex-1 text-left`,children:[`Add `,D,` connection`]}),t[28]=D,t[29]=n);let r;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(oy,{className:`size-4`}),t[30]=r):r=t[30];let i;return t[31]!==o||t[32]!==T||t[33]!==n?(i=(0,Y.jsxs)(pv,{className:`w-full justify-start gap-2 border-warning/50 bg-warning/10 text-warning hover:bg-warning/20`,disabled:o,onClick:T,variant:`outline`,children:[e,n,r]}),t[31]=o,t[32]=T,t[33]=n,t[34]=i):i=t[34],i}if(_.length===1){let e=_[0],n;t[35]!==e||t[36]!==k?(n=k(e),t[35]=e,t[36]=k,t[37]=n):n=t[37];let a;t[38]!==e||t[39]!==C?(a=()=>C(e),t[38]=e,t[39]=C,t[40]=a):a=t[40];let s;t[41]!==e.id||t[42]!==i?(s=()=>i(e.id),t[41]=e.id,t[42]=i,t[43]=s):s=t[43];let c=r===e.id,l;return t[44]!==o||t[45]!==e||t[46]!==n||t[47]!==a||t[48]!==s||t[49]!==c?(l=(0,Y.jsx)(`div`,{role:`radiogroup`,children:(0,Y.jsx)(Y4,{className:`flex h-9 w-full items-center gap-2 rounded-md border px-3 text-sm`,disabled:o,displayName:n,integration:e,onEdit:a,onSelect:s,selected:c})}),t[44]=o,t[45]=e,t[46]=n,t[47]=a,t[48]=s,t[49]=c,t[50]=l):l=t[50],l}let A,j,M;if(t[51]!==o||t[52]!==_||t[53]!==k||t[54]!==i||t[55]!==C||t[56]!==r){let[e,n]=qa(_,Bde);A=`flex flex-col gap-1`,j=`radiogroup`,M=[...e,...n].map(e=>{let t=r===e.id;return(0,Y.jsx)(Y4,{className:Q(`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors`,t?`bg-primary/10 text-primary`:`hover:bg-muted/50`),disabled:o,displayName:k(e),integration:e,onEdit:()=>C(e),onSelect:()=>i(e.id),selected:t},e.id)}),t[51]=o,t[52]=_,t[53]=k,t[54]=i,t[55]=C,t[56]=r,t[57]=A,t[58]=j,t[59]=M}else A=t[57],j=t[58],M=t[59];let N;t[60]!==o||t[61]!==a?(N=a&&(0,Y.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-muted-foreground text-sm transition-colors hover:bg-muted/50 hover:text-foreground`,disabled:o,onClick:a,type:`button`,children:[(0,Y.jsx)(uy,{className:`size-4 shrink-0`}),(0,Y.jsx)(`span`,{children:`Manage all connections`})]}),t[60]=o,t[61]=a,t[62]=N):N=t[62];let P;return t[63]!==A||t[64]!==j||t[65]!==M||t[66]!==N?(P=(0,Y.jsxs)(`div`,{className:A,role:j,children:[M,N]}),t[63]=A,t[64]=j,t[65]=M,t[66]=N,t[67]=P):P=t[67],P}function Bde(e){return!!e.isManaged}function X4(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}function Vde(e){let[t,n]=J.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Z4(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Q4=J.createContext(null);function $4(){let e=J.useContext(Q4);if(e===null)throw Error(Rg(60));return e}var e3=(e,t)=>Object.is(e,t);function t3(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Hde(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&t3(t,e,n))}function n3(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&t3(e,t,n))}function r3(e,t,n,r){let i=n3(e,r&&Array.isArray(t)?t[t.length-1]:t,n);return i===-1?null:i}function i3(e,t,n){return e.filter(e=>!t3(t,e,n))}function a3(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function o3(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function s3(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(o3(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function c3(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return a3(e)}function l3(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?a3(e.value):a3(e)}function u3(e,t,n){function r(){return c3(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=o3(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Ude(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Y.jsx)(J.Fragment,{children:u3(r,t,n)},i)),e),[])}var d3={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:l3(t,r)!==``},hasNullItemLabel:(e,t)=>t?s3(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>t3(t,e,n)):t3(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function f3(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function p3(e,t){return Math.max(0,e-t)}function m3(e,t){if(t<=0)return 0;let n=eG(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Wde(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=e3,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=P4(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=N4(),F=L4({id:t}),I=M||d,L=j??c,[R,z]=hG({controlled:n,default:y?r??Zg:r,name:`Select`,state:`value`}),[B,V]=hG({controlled:a,default:o,name:`Select`,state:`open`}),H=J.useRef([]),U=J.useRef([]),W=J.useRef(null),G=J.useRef(null),K=J.useRef(0),ee=J.useRef(null),q=J.useRef([]),te=J.useRef(!1),ne=J.useRef(null),re=J.useRef(null),ie=J.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ae=J.useRef(!1),{mounted:oe,setMounted:se,transitionStatus:ce}=PU(B),{openMethod:le,triggerProps:ue}=lK(B),de=Cg(()=>new AU({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:oe,transitionStatus:ce,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,fe=$(de,d3.activeIndex),pe=$(de,d3.selectedIndex),me=$(de,d3.triggerElement),he=$(de,d3.positionerElement),ge=Vde(le),_e=le??ge,ve=J.useMemo(()=>y?``:l3(R,x),[y,R,x]),ye=J.useMemo(()=>y&&Array.isArray(R)?R.map(e=>l3(e,x)):l3(R,x),[y,R,x]);z4(Yz(me),F,R,Z(()=>ye),!I,c);let be=J.useRef(R),xe=y?Array.isArray(R)&&R.length>0:R!=null&&ve!==``;Tg(()=>{A(xe)},[xe,A]),Tg(function(){let e=R,t=!1;if(y){let n=Array.isArray(R)?R:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:n3(q.current,e,S),r=n===-1?null:n;r===null&&(re.current=null),!B&&de.set(`selectedIndex`,r)},[y,B,R,S,de]);function Se(e){let t=k.initialValue;return Array.isArray(e)&&Array.isArray(t)?!f3(e,t,(e,t)=>t3(e,t,S)):e!==t}sK(R,()=>{T(L),E(Se(R)),N.change(R)});let Ce=Z((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))}),we=Z(()=>{se(!1),de.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});IU({enabled:!h,open:B,ref:W,onComplete(){B||we()}}),J.useImperativeHandle(h,()=>({unmount:we}),[we]);let Te=Z((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Ee=Z(e=>{let t=p3(e.scrollHeight,e.clientHeight),n=m3(e.scrollTop,t),r=n>0,i=n<t;de.set(`scrollUpArrowVisible`,r),de.set(`scrollDownArrowVisible`,i)}),De=sW({open:B,onOpenChange:Ce,elements:{reference:me,floating:he}}),Oe=sH(De,{enabled:!f&&!I,event:`mousedown`}),ke=pH(De),Ae=DW(De,{enabled:!f&&!I,listRef:H,activeIndex:fe,selectedIndex:pe,disabledIndices:Zg,onNavigate(e){e===null&&!B||de.set(`activeIndex`,e)},focusItemOnHover:C}),je=OW(De,{enabled:!f&&!I&&(B||!y),listRef:U,activeIndex:fe,selectedIndex:pe,disabledIndices:e=>Z4(H.current[e]),onMatch(e){B?de.set(`activeIndex`,e):Te(q.current[e],tz(IR))},onTyping(e){te.current=e}}),Me=J.useMemo(()=>Og(je.reference,Ae.reference,ke.reference,Oe.reference,ue),[Oe.reference,je.reference,Ae.reference,ke.reference,ue]),Ne=J.useMemo(()=>Og(LU,je.floating,Ae.floating,ke.floating),[je.floating,Ae.floating,ke.floating]),Pe=Ae.item??Qg;X4(()=>{de.update({popupProps:Ne,triggerProps:Me})}),de.useSyncedValues({id:F,modal:m,multiple:y,value:R,open:B,mounted:oe,transitionStatus:ce,popupProps:Ne,triggerProps:Me,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:_e});let Fe=J.useMemo(()=>({store:de,floatingContext:De,required:p,disabled:I,readOnly:f,multiple:y,highlightItemOnHover:C,setValue:Te,setOpen:Ce,listRef:H,popupRef:W,scrollHandlerRef:G,handleScrollArrowVisibility:Ee,scrollArrowsMountedCountRef:K,itemProps:Pe,valueRef:ee,valuesRef:q,labelsRef:U,typingRef:te,selectionRef:ie,firstItemTextRef:ne,selectedItemTextRef:re,validation:N,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:ae,initialValueRef:be}),[de,De,p,I,f,y,C,Te,Ce,Pe,N,_,Ee]),Ie=Gg(g,N.inputRef),Le=y?void 0:L,Re=J.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=l3(e,x);return(0,Y.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,Y.jsxs)(Q4.Provider,{value:Fe,children:[w,(0,Y.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){de.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=tz(IR,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=q.current.findIndex(t=>l3(t,x).toLowerCase()===e||c3(t,b).toLowerCase()===e);r===-1&&(r=q.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=q.current[r];i!=null&&Te(i,n)}de.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Le==null?`${F}-hidden-input`:void 0,form:l,name:Le,autoComplete:u,value:ve,disabled:I,required:p&&!(y&&xe),readOnly:f,ref:Ie,style:L?rB:nB,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Re]})}function h3(e,t){return e??t}var g3=5;function _3(e,t){let n=Gde(t);return e.clientX>=n.left-g3&&e.clientX<=n.right+g3&&e.clientY>=n.top-g3&&e.clientY<=n.bottom+g3}function Gde(e){let t=e.getBoundingClientRect(),n=tg(e);if(Sz)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var Kde=400,qde={...jR,...A4,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Jde=J.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=N4(),{labelId:m}=F4(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:b,alignItemWithTriggerActiveRef:x,disabled:S}=$4(),C=p||S||a,w=$(h,d3.open),T=$(h,d3.mounted),E=$(h,d3.value),D=$(h,d3.triggerProps),O=$(h,d3.positionerElement),k=$(h,d3.listElement),A=$(h,d3.popupSide),j=$(h,d3.id),M=$(h,d3.labelId),N=$(h,d3.hasSelectedValue),P=T&&O?A:null,F=i??j,I=h3(m,M);L4({id:F});let L=Yz(O),R=J.useRef(null),{getButtonProps:z,buttonRef:B}=Ug({disabled:C,native:o}),V=h.useStateSetter(`triggerElement`),H=fz(),U=fz(),W=fz();J.useEffect(()=>{if(w)return W.start(Kde,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{W.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},U.clear()},[w,_,U,W]);let G=Og(D,{id:F,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?k?.id??Lz(O)?.id:void 0,"aria-labelledby":I,"aria-readonly":y||void 0,"aria-required":b||void 0,tabIndex:C?-1:0,onFocus(e){u(!0),w&&x.current&&g(!1,tz(IR,e.nativeEvent)),H.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Az(O,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(E))},onMouseDown(e){if(w)return;let t=Vg(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;Az(R.current,t)||Az(L.current,t)||_3(e,R.current)||g(!1,tz(ZR,e))}U.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,z),K=v.getValidationProps(C,G);K.role=`combobox`;let ee={...f,open:w,disabled:C,value:E,readOnly:y,popupSide:P,placeholder:!N};return e_(`button`,e,{ref:[t,R,B,V],state:ee,stateAttributesMapping:qde,props:K})}),Yde={value:()=>null},Xde=J.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=$4(),u=$(c,d3.value),d=$(c,d3.items),f=$(c,d3.itemToStringLabel),p=$(c,d3.hasSelectedValue),m=!p&&a!=null&&i==null,h=$(c,d3.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?Ude(u,d,f):u3(u,d,f)),e_(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Yde})}),Zde=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=$4();return e_(`span`,e,{state:{open:$(o,d3.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:AR})}),Qde=J.forwardRef(function(e,t){let{store:n}=$4(),r=$(n,d3.mounted),i=$(n,d3.forceMount);return r||i?(0,Y.jsx)(VV,{ref:t,...e}):null}),v3=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function $de(){return J.useContext(v3)}function y3(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Z(i),[,o]=J.useState(!1),s=Cg(tfe).current,c=Cg(efe).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef([]),f=J.useRef(null),p=Z(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Z((e,t)=>{c.set(e,t),p()}),h=Z(e=>{c.delete(e),p()}),g=Z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ife(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&b3(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=rfe(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Z(()=>{let[e,t]=nfe(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Tg(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Tg(()=>{u.current&&v()}),Tg(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Z(e=>(s.add(e),()=>{s.delete(e)})),b=J.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(v3.Provider,{value:b,children:t})}function efe(){return new Map}function tfe(){return new Set}function nfe(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>b3(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function rfe(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ife(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function b3(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var afe=J.createContext(void 0);function x3(){return J.useContext(afe)?.direction??`ltr`}var ofe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=fB(e,t)||{};if(l==null)return{};let f=AB(u),p={x:n,y:r},m=vB(i),h=gB(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=dB(k,j,A),N=!c.arrow&&mB(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),sfe=(e,t)=>({...ofe(e),options:[e,t]}),cfe={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},lfe={sideX:`left`,sideY:`top`},S3=`--available-width`,C3=`--available-height`;function w3(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function T3(e,t,n){let{rects:r,placement:i}=e;return{side:w3(t,pB(i),n),align:mB(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function E3(e){return ufe(e,cW)}function ufe(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=J.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=Z(A),M=A?j:n,N=Yz(n),P=Yz(g),F=x3()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],L=o===`center`?I:`${I}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),U={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},W=J.useRef(null),G=Yz(a),K=Yz(s),ee=typeof a==`function`?0:a,q=typeof s==`function`?0:s,te=[];p&&te.push(p),te.push(fU(e=>{let t=T3(e,i,F),n=typeof G.current==`function`?G.current(t):G.current,r=typeof K.current==`function`?K.current(t):K.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ee,q,F,i]));let ne=E===`none`&&T!==`shift`,re=!ne&&(u||O||T===`shift`),ie=T===`none`?null:hU({...U,padding:{top:R.top+1+z,right:R.right+1+H,bottom:R.bottom+1+B,left:R.left+1+V},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ae=ne?null:pU({...U,rootBoundary:k,mainAxis:E!==`none`,crossAxis:re,limiter:u||O?void 0:mU(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=_B(pB(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[U,u,O,k,R,E]);T===`shift`||E===`shift`||o===`center`?te.push(ae,ie):te.push(ie,ae),te.push(gU({...U,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(S3,`${t}px`),i.setProperty(C3,`${n}px`);let a=tg(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),sfe(e=>({element:W.current||Vg(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=pB(r),l=_B(c),u=W.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(T3(e,i,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,re&&l===`y`&&b?S:x),{}}},cfe,b),Tg(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let oe=J.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:se,elements:ce,x:le,y:ue,middlewareData:de,update:fe,placement:pe,context:me,isPositioned:he,floatingStyles:ge}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:te,strategy:r,whileElementsMounted:m?void 0:(...e)=>$H(...e,oe),nodeId:y,externalTree:S}),{sideX:_e,sideY:ve}=de.adaptiveOrigin||lfe,ye=he?r:`fixed`,be=J.useMemo(()=>{let e;return e=he?b?{position:ye,[_e]:le,[ve]:ue}:{...ge,position:ye}:{position:ye,top:0,left:0},e[S3]=`100vw`,e[C3]=`100vh`,he||(e.opacity=0),e},[b,ye,_e,le,ve,ue,ge,he]),xe=J.useRef(null);Tg(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(D3(t)?t.current:t)||null;n!==xe.current&&(se.setPositionReference(n),xe.current=n)},[g,se,M,N]),J.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&D3(e)&&e.current!==xe.current&&(se.setPositionReference(e.current),xe.current=e.current)},[g,se,M,N]),J.useEffect(()=>{if(m&&g&&ce.reference&&ce.floating)return $H(ce.reference,ce.floating,fe,oe)},[m,g,ce,fe,oe]);let Se=pB(pe),Ce=w3(i,Se,F),we=mB(pe)||`center`,Te=!!de.hide?.referenceHidden;Tg(()=>{x&&g&&he&&Se!==I&&w(Se)},[x,g,he,Se,I]);let Ee=J.useMemo(()=>({position:`absolute`,top:de.arrow?.y,left:de.arrow?.x}),[de.arrow]),De=de.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:be,arrowStyles:Ee,arrowRef:W,arrowUncentered:De,side:Ce,align:we,physicalSide:Se,anchorHidden:Te,refs:se,context:me,isPositioned:he,update:fe}),[be,Ee,W,De,Ce,we,Se,Te,se,me,he,fe])}function D3(e){return e!=null&&`current`in e}var O3=J.createContext(void 0);function k3(){let e=J.useContext(O3);if(!e)throw Error(Rg(59));return e}function A3(e,t){e&&Object.assign(e.style,t)}var j3={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function M3(e){return e===`starting`?kV:Qg}function N3(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),e_(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},M3(r),i],stateAttributesMapping:MR})}var dfe=20;function P3(e,t,n,r){let[i,a]=J.useState(!1);Tg(()=>{if(!e||!t||n==null){a(!1);return}let r=Vg(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-dfe)},[e,t,n]),EG(e&&(!t||i),r)}var ffe={position:`fixed`},pfe=J.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=PV,style:_,...v}=e,{store:y,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D,floatingContext:O}=$4(),k=$(y,d3.open),A=$(y,d3.mounted),j=$(y,d3.modal),M=$(y,d3.value),N=$(y,d3.openMethod),P=$(y,d3.positionerElement),F=$(y,d3.triggerElement),I=$(y,d3.isItemEqualToValue),L=$(y,d3.transitionStatus),R=J.useRef(null),z=J.useRef(null),[B,V]=J.useState(h),H=A&&B&&N!==`touch`;!A&&B!==h&&V(h),J.useImperativeHandle(S,()=>H),P3((H||j)&&k,N===`touch`,P,F);let U=E3({anchor:n,floatingRootContext:O,positionMethod:a,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??H,collisionAvoidance:g,keepMounted:!0}),W=H?`none`:U.side,G=H?ffe:U.positionerStyles,K={open:k,side:W,align:U.align,anchorHidden:U.anchorHidden};Tg(()=>{y.set(`popupSide`,U.side)},[y,U.side]);let ee=N3(e,K,{styles:G,transitionStatus:L,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!A,inert:!k}),q=J.useRef(0),te=Z(e=>{if(w.current.length===0)return;let t=q.current;if(q.current=e.size,e.size===t)return;let n=tz(IR);if(t!==0&&!y.state.multiple&&M!==null&&n3(w.current,M,I)===-1){let e=T.current,t=e!=null&&n3(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(y.set(`selectedIndex`,null),C.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(M)){let e=M.filter(e=>n3(w.current,e,I)!==-1);e.length!==M.length&&(D(e,n),e.length===0&&(y.set(`selectedIndex`,null),C.current=null))}if(k&&H){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};A3(P,e),A3(E.current,e)}}),ne=J.useMemo(()=>({...U,side:W,alignItemWithTriggerActive:H,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:R,scrollDownArrowRef:z}),[U,W,H,V]);return(0,Y.jsx)(y3,{elementsRef:b,labelsRef:x,onMapChange:te,children:(0,Y.jsxs)(O3.Provider,{value:ne,children:[A&&j&&(0,Y.jsx)(fG,{inert:dG(!k),cutout:F}),ee]})})}),F3=`base-ui-disable-scrollbar`,I3={className:F3,getElement(e){return(0,Y.jsx)(`style`,{nonce:e,href:F3,precedence:`base-ui:low`,children:`.${F3}{scrollbar-width:none}.${F3}::-webkit-scrollbar{display:none}`})}},mfe=J.createContext(void 0);function L3(e){let t=J.useContext(mfe);if(t===void 0&&!e)throw Error(Rg(69));return t}var hfe=J.createContext(void 0),gfe={disableStyleElements:!1};function _fe(){return J.useContext(hfe)??gfe}var vfe={...MR,...OR},yfe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v,floatingContext:y}=$4(),{side:b,align:x,alignItemWithTriggerActive:S,isPositioned:C,setControlledAlignItemWithTrigger:w}=k3(),T=L3(!0)!=null,E=x3(),{nonce:D,disableStyleElements:O}=_fe(),k=$(s,d3.id),A=$(s,d3.open),j=$(s,d3.openMethod),M=$(s,d3.mounted),N=$(s,d3.popupProps),P=$(s,d3.transitionStatus),F=$(s,d3.triggerElement),I=$(s,d3.positionerElement),L=$(s,d3.listElement),R=J.useRef(!1),z=J.useRef(!1),B=J.useRef({}),V=eB(),H=Z(e=>{if(!I||!c.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!S||!t&&!n){h(e);return}let r=B3(I),i=V3(I.getBoundingClientRect().height,`y`,r),a=Vg(I),o=tg(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=R3(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=z3(e),g=null,_=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=eG(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=eG(g,0,z3(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),h(e)});J.useImperativeHandle(g,()=>H,[H]),IU({open:A,ref:c,onComplete(){A&&l?.(!0)}});let U={open:A,transitionStatus:P,side:b,align:x};Tg(()=>{!I||!c.current||Object.keys(B.current).length||(B.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),Tg(()=>{A||S||(z.current=!1,R.current=!1,A3(I,B.current))},[A,S,I,c]),Tg(()=>{let e=c.current;if(!A||!F||!I||!e||S&&!C||s.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(`--transform-origin`),!S){V.request(()=>h(L||e));return}let t=bfe(e);try{let t=p.current;t?.isConnected||(t=!d3.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=tg(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=Vg(F),c=B3(F),l=H3(F.getBoundingClientRect(),c),u=H3(I.getBoundingClientRect(),c),m=l.height,g=L||e,y=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,T=R3(a),D=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=D-l.bottom+m,A,j=E===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=H3(n.getBoundingClientRect(),c);A=H3(t.getBoundingClientRect(),c),j=u.left+(E===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(D,N),z=D-x-S,V=N-P,H=O-5;I.style.left=`${eG(j,5,H-u.width)}px`,I.style.height=`${P}px`,I.style.maxHeight=`none`,I.style.marginTop=`${x}px`,I.style.marginBottom=`${S}px`,e.style.height=`100%`;let U=z3(g),W=V>=U-1;W&&(P=Math.min(D,u.height)-(V-U));let G=l.top<20||l.bottom>D-20||Math.ceil(P)+1<Math.min(y,C),K=(r.visualViewport?.scale??1)!==1&&yz;if(G||K){A3(I,B.current),w(!1);return}let ee=Math.max(C,P);if(W){let e=Math.max(0,D-N);I.style.top=u.height>=z?`0`:`${e}px`,I.style.height=`${P}px`,g.scrollTop=z3(g)}else I.style.bottom=`0`,g.scrollTop=V;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=eG(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(ee===D||P>=T)&&(R.current=!0),h(g),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,A,I,F,d,f,p,c,h,S,w,V,L,_,v,E,C]),J.useEffect(()=>{if(!S||!I||!A)return;let e=tg(I);function t(e){u(!1,tz(kce,e))}return qz(e,`resize`,t)},[u,S,I,A]);let W={...L?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${k}-list`},onKeyDown(e){T&&WW.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},...S&&{style:L?{height:`100%`}:j3},className:!L&&S?I3.className:void 0},G=e_(`div`,e,{ref:[t,c],state:U,stateAttributesMapping:vfe,props:[N,W,M3(P),o]});return(0,Y.jsxs)(J.Fragment,{children:[!O&&I3.getElement(D),(0,Y.jsx)(oH,{context:y,modal:!1,disabled:!M,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:G})]})});function R3(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function z3(e){return p3(e.scrollHeight,e.clientHeight)}function B3(e){return XH.getScale(e)}function V3(e,t,n){return e/n[t]}function H3(e,t){return jB({x:V3(e.x,`x`,t),y:V3(e.y,`y`,t),width:V3(e.width,`x`,t),height:V3(e.height,`y`,t)})}var U3=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function bfe(e){let{style:t}=e,n={};for(let[e,r]of U3)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of U3){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var xfe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=$4(),{alignItemWithTriggerActive:l}=k3(),u=$(o,d3.hasScrollArrows),d=$(o,d3.openMethod),f={id:`${$(o,d3.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:j3},className:u&&d!==`touch`?I3.className:void 0};return e_(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})});function W3(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=$de(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=J.useRef(null),h=J.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Tg(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var G3=J.createContext(void 0);function K3(){let e=J.useContext(G3);if(!e)throw Error(Rg(57));return e}var Sfe=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=J.useRef(null),d=W3({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:y,selectedItemTextRef:b,disabled:x,readOnly:S}=$4(),C=x||s,w=$(f,d3.isActive,d.index),T=$(f,d3.open),E=$(f,d3.isSelected,a),D=$(f,d3.isSelectedByFocus,d.index),O=$(f,d3.isItemEqualToValue),k=d.index,A=J.useRef(null);Tg(()=>{let e=v.current;return e[k]=a,()=>{delete e[k]}},[k,a,v]),Tg(()=>{let e=f.state.value,t=e;y&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&t3(a,t,O)&&(f.set(`selectedIndex`,k),u.current&&(b.current=u.current))},[k,y,O,f,a,b]);let j=J.useRef(`mouse`),M=J.useRef(!1),{getButtonProps:N,buttonRef:P}=Ug({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),F={disabled:C,selected:E,highlighted:w};function I(e){if(x||S)return;let t=f.state.value;if(y){let n=Array.isArray(t)?t:[],r=E?i3(n,a,O):[...n,a];h(r,tz(BR,e))}else h(a,tz(BR,e)),m(!1,tz(BR,e))}function L(){g.current.dragY=0}let R={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&wz(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,!(C||i)&&I(e.nativeEvent)},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,L()},onMouseUp(){if(L(),C||j.current===`touch`||M.current)return;let e=!g.current.allowSelectedMouseUp&&E,t=!g.current.allowUnselectedMouseUp&&!E;e||t||(M.current=!0,A.current?.click(),M.current=!1)}},z=e_(`div`,e,{ref:[P,t,d.ref,A],state:F,props:[p,R,l,N]}),B=J.useMemo(()=>({selected:E,index:k,textRef:u,selectedByFocus:D}),[E,k,u,D]);return(0,Y.jsx)(G3.Provider,{value:B,children:z})})),Cfe=J.forwardRef(function(e,t){let{selected:n}=K3();return e.keepMounted||n?(0,Y.jsx)(wfe,{...e,ref:t}):null}),wfe=J.memo(J.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=K3(),c=J.useRef(null),{transitionStatus:l,setMounted:u}=PU(s),d=e_(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:OR});return IU({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Tfe=J.memo(J.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=K3(),{firstItemTextRef:a,selectedItemTextRef:o}=$4(),{render:s,className:c,style:l,...u}=e;return e_(`div`,e,{ref:[J.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),q3=J.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=$4(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=k3(),_=$(l,c?d3.scrollUpArrowVisible:d3.scrollDownArrowVisible),v=$(l,d3.openMethod),y=_&&v!==`touch`,b=fz(),x=c?g:h,{mounted:S,transitionStatus:C,setMounted:w}=PU(y);Tg(()=>(p.current+=1,l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.set(`hasScrollArrows`,!1)}),[l,p]),IU({open:y,ref:x,onComplete(){y||w(!1)}});let T=e_(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f(e);let n=p3(e.scrollHeight,e.clientHeight),r=m3(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=Efe(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s],stateAttributesMapping:OR});return S||o?T:null});function Efe(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?m3(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?m3(l.offsetTop+l.offsetHeight-r+i,a):a}var Dfe=J.forwardRef(function(e,t){return(0,Y.jsx)(q3,{...e,ref:t,direction:`down`})}),Ofe=J.forwardRef(function(e,t){return(0,Y.jsx)(q3,{...e,ref:t,direction:`up`})}),J3=J.createContext(void 0);function kfe(){let e=J.useContext(J3);if(e===void 0)throw Error(Rg(56));return e}var Afe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(),c=J.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=e_(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Y.jsx)(J3.Provider,{value:c,children:l})}),jfe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=kfe(),c=oz(a);return Tg(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),e_(`div`,e,{ref:t,props:[{id:c},o]})}),Mfe=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return e_(`div`,e,{state:{orientation:i},ref:t,props:[{role:`presentation`},o]})});function Y3(e){let t=(0,X.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,items:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Wde,{"data-slot":`select`,items:r,...i,children:n}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nfe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`scroll-my-1 p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Afe,{"data-slot":`select-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function X3(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex flex-1 text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Xde,{"data-slot":`select-value`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Z3(e){let t=(0,X.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=Q(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Zde,{render:(0,Y.jsx)(Ev,{className:`pointer-events-none size-3.5 text-muted-foreground`}),children:null}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,Y.jsxs)(Jde,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function Q3(e){let t=(0,X.c)(27),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:r,children:n,side:a,sideOffset:o,align:s,alignOffset:c,alignItemWithTrigger:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=a===void 0?`bottom`:a,d=o===void 0?4:o,f=s===void 0?`center`:s,p=c===void 0?0:c,m=l!==void 0&&l,h;t[9]===r?h=t[10]:(h=Q(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[9]=r,t[10]=h);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(Ife,{}),t[11]=g):g=t[11];let _;t[12]===n?_=t[13]:(_=(0,Y.jsx)(xfe,{children:n}),t[12]=n,t[13]=_);let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Y.jsx)(Lfe,{}),t[14]=v):v=t[14];let y;t[15]!==m||t[16]!==i||t[17]!==h||t[18]!==_?(y=(0,Y.jsxs)(yfe,{"data-slot":`select-content`,"data-align-trigger":m,className:h,...i,children:[g,_,v]}),t[15]=m,t[16]=i,t[17]=h,t[18]=_,t[19]=y):y=t[19];let b;return t[20]!==f||t[21]!==m||t[22]!==p||t[23]!==u||t[24]!==d||t[25]!==y?(b=(0,Y.jsx)(Qde,{children:(0,Y.jsx)(pfe,{side:u,sideOffset:d,align:f,alignOffset:p,alignItemWithTrigger:m,className:`isolate z-50`,children:y})}),t[20]=f,t[21]=m,t[22]=p,t[23]=u,t[24]=d,t[25]=y,t[26]=b):b=t[26],b}function Pfe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`px-2 py-1.5 text-xs text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(jfe,{"data-slot":`select-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $3(e){let t=(0,X.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Q(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=(0,Y.jsx)(Tfe,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:n}),t[6]=n,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(Cfe,{render:(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Y.jsx)(Tv,{className:`pointer-events-none`})}),t[8]=s):s=t[8];let c;return t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Y.jsxs)(Sfe,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Ffe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`pointer-events-none -mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Mfe,{"data-slot":`select-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ife(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(kv,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Y.jsx)(Ofe,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function Lfe(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(Ev,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Y.jsx)(Dfe,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function e6(e){return t=>{t!==null&&e(t)}}function t6(e,t){let n=new Map;for(let e of t){let t=n.get(e.target);t?t.push(e.source):n.set(e.target,[e.source])}let r=new Set,i=new Set([e]),a=[e];for(;a.length>0;){let e=a.pop();if(e)for(let t of n.get(e)??[])r.add(t),i.has(t)||(i.add(t),a.push(t))}return r}var n6=`event:`;function r6(e){return`${n6}${e}`}function i6(e){if(typeof e!=`string`||!e.startsWith(n6))return null;let t=e.slice(6).trim();return t.length>0?t:null}function Rfe(e){return e===rJ.eventSplit}function a6(e){return pJ(e)}function o6(e){let{rule:t,event:n}=e,r=t.field.trim();return r===`$event.name`?A0(t)?!0:t.operator===`equals`?t.value===n.name:t.operator!==`not_equals`||t.value!==n.name:A0(t)||e.declaredElsewhere.has(r)?!0:n.payloadFields.some(e=>e.path===r)}function s6(e){let{rule:t,event:n}=e;return t.field.trim()!==`$event.name`||A0(t)?!0:t.operator===`equals`?t.value!==n.name:t.operator!==`not_equals`||t.value===n.name}function zfe(e){let t=(t,n)=>n?t.every(t=>o6({...e,rule:t})):t.some(t=>o6({...e,rule:t})),n=e.model.groups.map(e=>t(e.conditions,e.logic===`and`));return e.model.groupLogic===`and`?n.every(Boolean):n.some(Boolean)}function Bfe(e){let t=(t,n)=>n?t.some(t=>s6({...e,rule:t})):t.every(t=>s6({...e,rule:t})),n=e.model.groups.map(e=>t(e.conditions,e.logic===`and`));return e.model.groupLogic===`and`?n.some(Boolean):n.every(Boolean)}function Vfe(e){let{events:t,branch:n}=e;if(!n)return[...t];let r=t2(e.node.data.config?.conditionModel);return r.valid?t.filter(t=>{let i={model:r.model,event:t,declaredElsewhere:e.declaredElsewhere};return n===`true`?zfe(i):Bfe(i)}):[...t]}function Hfe(e){return Ga(p2(e.node.data.config).map(t=>My(e.catalog,t.event)))}function Ufe(e){let t=sQ(e.entryNode.data.config);return t?Ga((e.handle===`started`?t.startEvents:e.handle===`canceled`?t.cancelEvents:[]).map(t=>My(e.catalog,t))):[]}function Wfe(e,t){let n=e.data.config?.actionType;if(typeof n!=`string`)return[];let r=Ny(t,n);return r?q$(e.data.config,r.outputFields).map(e=>e.path):[]}function Gfe(e){let{catalog:t}=e,n=new Map(e.nodes.map(e=>[e.id,e])),r=new Map;for(let t of e.edges){let e=r.get(t.target);e?e.push(t):r.set(t.target,[t])}let i=r=>{let i=new Set,a=e=>{let r=n.get(e);if(r)for(let e of Wfe(r,t))i.add(e)};a(r);for(let t of t6(r,e.edges))a(t);return i},a=new Map,o=(e,s)=>{let c=a.get(e);if(c)return c;if(s.has(e))return[];let l=r.get(e)??[];if(l.length===0)return a.set(e,[]),[];let u=new Set(s);u.add(e);let d=null;for(let e of l){let r=n.get(e.source);if(!r)continue;let a=Kfe({parent:r,handle:e.sourceHandle,catalog:t,eventsAbove:o(r.id,u),declaredElsewhere:i(r.id)});d=d===null?a:Jfe(d,a)}let f=d??[];return a.set(e,f),f};return o(e.targetNodeId,new Set)}function Kfe(e){let{parent:t,catalog:n}=e;return dJ(t)?Ufe({entryNode:t,handle:e.handle,catalog:n}):uJ(t)?Hfe({node:t,catalog:n}):qfe({parent:t,handle:e.handle,events:e.eventsAbove,declaredElsewhere:e.declaredElsewhere})}function qfe(e){let{parent:t,handle:n,events:r}=e;if(a6(t)){let e=i6(n);return r.filter(t=>t.name===e)}return r.length>0&&s1(t)?Vfe({events:r,node:t,branch:i1(n),declaredElsewhere:e.declaredElsewhere}):r}function Jfe(e,t){let n=new Set(t.map(e=>e.name));return e.filter(e=>n.has(e.name))}function Yfe(e){let t=Ja(Ga(e.map(e=>e.field.type)));return t.length<2?t[0]?{type:t[0]}:{}:{typeClash:{types:t,events:e.filter(e=>e.field.type).map(e=>e.event.name)}}}function Xfe(e){return e.find(e=>e.field.description)?.field.description}function Zfe(e){return Ja(e.map(e=>(e.field.enumValues??[]).toSorted().join(` `))).length===1&&e[0]?.field.enumValues?[...e[0].field.enumValues]:void 0}function Qfe(e){let t=new Map;for(let n of e)for(let e of n.payloadFields){let r=t.get(e.path);r?r.push({event:n,field:e}):t.set(e.path,[{event:n,field:e}])}return Array.from(t.entries()).map(([t,n])=>{let{type:r,typeClash:i}=Yfe(n),a=Xfe(n),o=Zfe(n);return{path:t,...a?{description:a}:{},...r?{type:r}:{},...o?{enumValues:o}:{},...i?{typeClash:i}:{},...n.length<e.length||n.some(e=>e.field.nullable)?{nullable:!0}:{},declaredBy:n.map(e=>e.event.name)}})}function c6(e,t){if(t.data.label)return t.data.label;if(t.data.type===`action`){let n=iJ(t.data.config,`actionType`);if(n){let t=Ny(e,n);if(t?.label)return t.label}return n||`Action`}return t.data.type===`lifecycle`?`Lifecycle`:`Node`}var l6=`Carried by every Event`,$fe=`Event name`;function epe(e){return Qfe(e).map(({declaredBy:t,...n})=>{let[r,i]=qa(e,e=>t.includes(e.name));return{...n,...i.length>0?{absentOn:i.map(e=>e.label)}:{},...e.length<2?{}:{sourceLabel:i.length===0?l6:r.map(e=>e.label).join(`, `)}}})}function u6(e){return Gfe({targetNodeId:e.targetNodeId,nodes:e.nodes,edges:e.edges,catalog:e.catalog})}function tpe(e,t){let n=Ny(e,t);return n?[...n.outputFields]:[]}function d6(e,t){let n=iJ(e.data.config,`actionType`);if(n){let r=tpe(t.catalog,n);if(r.length>0)return[...q$(e.data.config,r)]}return e.data.type===`lifecycle`?epe(u6(t)):[]}function f6(e){let{currentNodeId:t,nodes:n,edges:r}=e;if(!t)return[];let i=t6(t,r);return n.filter(e=>i.has(e.id))}function npe(e){let{currentNodeId:t,nodes:n,edges:r,catalog:i}=e;return t?f6(e).flatMap(e=>{let a=c6(i,e);return d6(e,{targetNodeId:t,nodes:n,edges:r,catalog:i}).map(({sourceLabel:t,...n})=>({...n,sourceNodeId:e.id,sourceNodeName:t??a}))}):[]}function p6(e){return e.type===`timestamp`?`timestamp`:e.type===`string`||e.type===`number`||e.type===`boolean`?e.type:e.type===`duration`||e.type===void 0?`string`:null}function rpe(e,t){let n=My(e,t);return n?Ga(n.payloadFields.map(e=>{let r=e.path.trim(),i=p6({...e,sourceNodeId:t,sourceNodeName:n.label});return r&&i?{path:r,label:r,type:i,sourceNodeId:t,sourceNodeLabel:n.label,sourceNodeLabels:[n.label],...e.nullable?{nullable:!0}:{},...e.enumValues?{enumValues:e.enumValues}:{}}:null})).toSorted((e,t)=>e.path.localeCompare(t.path)):[]}function ipe(e){let{currentNodeId:t,nodes:n,edges:r,catalog:i}=e,a=f6(e).find(e=>e.data.type===`lifecycle`);if(!(a&&t))return[];let o=u6({targetNodeId:t,nodes:n,edges:r,catalog:i});return o.length<2?[]:[{path:ule,label:$fe,type:`string`,sourceNodeId:a.id,sourceNodeLabel:l6,sourceNodeLabels:[l6],enumValues:o.map(e=>e.name)}]}function m6(e){let t=new Map(ipe(e).map(e=>[e.path,e]));for(let n of npe(e)){let e=n.path.trim();if(!e||n.typeClash)continue;let r=p6(n);if(!r)continue;let i=t.get(e);if(i){i.sourceNodeLabels.includes(n.sourceNodeName)||(i.sourceNodeLabels.push(n.sourceNodeName),i.sourceNodeLabels.sort((e,t)=>e.localeCompare(t)));continue}t.set(e,{path:e,label:e,type:r,sourceNodeId:n.sourceNodeId,sourceNodeLabel:n.sourceNodeName,sourceNodeLabels:[n.sourceNodeName],...n.nullable?{nullable:!0}:{},...n.enumValues?{enumValues:n.enumValues}:{}})}return Array.from(t.values()).toSorted((e,t)=>e.path.localeCompare(t.path))}function ape(e,t,n){return!(t&&e.type)||n.allowNumber&&e.type===`number`?!0:e.type===t}function h6(e,t){return ape(e,t,{allowNumber:!1})}function ope(e,t,n){return n?2:t&&!e.type?1:0}function spe(e,t){let n=e.typeClash;if(n&&!(t&&!n.types.some(e=>h6({type:e},t))))return`${n.events.join(` and `)} type this differently. Add an Event Split above this node to use it.`}function g6(e){let t=(0,X.c)(45),{isOpen:n,position:r,onSelect:i,onClose:a,currentNodeId:o,filter:s,fieldType:c}=e,l=s===void 0?``:s,u=vy(),[d]=pA(e4),[f]=pA(t4),[p,m]=(0,J.useState)(0),h=(0,J.useRef)(null),g;t[0]!==o||t[1]!==f||t[2]!==d?(g=f6({currentNodeId:o,nodes:d,edges:f}),t[0]=o,t[1]=f,t[2]=d,t[3]=g):g=t[3];let _=g,v;bb0:{if(!o){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[4]=e):e=t[4],v=e;break bb0}let e;if(t[5]!==u||t[6]!==o||t[7]!==f||t[8]!==c||t[9]!==d||t[10]!==_){let n=[];for(let e of _){let t=c6(u,e),r=d6(e,{targetNodeId:o,nodes:d,edges:f,catalog:u});!c&&e.data.type!==`lifecycle`&&r.length&&n.push({type:`node`,rank:0,nodeId:e.id,nodeName:t,template:Q$({nodeId:e.id,nodeLabel:t})});for(let i of r){let r=spe(i,c);(r||h6(i,c))&&n.push({type:`field`,rank:ope(i,c,r),nodeId:e.id,nodeName:t,field:i.path,description:i.description,template:Q$({nodeId:e.id,nodeLabel:t,fieldPath:i.path}),...r?{unusable:r}:{},...i.absentOn?.length?{absentOn:i.absentOn}:{}})}}e=n.toSorted(lpe),t[5]=u,t[6]=o,t[7]=f,t[8]=c,t[9]=d,t[10]=_,t[11]=e}else e=t[11];v=e}let y=v,b;if(t[12]!==l||t[13]!==y){bb1:{let e=l.trim().toLowerCase();if(!e){b=y;break bb1}b=y.filter(t=>t.nodeName.toLowerCase().includes(e)||t.field&&t.field.toLowerCase().includes(e))}t[12]=l,t[13]=y,t[14]=b}else b=t[14];let x=b,S=x.length===0?0:Math.min(p,x.length-1),C=c&&y.length===0?c===`duration`?`No field upstream is a duration. Type a value like 24h.`:`No field upstream is a date and time. Type one, like 2026-03-10T09:00:00Z.`:null,w=x.length>0||C!==null,T;t[15]!==x||t[16]!==a||t[17]!==i||t[18]!==S?(T=e=>{bb87:switch(e.key){case`ArrowDown`:e.preventDefault(),m(e=>e<x.length-1?e+1:e);break bb87;case`ArrowUp`:e.preventDefault(),m(cpe);break bb87;case`Enter`:{e.preventDefault();let t=x[S];t&&!t.unusable&&i(t.template);break bb87}case`Escape`:e.preventDefault(),a()}},t[15]=x,t[16]=a,t[17]=i,t[18]=S,t[19]=T):T=t[19];let E=T,D=n&&w,O;t[20]===D?O=t[21]:(O={enabled:D},t[20]=D,t[21]=O),aq(window,`keydown`,E,O);let k;if(t[22]===S?k=t[23]:(k=()=>{let e=h.current?.children.item(S);e instanceof HTMLElement&&e.scrollIntoView({block:`nearest`})},t[22]=S,t[23]=k),oq(S,k),!(n&&w)||typeof document>`u`)return null;let A=Math.min(r.top,window.innerHeight-300),j=Math.min(r.left,window.innerWidth-320),M;t[24]!==j||t[25]!==A?(M={top:A,left:j},t[24]=j,t[25]=A,t[26]=M):M=t[26];let N=M,P=`${N.top}px`,F=`${N.left}px`,I;t[27]!==P||t[28]!==F?(I={top:P,left:F},t[27]=P,t[28]=F,t[29]=I):I=t[29];let L;t[30]===C?L=t[31]:(L=C&&(0,Y.jsx)(`div`,{className:`px-2 py-1.5 text-muted-foreground text-sm`,children:C}),t[30]=C,t[31]=L);let R;if(t[32]!==x||t[33]!==i||t[34]!==S){let e;t[36]!==i||t[37]!==S?(e=(e,t)=>(0,Y.jsxs)(`div`,{className:Q(`flex items-center justify-between rounded px-2 py-1.5 text-sm transition-colors`,e.unusable?`cursor-not-allowed opacity-60`:`cursor-pointer`,t===S?`bg-accent text-accent-foreground`:!e.unusable&&`hover:bg-accent/50`),onMouseDown:t=>{t.preventDefault(),e.unusable||i(e.template)},onMouseEnter:()=>m(t),children:[(0,Y.jsxs)(`div`,{className:`flex-1`,children:[(0,Y.jsx)(`div`,{className:`font-medium`,children:e.type===`node`?e.nodeName:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.nodeName,`.`]}),e.field]})}),e.description&&(0,Y.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.description}),e.absentOn&&(0,Y.jsxs)(`div`,{className:`text-warning text-xs dark:text-warning`,children:[`Absent on `,e.absentOn.join(`, `)]}),e.unusable&&(0,Y.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.unusable})]}),t===S&&!e.unusable&&(0,Y.jsx)(Tv,{className:`size-4`})]},`${e.nodeId}-${e.field||`root`}`),t[36]=i,t[37]=S,t[38]=e):e=t[38],R=x.map(e),t[32]=x,t[33]=i,t[34]=S,t[35]=R}else R=t[35];let z;t[39]!==L||t[40]!==R?(z=(0,Y.jsxs)(`div`,{className:`max-h-60 overflow-y-auto`,ref:h,children:[L,R]}),t[39]=L,t[40]=R,t[41]=z):z=t[41];let B;return t[42]!==I||t[43]!==z?(B=(0,Zi.createPortal)((0,Y.jsx)(`div`,{className:`fixed z-50 w-80 rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,style:I,children:z}),document.body),t[42]=I,t[43]=z,t[44]=B):B=t[44],B}function cpe(e){return e>0?e-1:e}function lpe(e,t){return e.rank-t.rank}var _6=`data-placeholder`,v6=`data-filler`,upe=`inline-flex items-center gap-1 rounded bg-info/10 px-1.5 py-0.5 text-info font-mono text-xs border border-info/20 mx-0.5`,dpe=`inline-flex items-center gap-1 rounded bg-destructive/10 px-1.5 py-0.5 text-destructive font-mono text-xs border border-destructive/20 mx-0.5`;function fpe(e,t,n){let r=e.fieldPath?`${e.nodeLabel}.${e.fieldPath}`:e.nodeLabel,i=t.find(t=>t.id===e.nodeId);if(!i)return r;let a=i.data.label;if(!a&&i.data.type===`action`){let e=iJ(i.data.config,`actionType`);e&&(a=Ny(n,e)?.label)}return a?e.fieldPath?`${a}.${e.fieldPath}`:a:r}function ppe(e){return e instanceof HTMLElement?e.getAttribute(`data-template`):null}function y6(e){return e.start+e.text.length}function b6(e,t){let n=[],r=0;function i(e){n.push(e),r+=e.text.length}function a(e){if(e instanceof Text){i({kind:`text`,node:e,start:r,text:e.data});return}if(!(e instanceof HTMLElement))return;let n=ppe(e);if(n!==null){i({kind:`badge`,node:e,start:r,text:n});return}if(!(e.hasAttribute(_6)||e.hasAttribute(v6))){if(e.tagName===`BR`){i({kind:`break`,node:e,start:r,text:t?`
|
|
58
|
+
`:``});return}for(let t of Array.from(e.childNodes))a(t)}}for(let t of Array.from(e.childNodes))a(t);return n}function x6(e,t){return b6(e,t).map(e=>e.text).join(``)}function mpe(e,t){let{catalog:n}=t,r=t.multiline??!1,i={focused:!1,nodes:[]};function a(e){let t=e.at(-1);return t?y6(t):0}function o(e,t,n){let r=e.find(e=>e.kind===`text`&&e.node===t);if(r)return r.start+Math.min(n,r.text.length);let i=e.find(e=>e.kind!==`text`&&e.node.contains(t));if(i)return n===0?i.start:y6(i);if(t instanceof HTMLElement){let r=Array.from(t.childNodes);for(let t of r.slice(n)){let n=e.find(e=>e.node===t||t.contains(e.node));if(n)return n.start}let i=e.findLast(e=>t.contains(e.node));return i?y6(i):a(e)}return a(e)}function s(e,t,n){let r=e.find(e=>e.kind===`badge`&&(t===`start`?e.start:y6(e))===n);return r?{end:y6(r),start:r.start}:null}function c(){let t=window.getSelection();if(!t||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e.contains(n.endContainer))return null;let i=b6(e,r),a=o(i,n.endContainer,n.endOffset);return{badgeAfter:s(i,`start`,a),badgeBefore:s(i,`end`,a),collapsed:n.collapsed,offset:a}}function l(){document.activeElement!==e&&e.focus()}function u(e,t){let n=e.find(e=>e.kind===`badge`&&t>e.start&&t<y6(e));if(n)return u(e,n.start);let r=e.findLast(e=>e.kind===`text`&&e.start<=t&&t<=y6(e));return r?.kind===`text`?{node:r.node,offset:t-r.start}:null}function d(t){let n=b6(e,r),i=u(n,Math.max(0,Math.min(t,a(n))));if(!i){l();return}let o=document.createRange(),s=window.getSelection();try{o.setStart(i.node,i.offset),o.collapse(!0),s?.removeAllRanges(),s?.addRange(o),l()}catch{l()}}function f(){e.appendChild(document.createTextNode(``))}function p(t){if(!r){e.appendChild(document.createTextNode(t));return}let n=t.split(`
|
|
59
|
+
`);n.forEach((t,r)=>{t&&e.appendChild(document.createTextNode(t)),r<n.length-1&&(f(),e.appendChild(document.createElement(`br`)),f())})}function m(t,r){i=r;let a=r.focused?r.caretOffset??c()?.offset??null:null;if(e.innerHTML=``,!(t||r.focused)){let t=document.createElement(`span`);t.setAttribute(_6,``),t.className=`text-muted-foreground pointer-events-none`,t.textContent=r.placeholder??``,e.appendChild(t);return}for(let i of Z$(t)){if(i.kind===`literal`){p(i.text);continue}let t=document.createElement(`span`);t.className=r.nodes.some(e=>e.id===i.token.nodeId)?upe:dpe,t.contentEditable=`false`,t.setAttribute(`data-template`,i.token.raw),t.textContent=fpe(i.token,r.nodes,n),f(),e.appendChild(t),f()}if(!t){let t=document.createElement(`br`);t.setAttribute(v6,``),f(),e.appendChild(t)}r.focused&&a!==null&&d(a)}return{render:m,rerender(t){m(x6(e,r),{...i,nodes:t,caretOffset:void 0})},readText:()=>x6(e,r),readCaret:c,setCaretOffset:d,insertText(e){let t=window.getSelection();if(!t||t.rangeCount===0)return!1;let n=t.getRangeAt(0);n.deleteContents();let r=document.createTextNode(e);return n.insertNode(r),n.setStartAfter(r),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!0},insertLineBreak(){let e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.getRangeAt(0);t.deleteContents();let n=document.createElement(`br`),r=document.createTextNode(``);return t.insertNode(n),n.parentNode?.insertBefore(r,n.nextSibling),n.parentNode?.insertBefore(document.createTextNode(``),n),t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!0}}}function S6(e){let t=(0,X.c)(52),{value:n,onChange:r,placeholder:i,multiline:a}=e,o=vy(),s=dA(e4),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(n),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={top:0,left:0},t[0]=h):h=t[0];let[g,_]=(0,J.useState)(h),[v,y]=(0,J.useState)(``),[b,x]=(0,J.useState)(null),S;t[1]!==o||t[2]!==a?(S=e=>{if(c.current=e,!e){l.current=null;return}l.current=mpe(e,{multiline:a,catalog:o})},t[1]=o,t[2]=a,t[3]=S):S=t[3];let C=S,w;t[4]!==d||t[5]!==s||t[6]!==i||t[7]!==n?(w=()=>{d||l.current?.render(n,{focused:!1,nodes:s,placeholder:i})},t[4]=d,t[5]=s,t[6]=i,t[7]=n,t[8]=w):w=t[8],oq(d?C6:n,w);let T;t[9]!==d||t[10]!==s?(T=()=>{d||l.current?.rerender(s)},t[9]=d,t[10]=s,t[11]=T):T=t[11],oq(d?C6:s,T);let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{let n=e.slice(0,t),r=n.lastIndexOf(`@`),i=r===-1?null:n.slice(r+1),a=X$(e).some(e=>r>=e.start&&r<e.end);if(i===null||a||i.includes(` `)){m(!1);return}y(i),x(r);let o=c.current?.getBoundingClientRect();o&&_({top:o.bottom+window.scrollY+4,left:o.left+window.scrollX}),m(!0)},t[12]=E):E=t[12];let D=E,O;t[13]!==s||t[14]!==r||t[15]!==i?(O=()=>{let e=l.current;if(!e)return;let t=e.readText();if(t===u.current)return;let n=X$(u.current).length,a=X$(t).length;if(u.current=t,r?.(t),n===a){D(t,e.readCaret()?.offset??t.length);return}m(!1),e.render(t,{focused:!0,nodes:s,placeholder:i})},t[13]=s,t[14]=r,t[15]=i,t[16]=O):O=t[16];let k=O,A;t[17]!==b||t[18]!==v||t[19]!==s||t[20]!==r||t[21]!==i?(A=e=>{let t=l.current;if(!t||b===null)return;let n=t.readText(),a=n.slice(0,b),o=n.slice(b+1+v.length),c=a+e+o;u.current=c,r?.(c),m(!1),x(null),f(!0),t.render(c,{caretOffset:a.length+e.length,focused:!0,nodes:s,placeholder:i})},t[17]=b,t[18]=v,t[19]=s,t[20]=r,t[21]=i,t[22]=A):A=t[22];let j=A,M;t[23]!==s||t[24]!==i||t[25]!==n?(M=()=>{f(!0);let e=l.current?.readText()??n;u.current=e,e||l.current?.render(``,{focused:!0,nodes:s,placeholder:i})},t[23]=s,t[24]=i,t[25]=n,t[26]=M):M=t[26];let N=M,P;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{setTimeout(()=>{document.activeElement!==c.current&&(f(!1),m(!1))},hpe)},t[27]=P):P=t[27];let F=P,I;t[28]===k?I=t[29]:(I=e=>{e.preventDefault(),l.current?.insertText(e.clipboardData.getData(`text/plain`))&&k()},t[28]=k,t[29]=I);let L=I,R;t[30]===k?R=t[31]:(R=()=>{l.current?.insertLineBreak()&&k()},t[30]=k,t[31]=R);let z=R,B;t[32]!==s||t[33]!==r||t[34]!==i?(B=e=>{let t=l.current;if(!t)return;let n=t.readText(),a=n.slice(0,e.start)+n.slice(e.end);u.current=a,r?.(a),m(!1),t.render(a,{caretOffset:e.start,focused:!0,nodes:s,placeholder:i})},t[32]=s,t[33]=r,t[34]=i,t[35]=B):B=t[35];let V=B,H;t[36]!==z||t[37]!==a||t[38]!==V?(H=e=>{let t=l.current;if(!t)return;if(a&&e.key===`Enter`){e.preventDefault(),z();return}if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=e.key===`Backspace`||e.key===`ArrowLeft`,r=e.key===`Delete`||e.key===`ArrowRight`;if(!(n||r))return;let i=t.readCaret();if(!i?.collapsed)return;let o=n?i.badgeBefore:i.badgeAfter;o&&(e.preventDefault(),e.key===`ArrowLeft`?t.setCaretOffset(o.start):e.key===`ArrowRight`?t.setCaretOffset(o.end):V(o))},t[36]=z,t[37]=a,t[38]=V,t[39]=H):H=t[39];let U=H,W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>m(!1),t[40]=W):W=t[40];let G;return t[41]!==C||t[42]!==v||t[43]!==g||t[44]!==j||t[45]!==N||t[46]!==k||t[47]!==U||t[48]!==L||t[49]!==s||t[50]!==p?(G={attachEditor:C,autocompleteFilter:v,autocompletePosition:g,handleBlur:F,handleFocus:N,handleInput:k,handleAutocompleteSelect:j,handleKeyDown:U,handlePaste:L,closeAutocomplete:W,nodes:s,showAutocomplete:p},t[41]=C,t[42]=v,t[43]=g,t[44]=j,t[45]=N,t[46]=k,t[47]=U,t[48]=L,t[49]=s,t[50]=p,t[51]=G):G=t[51],G}var C6=Symbol(`focused`),hpe=200;function w6(e){let t=(0,X.c)(38),{value:n,onChange:r,placeholder:i,disabled:a,className:o,id:s,fieldType:c,currentNodeId:l,labelledBy:u,ariaLabel:d,required:f,invalid:p}=e,m=n===void 0?``:n,h;t[0]!==r||t[1]!==i||t[2]!==m?(h={value:m,onChange:r,placeholder:i},t[0]=r,t[1]=i,t[2]=m,t[3]=h):h=t[3];let{attachEditor:g,autocompleteFilter:_,autocompletePosition:v,closeAutocomplete:y,handleAutocompleteSelect:b,handleBlur:x,handleFocus:S,handleInput:C,handleKeyDown:w,handlePaste:T,nodes:E,showAutocomplete:D}=S6(h),O;t[4]===E?O=t[5]:(O=E.find(gpe)?.id,t[4]=E,t[5]=O);let k=O,A=p&&`border-destructive focus-within:border-destructive focus-within:ring-destructive/20`,j=a&&`cursor-not-allowed opacity-50`,M;t[6]!==o||t[7]!==A||t[8]!==j?(M=Q(`flex min-h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-colors focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/50 lg:text-sm`,A,j,o),t[6]=o,t[7]=A,t[8]=j,t[9]=M):M=t[9];let N=p||void 0,P=p||void 0,F=f||void 0,I=!a,L;t[10]!==d||t[11]!==g||t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==w||t[16]!==T||t[17]!==s||t[18]!==u||t[19]!==I||t[20]!==P||t[21]!==F?(L=(0,Y.jsx)(`div`,{"aria-invalid":P,"aria-label":d,"aria-labelledby":u,"aria-required":F,className:`w-full outline-none`,contentEditable:I,id:s,onBlur:x,onFocus:S,onInput:C,onKeyDown:w,onPaste:T,ref:g,role:`textbox`,suppressContentEditableWarning:!0}),t[10]=d,t[11]=g,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=s,t[18]=u,t[19]=I,t[20]=P,t[21]=F,t[22]=L):L=t[22];let R;t[23]!==L||t[24]!==M||t[25]!==N?(R=(0,Y.jsx)(`div`,{className:M,"data-invalid":N,children:L}),t[23]=L,t[24]=M,t[25]=N,t[26]=R):R=t[26];let z=l??k??void 0,B;t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==c||t[31]!==b||t[32]!==D||t[33]!==z?(B=(0,Y.jsx)(g6,{currentNodeId:z,fieldType:c,filter:_,isOpen:D,onClose:y,onSelect:b,position:v}),t[27]=_,t[28]=v,t[29]=y,t[30]=c,t[31]=b,t[32]=D,t[33]=z,t[34]=B):B=t[34];let V;return t[35]!==R||t[36]!==B?(V=(0,Y.jsxs)(Y.Fragment,{children:[R,B]}),t[35]=R,t[36]=B,t[37]=V):V=t[37],V}function gpe(e){return e.selected}var T6=[{label:`North America`,zones:[{value:`America/New_York`,label:`Eastern Time (ET)`},{value:`America/Chicago`,label:`Central Time (CT)`},{value:`America/Denver`,label:`Mountain Time (MT)`},{value:`America/Phoenix`,label:`Arizona Time (MST)`},{value:`America/Los_Angeles`,label:`Pacific Time (PT)`},{value:`America/Anchorage`,label:`Alaska Time (AKT)`},{value:`Pacific/Honolulu`,label:`Hawaii Time (HST)`},{value:`America/Toronto`,label:`Toronto`},{value:`America/Vancouver`,label:`Vancouver`}]},{label:`Europe`,zones:[{value:`Europe/London`,label:`London (GMT/BST)`},{value:`Europe/Paris`,label:`Paris (CET/CEST)`},{value:`Europe/Berlin`,label:`Berlin (CET/CEST)`},{value:`Europe/Rome`,label:`Rome (CET/CEST)`},{value:`Europe/Madrid`,label:`Madrid (CET/CEST)`},{value:`Europe/Amsterdam`,label:`Amsterdam (CET/CEST)`},{value:`Europe/Brussels`,label:`Brussels (CET/CEST)`},{value:`Europe/Stockholm`,label:`Stockholm (CET/CEST)`},{value:`Europe/Warsaw`,label:`Warsaw (CET/CEST)`},{value:`Europe/Athens`,label:`Athens (EET/EEST)`},{value:`Europe/Moscow`,label:`Moscow (MSK)`}]},{label:`Asia`,zones:[{value:`Asia/Dubai`,label:`Dubai (GST)`},{value:`Asia/Kolkata`,label:`India (IST)`},{value:`Asia/Shanghai`,label:`China (CST)`},{value:`Asia/Hong_Kong`,label:`Hong Kong (HKT)`},{value:`Asia/Tokyo`,label:`Tokyo (JST)`},{value:`Asia/Seoul`,label:`Seoul (KST)`},{value:`Asia/Singapore`,label:`Singapore (SGT)`},{value:`Asia/Bangkok`,label:`Bangkok (ICT)`},{value:`Asia/Jakarta`,label:`Jakarta (WIB)`}]},{label:`Australia & Pacific`,zones:[{value:`Australia/Sydney`,label:`Sydney (AEDT/AEST)`},{value:`Australia/Melbourne`,label:`Melbourne (AEDT/AEST)`},{value:`Australia/Brisbane`,label:`Brisbane (AEST)`},{value:`Australia/Perth`,label:`Perth (AWST)`},{value:`Pacific/Auckland`,label:`Auckland (NZDT/NZST)`}]},{label:`South America`,zones:[{value:`America/Sao_Paulo`,label:`São Paulo (BRT)`},{value:`America/Argentina/Buenos_Aires`,label:`Buenos Aires (ART)`},{value:`America/Santiago`,label:`Santiago (CLT)`},{value:`America/Bogota`,label:`Bogotá (COT)`},{value:`America/Lima`,label:`Lima (PET)`}]},{label:`Africa & Middle East`,zones:[{value:`Africa/Cairo`,label:`Cairo (EET)`},{value:`Africa/Johannesburg`,label:`Johannesburg (SAST)`},{value:`Africa/Lagos`,label:`Lagos (WAT)`},{value:`Africa/Nairobi`,label:`Nairobi (EAT)`},{value:`Asia/Jerusalem`,label:`Jerusalem (IST)`}]},{label:`Other`,zones:[{value:`UTC`,label:`UTC (Coordinated Universal Time)`}]}];function _pe(e){let t=(0,X.c)(12),{value:n,onValueChange:r,disabled:i,id:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=T6.flatMap(bpe),t[0]=o):o=t[0];let s;t[1]===r?s=t[2]:(s=e6(r),t[1]=r,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(X3,{placeholder:`Select timezone`}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l=(0,Y.jsx)(Z3,{className:`w-full`,id:a,children:c}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(Q3,{children:T6.map(vpe)}),t[6]=u):u=t[6];let d;return t[7]!==i||t[8]!==s||t[9]!==l||t[10]!==n?(d=(0,Y.jsxs)(Y3,{disabled:i,items:o,onValueChange:s,value:n,children:[l,u]}),t[7]=i,t[8]=s,t[9]=l,t[10]=n,t[11]=d):d=t[11],d}function vpe(e){return(0,Y.jsxs)(Nfe,{children:[(0,Y.jsx)(Pfe,{children:e.label}),e.zones.map(ype)]},e.label)}function ype(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function bpe(e){return e.zones}var E6=J.createContext(void 0);function D6(e){let t=J.useContext(E6);if(t===void 0&&!e)throw Error(Rg(72));return t}var xpe={...aW,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Spe=class extends AU{constructor(e,t,n){let r=new XU;super(Cpe(e,r,t,n),wpe(r),xpe)}setOpen=(e,t)=>{WU(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,tz(LR,e))}};function Cpe(e,t,n,r=!1){let i={...QU(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=$U(t,n,r),i}function wpe(e){return{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Tpe=xU(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=zU((e,t)=>new Spe({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),KU(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=qU(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=J.useRef(null);Tg(()=>{m&&t&&p.setOpen(!1,tz(Oce))},[m,t,p]),Tg(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Tg(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),J.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,tz($R))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,Y.jsxs)(E6.Provider,{value:p,children:[l&&(0,Y.jsx)(BU,{handle:l,store:p}),T&&(0,Y.jsx)(Epe,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Epe({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=pH(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=uH(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=J.useMemo(()=>Og(a.reference,i.reference),[a.reference,i.reference]);return JU(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??Qg}),null}var O6=J.createContext(void 0);function Dpe(){return J.useContext(O6)}var k6=`data-base-ui-tooltip-trigger`;function A6(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(ig(n))return n}}let t=e.target;return ig(t)?t:null}function Ope(e){let t=e;for(;t;){let e=t.closest(`[${k6}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&ig(n.host)?n.host:null}return null}var kpe=SU(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=D6(!0),m=oW(a)??p;if(!m)throw Error(Rg(82));let h=oz(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=J.useRef(null),b=c??600,x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=GU(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=Dpe(),{delayRef:T,isInstantPhase:E,hasProvider:D}=Kz(v,{open:_}),O=gW(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=Yz(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=J.useRef(!1),F=fz(),I=J.useRef(void 0);function L(){return D?zz(T.current,`open`)===0?0:c??w??600:b}function R(e){let t=y.current;if(!t||!e)return!1;let n=Ope(e);return n!==null&&n!==t&&Az(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=yW(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?IW():null,restMs:L,delay(){return u==null&&D?{close:zz(T.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),V=dW(v,{enabled:!A}).reference,H=e=>{let t=P.current,n=A6(e),r=z(n),i=y.current,a=i&&n&&Az(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,tz(RR,e));return}if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&Ez(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,tz(RR,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},U=m.useState(`triggerProps`,C);return e_(`button`,e,{state:{open:_},ref:[t,S,y],props:[B,V,C||M!==`none`?U:void 0,{onMouseOver(e){H(e.nativeEvent)},onFocus(e){R(A6(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":A?``:void 0,[k6]:A?void 0:``},f],stateAttributesMapping:AR})}),j6=J.createContext(void 0);function Ape(){let e=J.useContext(j6);if(e===void 0)throw Error(Rg(70));return e}var jpe=J.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=BV({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Y.jsxs)(J.Fragment,{children:[l,c&&Zi.createPortal(n,c)]})}),Mpe=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return D6().useState(`mounted`)||n?(0,Y.jsx)(j6.Provider,{value:n,children:(0,Y.jsx)(jpe,{ref:t,...r})}):null}),M6=J.createContext(void 0);function N6(){let e=J.useContext(M6);if(e===void 0)throw Error(Rg(71));return e}var Npe=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=FV,style:g,..._}=e,v=D6(),y=Ape(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=E3({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=N3(e,J.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Y.jsx)(M6.Provider,{value:D,children:O})}),Ppe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=D6(),{side:s,align:c}=N6(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);IU({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),_W(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return e_(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[LU,f,M3(d),a],stateAttributesMapping:NR})}),Fpe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=D6(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=N6();return e_(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:MR})}),Ipe=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=J.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Y.jsx)(O6.Provider,{value:t,children:(0,Y.jsx)(Gz,{delay:i,timeoutMs:r,children:e.children})})};function P6(e){let t=(0,X.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delay:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,Y.jsx)(Ipe,{"data-slot":`tooltip-provider`,delay:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function F6(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Tpe,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function I6(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(kpe,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function L6(e){let t=(0,X.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`top`:a,u=o===void 0?4:o,d=s===void 0?`center`:s,f=c===void 0?0:c,p;t[8]===r?p=t[9]:(p=Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[8]=r,t[9]=p);let m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(Fpe,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`}),t[10]=m):m=t[10];let h;t[11]!==n||t[12]!==i||t[13]!==p?(h=(0,Y.jsxs)(Ppe,{"data-slot":`tooltip-content`,className:p,...i,children:[n,m]}),t[11]=n,t[12]=i,t[13]=p,t[14]=h):h=t[14];let g;return t[15]!==d||t[16]!==f||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,Y.jsx)(Mpe,{children:(0,Y.jsx)(Npe,{align:d,alignOffset:f,side:l,sideOffset:u,className:`isolate z-50`,children:h})}),t[15]=d,t[16]=f,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}var Lpe=[];function R6(e){let t=(0,X.c)(5),n=vy(),r=dA(e4),i=dA(t4),a;return t[0]!==n||t[1]!==i||t[2]!==e||t[3]!==r?(a=e?u6({targetNodeId:e,nodes:r,edges:i,catalog:n}):Lpe,t[0]=n,t[1]=i,t[2]=e,t[3]=r,t[4]=a):a=t[4],a}function Rpe(e){let t=(0,X.c)(40),{value:n,onChange:r,placeholder:i,disabled:a,className:o,id:s,rows:c,fieldType:l,labelledBy:u,required:d,invalid:f}=e,p=n===void 0?``:n,m=c===void 0?3:c,h;t[0]!==r||t[1]!==i||t[2]!==p?(h={value:p,onChange:r,placeholder:i,multiline:!0},t[0]=r,t[1]=i,t[2]=p,t[3]=h):h=t[3];let{attachEditor:g,autocompleteFilter:_,autocompletePosition:v,closeAutocomplete:y,handleAutocompleteSelect:b,handleBlur:x,handleFocus:S,handleInput:C,handleKeyDown:w,handlePaste:T,nodes:E,showAutocomplete:D}=S6(h),O;t[4]===E?O=t[5]:(O=E.find(zpe)?.id,t[4]=E,t[5]=O);let k=O,A=f&&`border-destructive focus-within:border-destructive focus-within:ring-destructive/20`,j=a&&`cursor-not-allowed opacity-50`,M;t[6]!==o||t[7]!==A||t[8]!==j?(M=Q(`flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-colors focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/50 lg:text-sm`,A,j,o),t[6]=o,t[7]=A,t[8]=j,t[9]=M):M=t[9];let N=f||void 0,P=`${m*1.5}rem`,F;t[10]===P?F=t[11]:(F={minHeight:P},t[10]=P,t[11]=F);let I=f||void 0,L=d||void 0,R=!a,z;t[12]!==g||t[13]!==x||t[14]!==S||t[15]!==C||t[16]!==w||t[17]!==T||t[18]!==s||t[19]!==u||t[20]!==I||t[21]!==L||t[22]!==R?(z=(0,Y.jsx)(`div`,{"aria-invalid":I,"aria-labelledby":u,"aria-required":L,className:`w-full whitespace-pre-wrap break-words outline-none`,contentEditable:R,id:s,onBlur:x,onFocus:S,onInput:C,onKeyDown:w,onPaste:T,ref:g,role:`textbox`,suppressContentEditableWarning:!0}),t[12]=g,t[13]=x,t[14]=S,t[15]=C,t[16]=w,t[17]=T,t[18]=s,t[19]=u,t[20]=I,t[21]=L,t[22]=R,t[23]=z):z=t[23];let B;t[24]!==F||t[25]!==z||t[26]!==M||t[27]!==N?(B=(0,Y.jsx)(`div`,{className:M,"data-invalid":N,style:F,children:z}),t[24]=F,t[25]=z,t[26]=M,t[27]=N,t[28]=B):B=t[28];let V=k||void 0,H;t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==l||t[33]!==b||t[34]!==D||t[35]!==V?(H=(0,Y.jsx)(g6,{currentNodeId:V,fieldType:l,filter:_,isOpen:D,onClose:y,onSelect:b,position:v}),t[29]=_,t[30]=v,t[31]=y,t[32]=l,t[33]=b,t[34]=D,t[35]=V,t[36]=H):H=t[36];let U;return t[37]!==B||t[38]!==H?(U=(0,Y.jsxs)(Y.Fragment,{children:[B,H]}),t[37]=B,t[38]=H,t[39]=U):U=t[39],U}function zpe(e){return e.selected}function Bpe(e){let t=(0,X.c)(8),{field:n,value:r,onChange:i,disabled:a}=e,o=n.label?`${n.key}-label`:void 0,s=typeof r==`string`?r:``,c;return t[0]!==a||t[1]!==n.key||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,Y.jsx)(w6,{disabled:a,id:n.key,labelledBy:o,onChange:i,placeholder:n.placeholder,required:n.required,value:s}),t[0]=a,t[1]=n.key,t[2]=n.placeholder,t[3]=n.required,t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Vpe(e){let t=(0,X.c)(9),{field:n,value:r,onChange:i,disabled:a}=e,o=n.label?`${n.key}-label`:void 0,s=n.rows||4,c=typeof r==`string`?r:``,l;return t[0]!==a||t[1]!==n.key||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==i||t[5]!==o||t[6]!==s||t[7]!==c?(l=(0,Y.jsx)(Rpe,{disabled:a,id:n.key,labelledBy:o,onChange:i,placeholder:n.placeholder,required:n.required,rows:s,value:c}),t[0]=a,t[1]=n.key,t[2]=n.placeholder,t[3]=n.required,t[4]=i,t[5]=o,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Hpe(e){let t=(0,X.c)(8),{field:n,value:r,onChange:i,disabled:a}=e,o;t[0]===i?o=t[1]:(o=e=>i(e.target.value),t[0]=i,t[1]=o);let s=typeof r==`string`?r:``,c;return t[2]!==a||t[3]!==n.key||t[4]!==n.placeholder||t[5]!==o||t[6]!==s?(c=(0,Y.jsx)(B4,{disabled:a,id:n.key,onChange:o,placeholder:n.placeholder,value:s}),t[2]=a,t[3]=n.key,t[4]=n.placeholder,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Upe(e){let t=(0,X.c)(9),{field:n,value:r,onChange:i,disabled:a}=e,o=typeof r==`number`||typeof r==`string`?`${r}`:``,s;t[0]===i?s=t[1]:(s=e=>{let t=e.target.value.trim();if(!t){i(void 0);return}let n=Number.parseFloat(t);Number.isFinite(n)&&i(n)},t[0]=i,t[1]=s);let c;return t[2]!==a||t[3]!==o||t[4]!==n.key||t[5]!==n.min||t[6]!==n.placeholder||t[7]!==s?(c=(0,Y.jsx)(B4,{disabled:a,id:n.key,min:n.min,onChange:s,placeholder:n.placeholder,type:`number`,value:o}),t[2]=a,t[3]=o,t[4]=n.key,t[5]=n.min,t[6]=n.placeholder,t[7]=s,t[8]=c):c=t[8],c}function Wpe(e){let t=(0,X.c)(16),{field:n,value:r,onChange:i,disabled:a}=e;if(!n.options)return null;let o=n.options,s=typeof r==`string`?r:``,c;t[0]===n.placeholder?c=t[1]:(c=(0,Y.jsx)(X3,{placeholder:n.placeholder}),t[0]=n.placeholder,t[1]=c);let l;t[2]!==n.key||t[3]!==c?(l=(0,Y.jsx)(Z3,{className:`w-full`,id:n.key,children:c}),t[2]=n.key,t[3]=c,t[4]=l):l=t[4];let u;t[5]===n.options?u=t[6]:(u=n.options.map(Gpe),t[5]=n.options,t[6]=u);let d;t[7]===u?d=t[8]:(d=(0,Y.jsx)(Q3,{children:u}),t[7]=u,t[8]=d);let f;return t[9]!==a||t[10]!==n.options||t[11]!==i||t[12]!==s||t[13]!==l||t[14]!==d?(f=(0,Y.jsxs)(Y3,{disabled:a,items:o,onValueChange:i,value:s,children:[l,d]}),t[9]=a,t[10]=n.options,t[11]=i,t[12]=s,t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function Gpe(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}var Kpe=0;function z6(){return`kv-${++Kpe}`}function qpe(e){return typeof e!=`object`||!e||!(`name`in e&&`value`in e)?!1:typeof e.name==`string`&&typeof e.value==`string`}function Jpe(e){if(typeof e!=`string`||!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(qpe)}catch{}return[]}function Ype(e){let t=(0,X.c)(29),{value:n,onChange:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=()=>Jpe(n).map(Zpe),t[0]=n,t[1]=a);let[o,s]=(0,J.useState)(a),c;t[2]===r?c=t[3]:(c=function(e){s(e),r(JSON.stringify(e.map(Xpe)))},t[2]=r,t[3]=c);let l=c,u;t[4]!==o||t[5]!==l?(u=function(){l([...o,{name:``,value:``,_id:z6()}])},t[4]=o,t[5]=l,t[6]=u):u=t[6];let d=u,f;t[7]!==o||t[8]!==l?(f=function(e){l(o.filter(t=>t._id!==e))},t[7]=o,t[8]=l,t[9]=f):f=t[9];let p=f,m;t[10]!==o||t[11]!==l?(m=function(e,t,n){l(o.map(r=>r._id===e?{...r,[t]:n}:r))},t[10]=o,t[11]=l,t[12]=m):m=t[12];let h=m,g;if(t[13]!==i||t[14]!==p||t[15]!==o||t[16]!==h){let e;t[18]!==i||t[19]!==p||t[20]!==h?(e=e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(B4,{className:`flex-1`,disabled:i,onChange:t=>h(e._id,`name`,t.target.value),placeholder:`Name`,value:e.name}),(0,Y.jsx)(w6,{ariaLabel:`Value`,className:`flex-1`,disabled:i,onChange:t=>h(e._id,`value`,t??``),placeholder:`Value`,value:e.value}),(0,Y.jsx)(pv,{className:`size-8 shrink-0`,disabled:i,onClick:()=>p(e._id),size:`icon`,type:`button`,variant:`ghost`,children:(0,Y.jsx)(my,{className:`size-4`})})]},e._id),t[18]=i,t[19]=p,t[20]=h,t[21]=e):e=t[21],g=o.map(e),t[13]=i,t[14]=p,t[15]=o,t[16]=h,t[17]=g}else g=t[17];let _;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(oy,{className:`mr-1 size-3.5`}),t[22]=_):_=t[22];let v;t[23]!==d||t[24]!==i?(v=(0,Y.jsxs)(pv,{className:`h-8`,disabled:i,onClick:d,size:`sm`,type:`button`,variant:`outline`,children:[_,`Add`]}),t[23]=d,t[24]=i,t[25]=v):v=t[25];let y;return t[26]!==g||t[27]!==v?(y=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[g,v]}),t[26]=g,t[27]=v,t[28]=y):y=t[28],y}function Xpe(e){let{name:t,value:n}=e;return{name:t,value:n}}function Zpe(e){return{...e,_id:z6()}}var Qpe={"template-input":Bpe,"template-textarea":Vpe,text:Hpe,number:Upe,select:Wpe,"key-value":Ype};function B6(e,t,n,r){if(!K$(t,e.showWhen))return null;let i=t[e.key]??e.defaultValue??``,a=Qpe[e.type];return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.label&&(0,Y.jsxs)(V4,{className:`ml-1`,htmlFor:e.key,id:`${e.key}-label`,children:[e.label,e.required&&(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:`*`})]}),(0,Y.jsx)(a,{disabled:r,field:e,onChange:t=>n({[e.key]:t}),value:i})]},e.key)}function $pe(e){let t=(0,X.c)(19),{label:n,fields:r,config:i,onUpdateConfig:a,disabled:o,defaultExpanded:s}=e,[c,l]=(0,J.useState)(s!==void 0&&s),u;t[0]===c?u=t[1]:(u=()=>l(!c),t[0]=c,t[1]=u);let d;t[2]===n?d=t[3]:(d=(0,Y.jsx)(`span`,{className:`font-medium text-sm`,children:n}),t[2]=n,t[3]=d);let f=`size-3.5 text-muted-foreground transition-transform duration-200 ${c?``:`-rotate-90`}`,p;t[4]===f?p=t[5]:(p=(0,Y.jsx)(Ev,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==u||t[7]!==d||t[8]!==p?(m=(0,Y.jsxs)(`button`,{className:`ml-1 flex items-center gap-1 text-left`,onClick:u,type:`button`,children:[d,p]}),t[6]=u,t[7]=d,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==i||t[11]!==o||t[12]!==r||t[13]!==c||t[14]!==a?(h=c&&(0,Y.jsx)(`div`,{className:`ml-1 space-y-4 border-primary/50 border-l-2 py-2 pl-3`,children:r.map(e=>B6(e,i,a,o))}),t[10]=i,t[11]=o,t[12]=r,t[13]=c,t[14]=a,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function eme(e){let t=(0,X.c)(11),{fields:n,config:r,onUpdateConfig:i,disabled:a}=e,o;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i){let e;t[5]!==r||t[6]!==a||t[7]!==i?(e=e=>v2(e)?(0,Y.jsx)($pe,{config:r,defaultExpanded:e.defaultExpanded,disabled:a,fields:e.fields,label:e.label,onUpdateConfig:i},`group-${e.label}`):B6(e,r,i,a),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],o=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=(0,Y.jsx)(Y.Fragment,{children:o}),t[9]=o,t[10]=s),s}function tme(e){return MG(`alert-dialog`,e)}function nme(e,t,n,r,i,a,o,s,c,l=2){let u=LB(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return NB(n.current,u)?void 0:u}var V6=J.createContext(void 0),H6=J.createContext(void 0),U6=J.createContext(void 0),W6=J.createContext(!1),G6=J.createContext(``);function K6(){let e=J.useContext(V6);if(!e)throw Error(Rg(22));return e}function q6(){let e=J.useContext(H6);if(!e)throw Error(Rg(23));return e}function J6(){let e=J.useContext(U6);if(!e)throw Error(Rg(24));return e}function Y6(){return J.useContext(G6)}function rme(){return J.useContext(W6)}var X6={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?s3(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>t3(t,e,n)):t3(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function Z6(e){return e==null?void 0:`${e}-popup`}function ime(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Q6(e){return Array.isArray(e)?e.map(e=>Q6(e)).join(`,`):e==null?``:String(e)}var $6=new Map;function ame(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${Q6(e.locale)}|${JSON.stringify(t)}`,r=$6.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=c3(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=c3(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=c3(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return $6.set(n,a),a}var e8=ame,t8=Symbol(`none`),n8={value:t8,index:-1};function r8(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,openOnInputClick:S=!0,autoHighlight:C=!1,keepHighlight:w=!1,highlightItemOnHover:T=!0,loopFocus:E=!0,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:k=e3,virtualized:A=!1,inline:j=!1,fillInputOnItemPress:M=!0,modal:N=!1,limit:P=-1,autoComplete:F=`list`,formAutoComplete:I,locale:L,submitOnItemClick:R=!1}=e,{clearErrors:z}=P4(),{setDirty:B,validityData:V,setFilled:H,name:U,disabled:W,setTouched:G,setFocused:K,validationMode:ee,validation:q}=N4(),te=x3(),ne=L4({id:t}),re=e8({locale:L}),[ie,ae]=J.useState(!1),[oe,se]=J.useState(null),ce=J.useRef([]),le=J.useRef([]),ue=J.useRef(null),de=J.useRef(null),fe=J.useRef(null),pe=J.useRef(null),me=J.useRef(null),he=J.useRef(!0),ge=J.useRef(!1),_e=J.useRef(null),ve=J.useRef(null),ye=J.useRef(null),be=J.useRef(n8),xe=J.useRef(null),Se=J.useRef([]),Ce=J.useRef(null),we=W||m,Te=U??f,Ee=u===`multiple`,De=u===`single`,Oe=s!==void 0||o!==void 0,ke=y!==void 0,Ae=b!==void 0,je;je=C===`always`?`always`:C?`input-change`:!1;let[Me,Ne]=hG({controlled:i,default:Ee?r??Zg:r,name:`Combobox`,state:`selectedValue`}),Pe=J.useMemo(()=>x===null?()=>!0:x===void 0?ime(re,D):x,[x,re,D]),Fe=Cg(()=>Oe?o??``:De?c3(Me,D):``).current,[Ie,Le]=hG({controlled:s,default:Fe,name:`Combobox`,state:`inputValue`}),[Re,ze]=hG({controlled:c,default:l,name:`Combobox`,state:`open`}),Be=o3(y),Ve=oe??String(Ie).trim(),He=De?c3(Me,D):``,Ue=De&&!ie&&Ve!==``&&He.length===Ve.length&&re.contains(He,Ve),We=Ue?``:Ve,Ge=ke&&Ae&&Ue,Ke=J.useMemo(()=>y?Be?y.flatMap(e=>e.items):y:Zg,[y,Be]),qe=J.useMemo(()=>{if(b&&!Ge)return b;if(!y)return Zg;if(Be){let e=y,t=[],n=0;for(let r of e){if(P>-1&&n>=P)break;let e=P>-1?P-n:1/0,i=We===``?r.items.slice(0,e):[];if(We!==``)for(let t of r.items){if(i.length>=e)break;Pe(t,We,D)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(We===``)return P>-1?Ke.slice(0,P):Ke;let e=[];for(let t of Ke){if(P>-1&&e.length>=P)break;Pe(t,We,D)&&e.push(t)}return e},[b,Ge,y,Be,We,P,Pe,D,Ke]),Je=J.useMemo(()=>Be?qe.flatMap(e=>e.items):qe,[qe,Be]),Ye=Cg(()=>{let e=null;return j&&Re&&ke&&u!==`none`&&(e=r3(Je,Me,k,Ee)),new kU({id:ne,labelId:void 0,selectedValue:Me,open:Re,items:y,selectionMode:u,listRef:ce,labelsRef:le,popupRef:ue,emptyRef:me,inputRef:de,startDismissRef:fe,endDismissRef:pe,keyboardActiveRef:he,chipsContainerRef:_e,clearRef:ve,valuesRef:Se,pointerDownItemRef:Ce,selectionEventRef:ye,name:Te,form:p,disabled:we,readOnly:h,required:g,grid:v,virtualized:A,openOnInputClick:S,itemToStringLabel:D,isItemEqualToValue:k,modal:N,autoHighlight:je,submitOnItemClick:R,hasInputValue:Oe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:j,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:Qg,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`,onOpenChangeComplete:Xg,setOpen:Xg,setInputValue:Xg,setSelectedValue:Xg,setIndices:Xg,handleSelection:Xg,forceMount:Xg,requestSubmit:Xg})}).current,Xe=u===`none`?Ie:Me,Ze=J.useMemo(()=>u===`none`?Xe:Array.isArray(Me)?Me.map(e=>l3(e,O)):l3(Me,O),[Xe,O,u,Me]),Qe=Z(d),$e=Z(n),et=$(Ye,X6.activeIndex),tt=$(Ye,X6.selectedIndex),nt=$(Ye,X6.positionerElement),rt=$(Ye,X6.listElement),it=$(Ye,X6.triggerElement),at=$(Ye,X6.inputElement),ot=$(Ye,X6.inputGroupElement),st=$(Ye,X6.inline),ct=$(Ye,X6.inputInsidePopup),lt=$(Ye,X6.inputOwnsFormValue),ut=Yz(it),{mounted:dt,setMounted:ft,transitionStatus:pt}=PU(Re),{openMethod:mt,triggerProps:ht}=lK(Re),gt=Z(()=>Ze);z4(ct?ut:de,ne,Xe,gt,!we,f);let _t=Z(()=>{y?le.current=Je.map(e=>c3(e,D)):Ye.set(`forceMounted`,!0)}),vt=Z((e,t,n)=>{if(t===-1){if(be.current===n8)return;be.current=n8}else be.current={value:e,index:t};Qe(e,Ace(n,void 0,{index:t}))}),yt=Z(e=>{Ye.update(e);let t=e.activeIndex;if(t===void 0)return;let n=e.type||`none`;t===null?vt(void 0,-1,n):vt(Se.current[t],t,n)}),bt=Z((t,n)=>{if(ge.current=n.reason===WR,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){Re&&oe!==null&&se(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&ae(!0),xe.current={hasQuery:e};let n=Ye.state.listElement;if(!Ye.state.virtualized&&n){let e=ue.current;for(let t of yg(n.firstElementChild??n)){if(!ag(t)||(e?!Az(e,t):t.getAttribute(`role`)===`dialog`))break;if(RG(t)){t.scrollTop=0;break}}}e&&je&&Ye.state.activeIndex==null&&(Re||st)&&Ye.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&Ye.state.inputInsidePopup&&(xe.current={hasQuery:!1,selection:!0});Le(t)}}),xt=Z((t,n)=>{if(Re!==t&&(n.reason===`escape-key`&&ke&&Je.length===0&&!me.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&ct&&!st&&oe!==null&&(ae(!1),se(null),Ie!==``&&n.reason!==`input-change`&&bt(``,tz(WR,n.event))),!t&&ie&&(De?(st||se(Ve),Ve===``&&ae(!1)):Ee&&(st||se(Ve),ct&&yt({activeIndex:null}),(!ct||st)&&bt(``,tz(WR,n.event)))),ze(t),!t&&ct&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(G(!0),K(!1),ee===`onBlur`)))){let e=u===`none`?Ie:Me;q.commit(e)}}),St=Z((e,t)=>{a?.(e,t),!t.isCanceled&&(Ne(e),(u===`none`&&ue.current&&M||De&&!Ye.state.inputInsidePopup)&&bt(c3(e,D),tz(t.reason,t.event)))}),Ct=Z((e,t)=>{let n=jz(e),r=ye.current??e;ye.current=null;let i=tz(BR,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&xt(!1,i);return}if(Ee){let e=Array.isArray(Me)?Me:[],n=Hde(e,t,k)?i3(e,t,k):[...e,t];if(St(n,i),i.isCanceled||!(de.current&&de.current.value.trim()!==``))return;Ye.state.inputInsidePopup?bt(``,tz(WR,i.event)):xt(!1,i)}else{if(St(t,i),i.isCanceled)return;xt(!1,i)}}),wt=Z(()=>{let e=q.inputRef.current?.form??Ye.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Tt=Z(()=>{if(ft(!1),$e?.(!1),ae(!1),se(null),yt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ee&&de.current&&de.current.value!==``&&!ge.current&&bt(``,tz(WR)),De){if(Ye.state.inputInsidePopup)de.current&&de.current.value!==``&&bt(``,tz(WR));else{let e=c3(Me,D);de.current&&de.current.value!==e&&bt(e,tz(e===``?WR:IR))}}}),Et=J.useMemo(()=>st&&nt?{current:nt.closest(`[role="dialog"]`)}:ue,[st,nt]);IU({enabled:!e.actionsRef,open:Re,ref:Et,onComplete(){Re||Tt()}}),J.useImperativeHandle(e.actionsRef,()=>({unmount:Tt}),[Tt]),Tg(function(){if(Re||(Ce.current=null,u===`none`))return;let e=ke?Ke:Se.current;yt({selectedIndex:r3(e,Me,k,Ee)})},[Re,Me,u,Ee,ke,Ke,k,yt]),Tg(()=>{y&&(Se.current=Je,ce.current.length=Je.length)},[y,Je]),Tg(()=>{let e=xe.current;if(e){let t=Re||st||Ye.state.positionerElement?.hidden===!1;if(e.hasQuery)je&&t&&Ye.set(`activeIndex`,0),xe.current=null;else if(String(Ie).trim()===``&&(xe.current=null,t)){let t=e.selection;je===`always`&&!t&&Ye.state.selectionMode===`none`&&Ye.set(`activeIndex`,0),queueMicrotask(()=>{if(!Ye.state.open&&!Ye.state.inline||de.current&&de.current.value.trim()!==``)return;let e=Ye.state.selectedValue,n=Ye.state.selectionMode===`multiple`,r=n&&Array.isArray(e)?e[e.length-1]:e,i=Ye.state.selectionMode!==`none`&&r!=null;if(i||t){let t=ke||Ae?Je:Se.current;Ye.set(`activeIndex`,i?r3(t,e,Ye.state.isItemEqualToValue,n):null)}else je===`always`&&Ye.set(`activeIndex`,0)})}}if(!Re&&!st)return;let t=ke||Ae?Je:Se.current,n=Ye.state.activeIndex;if(n==null){if(je===`always`&&t.length>0){Ye.set(`activeIndex`,0);return}vt(void 0,-1,IR);return}if(n>=t.length){vt(void 0,-1,IR),Ye.set(`activeIndex`,null);return}let r=t[n],i=be.current.value,a=i!==t8&&t3(r,i,Ye.state.isItemEqualToValue);(be.current.index!==n||!a)&&vt(r,n,IR)},[et,je,vt,Ae,ke,Je,st,Re,Ye,Ie]),Tg(()=>{if(u===`none`){H(String(Ie)!==``);return}H(Ee?Array.isArray(Me)&&Me.length>0:Me!=null)},[H,u,Ie,Me,Ee]),J.useEffect(()=>{ke&&je&&Je.length===0&&yt({activeIndex:null})},[ke,je,Je.length,yt]);function Dt(e){let t=V.initialValue;return Array.isArray(e)&&Array.isArray(t)?!f3(e,t,(e,t)=>t3(e,t,k)):e!==t}sK(Ve,()=>{!Re||Ve===``||Ve===String(Fe)||ae(!0)});function Ot(){let e=c3(Me,D);Ie!==e&&bt(e,tz(IR))}sK(Me,()=>{u!==`none`&&(z(Te),B(Dt(Me)),q.change(Me),De&&!Oe&&!ct&&Ot())}),sK(Ie,()=>{u===`none`&&(z(Te),B(Ie!==V.initialValue),q.change(Ie))}),sK(y,()=>{!De||Oe||ct||ie||Ot()});let kt=sW({open:st?!0:Re,onOpenChange:xt,elements:{reference:ct?it:at,floating:nt}}),At=v?`grid`:`listbox`,jt=Re||st,Mt=jt?`true`:`false`,Nt=J.useMemo(()=>{let e=at?.tagName===`INPUT`,t=at==null||e,n=t||jt,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=Mt,r[`aria-haspopup`]=At,r[`aria-controls`]=jt?rt?.id:void 0,r[`aria-autocomplete`]=F),{reference:r,floating:{role:`presentation`}}},[at,jt,Mt,At,rt?.id,F]),Pt=sH(kt,{enabled:!h&&!we&&S,event:`mousedown-only`,toggle:!1,touchOpenDelay:ct?0:100,reason:GR}),Ft=pH(kt,{enabled:!h&&!we&&!st,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:st?!0:void 0,outsidePress(e){let t=jz(e);return!Az(it,t)&&!Az(ve.current,t)&&!Az(_e.current,t)&&!Az(ot,t)}}),It=DW(kt,{enabled:!h&&!we,id:ne,listRef:ce,activeIndex:et,selectedIndex:tt,virtual:!0,loopFocus:E,allowEscape:E&&!je,focusItemOnOpen:ie||u===`none`&&!je?!1:`auto`,focusItemOnHover:T,resetOnPointerLeave:!w,orientation:v?`horizontal`:void 0,rtl:te===`rtl`,disabledIndices:Zg,grid:v?nme:void 0,onNavigate(e,t){!t&&!Re||pt===`ending`||yt(t?{activeIndex:e,type:he.current?YR:XR}:{activeIndex:e})}}),Lt=J.useMemo(()=>Og(It.reference,{onKeyDown(e){v&&Ye.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},Ft.reference,Pt.reference,Nt.reference),[It.reference,Ft.reference,Pt.reference,Nt.reference,v,Ye]),Rt=J.useMemo(()=>Og(LU,Ft.floating),[Ft.floating]),zt=J.useMemo(()=>Og(It.floating,Nt.floating),[It.floating,Nt.floating]),Bt=J.useMemo(()=>{let e=It.item;return e?{...e,onFocus:void 0}:Qg},[It.item]);X4(()=>{Ye.update({inline:j,popupProps:Rt,listProps:zt,inputProps:Lt,triggerProps:ht,itemProps:Bt,setOpen:xt,setInputValue:bt,setSelectedValue:St,setIndices:yt,handleSelection:Ct,forceMount:_t,requestSubmit:wt,onOpenChangeComplete:$e})}),Tg(()=>{Ye.update({id:ne,selectedValue:Me,open:Re,mounted:dt,transitionStatus:pt,items:y,inline:j,popupProps:Rt,listProps:zt,inputProps:Lt,triggerProps:ht,openMethod:mt,itemProps:Bt,selectionMode:u,name:Te,form:p,disabled:we,readOnly:h,required:g,grid:v,virtualized:A,openOnInputClick:S,itemToStringLabel:D,modal:N,autoHighlight:je,isItemEqualToValue:k,submitOnItemClick:R,hasInputValue:Oe,inputOwnsFormValue:u===`none`&&(j||!Ye.state.inputInsidePopup)})},[Ye,ne,Me,Re,dt,pt,y,Rt,zt,Lt,Bt,mt,ht,u,Te,we,h,g,v,A,S,D,N,k,R,Oe,j,je,p]);let Vt=Gg(_,q.inputRef),Ht=J.useMemo(()=>({query:Ve,hasItems:ke,filteredItems:qe,flatFilteredItems:Je}),[Ve,ke,qe,Je]),Ut=J.useMemo(()=>Array.isArray(Xe)?``:l3(Xe,O),[Xe,O]),Wt=Ee&&Array.isArray(Me)&&Me.length>0,Gt=Ee||u===`none`&<?void 0:Te,Kt=J.useMemo(()=>!Ee||!Array.isArray(Me)||!Te?null:Me.map(e=>{let t=l3(e,O);return(0,Y.jsx)(`input`,{type:`hidden`,form:p,name:Te,value:t,disabled:we},t)}),[Ee,Me,p,Te,O,we]),qt=(0,Y.jsxs)(J.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...q.getValidationProps(we,{onFocus(){if(ct){it?.focus();return}(de.current||it)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||we||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=tz(IR,e.nativeEvent),i=()=>Se.current.findIndex(e=>l3(e,O).toLowerCase()===n||c3(e,D).toLowerCase()===n);function a(){if(Ee)return;if(u===`none`){bt(t,r);return}let e=i();e===-1&&(e=Se.current.findIndex((e,t)=>{let r=le.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Se.current[e];a!=null&&St?.(a,r)}De&&(_t(),y&&i()===-1&&Ye.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:ne&&Gt==null?`${ne}-hidden-input`:void 0,form:p,name:Gt,autoComplete:I,disabled:we,required:g&&!Wt,readOnly:h,value:Ut,ref:Vt,style:Gt?rB:nB,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Kt]});return(0,Y.jsx)(V6.Provider,{value:Ye,children:(0,Y.jsx)(H6.Provider,{value:kt,children:(0,Y.jsx)(W6.Provider,{value:ke,children:(0,Y.jsx)(U6.Provider,{value:Ht,children:(0,Y.jsx)(G6.Provider,{value:Ie,children:qt})})})})})}function ome(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=a===`inline`||a===`both`,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=J.useState(r??``),[p,m]=J.useState(``);J.useEffect(()=>{u&&m(``)},[n,u]);let h;h=c&&p!==``?p:u?n??``:d;let g=e8({locale:s.locale}),_=J.useMemo(()=>s.filter===void 0?g.contains:s.filter,[s.filter,g]),v=String(u?n:d).trim(),y=J.useMemo(()=>a===`both`?_===null?null:(e,t,n)=>_(e,v,n):l?null:_,[_,a,v,l]);function b(e,t){m(``),u||f(e),i?.(e,t)}function x(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?c3(t,o):``)}return(0,Y.jsx)(r8,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:y,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:b,onItemHighlighted:x})}var i8={...jR,...A4,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null};function a8(e){let t=$(e,X6.mounted),n=$(e,X6.popupSide),r=$(e,X6.positionerElement);return t&&r?n:null}function o8(){return J6().filteredItems.length===0}function sme(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function cme(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function s8(e,t,n){let r=e.state.listRef.current[t];r&&(e.state.selectionEventRef.current=n,r.click(),e.state.selectionEventRef.current=null)}var lme=J.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=N4(),{labelId:h}=F4(),g=K6(),_=$(g,X6.selectionMode),v=$(g,X6.disabled),y=$(g,X6.readOnly),b=$(g,X6.required),x=$(g,X6.positionerElement),S=$(g,X6.listElement),C=$(g,X6.popupId),w=$(g,X6.triggerProps),T=$(g,X6.inputInsidePopup),E=$(g,X6.id),D=$(g,X6.labelId),O=$(g,X6.open),k=$(g,X6.selectedValue),A=$(g,X6.activeIndex),j=$(g,X6.selectedIndex),M=$(g,X6.hasSelectedValue),N=q6(),P=Y6(),F=fz(),I=u||v||a,L=o8(),R=a8(g);L4({id:T?o:void 0});let z=T?o??E:o,B=h3(h,D),V;O&&T?V=C??Z6(E):O&&(V=S?.id);let H=J.useRef(``);function U(e){H.current=e.pointerType}let{reference:W}=OW(N,{enabled:!O&&!y&&!v&&_===`single`,listRef:g.state.labelsRef,activeIndex:A,selectedIndex:j,onMatch(e){let t=g.state.valuesRef.current[e];t!==void 0&&g.state.setSelectedValue(t,tz(IR))}}),{reference:G}=sH(N,{enabled:!y&&!v,event:`mousedown`}),{buttonRef:K,getButtonProps:ee}=Ug({native:i,disabled:I}),q={...l,open:O,disabled:I,popupSide:R,listEmpty:L,placeholder:_!==`none`&&!M};return e_(`button`,e,{ref:[t,K,Z(e=>{g.set(`triggerElement`,e)})],state:q,props:[w,G,W,{id:z,tabIndex:T?0:-1,role:T?`combobox`:void 0,"aria-expanded":O,"aria-haspopup":T?`dialog`:`listbox`,"aria-controls":V,"aria-required":T&&b||void 0,"aria-labelledby":B,onPointerDown:U,onPointerEnter:U,onFocus(){f(!0),!(I||y)&&F.start(0,g.state.forceMount)},onBlur(e){if(!Az(x,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=_===`none`?P:k;m.commit(e)}},onMouseDown(e){if(I||y||(T||N.set(`domReferenceElement`,e.currentTarget),g.state.forceMount(),H.current!==`touch`&&(g.state.inputRef.current?.focus(),T||e.preventDefault()),O))return;let t=Vg(e.currentTarget);function n(e){let t=g.state.triggerElement;if(!t)return;let n=jz(e),r=g.state.positionerElement,i=g.state.listElement;Az(t,n)||Az(r,n)||Az(i,n)||_3(e,t)||g.state.setOpen(!1,tz(ZR,e))}T&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){y||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(Cz(e),g.state.setOpen(!0,tz(JR,e.nativeEvent)),g.state.inputRef.current?.focus())}},m.getValidationProps(I,c),ee],stateAttributesMapping:i8})}),ume=J.createContext(void 0);function dme(){return J.useContext(ume)}var c8=J.createContext(void 0);function l8(e){let t=J.useContext(c8);if(t===void 0&&!e)throw Error(Rg(21));return t}var u8=J.forwardRef(function(e,t){let n=K6(),{buttonRef:r,getButtonProps:i}=Ug({native:!1}),a=Gg(t,r);function o(e){n.state.setOpen(!1,tz(VR,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:rB})}),d8=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=N4(),{labelId:m}=F4(),h=dme(),g=!!l8(!0),_=K6(),v=Y6(),y=x3(),b=$(_,X6.required),x=$(_,X6.disabled),S=$(_,X6.readOnly),C=$(_,X6.name),w=$(_,X6.form),T=$(_,X6.selectionMode),E=$(_,X6.autoHighlight),D=$(_,X6.inputProps),O=$(_,X6.triggerProps),k=$(_,X6.open),A=$(_,X6.mounted),j=$(_,X6.selectedValue),M=$(_,X6.id),N=$(_,X6.inline),P=$(_,X6.modal),F=!!E,I=a8(_),L=l||x||i,R=o8(),z=g||N,B=!z||P,V=oz(a??(z?void 0:M)),H=g?k4:c,[U,W]=J.useState(null),G=J.useRef(!1),K=J.useRef(null),ee=J.useRef(!1),q=T===`none`&&!g,te=Z(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.state.setInputValue(``,tz(IR)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:q})}),ne=g?s:p.getValidationProps(L,s);function re(){_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?YR:XR})}function ie(){_.state.keyboardActiveRef.current=!1}let ae={...H,open:k,disabled:L,readOnly:S,popupSide:I,listEmpty:R};function oe(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=sme(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=cme(n,j.length),re()),t)}let se=e_(`input`,e,{state:ae,ref:[t,_.state.inputRef,te],props:[D,O,{value:U??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:L,readOnly:S,required:T===`none`?b:void 0,form:w,...q&&C&&{name:C},id:V,onFocus(){if(d(!0),!N||!ee.current)return;ee.current=!1;let e=K.current;e==null||!Object.hasOwn(_.state.valuesRef.current,e)||_.state.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(N&&e!==null&&E!==`always`&&(K.current=e,ee.current=!0,_.state.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:j;p.commit(e)}},onCompositionStart(e){_z||(G.current=!0,W(e.currentTarget.value))},onCompositionEnd(e){G.current=!1;let t=e.currentTarget.value;W(null),_.state.setInputValue(t,tz(UR,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=G.current||!r;function a(e){S||L||!e||!i||(_.state.setOpen(!0,tz(UR,t)),F||re())}if(G.current){let n=e.currentTarget.value;W(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.state.setOpen(!1,tz(WR,t));let r=n.trim(),i=F&&r!==``;a(r),k&&_.state.activeIndex!==null&&!i&&re();return}let o=tz(UR,t);if(_.state.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=tz(WR,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.state.setSelectedValue(null,c),_.state.openOnInputClick||_.state.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&_.state.activeIndex!==null&&!F&&re()},onKeyDown(e){if(L||S||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;_.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){Cz(e);let n=bz&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Cz(e);let i=bz&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!A&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=tz(qR,e.nativeEvent),r=T===`multiple`?[]:null;_.state.setInputValue(``,n),_.state.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);re(),_.state.setSelectedValue(r,tz(IR,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=oe(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.state.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(N)return;_.state.setOpen(!1,tz(IR,n));return}Cz(e),s8(_,t,n)}},onPointerMove:ie,onPointerDown:ie},ne],stateAttributesMapping:i8}),ce=g?(0,Y.jsx)(M4.Provider,{value:j4,children:se}):se;return(0,Y.jsxs)(J.Fragment,{children:[k&&B&&(0,Y.jsx)(u8,{ref:_.state.startDismissRef}),ce]})});function fme(e,t,n,r,i){if(e.baseUIHandlerPrevented||r)return;let a=jz(e.nativeEvent),o=ig(a)?a:null;o!==e.currentTarget&&(i?.(o)||Fz(o))||(e.preventDefault(),!n&&(t.state.inputRef.current?.focus(),t.state.openOnInputClick&&t.state.setOpen(!0,tz(GR,e.nativeEvent))))}var pme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=N4(),s=K6(),c=$(s,X6.open),l=$(s,X6.disabled),u=$(s,X6.readOnly),d=$(s,X6.hasSelectedValue),f=$(s,X6.selectionMode),p=a8(s),m=l,h=o8(),g=f!==`none`&&!d,_={...o,open:c,disabled:m,readOnly:u,popupSide:p,listEmpty:h,placeholder:g};return e_(`div`,e,{ref:[t,Z(e=>{s.set(`inputGroupElement`,e)})],props:[{role:`group`,onMouseDown(e){fme(e,s,m,u,e=>Az(s.state.chipsContainerRef.current,e))}},a],state:_,stateAttributesMapping:i8})}),mme={...OR,...AR},hme=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=N4(),u=K6(),d=$(u,X6.selectionMode),f=$(u,X6.disabled),p=$(u,X6.readOnly),m=$(u,X6.open),h=$(u,X6.selectedValue),g=$(u,X6.hasSelectionChips),_=Y6(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=Ug({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=PU(v),T={disabled:y,visible:v,open:m,transitionStatus:C};IU({open:v,ref:u.state.clearRef,onComplete(){v||w(!1)}});let E=e_(`button`,e,{state:T,ref:[t,b,u.state.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=u.state.keyboardActiveRef.current?YR:XR;u.state.setInputValue(``,tz(HR,e.nativeEvent)),d===`none`?u.state.setIndices({activeIndex:null,type:t}):(u.state.setSelectedValue(Array.isArray(h)?[]:null,tz(HR,e.nativeEvent)),u.state.setIndices({activeIndex:null,selectedIndex:null,type:t})),u.state.inputRef.current?.focus()}},c,x],stateAttributesMapping:mme});return o||S?E:null}),f8=J.createContext(null);function gme(){return J.useContext(f8)}function _me(e){let{children:t,items:n}=e,r=J.useMemo(()=>({items:n}),[n]);return(0,Y.jsx)(f8.Provider,{value:r,children:t})}function p8(e){let{children:t}=e,{filteredItems:n}=J6(),r=gme(),i=r?r.items:n;return(0,Y.jsx)(J.Fragment,{children:i.map(t)})}var m8=J.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=K6(),l=q6(),u=!!l8(!0),{filteredItems:d,hasItems:f}=J6(),p=$(c,X6.selectionMode),m=$(c,X6.grid),h=$(c,X6.listProps),g=$(c,X6.virtualized),_=$(c,X6.forceMounted),v=p===`multiple`,y=d.length===0,b=Z(e=>{c.set(`positionerElement`,e)}),x=Z(e=>{c.set(`listElement`,e)}),S=J.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(p8,{children:o}):o,[o]),C={empty:y},w=l.useState(`floatingId`),T=e_(`div`,e,{state:C,ref:[t,x,u?null:b],props:[h,{children:S,tabIndex:-1,id:w,role:m?`grid`:`listbox`,"aria-multiselectable":v?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Cz(e),s8(c,t,e.nativeEvent)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});if(g)return T;let E=f&&!_?void 0:c.state.labelsRef;return(0,Y.jsx)(y3,{elementsRef:c.state.listRef,labelsRef:E,children:T})}),vme=``;function yme(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function bme(){let e=fz(),t=J.useRef(null);return J.useEffect(()=>{if(hz)return;let n=t.current;if(n==null)return;let r=yme(n);if(r==null)return;let i=r.data,a=`${i}${vme}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var h8=J.createContext(void 0);function xme(){let e=J.useContext(h8);if(e===void 0)throw Error(Rg(20));return e}var Sme=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=K6(),a=$(i,X6.mounted),o=$(i,X6.forceMounted);return a||n||o?(0,Y.jsx)(h8.Provider,{value:n,children:(0,Y.jsx)(VV,{ref:t,...r})}):null}),Cme=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=PV,style:g,..._}=e,v=K6(),y=q6(),b=xme(),x=$(v,X6.modal),S=$(v,X6.open),C=$(v,X6.mounted),w=$(v,X6.openMethod),T=$(v,X6.positionerElement),E=$(v,X6.triggerElement),D=$(v,X6.inputElement),O=$(v,X6.inputGroupElement),k=$(v,X6.inputInsidePopup),A=$(v,X6.transitionStatus),j=o8(),M=E3({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});P3(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Tg(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=Z(e=>{v.set(`positionerElement`,e)}),F=N3(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,Y.jsxs)(c8.Provider,{value:M,children:[C&&x&&(0,Y.jsx)(fG,{inert:dG(!S),cutout:O??D??E}),F]})}),wme={...MR,...OR},Tme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=K6(),l=l8(),u=q6(),d=$(c,X6.mounted),f=$(c,X6.open),p=$(c,X6.openMethod),m=$(c,X6.popupProps),h=$(c,X6.transitionStatus),g=$(c,X6.inputInsidePopup),_=$(c,X6.inputElement),v=$(c,X6.modal),y=$(c,X6.id),b=o8(),x=s.id??(g?Z6(y):void 0);Tg(()=>(c.set(`popupId`,c.state.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),IU({open:f,ref:c.state.popupRef,onComplete(){f&&c.state.onOpenChangeComplete(!0)}});let S=e_(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.state.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=jz(e.nativeEvent);p!==`touch`&&(Az(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},M3(h),s],stateAttributesMapping:wme}),C=a===void 0?g?e=>e===`touch`?c.state.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return(0,Y.jsx)(oH,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,Y.jsxs)(J.Fragment,{children:[S,T&&(0,Y.jsx)(u8,{ref:c.state.endDismissRef})]})})}),g8=J.createContext(void 0);function Eme(){let e=J.useContext(g8);if(e===void 0)throw Error(Rg(18));return e}var _8=J.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,[s,c]=J.useState(),l=J.useMemo(()=>({labelId:s,setLabelId:c,items:a}),[s,c,a]),u=e_(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":s},o]}),d=(0,Y.jsx)(g8.Provider,{value:l,children:u});return a?(0,Y.jsx)(_me,{items:a,children:d}):d}),v8=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=Eme(),c=oz(a);return Tg(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),e_(`div`,e,{ref:t,props:[{id:c},o]})}),y8=J.createContext(void 0);function b8(){let e=J.useContext(y8);if(!e)throw Error(Rg(19));return e}var Dme=J.createContext(!1);function Ome(){return J.useContext(Dme)}function x8(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=J.useRef(null),m=W3({guess:!0,index:l,textRef:p}),h=K6(),g=Ome(),_=rme(),v=$(h,X6.selectionMode),y=$(h,X6.disabled),b=$(h,X6.readOnly),x=$(h,X6.isItemEqualToValue),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=$(h,X6.id),D=$(h,X6.isActive,w),O=$(h,X6.isSelected,c),k=$(h,X6.itemProps),A=J.useRef(null),j=E!=null&&T?`${E}-${w}`:void 0,M=O&&C;Tg(()=>{if(!(T&&(r||l!=null)))return;let e=h.state.listRef.current;return e[w]=A.current,()=>{delete e[w]}},[T,r,w,l,h]),Tg(()=>{if(!T||_)return;let e=h.state.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),Tg(()=>{if(!T||_)return;let e=h.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;t3(c,t,x)&&h.set(`selectedIndex`,w)},[T,_,h,w,c,x]);let{getButtonProps:N,buttonRef:P}=Ug({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:S,selected:M,highlighted:D};function I(e){function t(){h.state.handleSelection(e,c)}h.state.submitOnItemClick?(Zi.flushSync(t),h.state.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":C?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.state.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||I(e.nativeEvent)},onMouseUp(e){let t=h.state.pointerDownItemRef.current===e.currentTarget;h.state.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&I(e.nativeEvent)}},R=e_(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[k,L,f,N]}),z=J.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,Y.jsx)(y8.Provider,{value:z,children:R})}function kme(e){let{componentProps:t,forwardedRef:n}=e,r=$(K6(),X6.isItemEqualToValue),{flatFilteredItems:i}=J6(),a=n3(i,t.value??null,r);return(0,Y.jsx)(x8,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var S8=J.memo(J.forwardRef(function(e,t){let n=$(K6(),X6.virtualized);return n&&e.index==null?(0,Y.jsx)(kme,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(x8,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),Ame=S8,C8=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=J6(),c=K6(),l=bme(),u=s.length===0?a:null;return e_(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function jme(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function w8(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...A4}}var Mme=J.createContext(void 0);function Nme(){return J.useContext(Mme)}var T8=J.createContext(void 0);function Pme(){let e=J.useContext(T8);if(e===void 0)throw Error(Rg(14));return e}var Fme=`data-parent`,Ime=J.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=P4(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:D,setTouched:O,state:k,validationMode:A,validityData:j,validation:M}=N4(),N=R4(),{labelId:P,controlId:F,registerControlId:I,getDescriptionProps:L}=F4(),R=Nme(),z=R?.allValues===void 0?void 0:R.parent,B=z!==void 0,V=C||N.disabled||R?.disabled||o,H=w??d,U=v??H,W=oz(),G=oz(),K=c||F;B&&(p?K=G:U===void 0?K||=G:K=`${z.id}-${U}`);let ee={};B&&(p?ee=z.getParentProps():U!==void 0&&(ee=z.getChildProps(U)));let{checked:q=n,indeterminate:te=l,onCheckedChange:ne,...re}=ee,ie=R?.value,ae=J.useRef(null),oe=Cg(()=>Symbol()),se=J.useRef(!1),{getButtonProps:ce,buttonRef:le}=Ug({disabled:V,native:y}),ue=R?.validation??M,[de,fe]=hG({controlled:U!==void 0&&ie!==void 0&&!p?ie.includes(U):q,default:i,name:`Checkbox`,state:`checked`}),pe=B?!!q:de,me=B&&te||l;Tg(()=>{I!==Xg&&(se.current=!0,I(oe.current,K))},[K,I,oe]),J.useEffect(()=>{let e=oe.current;return()=>{!se.current||I===Xg||(se.current=!1,I(e,void 0))}},[I,oe]),z4(ae,W,de,void 0,!R&&!V,d);let he=J.useRef(null),ge=ue.registerInput,_e=R?U:void 0,ve=J.useCallback(e=>ge(e,{controlRef:ae,value:_e}),[ge,_e]),ye=Gg(u,he,p?void 0:ve),be=I4(a,P,he,!y,K??void 0);Tg(()=>{he.current&&(he.current.indeterminate=me,de&&E(!0))},[de,me,E]),sK(de,()=>{R||(S(H),E(de),T(de!==j.initialValue),ue.change(de))});let xe=Og({checked:de,disabled:V,form:s,name:p?void 0:H,id:y?void 0:K??void 0,required:g,ref:ye,style:H?rB:nB,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=tz(IR,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(ne?.(t,n),!n.isCanceled&&(fe(t),U!==void 0&&R!==void 0&&!p&&!B))){let e=t?[...R.value,U]:R.value.filter(e=>e!==U);R.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ae.current?.focus()}},v===void 0?Qg:{value:(R?de&&v:v)||``},L,e=>ue.getValidationProps(V,e));J.useEffect(()=>{if(!z||U===void 0)return;let e=z.disabledStatesRef.current;return e.set(U,V),()=>{e.delete(U)}},[z,V,U]);let Se=J.useMemo(()=>({...k,checked:pe,disabled:V,readOnly:m,required:g,indeterminate:me}),[k,pe,V,m,g,me]),Ce=w8(Se),we=e_(`span`,e,{state:Se,ref:[le,ae,t],props:[{id:y?K??void 0:W,role:`checkbox`,"aria-checked":me?`mixed`:pe,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":be,[Fme]:p?``:void 0,onFocus(){V||D(!0)},onBlur(){let e=he.current;e&&(O(!0),D(!1),A===`onBlur`&&ue.commit(R?ie:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=he.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),tg(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||jme(t)?.click()})},onClick(e){if(m||V)return;e.preventDefault();let t=he.current;t&&Hg(t,e)}},x,re,ce,L,e=>ue.getValidationProps(V,e)],stateAttributesMapping:Ce});return(0,Y.jsxs)(T8.Provider,{value:Se,children:[we,!de&&!R&&H&&!p&&_!==void 0&&(0,Y.jsx)(`input`,{type:`hidden`,form:s,name:H,value:_,disabled:V}),(0,Y.jsx)(`input`,{...xe,suppressHydrationWarning:!0})]})}),Lme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Pme(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=PU(c),f=J.useRef(null),p={...s,transitionStatus:u};IU({open:c,ref:f,onComplete(){c||d(!1)}});let m={...w8(s),...OR},h=a||l,g=e_(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function Rme(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,Y.jsx)(r8,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var zme=J.forwardRef(function(e,t){let{selected:n}=b8();return e.keepMounted||n?(0,Y.jsx)(Bme,{...e,ref:t}):null}),Bme=J.memo(J.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=b8(),c=J.useRef(null),{transitionStatus:l,setMounted:u}=PU(s),d=e_(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:OR});return IU({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Vme=J.createContext(void 0);function E8(e=!0){let t=J.useContext(Vme);if(t===void 0&&!e)throw Error(Rg(25));return t}var D8=J.createContext(void 0);function O8(e){let t=J.useContext(D8);if(t===void 0&&!e)throw Error(Rg(33));return t}var k8=J.createContext(void 0);function A8(e){let t=J.useContext(k8);if(t===void 0&&!e)throw Error(Rg(36));return t}function Hme(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=E8(!0),f=d!==void 0;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:BR})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!vz&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Hg(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var j8={type:`regular-item`};function M8(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=Ug({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Hme({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>Og(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Gg(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var N8=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),P8={checked(e){return e?{[N8.checked]:``}:{[N8.unchecked]:``}},...OR},F8=J.createContext(void 0);function Ume(){let e=J.useContext(F8);if(e===void 0)throw Error(Rg(31));return e}var Wme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(void 0),c=e_(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Y.jsx)(F8.Provider,{value:s,children:c})}),Gme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=oz(a),c=Ume();return Tg(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),e_(`div`,e,{ref:t,props:{id:s,role:`presentation`,...o}})}),Kme=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=W3({guess:!0,label:a}),f=O8(!0),p=oz(i),{store:m}=A8(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=M8({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:j8});return e_(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),qme=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=A8(),{side:c,align:l}=O8(),u=L3(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;IU({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){s.setOpen(!1,tz(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),_W(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=e_(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:NR,props:[p,{onKeyDown(e){u&&WW.has(e.key)&&e.stopPropagation()}},M3(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,Y.jsx)(oH,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})}),I8=J.createContext(void 0);function Jme(){let e=J.useContext(I8);if(e===void 0)throw Error(Rg(32));return e}var Yme=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=A8();return i.useState(`mounted`)||n?(0,Y.jsx)(I8.Provider,{value:n,children:(0,Y.jsx)(VV,{ref:t,...r})}):null}),Xme=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=PV,style:g,..._}=e,{store:v}=A8(),y=Jme(),b=E8(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),L=J.useRef(null),R=FU(A),z=n,B=c,V=l,H=s,U=h;x.type===`context-menu`&&(z=n??x.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let W=o,G=H;x.type===`menu`?(W??=`inline-end`,G??=`start`,U=e.collisionAvoidance??FV):x.type===`menubar`&&(W??=x.context.orientation===`vertical`?`inline-end`:`bottom`,G??=`start`);let K=x.type===`context-menu`,ee=E3({anchor:z,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:W,sideOffset:B,align:G,alignOffset:V,arrowPadding:K?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:U,shift:K?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,tz(QR)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,tz(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let q=fz();J.useEffect(()=>{T||q.clear()},[T,q]),J.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`))){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?q.isStarted()||q.start(e,()=>{v.setOpen(!1,tz(QR))}):v.setOpen(!1,tz(QR))}else q.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,q]),J.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Tg(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,v]);let te={open:T,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,nested:x.type===`menu`,instant:j},ne=x.type===`menubar`&&x.context.modal;P3(T&&(ne||E&&N!==`trigger-hover`),D===`touch`,A,O);let re=N3(e,te,{styles:ee.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ie=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ae=null;return x.type===`menubar`?ae=x.context.contentElement:x.type===void 0&&(ae=O),(0,Y.jsxs)(D8.Provider,{value:ee,children:[ie&&(0,Y.jsx)(fG,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:dG(!T),cutout:ae}),(0,Y.jsx)(YV,{id:P,children:(0,Y.jsx)(y3,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:re})})]})}),L8=J.createContext(void 0);function Zme(){let e=J.useContext(L8);if(e===void 0)throw Error(Rg(34));return e}var Qme=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=J.useState(void 0),[p,m]=hG({controlled:i,default:a,name:`MenuRadioGroup`}),h=Z((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=e_(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=J.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,Y.jsx)(F8.Provider,{value:f,children:(0,Y.jsx)(L8.Provider,{value:_,children:g})})})),R8=J.createContext(void 0);function $me(){let e=J.useContext(R8);if(e===void 0)throw Error(Rg(35));return e}var ehe=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=W3({guess:!0,label:a}),p=O8(!0),m=oz(i),{store:h}=A8(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=Zme(),x=h.useState(`disabled`),S=s||b||x,C=v===l,{getItemProps:w,itemRef:T}=M8({closeOnClick:c,disabled:S,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:j8}),E=J.useMemo(()=>({disabled:S,highlighted:g,checked:C}),[S,g,C]);function D(e){let t=tz(BR,e.nativeEvent,void 0,{preventUnmountOnClose:Xg});y(l,t)}let O=e_(`div`,e,{state:E,stateAttributesMapping:P8,props:[_,{role:`menuitemradio`,"aria-checked":C,onClick:D},d,w],ref:[T,t,f.ref]});return(0,Y.jsx)(R8.Provider,{value:E,children:O})}),the=J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=$me(),c=J.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=PU(s.checked);return IU({open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),e_(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:P8,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),nhe=J.createContext(null);function z8(e){let t=J.useContext(nhe);if(t===null&&!e)throw Error(Rg(5));return t}var rhe={...aW,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},ihe=class extends AU{constructor(e){super({...ohe(),...e},ahe(),rhe),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function ahe(){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:new XU}}function ohe(){return{...QU(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new UV,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Qg,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var B8=J.createContext(void 0);function V8(){return J.useContext(B8)}var H8=xU(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=E8(!0),_=A8(!0),v=z8(!0),y=V8(),b=J.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=she({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=az(),C=az(),w=x.useState(`floatingTreeRoot`),T=JV(w),E=KV(),D=x.useState(`open`),O=x.useState(`activeTriggerElement`),k=x.useState(`positionerElement`),A=x.useState(`hoverEnabled`),j=x.useState(`disabled`),M=x.useState(`lastOpenChangeReason`),N=x.useState(`parent`),P=x.useState(`activeIndex`),F=x.useState(`payload`),I=x.useState(`floatingParentNodeId`),L=J.useRef(null),R=J.useRef(N.type!==`context-menu`),z=fz(),B=J.useRef(!0),V=fz(),H=I!=null,{openMethod:U,triggerProps:W}=lK(D);x.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:N.type===void 0?s:void 0,openMethod:U,rootId:S}),KU(x);let{forceUnmount:G}=qU(D,x,()=>{x.set(`allowMouseEnter`,!1)});Tg(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:T,floatingParentNodeId:E}):_&&x.update({floatingNodeId:T,floatingParentNodeId:E})},[g,_,T,E,x]),J.useEffect(()=>{if(D||(L.current=null),N.type===`context-menu`){if(!D){z.clear(),R.current=!1;return}z.start(500,()=>{R.current=!0})}},[z,D,N.type]),Tg(()=>{!D&&!A&&x.set(`hoverEnabled`,!0)},[D,A,x]);let K=Z((e,t)=>{let n=t.reason;if(!e&&!x.select(`open`)||D===e&&t.trigger===O&&M===n)return;let i=UU(t);if(!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled)return;x.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!B.current)return;e&&n===`trigger-focus`?(B.current=!1,V.start(300,()=>{B.current=!0})):(B.current=!0,V.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};L.current=t.event,HU(c,e,t.trigger,i()),x.update(c),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),ee=NU({popupStore:x,floatingId:C,nested:E!=null,onOpenChange:K}),q=ee.context.events;Tg(()=>{let e=({open:e,eventDetails:t})=>K(e,t);return q.on(`setOpen`,e),()=>{q?.off(`setOpen`,e)}},[q,K]);let te=J.useCallback(()=>{x.setOpen(!1,tz($R))},[x]);J.useImperativeHandle(u,()=>({unmount:G,close:te}),[G,te]);let ne;N.type===`context-menu`&&(ne=N.context),J.useImperativeHandle(ne?.positionerRef,()=>k,[k]),J.useImperativeHandle(ne?.actionsRef,()=>({setOpen:K}),[K]);let re=pH(ee,{enabled:!j,bubbles:{escapeKey:d&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||L.current?.type===`contextmenu`||R.current},externalTree:H?w:void 0}),ie=x3(),ae=J.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),oe=DW(ee,{enabled:!j,listRef:x.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:ie===`rtl`,disabledIndices:Zg,onNavigate:ae,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:H?w:void 0,focusItemOnHover:h}),se=J.useCallback(e=>{x.context.typingRef.current=e},[x]),ce=OW(ee,{enabled:!j,listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{D&&e!==P&&x.set(`activeIndex`,e)},onTyping:se});JU(x,{floatingRootContext:ee,activeTriggerProps:J.useMemo(()=>{let e=Og(ce.reference,oe.reference,re.reference,{onMouseMove(){x.set(`allowMouseEnter`,!0)}},W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=D,e},[x,ce.reference,oe.reference,re.reference,W,D]),inactiveTriggerProps:J.useMemo(()=>{let e=Og(oe.trigger,re.trigger,W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[oe.trigger,re.trigger,W]),popupProps:J.useMemo(()=>Og(LU,{id:C,role:`menu`,"aria-labelledby":O?.id,onMouseMove(){x.set(`allowMouseEnter`,!0),N.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ce.floating,oe.floating,re.floating),[O,C,N.type,x,ce.floating,oe.floating,re.floating]),itemProps:oe.item??Qg});let le=J.useMemo(()=>({store:x,parent:b}),[x,b]),ue=(0,Y.jsxs)(k8.Provider,{value:le,children:[f&&(0,Y.jsx)(BU,{handle:f,store:x}),typeof t==`function`?t({payload:F}):t]});return N.type===void 0||N.type===`context-menu`?(0,Y.jsx)(XV,{externalTree:w,children:ue}):ue});function she(e){return Cg(()=>new ihe(e)).current}function che(e){let t=A8().store,n=J.useMemo(()=>({parentMenu:t}),[t]);return(0,Y.jsx)(B8.Provider,{value:n,children:(0,Y.jsx)(H8,{...e})})}function lhe(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Bg(),{ref:i,index:a}=W3(e),o=n===a,s=J.useRef(null),c=Gg(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function U8(e){let{render:t,className:n,style:r,state:i=Qg,props:a=Zg,refs:o=Zg,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=lhe({metadata:s});return e_(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function W8(e){if(ag(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!mg(e))return W8(_g(e))}function G8(e,t){let n=J.useRef(null);function r(t){Zi.flushSync(()=>{e.setOpen(!1,tz(KR,t.nativeEvent,t.currentTarget))}),cV(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&lV(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Zi.flushSync(()=>{e.setOpen(!1,tz(KR,n.nativeEvent,n.currentTarget))});let i=sV(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&Az(r,i);){let e=i;if(i=iV(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function uhe(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Vg(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Qg,[t,n,r])}var dhe=SU(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=A8(!0),h=oW(d)??m?.store;if(!h)throw Error(Rg(85));let g=oz(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=J.useRef(null),S=phe(),C=Bg(!0),w=qV(),T=J.useMemo(()=>w??new UV,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=GU(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:JV(T),floatingParentNodeId:KV(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Ug({disabled:A,native:o});J.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=J.useRef(null),P=fz(),F=Z(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Az(N.current,t)||Az(h.select(`positionerElement`),t)||t===N.current||(t==null||W8(t)!==h.select(`rootId`))&&(_3(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:ZR}))});J.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Vg(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=yW(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:IW({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=fhe(y,h.select(`lastOpenChangeReason`)),z=sH(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=dW(v,{enabled:!A&&I}),V=uhe({open:y,enabled:O,mouseDownAction:`open`}),H=J.useMemo(()=>Og(B.reference,z.reference),[B.reference,z.reference]),U=h.useState(`triggerProps`,D),{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:K}=G8(h,x),ee={disabled:A,open:y},q=[N,t,M,E,x],te=[H,L??Qg,U,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Vg(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},V,p,j],ne=e_(`button`,e,{enabled:!O,stateAttributesMapping:jR,state:ee,ref:q,props:te});return O?(0,Y.jsx)(U8,{tag:`button`,render:n,className:r,style:i,state:ee,refs:q,props:te,stateAttributesMapping:jR}):y?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(iB,{ref:W,onFocus:G},`${g}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:ne},g),(0,Y.jsx)(iB,{ref:h.context.triggerFocusTargetRef,onFocus:K},`${g}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:ne},g)});function fhe(e,t){let n=fz(),[r,i]=J.useState(!1);return Tg(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function phe(){let e=z8(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var K8=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return e_(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),mhe={"aria-expanded":void 0},hhe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=V8();if(!p?.parentMenu)throw Error(Rg(37));let m=W3({guess:!0,label:a}),h=O8(),{store:g}=A8(),_=oz(o),v=g.useState(`open`),y=g.useState(`floatingRootContext`),b=g.useState(`floatingTreeRoot`),x=g.useState(`triggerPopupId`,_),S=VU(_,g),C=J.useCallback(e=>{let t=S(e);return e!==null&&g.select(`open`)&&g.select(`activeTriggerId`)==null&&g.update({activeTriggerId:_,activeTriggerElement:e,closeDelay:u}),t},[S,u,g,_]),w=J.useRef(null),T=J.useCallback(e=>{w.current=e,g.set(`activeTriggerElement`,e)},[g]);g.useSyncedValue(`closeDelay`,u);let E=p.parentMenu,D=g.useState(`disabled`),O=E.useState(`disabled`),k=d||D||O,A=E.useState(`itemProps`),j=E.useState(`isActive`,m.index),M=J.useMemo(()=>({type:`submenu-trigger`,setActive(){E.select(`highlightItemOnHover`)&&E.set(`activeIndex`,m.index)}}),[E,m.index]),{getItemProps:N,itemRef:P}=M8({closeOnClick:!1,disabled:k,highlighted:j,id:_,store:g,typingRef:E.context.typingRef,nativeButton:s,itemMetadata:M,nodeId:h?.context.nodeId}),F=yW(y,{enabled:g.useState(`hoverEnabled`)&&c&&!k,handleClose:IW({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>E.select(`allowMouseEnter`):void 0,triggerElementRef:w,externalTree:b,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),I=sH(y,{enabled:!k,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??Qg,L=g.useState(`triggerProps`,!0);delete L.id;let R={disabled:k,highlighted:j,open:v},z=g.useState(`openMethod`),B=g.useState(`lastOpenChangeReason`)===`list-navigation`||z===`keyboard`;return e_(`div`,e,{state:R,stateAttributesMapping:AR,props:[I,F,L,A,v&&B&&xz?mhe:void 0,{"aria-controls":x,tabIndex:v||j?0:-1,onBlur(){j&&E.set(`activeIndex`,null)}},f,N],ref:[t,m.ref,P,C,T]})}),ghe=`data-composite-item-active`,_he=[];function vhe(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=_he}=e,[p,m]=J.useState(0),h=r!=null,g=J.useRef(null),_=Gg(g,c),v=J.useRef([]),y=J.useRef(!1),b=o??p,x=Z((e,t=!1)=>{if((s??m)(e),t){let t=v.current[e];YW(g.current,t,a,n)}}),S=Z(e=>{if(e.size===0||y.current)return;y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)x(i);else if(RB(t,b,d)){let e=IB(t,{disabledIndices:d});NB(t,e)||x(e)}YW(g.current,r,a,n)});Tg(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(RB(e,b,d)){let t=IB(e,{disabledIndices:d});NB(e,t)||x(t)}},[d,o,b,v,x]);let C=Z((e,t,n)=>i?i(e,t,n,v):n),w=Z(e=>{let o=e.key===`Home`||e.key===`End`;if(!WW.has(e.key)||!l&&o||yhe(e,f)||!g.current)return;let s=a===`rtl`,c=s?HW:UW,p=s?UW:HW,m=n===`vertical`?VW:c,_=n===`vertical`?BW:p,y=jz(e.nativeEvent);if(y!=null&&JW(y)&&!Z4(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let S=b,w=PB(v,d),T=FB(v,d);r!=null&&(S=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:b,loopFocus:t,maxIndex:T,minIndex:w,onLoop:C,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?S=w:e.key===`End`&&(S=T)),S===b&&(E||D)&&(t&&S===T&&E?(S=w,i&&(S=i(e,b,S,v))):t&&S===w&&D?(S=T,i&&(S=i(e,b,S,v))):S=IB(v.current,{startingIndex:S,decrement:D,disabledIndices:d})),S!==b&&!NB(v.current,S)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),x(S,!0),queueMicrotask(()=>{v.current[S]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=jz(e.nativeEvent);!t||n==null||!JW(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:w},highlightedIndex:b,onHighlightedIndexChange:x,elementsRef:v,onMapChange:S,relayKeyboardEvent:w}}function yhe(e,t){for(let n of KW)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function bhe(e){let{render:t,className:n,style:r,refs:i=Zg,props:a=Zg,state:o=Qg,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=vhe({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:x3(),disabledIndices:v,modifierKeys:y}),k=e_(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=J.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,Y.jsx)(zg.Provider,{value:A,children:(0,Y.jsx)(y3,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var q8=J.createContext(void 0);function J8(e){let t=J.useContext(q8);if(t===void 0&&!e)throw Error(Rg(47));return t}var xhe={...aW,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},She=class extends AU{constructor(e,t,n){let r=new XU;super(Che(e,r,t,n),whe(r),xhe)}setOpen=(e,t)=>{let n=t.reason===RR,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=UU(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};HU(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Zi.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Che(e,t,n,r=!1){let i={...QU(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=$U(t,n,r),i}function whe(e){return{popupRef:J.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),stickIfOpenTimeout:new dz,triggerElements:e}}function Y8({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Ehe(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),YU(u,d),KU(u);let{forceUnmount:m}=qU(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),J.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),J.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,tz($R))}),[m,u]);let h=d||f;return(0,Y.jsxs)(q8.Provider,{value:u,children:[s&&(0,Y.jsx)(BU,{handle:s,store:u}),h&&(0,Y.jsx)(Dhe,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function The(e){return J8(!0)?(0,Y.jsx)(Y8,{props:e}):(0,Y.jsx)(XV,{children:(0,Y.jsx)(Y8,{props:e})})}function Ehe(e,t){let n=zU((e,n)=>new She(t,e,n));return J.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Dhe({store:e,modal:t}){let n=pH(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return JU(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var Ohe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=J8(!0),h=oW(s)??m;if(!h)throw Error(Rg(74));let g=oz(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=J.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=GU(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=yW(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:IW(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=sH(v,{stickIfOpen:T}),A=cK(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=Ug({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?jR.open(e):AR.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=G8(h,x),R=e_(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[AV]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),z=(0,Y.jsx)(J.Fragment,{children:R},g);return C&&!D?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(iB,{ref:F,onFocus:I}),z,(0,Y.jsx)(iB,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),X8=J.createContext(void 0);function khe(){let e=J.useContext(X8);if(e===void 0)throw Error(Rg(45));return e}var Ahe=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return J8().useState(`mounted`)||n?(0,Y.jsx)(X8.Provider,{value:n,children:(0,Y.jsx)(VV,{ref:t,...r})}):null}),Z8=J.createContext(void 0);function jhe(){let e=J.useContext(Z8);if(!e)throw Error(Rg(46));return e}var Mhe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=FV,..._}=e,v=J8(),y=khe(),b=JV(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=J.useRef(null),N=FU(O),P=E3({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:j}),F=x.useState(`domReferenceElement`);Tg(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;P3(C&&I,D===`touch`,O,T);let L=v.useStateSetter(`positionerElement`),R=N3(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,L],hidden:!S,inert:!C});return(0,Y.jsxs)(Z8.Provider,{value:P,children:[S&&I&&(0,Y.jsx)(fG,{inert:dG(!C),cutout:T}),(0,Y.jsx)(YV,{id:b,children:R})]})}),Nhe=J.createContext(void 0);function Phe(){let[e,t]=J.useState(0),n=Z(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:J.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Fhe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=J8(),l=jhe(),u=L3(!0)!=null,{context:d,hasClosePart:f}=Phe(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);IU({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),_W(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?RU(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=e_(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...LU,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&WW.has(e.key)&&e.stopPropagation()}},M3(g),s],stateAttributesMapping:NR});return(0,Y.jsx)(oH,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:ag(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Y.jsx)(Nhe.Provider,{value:d,children:M})})}),Ihe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=J8(),s=oz(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),e_(`h2`,e,{ref:t,props:[{id:s},a]})}),Q8={checked(e){return e?{"data-checked":``}:{"data-unchecked":``}},...OR,...A4},$8=J.createContext(void 0);function Lhe(){return J.useContext($8)}var e5=J.createContext(void 0);function Rhe(){let e=J.useContext(e5);if(e===void 0)throw Error(Rg(52));return e}var zhe=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":s,value:c,inputRef:l,nativeButton:u=!1,id:d,style:f,...p}=e,m=Lhe(),{disabled:h,readOnly:g,required:_,form:v,checkedValue:y,touched:b=!1,validation:x,name:S,setCheckedValue:C=Xg,setTouched:w=Xg,registerInputRef:T=Xg}=m??{},{setTouched:E,setFilled:D,state:O,disabled:k}=N4(),A=R4(),{labelId:j,getDescriptionProps:M}=F4(),N=k||A.disabled||h||i,P=g||a,F=_||o,I=v,L=m?y===c:c===``,R=J.useRef(null),z=J.useRef(null),B=x?.registerInput,V=Gg(l,z,T,J.useCallback(e=>B?.(e,{controlRef:R,value:void 0}),[B]));Tg(()=>{z.current?.checked&&D(!0)},[D]),Tg(()=>{if(z.current){if(N&&L){T(null);return}T(z.current)}},[L,N,T]);let H=oz(),U=L4({id:d,implicit:!1,controlRef:R}),W=u?void 0:U,G={role:`radio`,"aria-checked":L,"aria-labelledby":I4(s,j,z,!u,W),[ghe]:L?``:void 0,id:u?U:H,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||N||P)return;e.preventDefault();let t=z.current;t&&Hg(t,e)},onFocus(e){e.defaultPrevented||N||P||!b||(z.current?.click(),w(!1))}},{getButtonProps:K,buttonRef:ee}=Ug({disabled:N,native:u,composite:!1}),q={type:`radio`,ref:V,form:I,id:W,name:S,tabIndex:-1,style:S?rB:nB,"aria-hidden":!0,...c===void 0?Qg:{value:a3(c)},disabled:N,checked:L,required:F,readOnly:P,onChange(e){if(e.nativeEvent.defaultPrevented||N||P||c===void 0)return;let t=tz(IR,e.nativeEvent);C(c,t),!t.isCanceled&&E(!0)},onClick(e){e.stopPropagation()},onFocus(){R.current?.focus()}},te=J.useMemo(()=>({...O,required:F,disabled:N,readOnly:P,checked:L}),[O,N,P,L,F]),ne=te,re=m!==void 0,ie=[t,R,ee],ae=[G,p,K,M,x?e=>x.getValidationProps(N,e):Qg],oe=e_(`span`,e,{enabled:!re,state:te,ref:ie,props:ae,stateAttributesMapping:Q8});return(0,Y.jsxs)(e5.Provider,{value:ne,children:[re?(0,Y.jsx)(U8,{tag:`span`,render:n,className:r,style:f,state:te,refs:ie,props:ae,stateAttributesMapping:Q8}):oe,(0,Y.jsx)(`input`,{...q,suppressHydrationWarning:!0})]})}),Bhe=J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Rhe(),c=s.checked,{mounted:l,transitionStatus:u,setMounted:d}=PU(c),f={...s,transitionStatus:u},p=J.useRef(null),m=a||l,h=e_(`span`,e,{ref:[t,p],state:f,props:o,stateAttributesMapping:Q8});return IU({open:c,ref:p,onComplete(){c||d(!1)}}),m?h:null}),Vhe=[GW],Hhe=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,form:u,name:d,inputRef:f,id:p,style:m,...h}=e,{setTouched:g,setFocused:_,validationMode:v,name:y,disabled:b,state:x,validation:S,setDirty:C,setFilled:w,validityData:T}=N4(),{labelId:E}=F4(),{clearErrors:D,elementRef:O}=P4(),k=Cde(!0),A=b||i,j=y??d,M=oz(p),[N,P]=hG({controlled:c,default:l,name:`RadioGroup`,state:`value`}),[F,I]=J.useState(!1),L=Z((e,t)=>{s?.(e,t),!t.isCanceled&&P(e)}),R=S.getInputControl,z=J.useMemo(()=>({get current(){return R()}}),[R]),B=J.useRef(null),V=J.useRef(null);function H(e){let t;return f&&(typeof f==`function`?t=f(e):f.current=e),B.current=e,t}let U=Z(e=>{if(!e||e.disabled)return;V.current||=e;let t=B.current,n=e.checked||t==null||t.disabled?H(e):void 0;return()=>{V.current===e&&(V.current=null),B.current===e?n?(n(),B.current=null):H(null):n?.()}}),W=Z(()=>{let e=O.current;if(!e)return N??null;for(let t of S.registeredInputs.keys())if(t.checked&&Ode(t,e))return N??null;return null});z4(z,M,N??null,W,!A,d),sK(N,()=>{D(j),C(N!==T.initialValue),w(N!=null),S.change(N);let e=V.current;N==null&&e&&!e.disabled&&H(e)});let G=E??k?.legendId,K={...x,disabled:A??!1,required:o??!1,readOnly:a??!1},ee=J.useMemo(()=>({checkedValue:N,disabled:A,form:u,validation:S,name:j,readOnly:a,registerInputRef:U,required:o,setCheckedValue:L,setTouched:I,touched:F}),[N,A,u,S,j,a,U,o,L,I,F]),q={id:p,role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":A||void 0,"aria-readonly":a||void 0,"aria-labelledby":G,onFocus(){_(!0)},onBlur(e){Az(e.currentTarget,e.relatedTarget)||(g(!0),_(!1),v===`onBlur`&&S.commit(N))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(I(!0),_(!0))}};return(0,Y.jsx)($8.Provider,{value:ee,children:(0,Y.jsx)(bhe,{render:n,className:r,style:m,state:K,props:[q,h,e=>S.getValidationProps(A??!1,e)],refs:[t],stateAttributesMapping:A4,enableHomeAndEndKeys:!1,modifierKeys:Vhe})})});function Uhe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Whe=u_(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Ghe(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=Q(Whe({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:Khe,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Khe(e){e.target instanceof HTMLElement&&e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}var qhe=u_(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function t5(e){let t=(0,X.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,type:i,variant:a,size:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`button`:i,c=a===void 0?`ghost`:a,l=o===void 0?`xs`:o,u;t[6]!==n||t[7]!==l?(u=Q(qhe({size:l}),n),t[6]=n,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==l||t[11]!==u||t[12]!==s||t[13]!==c?(d=(0,Y.jsx)(pv,{type:s,"data-size":l,variant:c,className:u,...r}),t[9]=r,t[10]=l,t[11]=u,t[12]=s,t[13]=c,t[14]=d):d=t[14],d}function Jhe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(B4,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var n5=Rme;function Yhe(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Q(`[&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Ev,{className:`pointer-events-none size-3.5 text-muted-foreground`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(lme,{"data-slot":`combobox-trigger`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Xhe(e){let t=(0,X.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(t5,{variant:`ghost`,size:`icon-xs`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=Q(n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(my,{className:`pointer-events-none`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,Y.jsx)(hme,{"data-slot":`combobox-clear`,render:i,className:a,...r,children:o}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function r5(e){let t=(0,X.c)(30),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,children:n,disabled:a,showTrigger:o,showClear:s,triggerLabel:c,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a!==void 0&&a,u=o===void 0||o,d=s!==void 0&&s,f;t[8]===r?f=t[9]:(f=Q(`w-auto`,r),t[8]=r,t[9]=f);let p;t[10]===l?p=t[11]:(p=(0,Y.jsx)(Jhe,{disabled:l}),t[10]=l,t[11]=p);let m;t[12]!==i||t[13]!==p?(m=(0,Y.jsx)(d8,{render:p,...i}),t[12]=i,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==l||t[16]!==u||t[17]!==c?(h=u&&(0,Y.jsx)(t5,{size:`icon-xs`,variant:`ghost`,render:(0,Y.jsx)(Yhe,{}),"aria-label":c,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:l}),t[15]=l,t[16]=u,t[17]=c,t[18]=h):h=t[18];let g;t[19]!==l||t[20]!==d?(g=d&&(0,Y.jsx)(Xhe,{disabled:l}),t[19]=l,t[20]=d,t[21]=g):g=t[21];let _;t[22]!==h||t[23]!==g?(_=(0,Y.jsxs)(Ghe,{align:`inline-end`,children:[h,g]}),t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==n||t[26]!==f||t[27]!==m||t[28]!==_?(v=(0,Y.jsxs)(Uhe,{className:f,children:[m,_,n]}),t[25]=n,t[26]=f,t[27]=m,t[28]=_,t[29]=v):v=t[29],v}function i5(e){let t=(0,X.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,anchor:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`bottom`:a,u=o===void 0?6:o,d=s===void 0?`start`:s,f=c===void 0?0:c,p=!!n,m;t[8]===r?m=t[9]:(m=Q(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[8]=r,t[9]=m);let h;t[10]!==i||t[11]!==p||t[12]!==m?(h=(0,Y.jsx)(Tme,{"data-slot":`combobox-content`,"data-chips":p,className:m,...i}),t[10]=i,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==d||t[15]!==f||t[16]!==n||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,Y.jsx)(Sme,{children:(0,Y.jsx)(Cme,{side:l,sideOffset:u,align:d,alignOffset:f,anchor:n,className:`isolate z-50`,children:h})}),t[14]=d,t[15]=f,t[16]=n,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function a5(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(m8,{"data-slot":`combobox-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function o5(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Q(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(zme,{render:(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Y.jsx)(Tv,{className:`pointer-events-none`})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(S8,{"data-slot":`combobox-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Zhe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(_8,{"data-slot":`combobox-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qhe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`px-2 py-1.5 text-xs text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(v8,{"data-slot":`combobox-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $he(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(p8,{"data-slot":`combobox-collection`,...n}),t[2]=n,t[3]=r),r}function s5(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`hidden w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground group-data-empty/combobox-content:flex`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(C8,{"data-slot":`combobox-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function c5(e){return`${e} (Unavailable)`}function ege(e){return{path:e,label:c5(e),type:`string`,sourceNodeId:``,sourceNodeLabel:`Unavailable`,sourceNodeLabels:[`Unavailable`]}}function tge(e){let t=new Map;for(let n of e){let e=t.get(n.sourceNodeLabel);e?e.push(n):t.set(n.sourceNodeLabel,[n])}return Array.from(t.entries()).toSorted(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({value:e,items:t.toSorted((e,t)=>e.path.localeCompare(t.path))}))}function nge(e,t){let n=e.find(e=>e.path===t),r=tge(e);if(n)return{selected:n,groups:r};let i=ege(t);return{selected:i,groups:[{value:i.sourceNodeLabel,items:[i]},...r]}}function rge(e,t){let n=t.trim().toLowerCase();return!n||[e.path,e.label,...e.sourceNodeLabels,...e.nullable?[`nullable`]:[]].some(e=>e.toLowerCase().includes(n))}function ige(e,t){return e.path===t.path}function age(e){return e.label}function oge(e){let t=(0,X.c)(12),{fields:n,valuePath:r,onValueChange:i,disabled:a}=e,o;t[0]!==n||t[1]!==r?(o=nge(n,r),t[0]=n,t[1]=r,t[2]=o):o=t[2];let{selected:s,groups:c}=o,l;t[3]===i?l=t[4]:(l=e=>{e&&i(e)},t[3]=i,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(r5,{"aria-label":`Select field`,className:`min-w-[280px]`,placeholder:`Select field`,triggerLabel:`Show the fields`}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsxs)(i5,{className:`w-max min-w-(--anchor-width)`,children:[(0,Y.jsx)(s5,{children:`No field matches that.`}),(0,Y.jsx)(a5,{children:sge})]}),t[6]=d):d=t[6];let f;return t[7]!==a||t[8]!==c||t[9]!==s||t[10]!==l?(f=(0,Y.jsxs)(n5,{disabled:a,filter:rge,isItemEqualToValue:ige,items:c,itemToStringLabel:age,onValueChange:l,value:s,children:[u,d]}),t[7]=a,t[8]=c,t[9]=s,t[10]=l,t[11]=f):f=t[11],f}function sge(e){return(0,Y.jsxs)(Zhe,{items:e.items,children:[(0,Y.jsx)(Qhe,{children:e.value}),(0,Y.jsx)($he,{children:t=>(0,Y.jsx)(o5,{className:`items-start`,value:t,children:(0,Y.jsxs)(`span`,{className:`flex w-full flex-col items-start`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t.label,t.nullable&&(0,Y.jsx)(`span`,{className:`rounded bg-muted px-1 py-0.5 font-normal text-xs text-muted-foreground leading-none`,children:`nullable`})]}),t.sourceNodeLabels.length>1&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Also from`,` `,t.sourceNodeLabels.filter(t=>t!==e.value).join(`, `)]})]})},t.path)})]},e.value)}function cge(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(The,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function lge(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Ohe,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function uge(e){let t=(0,X.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:n,align:i,alignOffset:a,side:o,sideOffset:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`center`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=Q(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Y.jsx)(Fhe,{"data-slot":`popover-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Y.jsx)(Ahe,{children:(0,Y.jsx)(Mhe,{align:c,alignOffset:l,side:u,sideOffset:d,className:`isolate z-50`,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function dge(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Ihe,{"data-slot":`popover-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function l5(e){let t=(0,X.c)(26),{label:n,editActionName:r,help:i,editable:a,editing:o,onEditingChange:s,stickyHeader:c,view:l,children:u}=e,d=r===void 0?n:r,f=c!==void 0&&c,p=o&&a,m=f&&p&&`sticky top-0 z-20 bg-card`,h;t[0]===m?h=t[1]:(h=Q(`flex items-center justify-between gap-2 py-1`,m),t[0]=m,t[1]=h);let g;t[2]===n?g=t[3]:(g=(0,Y.jsx)(`h3`,{className:`truncate font-medium text-xs/relaxed`,children:n}),t[2]=n,t[3]=g);let _;t[4]!==i||t[5]!==n?(_=i?(0,Y.jsx)(d5,{label:n,children:i}):null,t[4]=i,t[5]=n,t[6]=_):_=t[6];let v;t[7]!==g||t[8]!==_?(v=(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[g,_]}),t[7]=g,t[8]=_,t[9]=v):v=t[9];let y;t[10]!==d||t[11]!==a||t[12]!==p||t[13]!==s?(y=a?(0,Y.jsxs)(pv,{"aria-label":p?`Done editing ${d}`:`Edit ${d}`,className:`w-[4.5rem] justify-center`,onClick:()=>s(!p),size:`sm`,type:`button`,variant:`outline`,children:[p?(0,Y.jsx)(Tv,{"data-icon":`inline-start`}):(0,Y.jsx)(iy,{"data-icon":`inline-start`}),p?`Done`:`Edit`]}):null,t[10]=d,t[11]=a,t[12]=p,t[13]=s,t[14]=y):y=t[14];let b;t[15]!==h||t[16]!==v||t[17]!==y?(b=(0,Y.jsxs)(`div`,{className:h,children:[v,y]}),t[15]=h,t[16]=v,t[17]=y,t[18]=b):b=t[18];let x;t[19]!==u||t[20]!==p||t[21]!==l?(x=p?(0,Y.jsx)(`div`,{className:`space-y-2`,children:u}):l,t[19]=u,t[20]=p,t[21]=l,t[22]=x):x=t[22];let S;return t[23]!==x||t[24]!==b?(S=(0,Y.jsxs)(`section`,{className:`space-y-2`,children:[b,x]}),t[23]=x,t[24]=b,t[25]=S):S=t[25],S}function u5(e){let t=(0,X.c)(14),{label:n,help:r,className:i,children:a}=e,o;t[0]===i?o=t[1]:(o=Q(`space-y-1.5`,i),t[0]=i,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Y.jsx)(`h4`,{className:`truncate font-medium text-muted-foreground text-xs/relaxed`,children:n}),t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==n?(c=r?(0,Y.jsx)(d5,{label:n,children:r}):null,t[4]=r,t[5]=n,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==c?(l=(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;return t[10]!==a||t[11]!==o||t[12]!==l?(u=(0,Y.jsxs)(`section`,{className:o,children:[l,a]}),t[10]=a,t[11]=o,t[12]=l,t[13]=u):u=t[13],u}function d5(e){let t=(0,X.c)(15),{label:n,children:r}=e,i=`About ${n}`,a;t[0]===i?a=t[1]:(a=(0,Y.jsx)(pv,{"aria-label":i,className:`text-muted-foreground`,size:`icon-sm`,type:`button`,variant:`ghost`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(jv,{}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,Y.jsx)(lge,{render:a,children:o}),t[3]=a,t[4]=s);let c;t[5]===n?c=t[6]:(c=(0,Y.jsx)(dge,{className:`sr-only`,children:n}),t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Y.jsx)(`div`,{className:`space-y-2 text-muted-foreground`,children:r}),t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,Y.jsxs)(uge,{align:`start`,className:`max-h-(--available-height) max-w-[min(20rem,80vw)] overflow-y-auto`,side:`left`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==u?(d=(0,Y.jsxs)(cge,{children:[s,u]}),t[12]=s,t[13]=u,t[14]=d):d=t[14],d}function fge(e){let t=(0,X.c)(7),{label:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Y.jsx)(`span`,{className:`min-w-0`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-sm`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function pge(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n}),t[0]=n,t[1]=r),r}function f5(e){let t=(0,X.c)(18),{children:n,className:r,title:i,variant:a}=e;if((a===void 0?`box`:a)===`text`){let e;t[0]===r?e=t[1]:(e=Q(`text-warning text-xs`,r),t[0]=r,t[1]=e);let i;return t[2]!==n||t[3]!==e?(i=(0,Y.jsx)(`p`,{className:e,children:n}),t[2]=n,t[3]=e,t[4]=i):i=t[4],i}let o;t[5]===r?o=t[6]:(o=Q(`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-2`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(fy,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),t[7]=s):s=t[7];let c;t[8]===i?c=t[9]:(c=i?(0,Y.jsx)(`p`,{className:`font-medium text-warning text-xs`,children:i}):null,t[8]=i,t[9]=c);let l;t[10]===n?l=t[11]:(l=(0,Y.jsx)(`p`,{className:`text-warning text-xs`,children:n}),t[10]=n,t[11]=l);let u;t[12]!==c||t[13]!==l?(u=(0,Y.jsxs)(`div`,{className:`space-y-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==o||t[16]!==u?(d=(0,Y.jsxs)(`div`,{className:o,children:[s,u]}),t[15]=o,t[16]=u,t[17]=d):d=t[17],d}function mge(e){let t=(0,X.c)(11),{model:n,fields:r}=e,i;t[0]===r?i=t[1]:(i=new Map(r.map(hge)),t[0]=r,t[1]=i);let a=i,o;if(t[2]!==a||t[3]!==n.groupLogic||t[4]!==n.groups){let e;t[6]!==a||t[7]!==n.groupLogic?(e=(e,t)=>(0,Y.jsxs)(`div`,{children:[t>0?(0,Y.jsx)(vge,{label:p5(n.groupLogic)}):null,(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 font-medium text-xs`,children:t+1}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.conditions.length,` `,e.conditions.length===1?`condition`:`conditions`]})]}),(0,Y.jsx)(`ul`,{className:`mt-1 ml-2.5 space-y-1 border-l pl-3`,children:e.conditions.map((t,n)=>(0,Y.jsx)(gge,{condition:t,field:a.get(t.field),joiner:n>0?p5(e.logic):null},t.id))})]},e.id),t[6]=a,t[7]=n.groupLogic,t[8]=e):e=t[8],o=n.groups.map(e),t[2]=a,t[3]=n.groupLogic,t[4]=n.groups,t[5]=o}else o=t[5];let s;return t[9]===o?s=t[10]:(s=(0,Y.jsx)(`div`,{children:o}),t[9]=o,t[10]=s),s}function hge(e){return[e.path,e]}function gge(e){let t=(0,X.c)(26),{condition:n,field:r,joiner:i}=e,a;t[0]!==n||t[1]!==r?(a=_ge(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let o=a,s;t[3]===i?s=t[4]:(s=i?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:i}):null,t[3]=i,t[4]=s);let c;t[5]!==n||t[6]!==r?.label?(c=r?.label??c5(n.field),t[5]=n,t[6]=r?.label,t[7]=c):c=t[7];let l;t[8]===c?l=t[9]:(l=(0,Y.jsx)(`span`,{className:`font-medium`,children:c}),t[8]=c,t[9]=l);let u;t[10]===n?u=t[11]:(u=yge(n),t[10]=n,t[11]=u);let d;t[12]===u?d=t[13]:(d=(0,Y.jsx)(`span`,{className:`mx-1.5 text-muted-foreground`,children:u}),t[12]=u,t[13]=d);let f;t[14]===n?f=t[15]:(f=xge(n),t[14]=n,t[15]=f);let p;t[16]!==l||t[17]!==d||t[18]!==f?(p=(0,Y.jsxs)(`p`,{className:`text-sm`,children:[l,d,f]}),t[16]=l,t[17]=d,t[18]=f,t[19]=p):p=t[19];let m;t[20]===o?m=t[21]:(m=o?(0,Y.jsx)(f5,{variant:`text`,children:o}):null,t[20]=o,t[21]=m);let h;return t[22]!==s||t[23]!==p||t[24]!==m?(h=(0,Y.jsxs)(`li`,{children:[s,p,m]}),t[22]=s,t[23]=p,t[24]=m,t[25]=h):h=t[25],h}function _ge(e,t){let n=o2(e);if(!n.valid)return n.error;let r=t?.enumValues;return r&&r.length>0&&!A0(e)&&e.fieldType===`string`&&(e.operator===`equals`||e.operator===`not_equals`)&&!r.includes(e.value)?`${t.label} no longer offers this value. Choose one it does.`:null}function vge(e){let t=(0,X.c)(6),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-border`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}),t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-border`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[r,i,a]}),t[4]=i,t[5]=o),o}function p5(e){return N0.find(t=>t.value===e)?.label??e}function yge(e){return(A0(e)?z0:bge(e.fieldType)).find(t=>t.value===e.operator)?.label??e.operator}function bge(e){return e===`timestamp`?P0:e===`string`?I0:e===`number`?L0:R0}function xge(e){if(A0(e))return``;if(e.fieldType===`timestamp`){if(O0(e)){let t=F0.find(t=>t.value===e.unit)?.label??e.unit;return`${e.amount} ${t}`}if(k0(e)){let t=new Date(e.dateTime);return Number.isNaN(t.getTime())?e.dateTime:t.toLocaleString()}return``}return e.fieldType===`string`?e.value:e.fieldType===`number`?String(e.value):``}function Sge(e){return e===`within_next`||e===`more_than_from_now`||e===`less_than_ago`||e===`more_than_ago`}function Cge(e){return e===`before`||e===`after`}function wge(e){return e===`equals`||e===`not_equals`||e===`contains`}function Tge(e){return e===`equals`||e===`not_equals`||e===`greater_than`||e===`greater_or_equal`||e===`less_than`||e===`less_or_equal`}function Ege(e){return e===`is_true`||e===`is_false`}function Dge(e){return F0.some(t=>t.value===e)}function Oge(e,t){let n=t?z0:[];return e===`timestamp`?[...P0,...n]:e===`string`?[...I0,...n]:e===`number`?[...L0,...n]:[...R0,...n]}function kge(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function Age(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString()}function jge(e){return M0(e,{groupId:G$(),conditionId:G$()})}function m5(e){return j0(e,G$())}function Mge(e){let{condition:t,operatorValue:n}=e;return Sge(n)?{id:t.id,field:t.field,fieldType:`timestamp`,operator:n,amount:O0(t)?t.amount:1,unit:O0(t)?t.unit:`days`}:Cge(n)?{id:t.id,field:t.field,fieldType:`timestamp`,operator:n,dateTime:k0(t)?t.dateTime:new Date().toISOString()}:null}function Nge(e){return e===`is_set`||e===`is_not_set`}function Pge(e,t){let n={id:e.id,field:e.field};if(Nge(t))return{...n,fieldType:e.fieldType,operator:t};if(e.fieldType===`timestamp`)return Mge({condition:A0(e)?{...n,fieldType:`timestamp`,operator:`within_next`,amount:1,unit:`days`}:e,operatorValue:t});if(e.fieldType===`string`){if(!wge(t))return null;let r=!A0(e)&&`value`in e?e.value:``;return{...n,fieldType:`string`,operator:t,value:r}}if(e.fieldType===`number`){if(!Tge(t))return null;let r=!A0(e)&&`value`in e?e.value:0;return{...n,fieldType:`number`,operator:t,value:r}}return Ege(t)?{...n,fieldType:`boolean`,operator:t}:null}function h5(e){let t=(0,X.c)(6),{value:n,onChange:r,disabled:i}=e,a;t[0]!==i||t[1]!==r||t[2]!==n?(a=N0.map(e=>{let t=e.value===n;return(0,Y.jsx)(`button`,{className:`rounded-full px-3 py-1 font-medium text-xs transition-colors ${t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`}`,disabled:i,onClick:()=>r(e.value),type:`button`,children:e.label},e.value)}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,Y.jsx)(`div`,{className:`inline-flex items-center rounded-full border bg-card p-0.5`,children:a}),t[4]=a,t[5]=o),o}function Fge(e){let t=(0,X.c)(59),{condition:n,disabled:r,currentNodeId:i,enumValues:a,onConditionChange:o}=e;if(A0(n))return null;if(n.fieldType===`timestamp`){if(O0(n)){let e;t[0]!==n||t[1]!==o?(e=e=>{let t=Number.parseInt(e.target.value,10);o({...n,amount:Number.isNaN(t)?1:Math.max(t,1)})},t[0]=n,t[1]=o,t[2]=e):e=t[2];let i;t[3]!==n.amount||t[4]!==r||t[5]!==e?(i=(0,Y.jsx)(B4,{className:`w-24`,disabled:r,min:1,onChange:e,type:`number`,value:n.amount}),t[3]=n.amount,t[4]=r,t[5]=e,t[6]=i):i=t[6];let a;t[7]!==n||t[8]!==o?(a=e6(e=>{Dge(e)&&o({...n,unit:e})}),t[7]=n,t[8]=o,t[9]=a):a=t[9];let s;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(Z3,{className:`w-36`,children:(0,Y.jsx)(X3,{})}),t[10]=s):s=t[10];let c;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Q3,{children:F0.map(Rge)}),t[11]=c):c=t[11];let l;t[12]!==n.unit||t[13]!==r||t[14]!==a?(l=(0,Y.jsxs)(Y3,{disabled:r,items:F0,onValueChange:a,value:n.unit,children:[s,c]}),t[12]=n.unit,t[13]=r,t[14]=a,t[15]=l):l=t[15];let u;return t[16]!==i||t[17]!==l?(u=(0,Y.jsxs)(Y.Fragment,{children:[i,l]}),t[16]=i,t[17]=l,t[18]=u):u=t[18],u}let e;t[19]!==n||t[20]!==o?(e=e=>{k0(n)&&o({...n,dateTime:Age(e.target.value)})},t[19]=n,t[20]=o,t[21]=e):e=t[21];let i;t[22]===n?i=t[23]:(i=k0(n)?kge(n.dateTime):``,t[22]=n,t[23]=i);let a;return t[24]!==r||t[25]!==e||t[26]!==i?(a=(0,Y.jsx)(B4,{disabled:r,onChange:e,type:`datetime-local`,value:i}),t[24]=r,t[25]=e,t[26]=i,t[27]=a):a=t[27],a}if(n.fieldType===`string`){if(a&&a.length>0&&(n.operator===`equals`||n.operator===`not_equals`)){let e;t[28]===a?e=t[29]:(e=a.map(Lge),t[28]=a,t[29]=e);let i;t[30]!==n||t[31]!==o?(i=e6(e=>{o({...n,value:e})}),t[30]=n,t[31]=o,t[32]=i):i=t[32];let s=a.includes(n.value)?n.value:null,c;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(Z3,{className:`min-w-[240px]`,children:(0,Y.jsx)(X3,{placeholder:`Select value`})}),t[33]=c):c=t[33];let l;t[34]===a?l=t[35]:(l=a.map(Ige),t[34]=a,t[35]=l);let u;t[36]===l?u=t[37]:(u=(0,Y.jsx)(Q3,{children:l}),t[36]=l,t[37]=u);let d;return t[38]!==r||t[39]!==e||t[40]!==i||t[41]!==s||t[42]!==u?(d=(0,Y.jsxs)(Y3,{disabled:r,items:e,onValueChange:i,value:s,children:[c,u]}),t[38]=r,t[39]=e,t[40]=i,t[41]=s,t[42]=u,t[43]=d):d=t[43],d}let e;t[44]!==n||t[45]!==o?(e=e=>{o({...n,value:e})},t[44]=n,t[45]=o,t[46]=e):e=t[46];let s;return t[47]!==n.value||t[48]!==i||t[49]!==r||t[50]!==e?(s=(0,Y.jsx)(w6,{className:`min-w-[240px]`,currentNodeId:i,disabled:r,onChange:e,placeholder:`value`,value:n.value}),t[47]=n.value,t[48]=i,t[49]=r,t[50]=e,t[51]=s):s=t[51],s}if(n.fieldType===`number`){let e;t[52]!==n||t[53]!==o?(e=e=>{let t=Number.parseFloat(e.target.value);o({...n,value:Number.isNaN(t)?0:t})},t[52]=n,t[53]=o,t[54]=e):e=t[54];let i=String(n.value),a;return t[55]!==r||t[56]!==e||t[57]!==i?(a=(0,Y.jsx)(B4,{disabled:r,onChange:e,placeholder:`0`,type:`number`,value:i}),t[55]=r,t[56]=e,t[57]=i,t[58]=a):a=t[58],a}return null}function Ige(e){return(0,Y.jsx)($3,{value:e,children:e},e)}function Lge(e){return{label:e,value:e}}function Rge(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function g5(e){let t=(0,X.c)(23),{label:n,editActionName:r,stickyHeader:i,description:a,fields:o,emptyFieldsMessage:s,value:c,onChange:l,currentNodeId:u,defaultEditing:d,disabled:f}=e,p=d!==void 0&&d,m=o[0]??null,[h,g]=(0,J.useState)(p),_;t[0]===o?_=t[1]:(_=new Map(o.map(Bge)),t[0]=o,t[1]=_);let v=_,y;if(t[2]!==o||t[3]!==u||t[4]!==a||t[5]!==f||t[6]!==r||t[7]!==h||t[8]!==s||t[9]!==v||t[10]!==n||t[11]!==l||t[12]!==m||t[13]!==i||t[14]!==c){let e=c.trim(),d=t2(e),p=d.valid?d.model:null,_;t[16]===l?_=t[17]:(_=e=>{let t=s2(e);l({model:n2(e),expression:t.valid?t.expression:``})},t[16]=l,t[17]=_);let b=_,x;t[18]!==b||t[19]!==m?(x=()=>{m&&b(jge(m))},t[18]=b,t[19]=m,t[20]=x):x=t[20];let S=x,C=p?mle(p,v):null,w=C?s2(C):null,T=(e,t)=>{C&&b({...C,groups:C.groups.map(n=>n.id===e?t(n):n)})},E=(e,t,n)=>{T(e,e=>({...e,conditions:e.conditions.map(e=>e.id===t?n(e):e)}))},D=e=>{C&&m&&T(e,e=>({...e,conditions:[...e.conditions,m5(m)]}))},O=(e,t)=>{C&&T(e,e=>e.conditions.length<=1?e:{...e,conditions:e.conditions.filter(e=>e.id!==t)})},k=()=>{C&&m&&b({...C,groups:[...C.groups,{id:G$(),logic:`and`,conditions:[m5(m)]}]})},A=e=>{!C||C.groups.length<=1||b({...C,groups:C.groups.filter(t=>t.id!==e)})},j=!f&&C!==null,M;t[21]===a?M=t[22]:(M=(0,Y.jsx)(`p`,{children:a}),t[21]=a,t[22]=M),y=(0,Y.jsx)(l5,{editable:j,editActionName:r,editing:h,help:M,label:n,onEditingChange:g,stickyHeader:i,view:C?(0,Y.jsx)(mge,{fields:o,model:C}):(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[o.length>0?(0,Y.jsx)(pv,{disabled:f,onClick:()=>{S(),g(!0)},size:`sm`,type:`button`,variant:`outline`,children:`Configure condition`}):(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:s}),e&&!d.valid&&(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:d.error})]}),children:C?(0,Y.jsxs)(Y.Fragment,{children:[C.groups.map((e,t)=>(0,Y.jsxs)(`div`,{children:[t>0&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,Y.jsx)(h5,{disabled:f,onChange:e=>{b({...C,groupLogic:e})},value:C.groupLogic}),(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-border`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 font-medium text-xs`,children:t+1}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.conditions.length,` `,e.conditions.length===1?`condition`:`conditions`]})]}),(0,Y.jsx)(pv,{disabled:f||C.groups.length<=1,onClick:()=>A(e.id),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,Y.jsx)(dy,{className:`size-4`})})]}),(0,Y.jsxs)(`div`,{className:`mt-1 ml-2.5 space-y-2 border-l pl-3`,children:[e.conditions.map((t,n)=>{let r=v.get(t.field),i=Oge(t.fieldType,r?.nullable),a=e.conditions.length>1;return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(oge,{disabled:f||o.length===0,fields:o,onValueChange:n=>{n.path!==t.field&&E(e.id,t.id,e=>j0(n,e.id))},valuePath:t.field}),(0,Y.jsxs)(Y3,{disabled:f,items:i,onValueChange:e6(n=>{let r=Pge(t,n);r&&E(e.id,t.id,()=>r)}),value:t.operator,children:[(0,Y.jsx)(Z3,{className:`min-w-[190px]`,children:(0,Y.jsx)(X3,{placeholder:`Select operator`})}),(0,Y.jsx)(Q3,{children:i.map(zge)})]}),(0,Y.jsx)(Fge,{condition:t,currentNodeId:u,disabled:f,enumValues:r?.enumValues,onConditionChange:n=>{E(e.id,t.id,()=>n)}}),(0,Y.jsx)(pv,{disabled:f||!a,onClick:()=>O(e.id,t.id),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,Y.jsx)(dy,{className:`size-4`})})]}),n<e.conditions.length-1&&(0,Y.jsx)(`div`,{className:`pt-2`,children:(0,Y.jsx)(h5,{disabled:f,onChange:t=>{T(e.id,e=>({...e,logic:t}))},value:e.logic})})]},t.id)}),(0,Y.jsxs)(pv,{disabled:f||!m,onClick:()=>D(e.id),size:`sm`,type:`button`,variant:`ghost`,children:[(0,Y.jsx)(oy,{className:`size-4`}),`Add condition`]})]})]},e.id)),(0,Y.jsx)(`div`,{className:`flex justify-center pt-1`,children:(0,Y.jsxs)(pv,{disabled:f||!m,onClick:k,size:`sm`,type:`button`,variant:`outline`,children:[(0,Y.jsx)(oy,{className:`size-4`}),`Add group`]})}),w?.valid===!1&&(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:w.error}),w?.valid&&(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Compiled CEL: `,w.expression]})]}):null}),t[2]=o,t[3]=u,t[4]=a,t[5]=f,t[6]=r,t[7]=h,t[8]=s,t[9]=v,t[10]=n,t[11]=l,t[12]=m,t[13]=i,t[14]=c,t[15]=y}else y=t[15];return y}function zge(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function Bge(e){return[e.path,e]}function Vge(e,t){let n=t.trim().toLowerCase();return!n||e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)}function Hge(e,t){return e.name===t.name}function Uge(e){let t=(0,X.c)(6),{inputId:n,placeholder:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,Y.jsx)(r5,{id:n,placeholder:r,triggerLabel:`Show the Events`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsxs)(i5,{children:[(0,Y.jsx)(s5,{children:`No Event matches that.`}),(0,Y.jsx)(a5,{children:Wge})]}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,Y.jsxs)(Y.Fragment,{children:[i,a]}),t[4]=i,t[5]=o),o}function Wge(e){return(0,Y.jsxs)(o5,{value:e,children:[(0,Y.jsx)(`span`,{className:`block truncate`,children:e.label}),e.label===e.name?null:(0,Y.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.name})]},e.name)}function _5(e){let t=(0,X.c)(16),{choices:n,value:r,onValueChange:i,disabled:a,inputId:o,placeholder:s}=e,c=s===void 0?`Search Events`:s,l;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>n.find(t=>t.name===e)??[],t[3]=n,t[4]=e),l=r.flatMap(e),t[0]=n,t[1]=r,t[2]=l}else l=t[2];let u=l,d;t[5]===i?d=t[6]:(d=e=>i(e.map(Gge)),t[5]=i,t[6]=d);let f;t[7]!==o||t[8]!==c?(f=(0,Y.jsx)(Uge,{inputId:o,placeholder:c}),t[7]=o,t[8]=c,t[9]=f):f=t[9];let p;return t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==d||t[14]!==f?(p=(0,Y.jsx)(n5,{disabled:a,filter:Vge,isItemEqualToValue:Hge,items:n,itemToStringLabel:Kge,multiple:!0,onValueChange:d,value:u,children:f}),t[10]=n,t[11]=a,t[12]=u,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Gge(e){return e.name}function Kge(e){return e.label}function qge(e){let t=(0,X.c)(30),{config:n,onUpdateConfig:r,disabled:i}=e,a=(0,J.useId)(),o=p2(n),s=vy(),c=o.map(Jge),l;t[0]===r?l=t[1]:(l=e=>{r({waitFor:e})},t[0]=r,t[1]=l);let u=l,d;t[2]!==o||t[3]!==u?(d=e=>{u(e.map(e=>o.find(t=>t.event===e)??{event:e}))},t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,p;t[5]!==o||t[6]!==u?(p=e=>{u(o.filter(t=>t.event!==e))},t[5]=o,t[6]=u,t[7]=p):p=t[7];let m=p,h;t[8]!==o||t[9]!==u?(h=(e,t)=>{u(o.map(n=>n.event===e?{event:n.event,...t?{match:t}:{}}:n))},t[8]=o,t[9]=u,t[10]=h):h=t[10];let g=h,_;t[11]===a?_=t[12]:(_=(0,Y.jsx)(V4,{htmlFor:a,children:`Resume when the event is`}),t[11]=a,t[12]=_);let v;t[13]!==s.events||t[14]!==i||t[15]!==a||t[16]!==c||t[17]!==f?(v=s.events.length>0?(0,Y.jsx)(_5,{choices:s.events,disabled:i,inputId:a,onValueChange:f,value:c}):(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This server declares no Events, so there is nothing for a wait to park on. Ask whoever runs it to declare the Event.`}),t[13]=s.events,t[14]=i,t[15]=a,t[16]=c,t[17]=f,t[18]=v):v=t[18];let y;t[19]!==_||t[20]!==v?(y=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[_,v]}),t[19]=_,t[20]=v,t[21]=y):y=t[21];let b;t[22]!==i||t[23]!==m||t[24]!==o||t[25]!==g?(b=o.length===0?(0,Y.jsx)(f5,{children:`Name at least one event. A wait with none cannot be resumed by anything, and the workflow will not save.`}):o.map(e=>(0,Y.jsx)(Yge,{disabled:i,onMatchChange:g,onRemove:m,subscription:e},e.event)),t[22]=i,t[23]=m,t[24]=o,t[25]=g,t[26]=b):b=t[26];let x;return t[27]!==y||t[28]!==b?(x=(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[y,b]}),t[27]=y,t[28]=b,t[29]=x):x=t[29],x}function Jge(e){return e.event}function Yge(e){let t=(0,X.c)(60),{subscription:n,onMatchChange:r,onRemove:i,disabled:a}=e,o=dA(W2),s=dA(e4),c=vy(),l;t[0]!==c||t[1]!==n.event?(l=My(c,n.event),t[0]=c,t[1]=n.event,t[2]=l):l=t[2];let u=l,d;t[3]===s?d=t[4]:(d=s.filter(Qge).map(Zge).find(Xge),t[3]=s,t[4]=d);let f=d,p;t[5]!==c||t[6]!==n.event?(p=rpe(c,n.event),t[5]=c,t[6]=n.event,t[7]=p):p=t[7];let m=p,h;t[8]!==r||t[9]!==n.event?(h=e=>{r(n.event,e.model)},t[8]=r,t[9]=n.event,t[10]=h):h=t[10];let g=h,[_,v]=(0,J.useState)(!1),y;t[11]!==r||t[12]!==n.event?(y=()=>{r(n.event,``),v(!1)},t[11]=r,t[12]=n.event,t[13]=y):y=t[13];let b=y,x;t[14]!==f||t[15]!==u?.correlationPath||t[16]!==n.event?(x=()=>f?lQ({rules:f,eventName:n.event,declaredPath:u?.correlationPath}):u?.correlationPath,t[14]=f,t[15]=u?.correlationPath,t[16]=n.event,t[17]=x):x=t[17],u?.correlationPath;let S;t[18]===x?S=t[19]:(S=x(),t[18]=x,t[19]=S);let C=S,w;t[20]!==m||t[21]!==r||t[22]!==C||t[23]!==n.event?(w=()=>{let e=m.find(e=>e.path===C)??m[0];e&&(r(n.event,n2(M0(e,{groupId:`${n.event}-group`,conditionId:`${n.event}-rule`}))),v(!0))},t[20]=m,t[21]=r,t[22]=C,t[23]=n.event,t[24]=w):w=t[24];let T=w,E;t[25]===u?E=t[26]:(E=u?(0,Y.jsx)(`p`,{className:`truncate text-xs`,children:u.label}):null,t[25]=u,t[26]=E);let D;t[27]===n.event?D=t[28]:(D=(0,Y.jsx)(`p`,{className:`truncate font-mono text-xs text-muted-foreground`,children:n.event}),t[27]=n.event,t[28]=D);let O;t[29]===u?O=t[30]:(O=u?null:(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:`This app no longer declares this Event; the workflow will not save until it is removed or declared again.`}),t[29]=u,t[30]=O);let k;t[31]!==n.event||t[32]!==D||t[33]!==O||t[34]!==E?(k=(0,Y.jsxs)(`div`,{className:`min-w-0`,title:n.event,children:[E,D,O]}),t[31]=n.event,t[32]=D,t[33]=O,t[34]=E,t[35]=k):k=t[35];let A=`Remove ${n.event}`,j;t[36]!==i||t[37]!==n.event?(j=()=>i(n.event),t[36]=i,t[37]=n.event,t[38]=j):j=t[38];let M;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Y.jsx)(my,{className:`size-3.5`}),t[39]=M):M=t[39];let N;t[40]!==a||t[41]!==A||t[42]!==j?(N=(0,Y.jsx)(pv,{"aria-label":A,className:`size-7 shrink-0`,disabled:a,onClick:j,size:`icon`,type:`button`,variant:`ghost`,children:M}),t[40]=a,t[41]=A,t[42]=j,t[43]=N):N=t[43];let P;t[44]!==k||t[45]!==N?(P=(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[k,N]}),t[44]=k,t[45]=N,t[46]=P):P=t[46];let F;t[47]!==a||t[48]!==m||t[49]!==g||t[50]!==b||t[51]!==T||t[52]!==_||t[53]!==o||t[54]!==n.event||t[55]!==n.match?(F=n.match?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(g5,{currentNodeId:o??void 0,defaultEditing:_,description:`Only an arrival satisfying this resumes the run. Compare a payload field against a literal, or against a value from this run.`,disabled:a,emptyFieldsMessage:`This Event declares no fields, so there is nothing to match on.`,fields:m,label:`Match`,onChange:g,value:n.match}),(0,Y.jsxs)(pv,{disabled:a,onClick:b,size:`sm`,type:`button`,variant:`ghost`,children:[`Resume on any `,n.event]})]}):(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Any `,n.event,` resumes this run, whatever it carries.`]}),(0,Y.jsx)(pv,{disabled:a||m.length===0,onClick:T,size:`sm`,type:`button`,variant:`outline`,children:`Add a match`})]}),t[47]=a,t[48]=m,t[49]=g,t[50]=b,t[51]=T,t[52]=_,t[53]=o,t[54]=n.event,t[55]=n.match,t[56]=F):F=t[56];let I;return t[57]!==P||t[58]!==F?(I=(0,Y.jsxs)(`div`,{className:`space-y-2 rounded-md border p-2`,children:[P,F]}),t[57]=P,t[58]=F,t[59]=I):I=t[59],I}function Xge(e){return e!==void 0}function Zge(e){return sQ(e.data.config)}function Qge(e){return e.data.type===`lifecycle`}var v5=[{value:`duration`,label:`Wait for duration`},{value:`until`,label:`Wait until date/time`}],y5=[{value:`off`,label:`Off (continue immediately)`},{value:`require_actual_wait`,label:`Skip branch when already due`}],b5=[{value:`off`,label:`Off (allow any time)`},{value:`daily_window`,label:`Daily window`}],x5=[{value:`continue`,label:`Continue workflow`},{value:`skip`,label:`Skip remaining branch`}],S5=[{value:`delay`,label:`Wait for time`},{value:`event`,label:`Wait for an event`}];function C5(e){let t=(0,X.c)(5),{logoUrl:n,label:r,fallback:i}=e,a;t[0]===n?a=t[1]:(a=n?.trim(),t[0]=n,t[1]=a);let o=a;if(!o)return i;let s=`${r} logo`,c;return t[2]!==o||t[3]!==s?(c=(0,Y.jsx)(`img`,{alt:s,className:`size-4 rounded-sm object-contain`,height:16,loading:`lazy`,src:o,width:16}),t[2]=o,t[3]=s,t[4]=c):c=t[4],c}function $ge(e){let t=(0,X.c)(15),{config:n,onUpdateConfig:r,disabled:i}=e,a=dA(W2),o=dA(e4),s=dA(t4),c=vy(),l=a??void 0,u;t[0]!==c||t[1]!==s||t[2]!==o||t[3]!==l?(u=m6({currentNodeId:l,nodes:o,edges:s,catalog:c}),t[0]=c,t[1]=s,t[2]=o,t[3]=l,t[4]=u):u=t[4];let d=u,f;t[5]===r?f=t[6]:(f=e=>{r({conditionModel:e.model,condition:e.expression})},t[5]=r,t[6]=f);let p=f,m=a??void 0,h;t[7]===n?h=t[8]:(h=iJ(n,`conditionModel`)??``,t[7]=n,t[8]=h);let g;return t[9]!==i||t[10]!==d||t[11]!==p||t[12]!==m||t[13]!==h?(g=(0,Y.jsx)(g5,{currentNodeId:m,description:`Build a condition from the Lifecycle Node and upstream action output fields. Timestamp fields support relative and absolute time filters.`,disabled:i,emptyFieldsMessage:`No upstream fields available. Connect this node to the Lifecycle Node or an action with typed outputs first.`,editActionName:`condition`,fields:d,label:`Continue when`,onChange:p,stickyHeader:!0,value:h}),t[9]=i,t[10]=d,t[11]=p,t[12]=m,t[13]=h,t[14]=g):g=t[14],g}function e_e(){let e=(0,X.c)(3),t=R6(dA(W2)),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:`Splits On Event`}),e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r=(0,Y.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[n,t.length===0?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No Event reaches this node yet. Connect it below the Lifecycle Node, and it draws one outlet per Start Event.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`ul`,{className:`space-y-1`,children:t.map(t_e)}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`A run leaves by the outlet naming the Event it arrived on. An outlet with nothing connected ends the run there.`})]})]}),e[1]=t,e[2]=r),r}function t_e(e){return(0,Y.jsxs)(`li`,{className:`text-sm`,children:[e.label,(0,Y.jsx)(`span`,{className:`ml-2 text-muted-foreground text-xs`,children:e.name})]},e.name)}function n_e(e){let t=(0,X.c)(87),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=aJ(n,`waitGateMode`,`off`),t[0]=n,t[1]=a);let o=a,s;t[2]===n?s=t[3]:(s=iJ(n,`waitUntil`),t[2]=n,t[3]=s);let c=s,l;t[4]===n?l=t[5]:(l=iJ(n,`waitDuration`),t[4]=n,t[5]=l);let u=l,d;t[6]===n?d=t[7]:(d=d2(n),t[6]=n,t[7]=d);let f=d,p;t[8]===n?p=t[9]:(p=iJ(n,`waitAllowedHoursMode`),t[8]=n,t[9]=p);let m=p===`daily_window`,h;t[10]!==n||t[11]!==r?(h=e=>{let t={...n,waitDelayTimingMode:e},i=Object.fromEntries(f2(t).map(o_e));r({...i,waitDelayTimingMode:e})},t[10]=n,t[11]=r,t[12]=h):h=t[12];let g=h,_;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:`Time-Based Wait`}),t[13]=_):_=t[13];let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Y.jsx)(V4,{htmlFor:`waitDelayTimingMode`,children:`Time input mode`}),t[14]=v):v=t[14];let y;t[15]===g?y=t[16]:(y=e6(g),t[15]=g,t[16]=y);let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(Z3,{className:`w-full`,id:`waitDelayTimingMode`,children:(0,Y.jsx)(X3,{placeholder:`Select time input mode`})}),t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(Q3,{children:v5.map(a_e)}),t[18]=x):x=t[18];let S;t[19]!==f||t[20]!==i||t[21]!==y?(S=(0,Y.jsxs)(Y3,{disabled:i,items:v5,onValueChange:y,value:f,children:[b,x]}),t[19]=f,t[20]=i,t[21]=y,t[22]=S):S=t[22];let C;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Pick one mode. Switching modes clears fields that do not apply.`}),t[23]=C):C=t[23];let w;t[24]===S?w=t[25]:(w=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[v,S,C]}),t[24]=S,t[25]=w);let T;t[26]!==n||t[27]!==u||t[28]!==c||t[29]!==f||t[30]!==i||t[31]!==r?(T=f===`duration`?(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`waitDuration`,children:`Wait for (duration)`}),(0,Y.jsx)(w6,{disabled:i,fieldType:l2.waitDuration.type,id:`waitDuration`,onChange:e=>r({waitDuration:e}),placeholder:`24h, 90m, 3600000, or P1D`,value:u}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Example: use `,(0,Y.jsx)(`code`,{children:`24h`}),` to continue one day later.`]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`waitUntil`,children:`Wait until this date/time`}),(0,Y.jsx)(w6,{disabled:i,fieldType:l2.waitUntil.type,id:`waitUntil`,onChange:e=>r({waitUntil:e}),placeholder:`2026-03-10T09:00:00-05:00 or {{@lifecycle_1:Lifecycle.appointment.startsAt}}`,value:c}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Use this when timing comes from payload data, like an appointment start time.`})]}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`waitOffset`,children:`Send before/after that time (optional)`}),(0,Y.jsx)(w6,{disabled:i,fieldType:l2.waitOffset.type,id:`waitOffset`,onChange:e=>r({waitOffset:e}),placeholder:`-1d, 6h, 30m`,value:iJ(n,`waitOffset`)}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Example: `,(0,Y.jsx)(`code`,{children:`-1d`}),` sends one day before the target time.`]})]})]}),t[26]=n,t[27]=u,t[28]=c,t[29]=f,t[30]=i,t[31]=r,t[32]=T):T=t[32];let E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Y.jsx)(V4,{htmlFor:`waitGateMode`,children:`Continue only if time actually elapsed`}),t[33]=E):E=t[33];let D;t[34]===r?D=t[35]:(D=e=>r({waitGateMode:e}),t[34]=r,t[35]=D);let O;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Y.jsx)(Z3,{className:`w-full`,id:`waitGateMode`,children:(0,Y.jsx)(X3,{placeholder:`Select behavior`})}),t[36]=O):O=t[36];let k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Y.jsx)(Q3,{children:y5.map(i_e)}),t[37]=k):k=t[37];let A;t[38]!==i||t[39]!==D||t[40]!==o?(A=(0,Y.jsxs)(Y3,{disabled:i,items:y5,onValueChange:D,value:o,children:[O,k]}),t[38]=i,t[39]=D,t[40]=o,t[41]=A):A=t[41];let j;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Prevents immediate sends when the computed time is now or in the past after an update/reschedule.`}),t[42]=j):j=t[42];let M;t[43]===A?M=t[44]:(M=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[E,A,j]}),t[43]=A,t[44]=M);let N;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Y.jsx)(V4,{htmlFor:`waitAllowedHoursMode`,children:`Allowed send window`}),t[45]=N):N=t[45];let P;t[46]===r?P=t[47]:(P=e=>r({waitAllowedHoursMode:e}),t[46]=r,t[47]=P);let F;t[48]===n?F=t[49]:(F=aJ(n,`waitAllowedHoursMode`,`off`),t[48]=n,t[49]=F);let I;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Y.jsx)(Z3,{className:`w-full`,id:`waitAllowedHoursMode`,children:(0,Y.jsx)(X3,{placeholder:`Select window mode`})}),t[50]=I):I=t[50];let L;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Y.jsx)(Q3,{children:b5.map(r_e)}),t[51]=L):L=t[51];let R;t[52]!==i||t[53]!==P||t[54]!==F?(R=(0,Y.jsxs)(Y3,{disabled:i,items:b5,onValueChange:P,value:F,children:[I,L]}),t[52]=i,t[53]=P,t[54]=F,t[55]=R):R=t[55];let z;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`When enabled, times outside the window shift to the next allowed start.`}),t[56]=z):z=t[56];let B;t[57]===R?B=t[58]:(B=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[N,R,z]}),t[57]=R,t[58]=B);let V;t[59]!==n||t[60]!==i||t[61]!==m||t[62]!==r?(V=m&&(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`waitAllowedStartTime`,children:`Window start`}),(0,Y.jsx)(B4,{disabled:i,id:`waitAllowedStartTime`,onChange:e=>r({waitAllowedStartTime:e.target.value}),placeholder:`09:00`,value:iJ(n,`waitAllowedStartTime`)})]}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`waitAllowedEndTime`,children:`Window end`}),(0,Y.jsx)(B4,{disabled:i,id:`waitAllowedEndTime`,onChange:e=>r({waitAllowedEndTime:e.target.value}),placeholder:`17:00`,value:iJ(n,`waitAllowedEndTime`)})]}),(0,Y.jsx)(`p`,{className:`col-span-2 text-muted-foreground text-xs`,children:`Use 24-hour format (HH:MM). Start must be before end. Requires timezone below.`})]}),t[59]=n,t[60]=i,t[61]=m,t[62]=r,t[63]=V):V=t[63];let H=m?` (required for send window)`:` (optional)`,U;t[64]===H?U=t[65]:(U=(0,Y.jsxs)(V4,{htmlFor:`waitTimezone`,children:[`Timezone`,H]}),t[64]=H,t[65]=U);let W;t[66]===r?W=t[67]:(W=e=>r({waitTimezone:e}),t[66]=r,t[67]=W);let G;t[68]===n?G=t[69]:(G=aJ(n,`waitTimezone`,`UTC`),t[68]=n,t[69]=G);let K;t[70]!==i||t[71]!==W||t[72]!==G?(K=(0,Y.jsx)(_pe,{disabled:i,id:`waitTimezone`,onValueChange:W,value:G}),t[70]=i,t[71]=W,t[72]=G,t[73]=K):K=t[73];let ee=m&&` Also determines when the daily send window applies.`,q;t[74]===ee?q=t[75]:(q=(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Used when the target date/time does not include an offset.`,ee]}),t[74]=ee,t[75]=q);let te;t[76]!==U||t[77]!==K||t[78]!==q?(te=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[U,K,q]}),t[76]=U,t[77]=K,t[78]=q,t[79]=te):te=t[79];let ne;return t[80]!==w||t[81]!==T||t[82]!==M||t[83]!==B||t[84]!==V||t[85]!==te?(ne=(0,Y.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[_,w,T,M,B,V,te]}),t[80]=w,t[81]=T,t[82]=M,t[83]=B,t[84]=V,t[85]=te,t[86]=ne):ne=t[86],ne}function r_e(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function i_e(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function a_e(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function o_e(e){return[e,``]}function s_e(e){let t=(0,X.c)(35),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:`Wait for Event`}),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=(0,Y.jsx)(qge,{config:n,disabled:i,onUpdateConfig:r}),t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(V4,{htmlFor:`waitTimeout`,children:`Stop waiting after`}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=e=>r({waitTimeout:e}),t[6]=r,t[7]=c);let l;t[8]===n?l=t[9]:(l=iJ(n,`waitTimeout`),t[8]=n,t[9]=l);let u;t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,Y.jsx)(w6,{disabled:i,fieldType:l2.waitTimeout.type,id:`waitTimeout`,onChange:c,placeholder:`7d`,value:l}),t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13];let d;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Required. A wait with no end holds a run, and a place in the run list, until somebody notices.`}),t[14]=d):d=t[14];let f;t[15]===u?f=t[16]:(f=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[s,u,d]}),t[15]=u,t[16]=f);let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(V4,{htmlFor:`waitTimeoutBehavior`,children:`On timeout`}),t[17]=p):p=t[17];let m;t[18]===r?m=t[19]:(m=e=>r({waitTimeoutBehavior:e}),t[18]=r,t[19]=m);let h;t[20]===n?h=t[21]:(h=aJ(n,`waitTimeoutBehavior`,`continue`),t[20]=n,t[21]=h);let g;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(Z3,{className:`w-full`,id:`waitTimeoutBehavior`,children:(0,Y.jsx)(X3,{placeholder:`Select timeout behavior`})}),t[22]=g):g=t[22];let _;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(Q3,{children:x5.map(c_e)}),t[23]=_):_=t[23];let v;t[24]!==i||t[25]!==m||t[26]!==h?(v=(0,Y.jsxs)(Y3,{disabled:i,items:x5,onValueChange:m,value:h,children:[g,_]}),t[24]=i,t[25]=m,t[26]=h,t[27]=v):v=t[27];let y;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Choose whether to continue downstream nodes or halt the branch when the timeout expires.`}),t[28]=y):y=t[28];let b;t[29]===v?b=t[30]:(b=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[p,v,y]}),t[29]=v,t[30]=b);let x;return t[31]!==b||t[32]!==o||t[33]!==f?(x=(0,Y.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[a,o,f,b]}),t[31]=b,t[32]=o,t[33]=f,t[34]=x):x=t[34],x}function c_e(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function l_e(e){let t=(0,X.c)(31),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=aJ(n,`waitMode`,`delay`),t[0]=n,t[1]=a);let o=a,s;t[2]!==n||t[3]!==r?(s=e=>{let t={...n,waitMode:e},i=Object.fromEntries(f2(t).map(d_e));r({...i,waitMode:e,...e===`event`&&!(iJ(n,`waitTimeout`)??``).trim()?{waitTimeout:`7d`}:{}})},t[2]=n,t[3]=r,t[4]=s):s=t[4];let c=s,l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(V4,{htmlFor:`waitMode`,children:`How should this step wait?`}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=e6(c),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(Z3,{className:`w-full`,id:`waitMode`,children:(0,Y.jsx)(X3,{placeholder:`Select wait mode`})}),t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(Q3,{children:S5.map(u_e)}),t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==u||t[12]!==o?(p=(0,Y.jsxs)(Y3,{disabled:i,items:S5,onValueChange:u,value:o,children:[d,f]}),t[10]=i,t[11]=u,t[12]=o,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Resume on a clock, or when an event arrives that this step's match accepts.`}),t[14]=m):m=t[14];let h;t[15]===p?h=t[16]:(h=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[l,p,m]}),t[15]=p,t[16]=h);let g;t[17]!==n||t[18]!==i||t[19]!==r||t[20]!==o?(g=o===`delay`&&(0,Y.jsx)(n_e,{config:n,disabled:i,onUpdateConfig:r}),t[17]=n,t[18]=i,t[19]=r,t[20]=o,t[21]=g):g=t[21];let _;t[22]!==n||t[23]!==i||t[24]!==r||t[25]!==o?(_=o===`event`&&(0,Y.jsx)(s_e,{config:n,disabled:i,onUpdateConfig:r}),t[22]=n,t[23]=i,t[24]=r,t[25]=o,t[26]=_):_=t[26];let v;return t[27]!==g||t[28]!==_||t[29]!==h?(v=(0,Y.jsxs)(Y.Fragment,{children:[h,g,_]}),t[27]=g,t[28]=_,t[29]=h,t[30]=v):v=t[30],v}function u_e(e){return(0,Y.jsx)($3,{value:e.value,children:e.label},e.value)}function d_e(e){return[e,``]}function f_e(e){let t=(0,X.c)(9),{actionType:n,config:r,onUpdateConfig:i,disabled:a}=e;switch(n){case rJ.condition:{let e;return t[0]!==r||t[1]!==a||t[2]!==i?(e=(0,Y.jsx)($ge,{config:r,disabled:a,onUpdateConfig:i}),t[0]=r,t[1]=a,t[2]=i,t[3]=e):e=t[3],e}case rJ.eventSplit:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(e_e,{}),t[4]=e):e=t[4],e}case rJ.wait:{let e;return t[5]!==r||t[6]!==a||t[7]!==i?(e=(0,Y.jsx)(l_e,{config:r,disabled:a,onUpdateConfig:i}),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],e}default:return null}}function p_e(e){let t=(0,X.c)(3),n=vy(),r;if(t[0]!==n||t[1]!==e){let i=Sne(n,e);r=Object.fromEntries(Object.entries(i).map(m_e)),t[0]=n,t[1]=e,t[2]=r}else r=t[2];return r}function m_e(e){let[t,n]=e;return[t,n.map(h_e)]}function h_e(e){return{id:e.id,label:e.label,logoUrl:e.logoUrl,integration:e.integration}}function g_e(e,t){return Ny(e,t)?.category??null}function __e(e){let t=(0,X.c)(99),{config:n,onUpdateConfig:r,disabled:i,isOwner:a}=e,o=a===void 0||a,s=vy(),c;t[0]===n?c=t[1]:(c=iJ(n,`actionType`),t[0]=n,t[1]=c);let l=c,u=p_e(l),d;t[2]===u?d=t[3]:(d=Object.keys(u).filter(S_e).toSorted(),t[2]=u,t[3]=d);let f=d,p;t[4]!==l||t[5]!==s?(p=l&&g_e(s,l)||``,t[4]=l,t[5]=s,t[6]=p):p=t[6];let m=p,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h={value:`System`,label:`System`},t[7]=h):h=t[7];let g;t[8]===f?g=t[9]:(g=[h,...f.map(x_e)],t[8]=f,t[9]=g);let _=g,v;t[10]!==u||t[11]!==m?(v=m?u[m]??[]:[],t[10]=u,t[11]=m,t[12]=v):v=t[12];let y=v,b;t[13]===y?b=t[14]:(b=y.map(b_e),t[13]=y,t[14]=b);let x=b,S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=I$(),t[15]=S):S=t[15];let{data:C}=Ze(S),w;t[16]===C?w=t[17]:(w=C===void 0?[]:C,t[16]=C,t[17]=w);let T=w,{push:E}=Oq(),D;t[18]!==u||t[19]!==r?(D=e=>{let t=u[e]?.[0];t&&r({actionType:t.id})},t[18]=u,t[19]=r,t[20]=D):D=t[20];let O=D,k;t[21]===r?k=t[22]:(k=e=>{r({actionType:e})},t[21]=r,t[22]=k);let A=k,j;t[23]!==l||t[24]!==s?(j=l?Ny(s,l):void 0,t[23]=l,t[24]=s,t[25]=j):j=t[25];let M=j,N=M?.integration,P;if(t[26]!==T||t[27]!==N){let e;t[29]===N?e=t[30]:(e=e=>e.type===N,t[29]=N,t[30]=e),P=T.some(e),t[26]=T,t[27]=N,t[28]=P}else P=t[28];let F=P,I;t[31]!==N||t[32]!==r||t[33]!==E?(I=()=>{N&&E(G4,{type:N,onSuccess:e=>{r({integrationId:e})}})},t[31]=N,t[32]=r,t[33]=E,t[34]=I):I=t[34];let L=I,R;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Y.jsx)(V4,{className:`ml-1`,htmlFor:`actionCategory`,children:`Service`}),t[35]=R):R=t[35];let z;t[36]===O?z=t[37]:(z=e6(O),t[36]=O,t[37]=z);let B=m||void 0,V;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Y.jsx)(Z3,{className:`w-full`,id:`actionCategory`,children:(0,Y.jsx)(X3,{placeholder:`Select category`})}),t[38]=V):V=t[38];let H;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Y.jsx)($3,{value:`System`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(uy,{className:`size-4`}),(0,Y.jsx)(`span`,{children:`System`})]})}),t[39]=H):H=t[39];let U;t[40]===f.length?U=t[41]:(U=f.length>0&&(0,Y.jsx)(Ffe,{}),t[40]=f.length,t[41]=U);let W;if(t[42]!==u||t[43]!==f){let e;t[45]===u?e=t[46]:(e=e=>{let t=u[e],n=t?.[0]?.integration,r=t?.map(y_e).find(v_e);return(0,Y.jsx)($3,{value:e,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(C5,{fallback:n?(0,Y.jsx)(H4,{className:`size-4`,integration:n}):(0,Y.jsx)(hy,{className:`size-4`}),label:e,logoUrl:r}),(0,Y.jsx)(`span`,{children:e})]})},e)},t[45]=u,t[46]=e),W=f.map(e),t[42]=u,t[43]=f,t[44]=W}else W=t[44];let G;t[47]!==U||t[48]!==W?(G=(0,Y.jsxs)(Q3,{children:[H,U,W]}),t[47]=U,t[48]=W,t[49]=G):G=t[49];let K;t[50]!==_||t[51]!==i||t[52]!==z||t[53]!==B||t[54]!==G?(K=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[R,(0,Y.jsxs)(Y3,{disabled:i,items:_,onValueChange:z,value:B,children:[V,G]})]}),t[50]=_,t[51]=i,t[52]=z,t[53]=B,t[54]=G,t[55]=K):K=t[55];let ee;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Y.jsx)(V4,{className:`ml-1`,htmlFor:`actionType`,children:`Action`}),t[56]=ee):ee=t[56];let q=i||!m,te;t[57]===A?te=t[58]:(te=e6(A),t[57]=A,t[58]=te);let ne=l||void 0,re;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Y.jsx)(Z3,{className:`w-full`,id:`actionType`,children:(0,Y.jsx)(X3,{placeholder:`Select action`})}),t[59]=re):re=t[59];let ie;t[60]!==y||t[61]!==m?(ie=m&&y.map(e=>{let t;return t=m===`System`?(0,Y.jsx)(uy,{className:`size-4`}):e.integration?(0,Y.jsx)(H4,{className:`size-4`,integration:e.integration}):(0,Y.jsx)(hy,{className:`size-4`}),(0,Y.jsx)($3,{value:e.id,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(C5,{fallback:t,label:e.label,logoUrl:e.logoUrl}),(0,Y.jsx)(`span`,{children:e.label})]})},e.id)}),t[60]=y,t[61]=m,t[62]=ie):ie=t[62];let ae;t[63]===ie?ae=t[64]:(ae=(0,Y.jsx)(Q3,{children:ie}),t[63]=ie,t[64]=ae);let oe;t[65]!==x||t[66]!==q||t[67]!==te||t[68]!==ne||t[69]!==ae?(oe=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[ee,(0,Y.jsxs)(Y3,{disabled:q,items:x,onValueChange:te,value:ne,children:[re,ae]})]}),t[65]=x,t[66]=q,t[67]=te,t[68]=ne,t[69]=ae,t[70]=oe):oe=t[70];let se;t[71]!==K||t[72]!==oe?(se=(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[K,oe]}),t[71]=K,t[72]=oe,t[73]=se):se=t[73];let ce;t[74]!==n||t[75]!==i||t[76]!==F||t[77]!==N||t[78]!==o||t[79]!==r||t[80]!==L?(ce=N&&o&&(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`ml-1 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(V4,{children:`Connection`}),(0,Y.jsx)(P6,{children:(0,Y.jsxs)(F6,{children:[(0,Y.jsx)(I6,{render:(0,Y.jsx)(`span`,{className:`inline-flex`,children:(0,Y.jsx)(jv,{className:`size-3.5 text-muted-foreground`})}),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Connection help`})}),(0,Y.jsx)(L6,{children:(0,Y.jsx)(`p`,{children:`API key or OAuth credentials for this service`})})]})})]}),F&&(0,Y.jsx)(pv,{"aria-label":`Add connection`,className:`size-6`,disabled:i,onClick:L,size:`icon`,variant:`ghost`,children:(0,Y.jsx)(oy,{className:`size-4`})})]}),(0,Y.jsx)(zde,{disabled:i,integrationType:N,onChange:e=>r({integrationId:e}),value:iJ(n,`integrationId`)})]}),t[74]=n,t[75]=i,t[76]=F,t[77]=N,t[78]=o,t[79]=r,t[80]=L,t[81]=ce):ce=t[81];let le;t[82]===n?le=t[83]:(le=iJ(n,`actionType`)??``,t[82]=n,t[83]=le);let ue;t[84]!==n||t[85]!==i||t[86]!==r||t[87]!==le?(ue=(0,Y.jsx)(f_e,{actionType:le,config:n,disabled:i,onUpdateConfig:r}),t[84]=n,t[85]=i,t[86]=r,t[87]=le,t[88]=ue):ue=t[88];let de;t[89]!==M||t[90]!==n||t[91]!==i||t[92]!==r?(de=M&&M.configFields.length>0&&(0,Y.jsx)(eme,{config:n,disabled:i,fields:M.configFields,onUpdateConfig:r}),t[89]=M,t[90]=n,t[91]=i,t[92]=r,t[93]=de):de=t[93];let fe;return t[94]!==se||t[95]!==ce||t[96]!==ue||t[97]!==de?(fe=(0,Y.jsxs)(Y.Fragment,{children:[se,ce,ue,de]}),t[94]=se,t[95]=ce,t[96]=ue,t[97]=de,t[98]=fe):fe=t[98],fe}function v_e(e){return typeof e==`string`&&e.trim().length>0}function y_e(e){return e.logoUrl}function b_e(e){return{value:e.id,label:e.label}}function x_e(e){return{value:e,label:e}}function S_e(e){return e!==`System`}function w5(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(H8,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function T5(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(dhe,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function E5(e){let t=(0,X.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=Q(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Y.jsx)(qme,{"data-slot":`dropdown-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Y.jsx)(Yme,{children:(0,Y.jsx)(Xme,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function D5(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Wme,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function O5(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Q(`px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Y.jsx)(Gme,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function k5(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=Q(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Y.jsx)(Kme,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function C_e(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(che,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function w_e(e){let t=(0,X.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=Q(`flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(Ov,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Y.jsxs)(hhe,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function T_e(e){let t=(0,X.c)(16),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?-3:a,u=o===void 0?`right`:o,d=s===void 0?0:s,f;t[7]===n?f=t[8]:(f=Q(`w-auto min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;return t[9]!==c||t[10]!==l||t[11]!==r||t[12]!==u||t[13]!==d||t[14]!==f?(p=(0,Y.jsx)(E5,{"data-slot":`dropdown-menu-sub-content`,className:f,align:c,alignOffset:l,side:u,sideOffset:d,...r}),t[9]=c,t[10]=l,t[11]=r,t[12]=u,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function E_e(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Qme,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function A5(e){let t=(0,X.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,inset:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=Q(`relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Y.jsx)(the,{children:(0,Y.jsx)(Tv,{})})}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Y.jsxs)(ehe,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:o,...a,children:[s,n]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function j5(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`-mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(K8,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function D_e(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`ml-auto text-[0.625rem] tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function O_e(){return`ontouchstart`in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}var k_e={[rJ.condition]:[`branch`,`if`,`else`,`filter`,`decision`,`route`],[rJ.wait]:[`delay`,`sleep`,`pause`,`timer`,`schedule`,`later`],[rJ.eventSplit]:[`fan out`,`race`,`whichever`,`first event`,`branch on event`]};function M5(e){return Ga([e.label,e.category,e.integration,e.description,...k_e[e.id]??[]]).join(` `)}function A_e(e,t){return M5(e).toLowerCase().includes(t.toLowerCase())}function N5(e){let t=new Map;for(let n of e){let e=t.get(n.category);e?e.push(n):t.set(n.category,[n])}return[...t.keys()].toSorted((e,t)=>e===`System`?-1:t===`System`?1:e.localeCompare(t)).map(e=>({category:e,actions:t.get(e)??[]}))}function j_e(){let e=(0,X.c)(2),t=vy(),n;return e[0]===t?n=e[1]:(n=Fy(t),e[0]=t,e[1]=n),n}function M_e(e){let t=(0,X.c)(4),{group:n}=e,r=n.actions[0];if(r?.integration){let e;return t[0]===r.integration?e=t[1]:(e=(0,Y.jsx)(H4,{className:`size-4`,integration:r.integration}),t[0]=r.integration,t[1]=e),e}if(n.category===`System`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(uy,{className:`size-4`}),t[2]=e):e=t[2],e}let i;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(hy,{className:`size-4`}),t[3]=i):i=t[3],i}function P5(e){let t=(0,X.c)(11),{action:n,className:r}=e;if(n.integration){let e;return t[0]!==n.integration||t[1]!==r?(e=(0,Y.jsx)(H4,{className:r,integration:n.integration}),t[0]=n.integration,t[1]=r,t[2]=e):e=t[2],e}if(n.category===`System`){let e;t[3]===r?e=t[4]:(e=Q(r,`text-muted-foreground`),t[3]=r,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,Y.jsx)(uy,{className:e}),t[5]=e,t[6]=n),n}let i;t[7]===r?i=t[8]:(i=Q(r,`text-muted-foreground`),t[7]=r,t[8]=i);let a;return t[9]===i?a=t[10]:(a=(0,Y.jsx)(hy,{className:i}),t[9]=i,t[10]=a),a}var F5=`workflow-action-grid-hidden-groups`,I5=`workflow-action-grid-view-mode`;function N_e(){if(typeof window>`u`)return new Set;try{let e=localStorage.getItem(F5);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}function P_e(){if(typeof window>`u`)return`list`;try{return localStorage.getItem(I5)===`grid`?`grid`:`list`}catch{return`list`}}function F_e(e){let t=(0,X.c)(72),{onSelectAction:n,disabled:r,isNewlyCreated:i}=e,[a,o]=(0,J.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Set,t[0]=s):s=t[0];let[c,l]=(0,J.useState)(s),[u,d]=(0,J.useState)(N_e),[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(P_e),g=j_e(),_;t[1]===m?_=t[2]:(_=()=>{let e=m===`list`?`grid`:`list`;h(e),localStorage.setItem(I5,e)},t[1]=m,t[2]=_);let v=_,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=y):y=t[3];let b=y,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),localStorage.setItem(F5,JSON.stringify([...n])),n})},t[4]=x):x=t[4];let S=x,C;if(t[5]!==g||t[6]!==a){let e;t[8]===a?e=t[9]:(e=e=>A_e(e,a),t[8]=a,t[9]=e),C=g.filter(e),t[5]=g,t[6]=a,t[7]=C}else C=t[7];let w=C,T;t[10]===w?T=t[11]:(T=N5(w),t[10]=w,t[11]=T);let E=T,D;bb0:{if(f){D=E;break bb0}let e;if(t[12]!==E||t[13]!==u){let n;t[15]===u?n=t[16]:(n=e=>!u.has(e.category),t[15]=u,t[16]=n),e=E.filter(n),t[12]=E,t[13]=u,t[14]=e}else e=t[14];D=e}let O=D,k=u.size,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Y.jsx)(cy,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[17]=A):A=t[17];let j;t[18]===i?j=t[19]:(j=i===!0&&!O_e(),t[18]=i,t[19]=j);let M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>o(e.target.value),t[20]=M):M=t[20];let N;t[21]!==r||t[22]!==a||t[23]!==j?(N=(0,Y.jsxs)(`div`,{className:`relative flex-1`,children:[A,(0,Y.jsx)(B4,{autoFocus:j,className:`pl-9`,"data-testid":`action-search-input`,disabled:r,id:`action-filter`,onChange:M,placeholder:`Search actions...`,value:a})]}),t[21]=r,t[22]=a,t[23]=j,t[24]=N):N=t[24];let P;t[25]===v?P=t[26]:(P=(0,Y.jsx)(pv,{className:`shrink-0`,onClick:v,size:`icon`,variant:`ghost`}),t[25]=v,t[26]=P);let F;t[27]===m?F=t[28]:(F=m===`list`?(0,Y.jsx)(Wv,{className:`size-4`}):(0,Y.jsx)(Xv,{className:`size-4`}),t[27]=m,t[28]=F);let I;t[29]!==P||t[30]!==F?(I=(0,Y.jsx)(I6,{render:P,children:F}),t[29]=P,t[30]=F,t[31]=I):I=t[31];let L=m===`list`?`Grid view`:`List view`,R;t[32]===L?R=t[33]:(R=(0,Y.jsx)(L6,{children:L}),t[32]=L,t[33]=R);let z;t[34]!==I||t[35]!==R?(z=(0,Y.jsx)(P6,{children:(0,Y.jsxs)(F6,{children:[I,R]})}),t[34]=I,t[35]=R,t[36]=z):z=t[36];let B;t[37]!==k||t[38]!==f?(B=k>0&&(0,Y.jsx)(P6,{children:(0,Y.jsxs)(F6,{children:[(0,Y.jsx)(I6,{render:(0,Y.jsx)(pv,{className:Q(`shrink-0`,f&&`bg-muted`),onClick:()=>p(!f),size:`icon`,variant:`ghost`}),children:f?(0,Y.jsx)(Hv,{className:`size-4`}):(0,Y.jsx)(Vv,{className:`size-4`})}),(0,Y.jsx)(L6,{children:f?`Hide hidden groups`:`Show ${k} hidden group${k>1?`s`:``}`})]})}),t[37]=k,t[38]=f,t[39]=B):B=t[39];let V;t[40]!==N||t[41]!==z||t[42]!==B?(V=(0,Y.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[N,z,B]}),t[40]=N,t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]===w.length?H=t[45]:(H=w.length===0&&(0,Y.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`No actions found`}),t[44]=w.length,t[45]=H);let U;t[46]!==w.length||t[47]!==O?(U=w.length>0&&O.length===0&&(0,Y.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`All groups are hidden`}),t[46]=w.length,t[47]=O,t[48]=U):U=t[48];let W;t[49]!==r||t[50]!==w||t[51]!==u||t[52]!==n||t[53]!==f||t[54]!==m||t[55]!==O?(W=m===`grid`&&O.length>0&&(0,Y.jsx)(`div`,{className:`grid gap-2 p-1`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(72px, 1fr))`},children:w.filter(e=>f||!u.has(e.category)).map(e=>(0,Y.jsxs)(`button`,{className:Q(`flex aspect-square flex-col items-center justify-center gap-1.5 rounded-lg border border-transparent p-2 text-center transition-colors hover:border-border hover:bg-muted`,r&&`pointer-events-none opacity-50`),"data-testid":`action-option-${e.id.toLowerCase().replace(/\s+/g,`-`)}`,disabled:r,onClick:()=>n(e.id),type:`button`,children:[(0,Y.jsx)(P5,{action:e,className:`size-6`}),(0,Y.jsx)(`span`,{className:`line-clamp-2 font-medium text-xs leading-tight`,children:e.label})]},e.id))}),t[49]=r,t[50]=w,t[51]=u,t[52]=n,t[53]=f,t[54]=m,t[55]=O,t[56]=W):W=t[56];let G;t[57]!==c||t[58]!==r||t[59]!==u||t[60]!==n||t[61]!==m||t[62]!==O?(G=m===`list`&&O.length>0&&O.map((e,t)=>{let i=c.has(e.category),a=u.has(e.category);return(0,Y.jsxs)(`div`,{children:[t>0&&(0,Y.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,Y.jsxs)(`div`,{className:Q(`sticky top-0 z-10 mb-1 flex items-center gap-2 bg-background px-3 py-2 font-medium text-muted-foreground text-xs uppercase tracking-wider`,a&&`opacity-50`),children:[(0,Y.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 text-left hover:text-foreground`,onClick:()=>b(e.category),type:`button`,children:[(0,Y.jsx)(Ov,{className:Q(`size-3.5 transition-transform`,!i&&`rotate-90`)}),(0,Y.jsx)(M_e,{group:e}),e.category]}),(0,Y.jsxs)(w5,{children:[(0,Y.jsx)(T5,{render:(0,Y.jsx)(`button`,{className:`rounded p-0.5 hover:bg-muted hover:text-foreground`,type:`button`}),children:(0,Y.jsx)(zv,{className:`size-4`})}),(0,Y.jsx)(E5,{align:`end`,children:(0,Y.jsx)(k5,{onClick:()=>S(e.category),children:a?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Hv,{className:`mr-2 size-4`}),`Show group`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Vv,{className:`mr-2 size-4`}),`Hide group`]})})})]})]}),!i&&e.actions.map(e=>(0,Y.jsx)(`button`,{className:Q(`flex w-full items-center rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-muted`,r&&`pointer-events-none opacity-50`),"data-testid":`action-option-${e.id.toLowerCase().replace(/\s+/g,`-`)}`,disabled:r,onClick:()=>n(e.id),type:`button`,children:(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[` `,`- `,e.description]})]})},e.id))]},e.category)}),t[57]=c,t[58]=r,t[59]=u,t[60]=n,t[61]=m,t[62]=O,t[63]=G):G=t[63];let K;t[64]!==H||t[65]!==U||t[66]!==W||t[67]!==G?(K=(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-4`,"data-testid":`action-grid`,children:[H,U,W,G]}),t[64]=H,t[65]=U,t[66]=W,t[67]=G,t[68]=K):K=t[68];let ee;return t[69]!==V||t[70]!==K?(ee=(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[V,K]}),t[69]=V,t[70]=K,t[71]=ee):ee=t[71],ee}function L5(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(Lme,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,Y.jsx)(Tv,{})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Y.jsx)(Ime,{"data-slot":`checkbox`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function I_e(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`grid w-full gap-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Hhe,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function L_e(e){let t=(0,X.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(Bhe,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,Y.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Y.jsx)(zhe,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var R_e=`The entity is the value at the Correlation Path. A start carrying no payload uses the workflow itself, so every manual run is about the same entity.`,z_e=`The Run button and the execute route. With this off, only a Start Event starts a run.`;function B_e(e){let t=(0,X.c)(12),{editing:n,rules:r,disabled:i,manualStartId:a,onConcurrencyChange:o,onManualStartChange:s}=e,c;t[0]===r.concurrency?c=t[1]:(c=(0,Y.jsx)(V_e,{concurrency:r.concurrency}),t[0]=r.concurrency,t[1]=c);let l;t[2]!==i||t[3]!==n||t[4]!==a||t[5]!==o||t[6]!==s||t[7]!==r?(l=n?(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(I_e,{"aria-label":`Concurrency`,disabled:i,onValueChange:o,value:r.concurrency,children:z5.map(e=>(0,Y.jsxs)(`label`,{className:Q(`flex w-full cursor-pointer items-center gap-2 rounded-md border p-2 transition-colors`,r.concurrency===e.value?`border-primary bg-muted/50`:`border-input hover:bg-muted/30`,i&&`pointer-events-none opacity-50`),children:[(0,Y.jsx)(L_e,{value:e.value}),(0,Y.jsx)(`span`,{className:`font-medium text-sm`,children:e.label})]},e.value))}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(L5,{checked:r.allowManualStart===!0,disabled:i,id:a,onCheckedChange:s}),(0,Y.jsx)(V4,{htmlFor:a,children:`Allow manual runs`})]}),(0,Y.jsx)(R5,{rules:r})]}):(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsx)(`p`,{className:`text-sm`,children:U_e(r.concurrency)}),(0,Y.jsx)(fge,{label:`Allow manual runs`,children:r.allowManualStart===!0?`Allowed`:`Not allowed`}),(0,Y.jsx)(R5,{rules:r})]}),t[2]=i,t[3]=n,t[4]=a,t[5]=o,t[6]=s,t[7]=r,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,Y.jsx)(u5,{className:`py-3 first:pt-0 last:pb-0`,help:c,label:`Concurrency`,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function V_e(e){let t=(0,X.c)(6),{concurrency:n}=e,r;t[0]===n?r=t[1]:(r=[...z5.filter(e=>e.value===n),...z5.filter(e=>e.value!==n)].map(H_e),t[0]=n,t[1]=r);let i,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`p`,{children:R_e}),a=(0,Y.jsxs)(`p`,{children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:`Allow manual runs`}),` `,z_e]}),t[2]=i,t[3]=a):(i=t[2],a=t[3]);let o;return t[4]===r?o=t[5]:(o=(0,Y.jsxs)(Y.Fragment,{children:[r,i,a]}),t[4]=r,t[5]=o),o}function H_e(e){return(0,Y.jsxs)(`p`,{children:[(0,Y.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),` `,e.description]},e.value)}function R5(e){let t=(0,X.c)(1),{rules:n}=e;if(n.startEvents.length>0)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`A manual run's payload is described by nothing, so downstream nodes are offered no fields to reference. Add a Start Event to give them its payload.`}),t[0]=r):r=t[0],r}function U_e(e){return z5.find(t=>t.value===e)?.label??e}var z5=[{value:`unlimited`,label:`Unlimited`,description:`Every Event starts its own run.`},{value:`newest-wins`,label:`Newest wins`,description:`A new run for the same entity supersedes the ones already going, which end with that status.`},{value:`first-wins`,label:`First wins`,description:`A run already going for the same entity keeps it. The arriving Event is recorded as a Refused Start.`}],W_e={start:{label:`Start Events`,empty:`No Start Events.`,help:`A run starts when one of these Events arrives. Naming several is how one workflow answers an appointment being booked and being moved: Concurrency decides what happens to the run already going.`},cancel:{label:`Cancel Events`,empty:`No Cancel Events.`,help:`When one of these arrives, Workflow Graph reads its Entity Value at the Correlation Path you set for it and cancels the runs already going for that entity. A canceled run leaves through the Canceled outlet.`}};function B5(e){let t=(0,X.c)(18),{role:n,editing:r,rules:i,catalog:a,disabled:o,inputId:s,onEventNamesChange:c,onCorrelationPathChange:l}=e,u=W_e[n],d=n===`start`?i.startEvents:i.cancelEvents,f;t[0]===u.help?f=t[1]:(f=(0,Y.jsx)(`p`,{children:u.help}),t[0]=u.help,t[1]=f);let p;t[2]!==a||t[3]!==u.empty||t[4]!==u.label||t[5]!==o||t[6]!==r||t[7]!==d||t[8]!==s||t[9]!==l||t[10]!==c||t[11]!==n||t[12]!==i?(p=r?(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsxs)(K_e,{hasEvents:a.events.length>0,children:[(0,Y.jsx)(V4,{className:`sr-only`,htmlFor:s,children:u.label}),(0,Y.jsx)(_5,{choices:a.events,disabled:o,inputId:s,onValueChange:c,value:d})]}),d.map(e=>(0,Y.jsx)(q_e,{catalog:a,disabled:o,eventName:e,label:My(a,e)?.label,onCommitPath:l,onRemove:()=>c(d.filter(t=>t!==e)),request:gQ({rules:i,catalog:a,eventName:e,role:n})},e))]}):(0,Y.jsx)(G_e,{catalog:a,empty:u.empty,eventNames:d,role:n,rules:i}),t[2]=a,t[3]=u.empty,t[4]=u.label,t[5]=o,t[6]=r,t[7]=d,t[8]=s,t[9]=l,t[10]=c,t[11]=n,t[12]=i,t[13]=p):p=t[13];let m;return t[14]!==u.label||t[15]!==f||t[16]!==p?(m=(0,Y.jsx)(u5,{className:`py-3 first:pt-0 last:pb-0`,help:f,label:u.label,children:p}),t[14]=u.label,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}function G_e(e){let t=(0,X.c)(13),{eventNames:n,role:r,rules:i,catalog:a,empty:o}=e;if(n.length===0){let e;return t[0]===o?e=t[1]:(e=(0,Y.jsx)(pge,{children:o}),t[0]=o,t[1]=e),e}let s;if(t[2]!==a||t[3]!==n||t[4]!==r||t[5]!==i){let e;t[7]!==a||t[8]!==r||t[9]!==i?(e=e=>{let t=gQ({rules:i,catalog:a,eventName:e,role:r}),n=t?.suppliedPath??t?.declaredPath;return(0,Y.jsxs)(`li`,{className:`text-sm`,children:[(0,Y.jsx)(`span`,{title:e,children:My(a,e)?.label??e}),n?(0,Y.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[` correlated on `,(0,Y.jsx)(`span`,{className:`font-mono`,children:n})]}):null]},e)},t[7]=a,t[8]=r,t[9]=i,t[10]=e):e=t[10],s=n.map(e),t[2]=a,t[3]=n,t[4]=r,t[5]=i,t[6]=s}else s=t[6];let c;return t[11]===s?c=t[12]:(c=(0,Y.jsx)(`ul`,{className:`space-y-1`,children:s}),t[11]=s,t[12]=c),c}function K_e(e){let t=(0,X.c)(1),{hasEvents:n,children:r}=e;if(n)return r;let i;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`This server declares no Events. Whoever runs it passes them to`,(0,Y.jsx)(`code`,{className:`mx-1 font-mono text-xs`,children:`createWfGraphApp`}),`, and they appear here.`]}),t[0]=i):i=t[0],i}function q_e(e){let t=(0,X.c)(19),{eventName:n,label:r,request:i,catalog:a,onCommitPath:o,onRemove:s,disabled:c}=e,l=r??n,u;t[0]!==n||t[1]!==l?(u=(0,Y.jsx)(`p`,{className:`min-w-0 truncate text-xs`,title:n,children:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d=`Remove ${n}`,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(my,{className:`size-3.5`}),t[3]=f):f=t[3];let p;t[4]!==c||t[5]!==s||t[6]!==d?(p=(0,Y.jsx)(pv,{"aria-label":d,className:`size-7 shrink-0`,disabled:c,onClick:s,size:`icon`,type:`button`,variant:`ghost`,children:f}),t[4]=c,t[5]=s,t[6]=d,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==a||t[12]!==c||t[13]!==o||t[14]!==i?(h=i?(0,Y.jsx)(J_e,{catalog:a,disabled:c,onCommit:o,request:i}):null,t[11]=a,t[12]=c,t[13]=o,t[14]=i,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,Y.jsxs)(`div`,{className:`space-y-2 rounded-md border p-2`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function J_e(e){let t=(0,X.c)(49),{request:n,catalog:r,disabled:i,onCommit:a}=e,o=(0,J.useId)(),{eventName:s,declaredPath:c,suppliedPath:l}=n,u,d,f,p,m,h,g,_,v,y,b;if(t[0]!==r||t[1]!==c||t[2]!==i||t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l){let e=Q_e(r,s,c,l);y=`space-y-1`,t[18]!==s||t[19]!==o?(b=(0,Y.jsx)(V4,{className:`sr-only`,htmlFor:o,children:s}),t[18]=s,t[19]=o,t[20]=b):b=t[20],d=Y3,m=i,h=[...c?[]:[{label:`Choose a path`,value:null}],...e.map(X_e)],t[21]!==c||t[22]!==s||t[23]!==a?(g=e=>a(s,e===c||e===null?``:e),t[21]=c,t[22]=s,t[23]=a,t[24]=g):g=t[24],_=l??c??null;let n;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(X3,{}),t[25]=n):n=t[25],t[26]===o?v=t[27]:(v=(0,Y.jsx)(Z3,{className:`w-full`,id:o,children:n}),t[26]=o,t[27]=v),u=Q3,t[28]===c?f=t[29]:(f=c?null:(0,Y.jsx)($3,{value:null,children:`Choose a path`}),t[28]=c,t[29]=f),p=e.map(Y_e),t[0]=r,t[1]=c,t[2]=i,t[3]=s,t[4]=o,t[5]=a,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b}else u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17];let x;t[30]!==u||t[31]!==f||t[32]!==p?(x=(0,Y.jsxs)(u,{children:[f,p]}),t[30]=u,t[31]=f,t[32]=p,t[33]=x):x=t[33];let S;t[34]!==d||t[35]!==x||t[36]!==m||t[37]!==h||t[38]!==g||t[39]!==_||t[40]!==v?(S=(0,Y.jsxs)(d,{disabled:m,items:h,onValueChange:g,value:_,children:[v,x]}),t[34]=d,t[35]=x,t[36]=m,t[37]=h,t[38]=g,t[39]=_,t[40]=v,t[41]=S):S=t[41];let C=c?`Runs are matched on this payload path. The Event declares ${c}; a path here is read instead.`:`Runs are matched on this payload path. This Event declares none, so choose the one holding the value that identifies the entity.`,w;t[42]===C?w=t[43]:(w=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:C}),t[42]=C,t[43]=w);let T;return t[44]!==S||t[45]!==w||t[46]!==y||t[47]!==b?(T=(0,Y.jsxs)(`div`,{className:y,children:[b,S,w]}),t[44]=S,t[45]=w,t[46]=y,t[47]=b,t[48]=T):T=t[48],T}function Y_e(e){return(0,Y.jsx)($3,{value:e,children:e},e)}function X_e(e){return{label:e,value:e}}var Z_e=new Set([`string`,`number`]);function Q_e(e,t,n,r){return Ja(Ga([...(My(e,t)?.payloadFields??[]).filter(e=>Z_e.has(e.type??``)).map(e=>e.path),n,r]))}function $_e(e){let t=(0,X.c)(45),{config:n,onUpdateConfig:r,disabled:i}=e,a=(0,J.useId)(),o=(0,J.useId)(),s=(0,J.useId)(),c=vy(),l=sQ(n)??aQ,[u,d]=(0,J.useState)(!1),f=yQ({rules:l,catalog:c}),p;t[0]===r?p=t[1]:(p=e=>{r({lifecycleRules:e})},t[0]=r,t[1]=p);let m=p,h;t[2]!==l||t[3]!==m?(h=e=>{m(vQ({...l,startEvents:e}))},t[2]=l,t[3]=m,t[4]=h):h=t[4];let g=h,_;t[5]!==l||t[6]!==m?(_=e=>{m(vQ({...l,cancelEvents:e}))},t[5]=l,t[6]=m,t[7]=_):_=t[7];let v=_,y;t[8]!==l||t[9]!==m?(y=e=>{m(vQ({...l,concurrency:e}))},t[8]=l,t[9]=m,t[10]=y):y=t[10];let b=y,x;t[11]!==l||t[12]!==m?(x=(e,t)=>{let n=t.trim(),r={...l.correlationPaths};n?r[e]=n:delete r[e],m({...l,correlationPaths:Object.keys(r).length>0?r:void 0})},t[11]=l,t[12]=m,t[13]=x):x=t[13];let S=x,C;t[14]!==l||t[15]!==m?(C=e=>m({...l,allowManualStart:e}),t[14]=l,t[15]=m,t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==c||t[19]!==i||t[20]!==s||t[21]!==l||t[22]!==v||t[23]!==b||t[24]!==S||t[25]!==g||t[26]!==a||t[27]!==C?(w={rules:l,catalog:c,disabled:i,startEventId:a,cancelEventsId:o,manualStartId:s,onStartEventsChange:g,onCancelEventsChange:v,onConcurrencyChange:b,onManualStartChange:C,onCorrelationPathChange:S},t[17]=o,t[18]=c,t[19]=i,t[20]=s,t[21]=l,t[22]=v,t[23]=b,t[24]=S,t[25]=g,t[26]=a,t[27]=C,t[28]=w):w=t[28];let T=w,E=!i,D;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(`p`,{children:eve}),t[29]=D):D=t[29];let O,k;t[30]===T?(O=t[31],k=t[32]):(O=(0,Y.jsx)(V5,{editing:!1,...T}),k=(0,Y.jsx)(V5,{editing:!0,...T}),t[30]=T,t[31]=O,t[32]=k);let A;t[33]!==u||t[34]!==d||t[35]!==O||t[36]!==k||t[37]!==E?(A=(0,Y.jsx)(l5,{editable:E,editing:u,help:D,label:`Lifecycle Rules`,onEditingChange:d,stickyHeader:!0,view:O,children:k}),t[33]=u,t[34]=d,t[35]=O,t[36]=k,t[37]=E,t[38]=A):A=t[38];let j;t[39]!==f.error||t[40]!==f.valid?(j=f.valid?null:(0,Y.jsx)(f5,{title:`This will not save`,children:f.error}),t[39]=f.error,t[40]=f.valid,t[41]=j):j=t[41];let M;return t[42]!==A||t[43]!==j?(M=(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[A,j]}),t[42]=A,t[43]=j,t[44]=M):M=t[44],M}function V5(e){let t=(0,X.c)(27),{editing:n,rules:r,catalog:i,disabled:a,startEventId:o,cancelEventsId:s,manualStartId:c,onStartEventsChange:l,onCancelEventsChange:u,onConcurrencyChange:d,onManualStartChange:f,onCorrelationPathChange:p}=e,m;t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==p||t[4]!==l||t[5]!==r||t[6]!==o?(m=(0,Y.jsx)(B5,{catalog:i,disabled:a,editing:n,inputId:o,onCorrelationPathChange:p,onEventNamesChange:l,role:`start`,rules:r}),t[0]=i,t[1]=a,t[2]=n,t[3]=p,t[4]=l,t[5]=r,t[6]=o,t[7]=m):m=t[7];let h;t[8]!==a||t[9]!==n||t[10]!==c||t[11]!==d||t[12]!==f||t[13]!==r?(h=(0,Y.jsx)(B_e,{disabled:a,editing:n,manualStartId:c,onConcurrencyChange:d,onManualStartChange:f,rules:r}),t[8]=a,t[9]=n,t[10]=c,t[11]=d,t[12]=f,t[13]=r,t[14]=h):h=t[14];let g;t[15]!==s||t[16]!==i||t[17]!==a||t[18]!==n||t[19]!==u||t[20]!==p||t[21]!==r?(g=(0,Y.jsx)(B5,{catalog:i,disabled:a,editing:n,inputId:s,onCorrelationPathChange:p,onEventNamesChange:u,role:`cancel`,rules:r}),t[15]=s,t[16]=i,t[17]=a,t[18]=n,t[19]=u,t[20]=p,t[21]=r,t[22]=g):g=t[22];let _;return t[23]!==m||t[24]!==h||t[25]!==g?(_=(0,Y.jsxs)(`div`,{className:`divide-y`,children:[m,h,g]}),t[23]=m,t[24]=h,t[25]=g,t[26]=_):_=t[26],_}var eve=`What starts a run of this workflow, and what happens to the runs already going when another start arrives.`;function tve(e){let[t]=m6({currentNodeId:e.nodeId,nodes:e.nodes,edges:e.edges,catalog:e.catalog});if(!t)return;let n=M0(t),r=s2(n);return{conditionModel:n2(n),condition:r.valid?r.expression:``}}function nve(){let e=(0,X.c)(17),t=vy(),n=oA(),r=Ie(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={from:`/workflows/$workflowId`},e[0]=i):i=e[0];let a=Ki(i),o=dA(W2),s=fA(g4),c=fA(Gue),l;e[1]!==t||e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==s?(l=e=>{let i=n.get(e4),a=i.find(e=>e.id===o);if(!a)return;let c=typeof e.actionType==`string`&&!!a.data.config?.integrationId,l={...a.data.config,...e,...c?{integrationId:void 0}:{}};e.actionType===rJ.condition&&!l.conditionModel&&Object.assign(l,tve({nodeId:a.id,nodes:i,edges:n.get(t4),catalog:t}));let u=r.getQueryData(I$().queryKey),d=u?hJ(t,{...a,data:{...a.data,config:l}},u).data.config:l;s({id:a.id,data:{config:d}})},e[1]=t,e[2]=r,e[3]=o,e[4]=n,e[5]=s,e[6]=l):l=e[6];let u=l,d;e[7]===r?d=e[8]:(d=()=>H$(r),e[7]=r,e[8]=d);let f=d,p;e[9]!==c||e[10]!==a||e[11]!==r?(p=F$.workflow.deleteExecutions.mutationOptions({onSuccess:async()=>{c(),a({search:{},replace:!0}),await H$(r),wy.success(`All runs deleted`)},meta:{errorMessage:`Failed to delete runs`}}),e[9]=c,e[10]=a,e[11]=r,e[12]=p):p=e[12];let m=Qe(p),h;return e[13]!==m||e[14]!==f||e[15]!==u?(h={updateConfig:u,refreshRuns:f,deleteRuns:m},e[13]=m,e[14]=f,e[15]=u,e[16]=h):h=e[16],h}function H5(){let e=(0,X.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={from:`/workflows/$workflowId`},e[0]=t):t=e[0];let n=Ki(t),r;return e[1]===n?r=e[2]:(r=()=>{n({search:{},replace:!0})},e[1]=n,e[2]=r),r}function U5(){let e=(0,X.c)(3),t=H5(),n=fA(m0),r;return e[0]!==t||e[1]!==n?(r=()=>{n(`properties`),t()},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function W5(e,t){return`${e} ${t}${e===1?``:`s`} ago`}function G5(e){let t=new Date,n=new Date(e),r=Math.floor((t.getTime()-n.getTime())/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return W5(i,`min`);let a=Math.floor(i/60);if(a<24)return W5(a,`hour`);let o=Math.floor(a/24);if(o<7)return W5(o,`day`);let s=Math.floor(o/7);if(s<4)return W5(s,`week`);let c=Math.floor(o/30);return c<12?W5(c,`month`):W5(Math.floor(o/365),`year`)}var rve=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function K5(e){return e.toString().padStart(2,`0`)}function q5(e){return`${K5(e.getHours())}:${K5(e.getMinutes())}`}function ive(e){let t=rve[e.getMonth()];return`${K5(e.getDate())} ${t}, ${q5(e)}`}function J5(e){let t=(0,X.c)(5),{refusedStarts:n}=e;if(n.length===0)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(wv,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:`Refused Starts`})]}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(ave),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,Y.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[r,(0,Y.jsx)(`div`,{className:`divide-y`,children:i})]}),t[3]=i,t[4]=a),a}function ave(e){return(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-3 py-2`,children:[(0,Y.jsx)(`p`,{className:`text-foreground text-xs`,children:e.message}),(0,Y.jsx)(`p`,{className:`shrink-0 text-muted-foreground text-xs tabular-nums`,title:e.createdAt.toLocaleString(),children:G5(e.createdAt)})]},e.id)}var ove=Ay(`workflow`,`run`),sve={pending:`muted`,running:`info`,waiting:`pending`,completed:`good`,canceled:`quiet`,superseded:`quiet`,failed:`bad`},cve={pending:`muted`,running:`info`,success:`good`,error:`bad`,cancelled:`quiet`};function Y5(e){return sve[e]??cve[e]??`muted`}var lve={good:`bg-success`,bad:`bg-destructive`,info:`bg-info`,pending:`bg-warning`,quiet:`bg-cancelled`,muted:`bg-muted-foreground`},uve={pending:`Pending`,running:`Running`,waiting:`Waiting`,completed:`Completed`,canceled:`Canceled`,superseded:`Superseded`,failed:`Failed`},dve={pending:`Pending`,running:`Running`,success:`Success`,error:`Error`,cancelled:`Cancelled`},fve={good:`border-success/30 bg-success/10 text-success`,bad:`border-destructive/30 bg-destructive/10 text-destructive`,info:`border-info/30 bg-info/10 text-info`,pending:`border-warning/30 bg-warning/10 text-warning`,quiet:`border-cancelled/30 bg-cancelled/10 text-cancelled`,muted:`border-muted bg-muted/40 text-muted-foreground`};function X5(e){return lve[Y5(e)]}function Z5(e){return uve[e]??dve[e]??`Unknown`}function Q5(e){return fve[Y5(e)]}function $5(e){let t=Number.parseInt(e,10);return t<1e3?`${e}ms`:`${(t/1e3).toFixed(2)}s`}var pve=Wh(uh({base64:oh.check(Mh(101))}));function e7(e){return pve(e)?.base64??null}function mve(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function t7(e){let t=(0,X.c)(4),{data:n}=e,r;t[0]===n?r=t[1]:(r=JSON.stringify(n,null,2).split(/("https?:\/\/[^"]+"|"[^"]*")/g).map(hve),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Y.jsx)(Y.Fragment,{children:r}),t[2]=r,t[3]=i),i}function hve(e){if(e.startsWith(`"`)&&e.endsWith(`"`)){let t=e.slice(1,-1);if(mve(t))return(0,Y.jsx)(`a`,{className:`text-info underline underline-offset-2 hover:text-info/80`,href:t,rel:`noopener noreferrer`,target:`_blank`,children:e},t)}return e}function gve({data:e,isError:t=!1}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(pv,{className:`h-7 px-2`,onClick:async n=>{n.stopPropagation();try{let n=t?String(e):JSON.stringify(e,null,2);await navigator.clipboard.writeText(n),r(!0),setTimeout(()=>r(!1),2e3)}catch(e){ove.error(`Failed to copy the run payload`,{error:e})}},size:`sm`,type:`button`,variant:`ghost`,children:n?(0,Y.jsx)(Tv,{className:`size-3 text-success`}):(0,Y.jsx)(Lv,{className:`size-3`})})}function n7(e){let t=(0,X.c)(21),{title:n,children:r,defaultExpanded:i,copyData:a,isError:o}=e,s=i!==void 0&&i,c=o!==void 0&&o,[l,u]=(0,J.useState)(s),d;t[0]===l?d=t[1]:(d=()=>u(!l),t[0]=l,t[1]=d);let f;t[2]===l?f=t[3]:(f=l?(0,Y.jsx)(Ev,{className:`size-3 text-muted-foreground`}):(0,Y.jsx)(Ov,{className:`size-3 text-muted-foreground`}),t[2]=l,t[3]=f);let p;t[4]===n?p=t[5]:(p=(0,Y.jsx)(`span`,{className:`font-medium text-muted-foreground text-sm`,children:n}),t[4]=n,t[5]=p);let m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,Y.jsxs)(`button`,{className:`flex items-center gap-1.5`,onClick:d,type:`button`,children:[f,p]}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==c?(h=a===void 0?null:(0,Y.jsx)(gve,{data:a,isError:c}),t[10]=a,t[11]=c,t[12]=h):h=t[12];let g;t[13]===h?g=t[14]:(g=(0,Y.jsx)(`div`,{className:`flex items-center gap-1`,children:h}),t[13]=h,t[14]=g);let _;t[15]!==m||t[16]!==g?(_=(0,Y.jsxs)(`div`,{className:`mb-2 flex w-full items-center justify-between`,children:[m,g]}),t[15]=m,t[16]=g,t[17]=_):_=t[17];let v=l?r:null,y;return t[18]!==v||t[19]!==_?(y=(0,Y.jsxs)(`div`,{children:[_,v]}),t[18]=v,t[19]=_,t[20]=y):y=t[20],y}function _ve(e,t){let n=t?.integration;if(!n)return;let r=`${n}/`;if(t.id.startsWith(r))return e[n]?.outputComponents?.[t.id.slice(r.length)]}function vve(e){let t=(0,X.c)(22),{output:n,input:r,actionType:i}=e,a=vy(),o=by(),s;t[0]!==i||t[1]!==a||t[2]!==o?(s=i?_ve(o,Ny(a,i)):void 0,t[0]=i,t[1]=a,t[2]=o,t[3]=s):s=t[3];let c=s,l;t[4]!==c||t[5]!==n?(l=c?null:e7(n),t[4]=c,t[5]=n,t[6]=l):l=t[6];let u=l,d;t[7]!==c||t[8]!==u||t[9]!==r||t[10]!==n?(d=c?(0,Y.jsx)(`div`,{className:`overflow-hidden rounded-lg border bg-muted/50 p-3`,children:(0,Y.jsx)(c,{input:r,output:n})}):u?(0,Y.jsx)(`div`,{className:`overflow-hidden rounded-lg border bg-muted/50 p-3`,children:(0,Y.jsx)(`img`,{alt:`Step output`,className:`max-h-96 w-auto rounded`,height:384,src:`data:image/png;base64,${u}`,width:384})}):null,t[7]=c,t[8]=u,t[9]=r,t[10]=n,t[11]=d):d=t[11];let f=d,p;t[12]===n?p=t[13]:(p=(0,Y.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`,children:(0,Y.jsx)(t7,{data:n})}),t[12]=n,t[13]=p);let m;t[14]!==n||t[15]!==p?(m=(0,Y.jsx)(n7,{copyData:n,title:`Output`,children:p}),t[14]=n,t[15]=p,t[16]=m):m=t[16];let h;t[17]===f?h=t[18]:(h=f?(0,Y.jsx)(n7,{defaultExpanded:!0,title:`Result`,children:f}):null,t[17]=f,t[18]=h);let g;return t[19]!==m||t[20]!==h?(g=(0,Y.jsxs)(Y.Fragment,{children:[m,h]}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}var r7=`grid w-full grid-cols-[1.5rem_minmax(0,1fr)_5rem] items-start gap-3 px-1 py-3 text-left`;function yve(e){return e.type===`back`?(0,Y.jsx)(`button`,{"aria-label":`Back to runs list`,className:`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-muted`,onClick:e.onBack,type:`button`,children:(0,Y.jsx)(Cv,{className:`size-4 text-muted-foreground`})}):(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`size-6 shrink-0`})}function bve(e,t){return t.type===`cancel`?(0,Y.jsx)(`div`,{className:`flex w-20 justify-end`,children:(0,Y.jsxs)(pv,{className:`w-full`,disabled:t.isCanceling,onClick:()=>t.onCancel(e.id),size:`sm`,variant:`outline`,children:[t.isCanceling?(0,Y.jsx)(Zv,{className:`mr-1 size-3 animate-spin`}):(0,Y.jsx)(wv,{className:`mr-1 size-3`}),`Cancel`]})}):(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`w-20 shrink-0`})}function xve(e){let t=(0,X.c)(41),{execution:n,runNumber:r,showStartEventName:i}=e,a;t[0]===n.status?a=t[1]:(a=Q(`mt-1 size-2.5 shrink-0 rounded-full`,X5(n.status)),t[0]=n.status,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,Y.jsx)(`div`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===r?s=t[5]:(s=(0,Y.jsxs)(`span`,{className:`font-medium text-sm`,children:[`Run #`,r]}),t[4]=r,t[5]=s);let c;t[6]===n.status?c=t[7]:(c=Q(`rounded border px-1.5 py-0.5 font-medium text-xs uppercase`,Q5(n.status)),t[6]=n.status,t[7]=c);let l;t[8]===n.status?l=t[9]:(l=Z5(n.status),t[8]=n.status,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,Y.jsx)(`span`,{className:c,children:l}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d;t[13]===n.runMode?d=t[14]:(d=n.runMode===`test`?(0,Y.jsx)(`span`,{className:`rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 font-medium text-xs text-warning uppercase`,children:`Test Mode`}):null,t[13]=n.runMode,t[14]=d);let f;t[15]!==s||t[16]!==u||t[17]!==d?(f=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,u,d]}),t[15]=s,t[16]=u,t[17]=d,t[18]=f):f=t[18];let p;t[19]===n.startedAt?p=t[20]:(p=G5(n.startedAt),t[19]=n.startedAt,t[20]=p);let m;t[21]===p?m=t[22]:(m=(0,Y.jsx)(`span`,{children:p}),t[21]=p,t[22]=m);let h;t[23]===n.startSource?h=t[24]:(h=n.startSource?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{children:`·`}),(0,Y.jsx)(`span`,{className:`capitalize`,children:n.startSource})]}):null,t[23]=n.startSource,t[24]=h);let g;t[25]!==n.startEventName||t[26]!==i?(g=i&&n.startEventName?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{children:`·`}),(0,Y.jsx)(`span`,{children:n.startEventName})]}):null,t[25]=n.startEventName,t[26]=i,t[27]=g):g=t[27];let _;t[28]===n.duration?_=t[29]:(_=n.duration?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{children:`·`}),(0,Y.jsx)(`span`,{className:`font-mono tabular-nums`,children:$5(n.duration)})]}):null,t[28]=n.duration,t[29]=_);let v;t[30]!==m||t[31]!==h||t[32]!==g||t[33]!==_?(v=(0,Y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-muted-foreground text-xs`,children:[m,h,g,_]}),t[30]=m,t[31]=h,t[32]=g,t[33]=_,t[34]=v):v=t[34];let y;t[35]!==v||t[36]!==f?(y=(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[f,v]}),t[35]=v,t[36]=f,t[37]=y):y=t[37];let b;return t[38]!==y||t[39]!==o?(b=(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[o,y]}),t[38]=y,t[39]=o,t[40]=b):b=t[40],b}function i7(e){let t=(0,X.c)(21),{execution:n,runNumber:r,leading:i,trailing:a,onClick:o,selected:s,showStartEventName:c}=e,l=s!==void 0&&s,u=c!==void 0&&c,d;t[0]===i?d=t[1]:(d=yve(i),t[0]=i,t[1]=d);let f;t[2]!==n||t[3]!==r||t[4]!==u?(f=(0,Y.jsx)(xve,{execution:n,runNumber:r,showStartEventName:u}),t[2]=n,t[3]=r,t[4]=u,t[5]=f):f=t[5];let p;t[6]!==n||t[7]!==a?(p=bve(n,a),t[6]=n,t[7]=a,t[8]=p):p=t[8];let m;t[9]!==d||t[10]!==f||t[11]!==p?(m=(0,Y.jsxs)(Y.Fragment,{children:[d,f,p]}),t[9]=d,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h=m;if(o){let e=l&&`bg-muted/50`,n;t[13]===e?n=t[14]:(n=Q(r7,`transition-colors hover:bg-muted/50`,e),t[13]=e,t[14]=n);let r;return t[15]!==h||t[16]!==o||t[17]!==n?(r=(0,Y.jsx)(`button`,{className:n,"data-testid":`workflow-run-summary-row`,onClick:o,type:`button`,children:h}),t[15]=h,t[16]=o,t[17]=n,t[18]=r):r=t[18],r}let g;return t[19]===h?g=t[20]:(g=(0,Y.jsx)(`div`,{className:r7,"data-testid":`workflow-run-summary-row`,children:h}),t[19]=h,t[20]=g),g}function Sve(e){let t=(0,X.c)(36),{log:n,isLast:r}=e,[i,a]=(0,J.useState)(!1),o;t[0]===r?o=t[1]:(o=r?null:(0,Y.jsx)(`div`,{className:`absolute top-5 bottom-0 left-2 w-px bg-border`}),t[0]=r,t[1]=o);let s;t[2]===n.status?s=t[3]:(s=Q(`size-4 rounded-full ring-2 ring-background`,X5(n.status)),t[2]=n.status,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,Y.jsx)(`div`,{className:`relative z-10 mt-1.5 flex shrink-0 items-center justify-center`,children:(0,Y.jsx)(`div`,{className:s})}),t[4]=s,t[5]=c);let l;t[6]===i?l=t[7]:(l=()=>a(!i),t[6]=i,t[7]=l);let u=n.nodeName||n.nodeType,d;t[8]===u?d=t[9]:(d=(0,Y.jsx)(`span`,{className:`truncate font-medium text-sm transition-colors group-hover:text-foreground`,children:u}),t[8]=u,t[9]=d);let f;t[10]===n.status?f=t[11]:(f=Z5(n.status),t[10]=n.status,t[11]=f);let p;t[12]===f?p=t[13]:(p=(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:f}),t[12]=f,t[13]=p);let m;t[14]===n.duration?m=t[15]:(m=n.duration?(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground text-xs tabular-nums`,children:$5(n.duration)}):null,t[14]=n.duration,t[15]=m);let h;t[16]!==d||t[17]!==p||t[18]!==m?(h=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d,p,m]}),t[16]=d,t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;t[20]!==h||t[21]!==l?(g=(0,Y.jsx)(`button`,{className:`group w-full text-left`,onClick:l,type:`button`,children:h}),t[20]=h,t[21]=l,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==n.error||t[25]!==n.input||t[26]!==n.nodeType||t[27]!==n.output?(_=i?(0,Y.jsxs)(`div`,{className:`mt-2 space-y-3`,children:[n.input!==null&&n.input!==void 0?(0,Y.jsx)(n7,{copyData:n.input,title:`Input`,children:(0,Y.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`,children:(0,Y.jsx)(t7,{data:n.input})})}):null,n.output!==null&&n.output!==void 0?(0,Y.jsx)(vve,{actionType:n.nodeType,input:n.input,output:n.output}):null,n.error?(0,Y.jsx)(n7,{copyData:n.error,defaultExpanded:!0,isError:!0,title:`Error`,children:(0,Y.jsx)(`pre`,{className:`overflow-auto rounded-lg border border-destructive/20 bg-destructive/5 p-3 font-mono text-destructive text-xs leading-relaxed`,children:n.error})}):null,n.input||n.output||n.error?null:(0,Y.jsx)(`div`,{className:`rounded-lg border bg-muted/30 py-4 text-center text-muted-foreground text-xs`,children:`No data recorded`})]}):null,t[23]=i,t[24]=n.error,t[25]=n.input,t[26]=n.nodeType,t[27]=n.output,t[28]=_):_=t[28];let v;t[29]!==g||t[30]!==_?(v=(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 pb-4`,children:[g,_]}),t[29]=g,t[30]=_,t[31]=v):v=t[31];let y;return t[32]!==o||t[33]!==v||t[34]!==c?(y=(0,Y.jsxs)(`div`,{className:`relative flex gap-3`,children:[o,c,v]}),t[32]=o,t[33]=v,t[34]=c,t[35]=y):y=t[35],y}function Cve(e){let t=(0,X.c)(7),{logs:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`py-8 text-center text-muted-foreground text-xs`,children:`No steps recorded`}),t[0]=e):e=t[0],e}let r;if(t[1]!==n){let e;t[3]===n.length?e=t[4]:(e=(e,t)=>(0,Y.jsx)(Sve,{isLast:t===n.length-1,log:e},e.id),t[3]=n.length,t[4]=e),r=n.map(e),t[1]=n,t[2]=r}else r=t[2];let i;return t[5]===r?i=t[6]:(i=(0,Y.jsx)(`div`,{className:`pl-1`,children:r}),t[5]=r,t[6]=i),i}function wve(e){let t=(0,X.c)(32),{execution:n,runNumber:r,notice:i,logs:a,events:o,waits:s,isCanceling:c,isResuming:l,onBack:u,onCancel:d,onResume:f}=e,p;t[0]===a?p=t[1]:(p=a.toSorted(Eve),t[0]=a,t[1]=p);let m=p,h;t[2]===u?h=t[3]:(h={onBack:u,type:`back`},t[2]=u,t[3]=h);let g;t[4]!==n.status||t[5]!==c||t[6]!==d?(g=S4(n.status)?{isCanceling:c,onCancel:d,type:`cancel`}:{type:`spacer`},t[4]=n.status,t[5]=c,t[6]=d,t[7]=g):g=t[7];let _;t[8]!==n||t[9]!==r||t[10]!==h||t[11]!==g?(_=(0,Y.jsx)(i7,{execution:n,leading:h,runNumber:r,showStartEventName:!0,trailing:g}),t[8]=n,t[9]=r,t[10]=h,t[11]=g,t[12]=_):_=t[12];let v;t[13]===i?v=t[14]:(v=i?(0,Y.jsx)(`p`,{className:`rounded-md border bg-muted/30 p-2 text-muted-foreground text-xs`,children:i}):null,t[13]=i,t[14]=v);let y;if(t[15]!==l||t[16]!==f||t[17]!==s){let e;t[19]!==l||t[20]!==f?(e=e=>(0,Y.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-muted/30 p-2`,children:[(0,Y.jsxs)(`p`,{className:`font-medium text-xs`,children:[`Parked at `,e.nodeName]}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.subscribedEvents.length>0?`Waiting for ${e.subscribedEvents.join(`, `)}`:`Waiting on a timer`}),e.resumeToken?(0,Y.jsx)(pv,{disabled:l,onClick:()=>f(e.resumeToken??``),size:`sm`,type:`button`,variant:`outline`,children:`Resume now`}):null]},e.id),t[19]=l,t[20]=f,t[21]=e):e=t[21],y=s.map(e),t[15]=l,t[16]=f,t[17]=s,t[18]=y}else y=t[18];let b;t[22]===m?b=t[23]:(b=(0,Y.jsx)(Cve,{logs:m}),t[22]=m,t[23]=b);let x;t[24]===o?x=t[25]:(x=o.length>0?(0,Y.jsx)(n7,{title:`Audit Events`,children:(0,Y.jsx)(`div`,{className:`space-y-2`,children:o.map(Tve)})}):null,t[24]=o,t[25]=x);let S;return t[26]!==_||t[27]!==v||t[28]!==y||t[29]!==b||t[30]!==x?(S=(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[_,v,y,b,x]}),t[26]=_,t[27]=v,t[28]=y,t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function Tve(e){return(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border bg-muted/30 px-2 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`div`,{className:`truncate font-medium text-xs`,children:e.message}),(0,Y.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.eventType})]}),(0,Y.jsx)(`div`,{className:`ml-3 shrink-0 text-xs text-muted-foreground`,children:G5(e.createdAt)})]},e.id)}function Eve(e,t){return new Date(e.startedAt).getTime()-new Date(t.startedAt).getTime()}function Dve(e){let t=(0,X.c)(10),{executions:n,selectedId:r,onSelect:i}=e,a;if(t[0]!==n||t[1]!==i||t[2]!==r){let e;t[4]!==n.length||t[5]!==i||t[6]!==r?(e=(e,t)=>{let a=r===e.id,o=n.length-t;return(0,Y.jsx)(i7,{execution:e,leading:{type:`spacer`},onClick:()=>i(e.id),runNumber:o,selected:a,trailing:{type:`spacer`}},e.id)},t[4]=n.length,t[5]=i,t[6]=r,t[7]=e):e=t[7],a=n.map(e),t[0]=n,t[1]=i,t[2]=r,t[3]=a}else a=t[3];let o;return t[8]===a?o=t[9]:(o=(0,Y.jsx)(`div`,{className:`divide-y`,children:a}),t[8]=a,t[9]=o),o}var a7=2e3,o7=50,Ove=`This run has left the runs list, so what it shows stops here. A newer start supersedes the runs going for the same entity, and the list holds the newest 50.`,kve=ha(`/workflows/$workflowId`);function Ave(){let e=(0,X.c)(80),t=dA(K1),n=dA(C0),r=Ie(),{executionId:i}=kve.useSearch(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={from:`/workflows/$workflowId`},e[0]=a):a=e[0];let o=Ki(a),s=H5(),[c,l]=(0,J.useState)(!1),u=c||i!==void 0,d;e[1]!==t||e[2]!==u?(d=F$.workflow.getExecutions.queryOptions({input:{workflowId:t??``,includeSuperseded:u},select:Zue}),e[1]=t,e[2]=u,e[3]=d):d=e[3];let f=t!==null,p;e[4]!==d||e[5]!==f?(p={...d,enabled:f,staleTime:0,refetchInterval:a7,placeholderData:L},e[4]=d,e[5]=f,e[6]=p):p=e[6];let m=Ze(p),h;e[7]===m.data?.executions?h=e[8]:(h=m.data?.executions??[],e[7]=m.data?.executions,e[8]=h);let g=h,_=m.data?.supersededCount??0,v;e[9]===m.data?.refusedStarts?v=e[10]:(v=m.data?.refusedStarts??[],e[9]=m.data?.refusedStarts,e[10]=v);let y=v,b;e[11]!==i||e[12]!==g?(b=i===void 0?-1:g.findIndex(e=>e.id===i),e[11]=i,e[12]=g,e[13]=b):b=e[13];let x=b,S=x>=0?g[x]:void 0,C=S4(S?.status)?a7:!1,w;e[14]===i?w=e[15]:(w=F$.workflow.getExecutionLogs.queryOptions({input:{executionId:i??``},select:Que}),e[14]=i,e[15]=w);let T=i!==void 0,E;e[16]!==C||e[17]!==w||e[18]!==T?(E={...w,enabled:T,staleTime:0,refetchInterval:C},e[16]=C,e[17]=w,e[18]=T,e[19]=E):E=e[19];let D=Ze(E),O;e[20]===i?O=e[21]:(O=F$.workflow.getExecutionEvents.queryOptions({input:{executionId:i??``},select:ide}),e[20]=i,e[21]=O);let k=i!==void 0,A;e[22]!==C||e[23]!==O||e[24]!==k?(A={...O,enabled:k,staleTime:0,refetchInterval:C},e[22]=C,e[23]=O,e[24]=k,e[25]=A):A=e[25];let j=Ze(A),M;e[26]===r?M=e[27]:(M=F$.workflow.cancelExecution.mutationOptions({onSuccess:()=>H$(r),meta:{errorMessage:`Failed to cancel run`}}),e[26]=r,e[27]=M);let N=Qe(M),P;e[28]===r?P=e[29]:(P=F$.workflow.resumeWait.mutationOptions({onSuccess:()=>H$(r),meta:{errorMessage:`Failed to resume the run`}}),e[28]=r,e[29]=P);let F=Qe(P),I;e[30]===o?I=e[31]:(I=e=>{o({search:{executionId:e}})},e[30]=o,e[31]=I);let R=I;if(m.isPending&&i===void 0){let t;return e[32]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Y.jsx)(gy,{})}),e[32]=t):t=e[32],t}let z;e[33]!==c||e[34]!==_?(z=_>0?(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-1 pb-2`,children:[(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[_===1?`1 run was superseded by a newer start`:`${_} runs were superseded by newer starts`,_>o7?`, of which the newest ${o7} can be shown`:``]}),(0,Y.jsx)(pv,{onClick:()=>l(jve),size:`sm`,type:`button`,variant:`ghost`,children:c?`Hide`:`Show`})]}):null,e[33]=c,e[34]=_,e[35]=z):z=e[35];let B=z;if(i!==void 0){let t=S??D.data?.execution;if(!t){if(!D.isError&&(D.isPending||m.isPending)){let t;return e[36]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Y.jsx)(gy,{})}),e[36]=t):t=e[36],t}let t;e[37]===s?t=e[38]:(t=(0,Y.jsx)(pv,{"aria-label":`Back to runs list`,onClick:s,size:`sm`,type:`button`,variant:`ghost`,children:`Back`}),e[37]=s,e[38]=t);let n;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This run could not be loaded.`}),e[39]=n):n=e[39];let r;return e[40]===t?r=e[41]:(r=(0,Y.jsxs)(`div`,{className:`space-y-2 px-1 py-2`,children:[t,n]}),e[40]=t,e[41]=r),r}let n=x>=0?g.length-x:0,r;e[42]===j.data?r=e[43]:(r=j.data??[],e[42]=j.data,e[43]=r);let i=N.isPending&&N.variables?.executionId===t.id,a;e[44]===D.data?.logs?a=e[45]:(a=D.data?.logs??[],e[44]=D.data?.logs,e[45]=a);let o=S?void 0:Ove,c;e[46]===N?c=e[47]:(c=e=>N.mutate({executionId:e}),e[46]=N,e[47]=c);let l;e[48]===F?l=e[49]:(l=e=>F.mutate({token:e}),e[48]=F,e[49]=l);let u;e[50]===D.data?.waits?u=e[51]:(u=D.data?.waits??[],e[50]=D.data?.waits,e[51]=u);let d;return e[52]!==t||e[53]!==s||e[54]!==F.isPending||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==a||e[59]!==o||e[60]!==c||e[61]!==l||e[62]!==u?(d=(0,Y.jsx)(wve,{events:r,execution:t,isCanceling:i,isResuming:F.isPending,logs:a,notice:o,onBack:s,onCancel:c,onResume:l,runNumber:n,waits:u}),e[52]=t,e[53]=s,e[54]=F.isPending,e[55]=n,e[56]=r,e[57]=i,e[58]=a,e[59]=o,e[60]=c,e[61]=l,e[62]=u,e[63]=d):d=e[63],d}if(g.length===0){let t;e[64]===y?t=e[65]:(t=(0,Y.jsx)(J5,{refusedStarts:y}),e[64]=y,e[65]=t);let n;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,Y.jsx)(`div`,{className:`mb-3 rounded-lg border border-dashed p-4`,children:(0,Y.jsx)(ay,{className:`size-6 text-muted-foreground`})}),(0,Y.jsx)(`div`,{className:`font-medium text-foreground text-sm`,children:`No runs yet`}),(0,Y.jsx)(`div`,{className:`mt-1 text-muted-foreground text-xs`,children:`Execute your workflow to see runs here`})]}),e[66]=n):n=e[66];let r;return e[67]!==B||e[68]!==t?(r=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[B,t,n]}),e[67]=B,e[68]=t,e[69]=r):r=e[69],r}let V;e[70]===y?V=e[71]:(V=(0,Y.jsx)(J5,{refusedStarts:y}),e[70]=y,e[71]=V);let H;e[72]!==g||e[73]!==R||e[74]!==n?(H=(0,Y.jsx)(Dve,{executions:g,onSelect:R,selectedId:n}),e[72]=g,e[73]=R,e[74]=n,e[75]=H):H=e[75];let U;return e[76]!==B||e[77]!==V||e[78]!==H?(U=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[B,V,H]}),e[76]=B,e[77]=V,e[78]=H,e[79]=U):U=e[79],U}function jve(e){return!e}function s7(){let e=(0,X.c)(3),t=dA(x0),n=fA(m0),r;return e[0]!==n||e[1]!==t?(r={validActiveTab:t,setActiveTab:n},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function Mve(){let{validActiveTab:e}=s7(),t=dA(W2),n=dA(G2);return e===`runs`?`Runs`:n&&!t?`Connection`:`Properties`}function Nve(e){let t=(0,X.c)(25),{placement:n,activeTab:r,onSelect:i,showRuns:a}=e;if(n===`bottom`){let e=`flex flex-1 flex-col items-center gap-1 py-3 font-medium text-xs transition-colors ${r===`properties`?`text-foreground`:`text-muted-foreground`}`,n;t[0]===i?n=t[1]:(n=()=>i(`properties`),t[0]=i,t[1]=n);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(ly,{className:`size-5`}),t[2]=o):o=t[2];let s;t[3]!==e||t[4]!==n?(s=(0,Y.jsxs)(`button`,{className:e,onClick:n,type:`button`,children:[o,`Properties`]}),t[3]=e,t[4]=n,t[5]=s):s=t[5];let c;t[6]!==r||t[7]!==i||t[8]!==a?(c=a?(0,Y.jsxs)(`button`,{className:`flex flex-1 flex-col items-center gap-1 py-3 font-medium text-xs transition-colors ${r===`runs`?`text-foreground`:`text-muted-foreground`}`,onClick:()=>i(`runs`),type:`button`,children:[(0,Y.jsx)(ay,{className:`size-5`}),`Runs`]}):null,t[6]=r,t[7]=i,t[8]=a,t[9]=c):c=t[9];let l;return t[10]!==s||t[11]!==c?(l=(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center justify-around border-t bg-background pb-safe`,children:[s,c]}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}let o=`inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center rounded-sm px-2 font-medium text-xs transition-[color,box-shadow] ${r===`properties`?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,s;t[13]===i?s=t[14]:(s=()=>i(`properties`),t[13]=i,t[14]=s);let c;t[15]!==o||t[16]!==s?(c=(0,Y.jsx)(`button`,{className:o,onClick:s,type:`button`,children:`Properties`}),t[15]=o,t[16]=s,t[17]=c):c=t[17];let l;t[18]!==r||t[19]!==i||t[20]!==a?(l=a?(0,Y.jsx)(`button`,{className:`inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center rounded-sm px-2 font-medium text-xs transition-[color,box-shadow] ${r===`runs`?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,onClick:()=>i(`runs`),type:`button`,children:`Runs`}):null,t[18]=r,t[19]=i,t[20]=a,t[21]=l):l=t[21];let u;return t[22]!==c||t[23]!==l?(u=(0,Y.jsx)(`div`,{className:`shrink-0 border-b px-4 py-2`,children:(0,Y.jsxs)(`div`,{className:`inline-flex h-7 w-full items-center justify-center rounded-md bg-muted p-[3px] text-muted-foreground`,children:[c,l]})}),t[22]=c,t[23]=l,t[24]=u):u=t[24],u}function c7(e){let t=(0,X.c)(64),{frame:n}=e,{updateConfig:r,refreshRuns:i,deleteRuns:a}=nve(),{validActiveTab:o,setActiveTab:s}=s7(),c=dA(W2),l=dA(G2),u=dA(e4),d=dA(t4),f=dA(b0),p=dA(K1),m=dA(X1),h=fA(g4),g=fA(_4),_=fA(Q2),v=fA(Tue),y=fA($2),b=fA(Vue),[x,S]=pA(s4),C,w,T,E,D;if(t[0]!==p||t[1]!==y||t[2]!==g||t[3]!==a||t[4]!==b||t[5]!==d||t[6]!==n||t[7]!==i||t[8]!==r||t[9]!==f||t[10]!==m||t[11]!==x||t[12]!==u||t[13]!==l||t[14]!==c||t[15]!==s||t[16]!==v||t[17]!==S||t[18]!==_||t[19]!==h||t[20]!==o){let e;t[26]===c?e=t[27]:(e=e=>e.id===c,t[26]=c,t[27]=e);let O=u.find(e),k;if(t[28]!==d||t[29]!==l){let e;t[31]===l?e=t[32]:(e=e=>e.id===l,t[31]=l,t[32]=e),k=d.find(e),t[28]=d,t[29]=l,t[30]=k}else k=t[30];let A=k,j;t[33]===u?j=t[34]:(j=u.filter(Fve),t[33]=u,t[34]=j);let M=j,N;t[35]===d?N=t[36]:(N=d.filter(Pve),t[35]=d,t[36]=N);let P=N,F=M.length+P.length>1,I;t[37]!==P.length||t[38]!==M.length?(I=[],M.length>0&&I.push(`${M.length} ${M.length===1?`step`:`steps`}`),P.length>0&&I.push(`${P.length} ${P.length===1?`connection`:`connections`}`),t[37]=P.length,t[38]=M.length,t[39]=I):I=t[39];let L=I.join(` and `),R=e=>{O&&h({id:O.id,data:{label:e}})},z=e=>{O&&h({id:O.id,data:{description:e}})},B=O&&c1(O)?w1(u).has(O.id):!1,V=!!(O&&!O.parentId&&(O.data.type===`action`||c1(O))),H=O?c1(O)?B:O.data.enabled===!1:!1,U=()=>{if(O){if(c1(O)){v({groupId:O.id,enabled:B});return}h({id:O.id,data:{enabled:O.data.enabled===!1}})}},W=()=>{if(!O)return;let e=O.id;n.confirm({title:`Delete Step`,message:`Are you sure you want to delete this step? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{g(e),n.dismiss?.()}})},G;t[40]!==y||t[41]!==n||t[42]!==l?(G=()=>{l&&n.confirm({title:`Delete Connection`,message:`Are you sure you want to delete this connection? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{y(l),n.dismiss?.()}})},t[40]=y,t[41]=n,t[42]=l,t[43]=G):G=t[43];let K=G,ee;t[44]!==b||t[45]!==n||t[46]!==L?(ee=()=>{n.confirm({title:`Delete Selected Items`,message:`Are you sure you want to delete ${L}? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{b(),n.dismiss?.()}})},t[44]=b,t[45]=n,t[46]=L,t[47]=ee):ee=t[47];let q=ee,te;t[48]!==p||t[49]!==a||t[50]!==n?(te=()=>{n.confirm({title:`Delete All Runs`,message:`Are you sure you want to delete all workflow runs? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{p&&a.mutate({workflowId:p})}})},t[48]=p,t[49]=a,t[50]=n,t[51]=te):te=t[51];let ne=te,re=O?.data.type===`action`&&!O.data.config?.actionType&&m,ie;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Y.jsx)(`div`,{className:`rounded-lg border border-muted bg-muted/30 p-3`,children:(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`You are viewing a public workflow. Duplicate it to make changes.`})}),t[52]=ie):ie=t[52];let ae=ie,oe=()=>F?(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{children:`Selection`}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[L,` selected`]})]}),m?(0,Y.jsx)(`div`,{className:`flex items-center gap-2 pt-4`,children:(0,Y.jsxs)(pv,{onClick:q,size:`sm`,variant:`outline`,children:[(0,Y.jsx)(dy,{className:`mr-2 size-4 text-destructive`}),(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})}):null]}):A&&!O?(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`edge-id`,children:`Connection ID`}),(0,Y.jsx)(B4,{disabled:!0,id:`edge-id`,value:A.id})]}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`edge-source`,children:`Source`}),(0,Y.jsx)(B4,{disabled:!0,id:`edge-source`,value:A.source})]}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`edge-target`,children:`Target`}),(0,Y.jsx)(B4,{disabled:!0,id:`edge-target`,value:A.target})]}),m?(0,Y.jsx)(`div`,{className:`flex items-center gap-2 pt-4`,children:(0,Y.jsxs)(pv,{onClick:K,size:`sm`,variant:`outline`,children:[(0,Y.jsx)(dy,{className:`mr-2 size-4 text-destructive`}),(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})}):null]}):O?re?(0,Y.jsx)(`div`,{className:`px-4 pt-4`,children:(0,Y.jsx)(F_e,{disabled:f,isNewlyCreated:O.id===x,onSelectAction:e=>{r({actionType:e}),O.id===x&&S(null)}},O.id)}):(0,Y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[O.data.type===`group`?(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Lookups and a Condition in a single-entry, single-exit frame. Lookups may run side by side and join at the Condition. True continues; False with no outgoing edge ends that path.`}):null,O.data.type===`lifecycle`?(0,Y.jsx)($_e,{config:O.data.config||{},disabled:f||!m,onUpdateConfig:r},O.id):null,O.data.type===`action`&&!O.data.config?.actionType?(0,Y.jsx)(`div`,{className:`rounded-lg border border-muted bg-muted/30 p-3`,children:(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No action configured for this step.`})}):null,O.data.type===`action`&&O.data.config?.actionType?(0,Y.jsx)(__e,{config:O.data.config||{},disabled:f||!m,isOwner:m,onUpdateConfig:r},O.id):null,O.data.type!==`action`||O.data.config?.actionType?(0,Y.jsxs)(`div`,{className:O.data.type===`lifecycle`?`space-y-3 rounded-md border border-muted/70 bg-muted/20 p-3`:`space-y-4`,children:[O.data.type===`lifecycle`?(0,Y.jsx)(`p`,{className:`font-medium text-muted-foreground text-sm`,children:`Node Metadata`}):null,(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`label`,children:`Label`}),(0,Y.jsx)(B4,{disabled:f||!m,id:`label`,onChange:e=>R(e.target.value),value:O.data.label})]}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(V4,{htmlFor:`description`,children:`Description`}),(0,Y.jsx)(B4,{disabled:f||!m,id:`description`,onChange:e=>z(e.target.value),placeholder:`Optional description`,value:O.data.description||``})]})]}):null,m?null:ae,m&&O.parentId?(0,Y.jsx)(`p`,{className:`pt-4 text-muted-foreground text-xs`,children:`This step runs with its Group. Select the frame to switch it off.`}):null,m?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 pt-4`,children:[V?(0,Y.jsx)(pv,{onClick:U,size:`sm`,variant:`outline`,children:H?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Vv,{className:`mr-2 size-4`}),`Disabled`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Hv,{className:`mr-2 size-4`}),`Enabled`]})}):null,I2(O)?(0,Y.jsxs)(pv,{onClick:()=>_(O.id),size:`sm`,variant:`outline`,children:[(0,Y.jsx)(py,{className:`mr-2 size-4`}),`Ungroup`]}):null,P2([O])?null:(0,Y.jsxs)(pv,{onClick:W,size:`sm`,variant:`outline`,children:[(0,Y.jsx)(dy,{className:`mr-2 size-4 text-destructive`}),(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})]}):null]}):(0,Y.jsxs)(`div`,{className:`flex min-h-full flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,Y.jsx)(ny,{className:`size-5 text-muted-foreground`}),(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:`Nothing selected`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Select a step on the canvas to configure it.`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This workflow's own settings are in the menu beside its name.`}),m?null:ae]}),se;t[53]!==n.tabs||t[54]!==m||t[55]!==s||t[56]!==o?(se=(0,Y.jsx)(Nve,{activeTab:o,onSelect:s,placement:n.tabs,showRuns:m}),t[53]=n.tabs,t[54]=m,t[55]=s,t[56]=o,t[57]=se):se=t[57],D=se,C=`flex min-h-0 flex-1 flex-col`,w=`properties-panel`,T=n.tabs===`top`?D:null,E=o===`properties`?(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable_both-edges]`,children:oe()}):(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-4 py-2`,children:[(0,Y.jsxs)(pv,{onClick:i,size:`sm`,variant:`outline`,children:[(0,Y.jsx)(Ate,{className:`mr-2 size-4`}),`Refresh`]}),(0,Y.jsxs)(pv,{className:`text-muted-foreground`,onClick:ne,size:`sm`,variant:`ghost`,children:[(0,Y.jsx)(Bv,{className:`mr-2 size-4`}),`Clear All`]})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 [scrollbar-gutter:stable_both-edges]`,children:(0,Y.jsx)(Ave,{})})]}),t[0]=p,t[1]=y,t[2]=g,t[3]=a,t[4]=b,t[5]=d,t[6]=n,t[7]=i,t[8]=r,t[9]=f,t[10]=m,t[11]=x,t[12]=u,t[13]=l,t[14]=c,t[15]=s,t[16]=v,t[17]=S,t[18]=_,t[19]=h,t[20]=o,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D}else C=t[21],w=t[22],T=t[23],E=t[24],D=t[25];let O=n.tabs===`bottom`?D:null,k;return t[58]!==C||t[59]!==w||t[60]!==T||t[61]!==E||t[62]!==O?(k=(0,Y.jsxs)(`div`,{className:C,"data-testid":w,children:[T,E,O]}),t[58]=C,t[59]=w,t[60]=T,t[61]=E,t[62]=O,t[63]=k):k=t[63],k}function Pve(e){return e.selected}function Fve(e){return e.selected}function l7(e){let t=(0,X.c)(16),{overlayId:n}=e,{push:r,closeAll:i}=Oq(),a=Mve(),o=xq(),s;t[0]!==i||t[1]!==o?(s=()=>{o||i()},t[0]=i,t[1]=o,t[2]=s):s=t[2],oq(o,s);let c;t[3]===r?c=t[4]:(c=e=>{let{title:t,message:n,confirmLabel:i,onConfirm:a}=e;return r(D4,{title:t,message:n,confirmLabel:i,confirmVariant:`destructive`,destructive:!0,onConfirm:a})},t[3]=r,t[4]=c);let l;t[5]!==i||t[6]!==c?(l={confirm:c,dismiss:i,tabs:`bottom`},t[5]=i,t[6]=c,t[7]=l):l=t[7];let u=l,d;t[8]!==n||t[9]!==a?(d=(0,Y.jsx)(T4,{overlayId:n,title:a}),t[8]=n,t[9]=a,t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Y.jsx)(c7,{frame:u}),t[11]=u,t[12]=f);let p;return t[13]!==d||t[14]!==f?(p=(0,Y.jsxs)(`div`,{className:`flex h-full max-h-[80vh] flex-col`,children:[d,f]}),t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function u7(){let e=(0,X.c)(11),{open:t,push:n}=Oq(),r=U5(),i;e[0]===r?i=e[1]:(i=()=>{bq()&&r()},e[0]=r,e[1]=i);let a=i,o;e[2]!==a||e[3]!==t?(o=()=>{t(l7,{},{onClose:a})},e[2]=a,e[3]=t,e[4]=o):o=e[4];let s=o,c;e[5]!==a||e[6]!==n?(c=()=>{n(l7,{},{onClose:a})},e[5]=a,e[6]=n,e[7]=c):c=e[7];let l=c,u;return e[8]!==s||e[9]!==l?(u={openSheet:s,pushSheet:l},e[8]=s,e[9]=l,e[10]=u):u=e[10],u}function Ive(){let e=(0,X.c)(2),t=LE(Lve),n;return e[0]===t?n=e[1]:(n=()=>{document.documentElement.style.setProperty(`--rf-zoom`,String(t))},e[0]=t,e[1]=n),oq(t,n),null}function Lve(e){return e.transform[2]}var Rve=e=>{let t=(0,X.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`Backspace`,`Delete`],t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`Meta`,`Control`,`Shift`],t[4]=a):a=t[4];let o,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Ive,{}),s=(0,Y.jsx)(vk,{bgColor:`var(--sidebar)`,color:`var(--border)`,gap:24,size:2}),t[5]=o,t[6]=s):(o=t[5],s=t[6]);let c;return t[7]!==n||t[8]!==r?(c=(0,Y.jsxs)(sk,{deleteKeyCode:i,fitView:!0,multiSelectionKeyCode:a,panActivationKeyCode:null,selectionOnDrag:!1,zoomOnDoubleClick:!1,zoomOnPinch:!0,...r,children:[o,s,n]}),t[7]=n,t[8]=r,t[9]=c):c=t[9],c},zve=16,Bve=16;function d7(e){return KT({...e,borderRadius:zve,offset:Bve})}var Vve=e=>{let t=(0,X.c)(15),{fromX:n,fromY:r,fromPosition:i,toX:a,toY:o,toPosition:s}=e,c;t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==o?(c=d7({sourceX:n,sourceY:r,sourcePosition:i,targetX:a,targetY:o,targetPosition:s}),t[0]=i,t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=o,t[6]=c):c=t[6];let[l]=c,u;t[7]===l?u=t[8]:(u=(0,Y.jsx)(`path`,{className:`animated`,d:l,fill:`none`,stroke:`var(--color-ring)`,strokeDasharray:`5, 5`,strokeWidth:1}),t[7]=l,t[8]=u);let d;t[9]!==a||t[10]!==o?(d=(0,Y.jsx)(`circle`,{cx:a,cy:o,fill:`#fff`,r:3,stroke:`var(--color-ring)`,strokeWidth:1}),t[9]=a,t[10]=o,t[11]=d):d=t[11];let f;return t[12]!==u||t[13]!==d?(f=(0,Y.jsxs)(`g`,{children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14],f};function f7(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0||a?!0:void 0,c;t[5]===n?c=t[6]:(c=Q(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,Y.jsx)(K8,{"aria-hidden":s,"data-slot":`separator`,orientation:o,className:c,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}var Hve=u_(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});function p7(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=Q(Hve({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,Y.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}var Uve=e=>{let t=(0,X.c)(33),{onReflow:n,canReflow:r}=e,i=r===void 0||r,{zoomIn:a,zoomOut:o,fitView:s}=kD(),[c,l]=pA(h0),u;t[0]===a?u=t[1]:(u=()=>{a()},t[0]=a,t[1]=u);let d=u,f;t[2]===o?f=t[3]:(f=()=>{o()},t[2]=o,t[3]=f);let p=f,m;t[4]===s?m=t[5]:(m=()=>{s({padding:.2,duration:300})},t[4]=s,t[5]=m);let h=m,g;t[6]!==l||t[7]!==c?(g=()=>{l(!c)},t[6]=l,t[7]=c,t[8]=g):g=t[8];let _=g,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Y.jsx)(Ite,{className:`size-4`}),t[9]=v):v=t[9];let y;t[10]===d?y=t[11]:(y=(0,Y.jsx)(pv,{onClick:d,size:`icon`,title:`Zoom in`,variant:`outline`,children:v}),t[10]=d,t[11]=y);let b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(Lte,{className:`size-4`}),t[12]=b):b=t[12];let x;t[13]===p?x=t[14]:(x=(0,Y.jsx)(pv,{onClick:p,size:`icon`,title:`Zoom out`,variant:`outline`,children:b}),t[13]=p,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(ey,{className:`size-4`}),t[15]=S):S=t[15];let C;t[16]===h?C=t[17]:(C=(0,Y.jsx)(pv,{onClick:h,size:`icon`,title:`Fit view`,variant:`outline`,children:S}),t[16]=h,t[17]=C);let w=c?`Hide minimap`:`Show minimap`,T;t[18]===c?T=t[19]:(T=c?(0,Y.jsx)($v,{className:`size-4`}):(0,Y.jsx)(Qv,{className:`size-4`}),t[18]=c,t[19]=T);let E;t[20]!==_||t[21]!==w||t[22]!==T?(E=(0,Y.jsx)(pv,{onClick:_,size:`icon`,title:w,variant:`outline`,children:T}),t[20]=_,t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==i||t[25]!==n?(D=n?(0,Y.jsx)(pv,{"aria-label":`Reflow nodes`,disabled:!i,onClick:n,size:`icon`,title:`Reflow nodes`,variant:`outline`,children:(0,Y.jsx)(sy,{className:`size-4`})}):null,t[24]=i,t[25]=n,t[26]=D):D=t[26];let O;return t[27]!==C||t[28]!==E||t[29]!==D||t[30]!==y||t[31]!==x?(O=(0,Y.jsxs)(p7,{orientation:`vertical`,children:[y,x,C,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=y,t[31]=x,t[32]=O):O=t[32],O};function m7(e,t){return e?.data.label?.trim()||t}function Wve(e){return e.data.type===`lifecycle`||s1(e)||a6(e)}function Gve(e){return i1(e.sourceHandle)||(typeof e.sourceHandle==`string`&&e.sourceHandle.length>0?e.sourceHandle:``)}function Kve(e){let{joinNodeId:t,predecessorIds:n,edges:r}=e;if(n.length===0)return new Set;let i=null;for(let e of n){let t=t6(e,r);if(!i){i=t;continue}for(let e of i)t.has(e)||i.delete(e)}let a=t6(t,r);for(let e of i??[])a.delete(e);return a}function qve(e){if(e.nodeById.get(e.nodeId)?.data.type===`lifecycle`)return!0;for(let t of t6(e.nodeId,e.edges))if(e.nodeById.get(t)?.data.type===`lifecycle`)return!0;return!1}function Jve(e){let{joinNodeId:t,nodes:n,edges:r}=e,i=new Map(n.map(e=>[e.id,e])),a=m7(i.get(t),t),o=r.filter(e=>e.target===t).map(e=>e.source),s=t6(t,r);for(let e of o)if(!qve({nodeId:e,nodeById:i,edges:r}))return`Node "${a}" cannot join an unreachable branch (found "${m7(i.get(e),e)}")`;let c=new Map;for(let e of r){if(e.target!==t&&!s.has(e.target))continue;let n=i.get(e.source);if(!n||!Wve(n))continue;let r=c.get(n.id)??new Set;r.add(Gve(e)),c.set(n.id,r)}for(let[e,t]of c){if(t.size<=1)continue;let n=i.get(e);return n?.data.type===`lifecycle`?`Node "${a}" cannot join the Started and Canceled branches`:`Node "${a}" cannot join mutually exclusive branches from "${m7(n,e)}"`}for(let e of Kve({joinNodeId:t,predecessorIds:o,edges:r})){let t=i.get(e);if(t&&lJ(t))return`Node "${a}" cannot join branches that include a Wait (found "${m7(t,e)}")`}return null}function Yve(e){let t=new Map;for(let n of e.edges)t.set(n.target,(t.get(n.target)??0)+1);for(let[n,r]of t){if(r<=1)continue;let t=Jve({joinNodeId:n,nodes:e.nodes,edges:e.edges});if(t)return t}return null}function Xve(e,t){return a1(e)??t?.displayLabel??null}var h7=(e,t,n,r)=>{let i=e.internals.handleBounds?.[t];if(!(i&&i.length>0))return[0,0];let a=(r?i.find(e=>(e.id??null)===r):void 0)??i.find(e=>e.position===n)??i[0];if(!a)return[0,0];let o=a.width/2,s=a.height/2;switch(n){case Yw.Left:o=0;break;case Yw.Right:o=a.width;break;case Yw.Top:s=0;break;case Yw.Bottom:s=a.height;break;default:throw Error(`Invalid handle position`)}return[e.internals.positionAbsolute.x+a.x+o,e.internals.positionAbsolute.y+a.y+s]},Zve=(e,t,n,r)=>{let i=Yw.Bottom,[a,o]=h7(e,`source`,i,n),s=Yw.Top,[c,l]=h7(t,`target`,s,r);return{sx:a,sy:o,tx:c,ty:l,sourcePos:i,targetPos:s}},Qve={Animated:(0,J.memo)(function(e){let t=(0,X.c)(27),{id:n,source:r,sourceHandleId:i,target:a,targetHandleId:o,style:s,selected:c,data:l}=e,u=dk(r),d=dk(a);if(!(u&&d))return null;let f;if(t[0]!==i||t[1]!==u||t[2]!==o||t[3]!==d){let{sx:e,sy:n,tx:r,ty:a,sourcePos:s,targetPos:c}=Zve(u,d,i,o);f=d7({sourceX:e,sourceY:n,sourcePosition:s,targetX:r,targetY:a,targetPosition:c}),t[0]=i,t[1]=u,t[2]=o,t[3]=d,t[4]=f}else f=t[4];let[p,m,h]=f,g;t[5]!==l||t[6]!==i?(g=Xve(i,l),t[5]=l,t[6]=i,t[7]=g):g=t[7];let _=g,v=l?.inactive===!0,y=c?`var(--primary)`:v?`var(--canvas-line-muted)`:`var(--canvas-line)`,b=v?`4, 8`:`5`,x;t[8]===v?x=t[9]:(x=v?{}:{animation:`dashdraw 0.5s linear infinite`},t[8]=v,t[9]=x);let S;t[10]!==s||t[11]!==y||t[12]!==b||t[13]!==x?(S={...s,stroke:y,strokeWidth:2,strokeDasharray:b,...x},t[10]=s,t[11]=y,t[12]=b,t[13]=x,t[14]=S):S=t[14];let C;t[15]!==p||t[16]!==n||t[17]!==S?(C=(0,Y.jsx)(cO,{id:n,path:p,style:S}),t[15]=p,t[16]=n,t[17]=S,t[18]=C):C=t[18];let w;t[19]!==_||t[20]!==v||t[21]!==m||t[22]!==h?(w=_&&(0,Y.jsx)(lk,{children:(0,Y.jsx)(`div`,{className:`pointer-events-none absolute rounded-sm border bg-background px-1.5 py-0.5 font-medium text-xs text-muted-foreground leading-none`,style:{transform:`translate(-50%, -50%) translate(${m}px,${h}px)`,...v?{opacity:.7}:{}},children:_})}),t[19]=_,t[20]=v,t[21]=m,t[22]=h,t[23]=w):w=t[23];let T;return t[24]!==C||t[25]!==w?(T=(0,Y.jsxs)(Y.Fragment,{children:[C,w]}),t[24]=C,t[25]=w,t[26]=T):T=t[26],T})},$ve=e=>{let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`m-4 rounded-md border bg-card p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(GE,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};function g7(e){return e instanceof HTMLElement&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable)}function eye(e,t){let n=t.filter(t=>t.source===e);return n.some(e=>i1(e.sourceHandle)===`true`)?n.some(e=>i1(e.sourceHandle)===`false`)?`true`:`false`:`true`}function tye(e){let{nodes:t,edges:n,sourceNodeId:r,catalog:i}=e,a=u6({targetNodeId:r,nodes:t,edges:n,catalog:i}),o=new Set(n.filter(e=>e.source===r).map(e=>e.sourceHandle)),s=a.find(e=>!o.has(r6(e.name)))??a[0];return s?r6(s.name):null}function _7(e){let{nodes:t,edges:n,sourceNodeId:r,sourceHandle:i,catalog:a}=e,o=i1(i);if(o)return o;let s=t.find(e=>e.id===r);if(c1(s))return d1(s)??i??null;if(s?.data.type===`lifecycle`)return ale(i)?i:w0;if(a6(s)){let e=i6(i);return e?r6(e):tye({nodes:t,edges:n,sourceNodeId:r,catalog:a})}return s1(s)?eye(r,n):i??null}var nye=e=>{let t=(0,X.c)(12),{className:n}=e,r;t[0]===n?r=t[1]:(r=Q(`pointer-events-none absolute inset-0 animate-border-mask rounded-[inherit]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(`svg`,{className:`size-full overflow-visible`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Y.jsx)(`rect`,{fill:`none`,height:`calc(100% - 2px)`,rx:`6`,stroke:`var(--info)`,strokeWidth:`2`,width:`calc(100% - 2px)`,x:`1`,y:`1`})}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,Y.jsx)(`div`,{className:r,children:i}),t[3]=r,t[4]=a);let o;t[5]===n?o=t[6]:(o=Q(`pointer-events-none absolute inset-0 rounded-[inherit] border-2 border-info/20`,n),t[5]=n,t[6]=o);let s;t[7]===o?s=t[8]:(s=(0,Y.jsx)(`div`,{className:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,Y.jsxs)(Y.Fragment,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c};function rye(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=Q(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Y.jsx)(`div`,{"data-slot":`card`,"data-size":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function iye(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aye(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-xs/relaxed text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`card-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var oye={running:{label:`Running`,Icon:Zv,className:`bg-primary/5 text-foreground`,iconClassName:`animate-spin motion-reduce:animate-none`},success:{label:`Succeeded`,Icon:Tv,className:`bg-success/10 text-success`,iconClassName:``},error:{label:`Failed`,Icon:Mv,className:`bg-destructive/10 text-destructive`,iconClassName:``},cancelled:{label:`Cancelled`,Icon:wv,className:`bg-cancelled/10 text-cancelled`,iconClassName:``}},sye=e=>{let t=(0,X.c)(11),{status:n}=e;if(!n||n===`idle`)return null;let r=oye[n],i;t[0]===r.className?i=t[1]:(i=Q(`absolute top-2 right-2 z-10 flex items-center gap-1 rounded-sm py-0.5 pr-2 pl-1.5 font-medium text-xs leading-none`,r.className),t[0]=r.className,t[1]=i);let a=r.Icon,o;t[2]===r.iconClassName?o=t[3]:(o=Q(`size-3`,r.iconClassName),t[2]=r.iconClassName,t[3]=o);let s;t[4]!==r.Icon||t[5]!==o?(s=(0,Y.jsx)(a,{className:o,strokeWidth:2.5}),t[4]=r.Icon,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==r.label||t[8]!==i||t[9]!==s?(c=(0,Y.jsxs)(`div`,{className:i,role:`status`,children:[s,r.label]}),t[7]=r.label,t[8]=i,t[9]=s,t[10]=c):c=t[10],c};function v7(e,t){return t===!1?null:t===!0?(0,Y.jsx)(YD,{position:e===`source`?Yw.Bottom:Yw.Top,type:e}):t.map(t=>{let n=[e,t.position,t.style?.top,t.style?.right,t.style?.bottom,t.style?.left].join(`:`);return(0,Y.jsx)(YD,{className:t.className,id:t.id,position:t.position,style:t.style,type:e},t.id??n)})}var y7=e=>{let t=(0,X.c)(25),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({handles:r,className:n,status:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===`success`&&`border-2 border-success`,s=a===`error`&&`border-2 border-destructive`,c=a===`cancelled`&&`border-2 border-cancelled`,l;t[5]!==n||t[6]!==o||t[7]!==s||t[8]!==c?(l=Q(`node-container relative flex flex-col items-center justify-center gap-0 overflow-visible rounded-md border-[1.5px] border-canvas-line bg-card p-0 shadow-none transition-all duration-150 ease-out`,o,s,c,n),t[5]=n,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=a===`running`&&(0,Y.jsx)(nye,{}),t[10]=a,t[11]=u);let d;t[12]===a?d=t[13]:(d=(0,Y.jsx)(sye,{status:a}),t[12]=a,t[13]=d);let f;t[14]===r.target?f=t[15]:(f=v7(`target`,r.target),t[14]=r.target,t[15]=f);let p;t[16]===r.source?p=t[17]:(p=v7(`source`,r.source),t[16]=r.source,t[17]=p);let m;return t[18]!==i||t[19]!==l||t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p?(m=(0,Y.jsxs)(rye,{className:l,...i,children:[u,d,f,p,i.children]}),t[18]=i,t[19]=l,t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=m):m=t[24],m},b7=e=>{let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`w-full truncate text-base`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(iye,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a},x7=e=>{let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`w-full truncate text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(aye,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a},S7=e=>{let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex w-full flex-col items-center justify-center gap-1 px-3 py-2 text-center`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};function cye(e){if(!e)return``;let t=e.messages.length,n=t===1?`issue`:`issues`;return e.severity===`blocking`?`${t} blocking ${n}`:`${t} ${n}`}function C7(e){let t=(0,X.c)(13),{issues:n,placement:r}=e,i=r===void 0?`corner`:r;if(!n)return null;let a,o;t[0]===n.messages?(a=t[1],o=t[2]):([a,...o]=n.messages,t[0]=n.messages,t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=cye(n),t[3]=n,t[4]=s);let c=i===`corner`?`absolute top-2 left-2 z-10`:`shrink-0`,l=n.severity===`blocking`?`bg-warning/50`:`bg-muted-foreground/40`,u;t[5]!==c||t[6]!==l?(u=Q(`rounded-full p-1`,c,l),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=o.length>0?`${a} and ${o.length} more`:a,f;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(fy,{className:`size-3.5 text-background`}),t[8]=f):f=t[8];let p;return t[9]!==s||t[10]!==u||t[11]!==d?(p=(0,Y.jsx)(`div`,{"aria-label":s,className:u,role:`img`,title:d,children:f}),t[9]=s,t[10]=u,t[11]=d,t[12]=p):p=t[12],p}var lye=/(-?\d+(?:\.\d+)?)\s*(ms|s|m|h|d|w)/gi,uye=/(Z|[+-]\d{2}:\d{2})$/i,dye=/^(-)?P(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/i,fye=/^-?\d+(?:\.\d+)?$/,pye=/^\d+$/,mye=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function w7(e){switch(e){case`ms`:return 1;case`s`:return 1e3;case`m`:return 6e4;case`h`:return 36e5;case`d`:return 864e5;case`w`:return 6048e5;default:return NaN}}function hye(e){let t=dye.exec(e.trim());if(!t)return null;let n=t[1]?-1:1,r=Number.parseFloat(t[2]??`0`),i=Number.parseFloat(t[3]??`0`),a=Number.parseFloat(t[4]??`0`),o=Number.parseFloat(t[5]??`0`),s=Number.parseFloat(t[6]??`0`);return n*(r*w7(`w`)+i*w7(`d`)+a*w7(`h`)+o*w7(`m`)+s*w7(`s`))}function T7(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;if(fye.test(t))return Number.parseFloat(t);let n=hye(t);if(n!==null)return n;let r=0,i=!1;for(let e of t.matchAll(lye)){let t=Number.parseFloat(e[1]),n=w7(e[2].toLowerCase());if(!Number.isFinite(t)||Number.isNaN(n))return null;i=!0,r+=t*n}return i?r:null}function gye(e){let t=mye.exec(e);return t?{year:Number.parseInt(t[1],10),month:Number.parseInt(t[2],10),day:Number.parseInt(t[3],10),hour:Number.parseInt(t[4]??`0`,10),minute:Number.parseInt(t[5]??`0`,10),second:Number.parseInt(t[6]??`0`,10)}:null}function E7(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).formatToParts(e),r=Object.fromEntries(n.map(e=>[e.type,e.value]));return Date.UTC(Number.parseInt(r.year,10),Number.parseInt(r.month,10)-1,Number.parseInt(r.day,10),Number.parseInt(r.hour,10),Number.parseInt(r.minute,10),Number.parseInt(r.second,10))-e.getTime()}function _ye(e,t){let n=gye(e);if(!n)return null;let r=new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)),i=E7(r,t),a=new Date(r.getTime()-i),o=E7(a,t);return o===i?a:new Date(r.getTime()-o)}function D7(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`)return O7(e);if(typeof e!=`string`)return null;let n=e.trim();return n?vye(n)??yye(n)??bye(n,t):null}function O7(e){if(typeof e==`number`&&!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function vye(e){if(!pye.test(e))return null;let t=Number.parseInt(e,10);return O7(e.length<=10?t*1e3:t)}function yye(e){return uye.test(e)?O7(e):null}function bye(e,t){if(t){let n=_ye(e,t);if(n)return n}return O7(e)}function xye(e,t,n,r){let i=E7(e,r),a=e.getTime()+i,o=new Date(a),s=o.getUTCHours()*60+o.getUTCMinutes();if(s>=t&&s<n)return e;let c=Math.floor(t/60),l=t%60,u=s<t?0:1,d=new Date(a);d.setUTCDate(d.getUTCDate()+u),d.setUTCHours(c,l,0,0);let f=new Date(d.getTime()-i),p=E7(f,r);return p===i?f:new Date(d.getTime()-p)}function Sye(e){let t=m2(e.waitAllowedHoursMode);if(t===`off`)return{date:e.candidate};let n=Kle({mode:t,startTime:e.waitAllowedStartTime,endTime:e.waitAllowedEndTime});if(n.length>0)return{date:e.candidate,error:n.map(e=>e.message).join(` `)};if(!e.timeZone)return{date:e.candidate,error:`Timezone is required when allowed-hours window is enabled.`};let r=h2(e.waitAllowedStartTime),i=h2(e.waitAllowedEndTime);return r===null||i===null?{date:e.candidate,error:`Invalid allowed-hours time format after validation.`}:{date:xye(e.candidate,r,i,e.timeZone)}}function k7(e){let t=e.now??new Date,n=typeof e.waitTimezone==`string`&&e.waitTimezone.trim()?e.waitTimezone.trim():void 0,r;if(e.waitUntil!==void 0&&e.waitUntil!==``){let t=D7(e.waitUntil,n);if(!t)return{error:`Invalid waitUntil value. Use an ISO timestamp or unix epoch.`};let i=T7(e.waitOffset);if(e.waitOffset!==void 0&&e.waitOffset!==``&&i===null)return{error:`Invalid waitOffset value. Use duration like -1d, 6h, 30m, or ISO duration.`};r=new Date(t.getTime()+(i??0))}else{let n=T7(e.waitDuration);if(n===null)return{error:`Invalid waitDuration value. Use milliseconds, duration tokens (e.g. 24h), or ISO duration.`};r=new Date(t.getTime()+n)}let i=Sye({candidate:r,waitAllowedHoursMode:e.waitAllowedHoursMode,waitAllowedStartTime:e.waitAllowedStartTime,waitAllowedEndTime:e.waitAllowedEndTime,timeZone:n});return i.error?{error:i.error}:{waitUntil:i.date}}var Cye={};function wye(){let e=(0,X.c)(5),t=dA(C0),n;e[0]===t?n=e[1]:(n=F$.workflow.getExecutionLogs.queryOptions({input:{executionId:t??``},select:tde}),e[0]=t,e[1]=n);let r=t!==null,i;e[2]!==n||e[3]!==r?(i={...n,enabled:r},e[2]=n,e[3]=r,e[4]=i):i=e[4];let{data:a}=Ze(i);return a??Cye}var Tye=Wh(uh({waitMode:th(Lh),waitTimezone:th(Lh),waitDuration:th(ih),waitUntil:th(ih),waitOffset:th(ih),waitTimeout:th(ih)}));function A7(e){return typeof e==`string`&&e.includes(`{{`)&&e.includes(`}}`)}function j7(e){let t=Math.max(Math.floor(e/1e3),0),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return`${n} ${n===1?`day`:`days`} ${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function M7(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0,timeZoneName:`short`}),r=Object.fromEntries(n.formatToParts(e).map(e=>[e.type,e.value])),i=r.dayPeriod?` ${r.dayPeriod.toUpperCase()}`:``,a=r.timeZoneName?` ${r.timeZoneName}`:``;return`${r.month} ${r.day}, ${r.year} ${r.hour}:${r.minute}${i}${a}`}function Eye(e,t){let n=(0,X.c)(15),r=aJ(t,`waitMode`,`delay`),i=e===rJ.wait&&(r===`delay`||r===`event`),a=t?.waitDuration,o=t?.waitUntil,s=t?.waitOffset,c;n[0]===t?c=n[1]:(c=typeof t?.waitTimezone==`string`&&t.waitTimezone.trim()?t.waitTimezone.trim():void 0,n[0]=t,n[1]=c);let l=c,u=A7(a)||A7(o)||A7(s),d;bb0:{if(!i||u||r===`event`){d=null;break bb0}let e;n[2]!==a||n[3]!==s||n[4]!==l||n[5]!==o?(e=k7({waitDuration:a,waitUntil:o,waitOffset:s,waitTimezone:l}),n[2]=a,n[3]=s,n[4]=l,n[5]=o,n[6]=e):e=n[6],d=e}let f=d;if(!i)return null;if(r===`event`){let e;return n[7]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Waiting for event`,triggerTime:`Resumes when a matching event arrives`},n[7]=e):e=n[7],e}if(u){let e;return n[8]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Runtime-calculated`,triggerTime:`Trigger time comes from workflow data`},n[8]=e):e=n[8],e}if(!f?.waitUntil){let e;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Set wait duration`,triggerTime:`Add a valid wait time`},n[9]=e):e=n[9],e}let p;n[10]!==f.waitUntil||n[11]!==l?(p=M7(f.waitUntil,l),n[10]=f.waitUntil,n[11]=l,n[12]=p):p=n[12];let m;return n[13]===p?m=n[14]:(m={countdown:`Delay configured`,triggerTime:p},n[13]=p,n[14]=m),m}function Dye(e,t,n){let r=(0,X.c)(16),i=e===rJ.wait&&t!==null&&n!==void 0&&(n.status===`running`||n.status===`pending`),a;r[0]===i?a=r[1]:(a={intervalMs:1e3,enabled:i},r[0]=i,r[1]=a);let o=uq(a);n?.input;let s;bb0:{if(!i){s=null;break bb0}let e;r[2]===n?.input?e=r[3]:(e=Tye(n?.input)??null,r[2]=n?.input,r[3]=e),s=e}let c=s,l,u,d;if(r[4]!==n||r[5]!==o||r[6]!==c||r[7]!==i){d=Symbol.for(`react.early_return_sentinel`);bb1:{let e=i&&n?.startedAt!==void 0?D7(n.startedAt):null;if(!(i&&c&&e)){d=null;break bb1}let t=c.waitMode||`delay`,a=c.waitTimezone||void 0;if(t===`event`){let t=k7({now:e,waitDuration:c.waitTimeout});if(!t.waitUntil){d={countdown:`Waiting for event`,triggerTime:`Resumes when matching event arrives`};break bb1}d={countdown:j7(t.waitUntil.getTime()-o),triggerTime:M7(t.waitUntil,a)};break bb1}let s=k7({now:e,waitDuration:c.waitDuration,waitUntil:c.waitUntil,waitOffset:c.waitOffset,waitTimezone:a});if(!s.waitUntil){d={countdown:`Runtime-calculated`,triggerTime:`Waiting timestamp unavailable`};break bb1}let f=s.waitUntil.getTime()-o;r[11]===f?l=r[12]:(l=j7(f),r[11]=f,r[12]=l),u=M7(s.waitUntil,a)}r[4]=n,r[5]=o,r[6]=c,r[7]=i,r[8]=l,r[9]=u,r[10]=d}else l=r[8],u=r[9],d=r[10];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;return r[13]!==l||r[14]!==u?(f={countdown:l,triggerTime:u},r[13]=l,r[14]=u,r[15]=f):f=r[15],f}var Oye=e=>({"gpt-5":`GPT-5`,"openai/gpt-5.1-instant":`GPT-5.1 Instant`,"openai/gpt-5.1-codex":`GPT-5.1 Codex`,"openai/gpt-5.1-codex-mini":`GPT-5.1 Codex Mini`,"openai/gpt-5.1-thinking":`GPT-5.1 Thinking`,"gpt-4":`GPT-4`,"gpt-4o":`GPT-4o`,"gpt-4o-mini":`GPT-4o Mini`,"claude-3-5-sonnet":`Claude 3.5`,"claude-3-opus":`Claude 3 Opus`,"anthropic/claude-opus-4.5":`Claude Opus 4.5`,"anthropic/claude-sonnet-4.5":`Claude Sonnet 4.5`,"anthropic/claude-haiku-4.5":`Claude Haiku 4.5`,"google/gemini-3-pro-preview":`Gemini 3 Pro Preview`,"google/gemini-2.5-flash-lite":`Gemini 2.5 Flash Lite`,"google/gemini-2.5-flash":`Gemini 2.5 Flash`,"google/gemini-2.5-pro":`Gemini 2.5 Pro`,"meta/llama-4-scout":`Llama 4 Scout`,"meta/llama-3.3-70b":`Llama 3.3 70B`,"meta/llama-3.1-8b":`Llama 3.1 8B`,"moonshotai/kimi-k2-0905":`Kimi K2`,"openai/gpt-oss-120b":`GPT OSS 120B`,"openai/gpt-oss-safeguard-20b":`GPT OSS Safeguard 20B`,"openai/gpt-oss-20b":`GPT OSS 20B`,"o1-preview":`o1 Preview`,"o1-mini":`o1 Mini`,"bfl/flux-2-pro":`FLUX.2 Pro`,"bfl/flux-1-pro":`FLUX.1 Pro`,"openai/dall-e-3":`DALL-E 3`,"google/imagen-4.0-generate":`Imagen 4.0`})[e]||e,kye=(e,t)=>{let n=Ny(e,t)?.integration;return n&&Py(e,n)?.label||`System`},N7=e=>{let t=(0,X.c)(19),{actionType:n,catalog:r,className:i}=e,a=i===void 0?A2:i,o=by();switch(n){case rJ.condition:{let e;t[0]===a?e=t[1]:(e=Q(a,`text-node-condition`),t[0]=a,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,Y.jsx)(Uv,{className:e,strokeWidth:1.5}),t[2]=e,t[3]=n),n}case rJ.eventSplit:{let e;t[4]===a?e=t[5]:(e=Q(a,`text-node-split`),t[4]=a,t[5]=e);let n;return t[6]===e?n=t[7]:(n=(0,Y.jsx)(Mte,{className:e,strokeWidth:1.5}),t[6]=e,t[7]=n),n}case rJ.wait:{let e;t[8]===a?e=t[9]:(e=Q(a,`text-node-wait`),t[8]=a,t[9]=e);let n;return t[10]===e?n=t[11]:(n=(0,Y.jsx)(Kv,{className:e,strokeWidth:1.5}),t[10]=e,t[11]=n),n}}let s=Ny(r,n)?.integration;if(s){let e=o[s];if(e){let n=e.icon,r;return t[12]!==n||t[13]!==a?(r=(0,Y.jsx)(n,{className:a}),t[12]=n,t[13]=a,t[14]=r):r=t[14],r}}let c;t[15]===a?c=t[16]:(c=Q(a,`text-node-wait`),t[15]=a,t[16]=c);let l;return t[17]===c?l=t[18]:(l=(0,Y.jsx)(hy,{className:c,strokeWidth:1.5}),t[17]=c,t[18]=l),l};function Aye(e){let t=(0,X.c)(14),{base64:n}=e,[r,i]=(0,J.useState)(!1),a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Q(A2,`relative cursor-zoom-in overflow-hidden rounded-lg transition-transform hover:scale-105`),o=e=>{e.stopPropagation(),i(!0)},t[0]=a,t[1]=o):(a=t[0],o=t[1]);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=Q(A2,`object-cover`),t[2]=s):s=t[2];let c=`data:image/png;base64,${n}`,l;t[3]===c?l=t[4]:(l=(0,Y.jsx)(`button`,{className:a,onClick:o,type:`button`,children:(0,Y.jsx)(`img`,{alt:`Generated output`,className:s,height:20,src:c,width:20})}),t[3]=c,t[4]=l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(nq,{className:`sr-only`,children:`Generated Image`}),t[5]=u):u=t[5];let d=`data:image/png;base64,${n}`,f;t[6]===d?f=t[7]:(f=(0,Y.jsxs)($K,{className:`max-w-3xl p-2`,showCloseButton:!1,children:[u,(0,Y.jsx)(`div`,{className:`relative aspect-square w-full overflow-hidden rounded-lg`,children:(0,Y.jsx)(`img`,{alt:`Generated output`,className:`h-auto w-full object-contain`,height:768,src:d,width:768})})]}),t[6]=d,t[7]=f);let p;t[8]!==r||t[9]!==f?(p=(0,Y.jsx)(YK,{onOpenChange:i,open:r,children:f}),t[8]=r,t[9]=f,t[10]=p):p=t[10];let m;return t[11]!==l||t[12]!==p?(m=(0,Y.jsxs)(Y.Fragment,{children:[l,p]}),t[11]=l,t[12]=p,t[13]=m):m=t[13],m}var P7=`38%`,F7=`62%`;function I7(e,t){return`${(e+.5)/t*100}%`}var L7=`group-child-handle`,jye=[{position:Yw.Top,className:L7}],Mye=[{position:Yw.Bottom,className:L7}],Nye=[{id:`true`,position:Yw.Bottom,className:L7,style:{left:P7}},{id:`false`,position:Yw.Bottom,className:L7,style:{left:F7}}];function Pye(e){let t=(0,X.c)(26),{data:n,selected:r,id:i}=e,a=vy(),o=uk(),s=iJ(n?.config,`actionType`),c=o1(s),l;if(t[0]!==i||t[1]!==o?(l=()=>{o(i)},t[0]=i,t[1]=o,t[2]=l):l=t[2],sq(c,l),!n)return null;let u=n.label||(s?Ny(a,s)?.label:void 0)||s||`Action`,d=r&&`border-primary`,f=n.enabled===!1&&`opacity-50`,p;t[3]!==d||t[4]!==f?(p=Q(`nodrag flex h-14 w-[188px] flex-row items-center shadow-none transition-all duration-150 ease-out`,d,f),t[3]=d,t[4]=f,t[5]=p):p=t[5];let m=`action-node-${i}`,h=c?Nye:Mye,g;t[6]===h?g=t[7]:(g={target:jye,source:h},t[6]=h,t[7]=g);let _;t[8]!==s||t[9]!==a?(_=s?(0,Y.jsx)(N7,{actionType:s,catalog:a,className:Q(A2,`shrink-0`)}):(0,Y.jsx)(hy,{className:Q(A2,`shrink-0 text-muted-foreground`),strokeWidth:1.5}),t[8]=s,t[9]=a,t[10]=_):_=t[10];let v;t[11]===u?v=t[12]:(v=(0,Y.jsx)(b7,{className:`truncate text-sm`,children:u}),t[11]=u,t[12]=v);let y;t[13]!==n.enabled||t[14]!==n.issues?(y=n.enabled!==!1&&(0,Y.jsx)(C7,{issues:n.issues,placement:`inline`}),t[13]=n.enabled,t[14]=n.issues,t[15]=y):y=t[15];let b;t[16]!==y||t[17]!==_||t[18]!==v?(b=(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 px-3`,children:[_,v,y]}),t[16]=y,t[17]=_,t[18]=v,t[19]=b):b=t[19];let x;return t[20]!==n.status||t[21]!==b||t[22]!==p||t[23]!==m||t[24]!==g?(x=(0,Y.jsx)(y7,{className:p,"data-testid":m,handles:g,status:n.status,children:b}),t[20]=n.status,t[21]=b,t[22]=p,t[23]=m,t[24]=g,t[25]=x):x=t[25],x}var R7=(0,J.memo)(e=>{let t=(0,X.c)(99),{data:n,selected:r,id:i}=e,a=vy(),o=uk(),s=dA(C0),c=wye()[i],l,u,d;t[0]===n?.config?(l=t[1],u=t[2],d=t[3]):(l=iJ(n?.config,`actionType`),u=o1(l),d=Rfe(l),t[0]=n?.config,t[1]=l,t[2]=u,t[3]=d);let f=d,p=R6(f?i:null),m=Dye(l??``,s,c),h=Eye(l??``,n?.config),g=m??h,_;t[4]!==f||t[5]!==p?(_=f?p.map(Fye).join(`|`):null,t[4]=f,t[5]=p,t[6]=_):_=t[6];let v=_,y;if(t[7]!==i||t[8]!==u||t[9]!==f||t[10]!==o?(y=()=>{(u||f)&&o(i)},t[7]=i,t[8]=u,t[9]=f,t[10]=o,t[11]=y):y=t[11],sq(u?i:v,y),!n)return null;let b=n.status,x;t[12]!==l||t[13]!==c?.output||t[14]!==s?(x=s&&l===`Generate Image`?e7(c?.output):null,t[12]=l,t[13]=c?.output,t[14]=s,t[15]=x):x=t[15];let S=x;if(!l){let e=n.enabled===!1,a=r&&`border-primary`,o=e&&`opacity-50`,s;t[16]!==a||t[17]!==o?(s=Q(a,o),t[16]=a,t[17]=o,t[18]=s):s=t[18];let c=`action-node-${i}`,l;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(l={target:!0,source:!0},t[19]=l):l=t[19];let u;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(u=D2(),t[20]=u):u=t[20];let d;t[21]===e?d=t[22]:(d=e&&(0,Y.jsx)(`div`,{className:`absolute top-2 left-2 rounded-full bg-muted-foreground/50 p-1`,children:(0,Y.jsx)(Vv,{className:`size-3.5 text-background`})}),t[21]=e,t[22]=d);let f;t[23]!==n.issues||t[24]!==e?(f=!e&&(0,Y.jsx)(C7,{issues:n.issues}),t[23]=n.issues,t[24]=e,t[25]=f):f=t[25];let p;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(hy,{className:Q(A2,`text-muted-foreground`),strokeWidth:1.5}),t[26]=p):p=t[26];let m=n.label||`Action`,h;t[27]===m?h=t[28]:(h=(0,Y.jsx)(b7,{children:m}),t[27]=m,t[28]=h);let g;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(x7,{children:`Select an action`}),t[29]=g):g=t[29];let _;t[30]===h?_=t[31]:(_=(0,Y.jsxs)(S7,{children:[p,h,g]}),t[30]=h,t[31]=_);let v;return t[32]!==b||t[33]!==d||t[34]!==f||t[35]!==_||t[36]!==s||t[37]!==c?(v=(0,Y.jsxs)(y7,{className:s,"data-testid":c,handles:l,status:b,style:u,children:[d,f,_]}),t[32]=b,t[33]=d,t[34]=f,t[35]=_,t[36]=s,t[37]=c,t[38]=v):v=t[38],v}let C;t[39]!==l||t[40]!==a?(C=Ny(a,l),t[39]=l,t[40]=a,t[41]=C):C=t[41];let w=C,T=n.label||w?.label||l,E;t[42]!==l||t[43]!==n.config?(E=()=>l===`Generate Text`?aJ(n.config,`aiModel`,`meta/llama-4-scout`):l===`Generate Image`?aJ(n.config,`imageModel`,`google/imagen-4.0-generate`):null,t[42]=l,t[43]=n.config,t[44]=E):E=t[44];let D=E,O,k;if(t[45]!==l||t[46]!==a||t[47]!==n.description||t[48]!==n.enabled||t[49]!==D||t[50]!==g){let e=D();O=n.enabled===!1,k=g?g.countdown:e?Oye(e):n.description||kye(a,l),t[45]=l,t[46]=a,t[47]=n.description,t[48]=n.enabled,t[49]=D,t[50]=g,t[51]=O,t[52]=k}else O=t[51],k=t[52];let A=k,j=r&&`border-primary`,M=O&&`opacity-50`,N;t[53]!==j||t[54]!==M?(N=Q(j,M),t[53]=j,t[54]=M,t[55]=N):N=t[55];let P=`action-node-${i}`,F;t[56]!==u||t[57]!==f||t[58]!==p?(F=u?[{id:`true`,position:Yw.Bottom,style:{left:P7,width:12,height:12}},{id:`false`,position:Yw.Bottom,style:{left:F7,width:12,height:12}}]:!f||p.map((e,t)=>({id:r6(e.name),position:Yw.Bottom,style:{left:I7(t,p.length),width:12,height:12}})),t[56]=u,t[57]=f,t[58]=p,t[59]=F):F=t[59];let I;t[60]===F?I=t[61]:(I={target:!0,source:F},t[60]=F,t[61]=I);let L;t[62]!==f||t[63]!==p?(L=D2(f?k2(p.length):192),t[62]=f,t[63]=p,t[64]=L):L=t[64];let R;t[65]===O?R=t[66]:(R=O&&(0,Y.jsx)(`div`,{className:`absolute top-2 left-2 rounded-full bg-muted-foreground/50 p-1`,children:(0,Y.jsx)(Vv,{className:`size-3.5 text-background`})}),t[65]=O,t[66]=R);let z;t[67]!==n.issues||t[68]!==O?(z=!O&&(0,Y.jsx)(C7,{issues:n.issues}),t[67]=n.issues,t[68]=O,t[69]=z):z=t[69];let B;t[70]===u?B=t[71]:(B=u&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 left-[38%] -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,children:`True`}),(0,Y.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 left-[62%] -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,children:`False`})]}),t[70]=u,t[71]=B);let V;t[72]!==f||t[73]!==p?(V=f&&p.map((e,t)=>(0,Y.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 max-w-28 -translate-x-1/2 truncate rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,style:{left:I7(t,p.length)},title:e.name,children:e.label},e.name)),t[72]=f,t[73]=p,t[74]=V):V=t[74];let H;t[75]!==l||t[76]!==a||t[77]!==S?(H=S?(0,Y.jsx)(Aye,{base64:S}):(0,Y.jsx)(N7,{actionType:l,catalog:a}),t[75]=l,t[76]=a,t[77]=S,t[78]=H):H=t[78];let U;t[79]===T?U=t[80]:(U=(0,Y.jsx)(b7,{children:T}),t[79]=T,t[80]=U);let W;t[81]!==A||t[82]!==g?(W=A&&(0,Y.jsx)(x7,{className:g?`font-medium tabular-nums`:void 0,children:A}),t[81]=A,t[82]=g,t[83]=W):W=t[83];let G;t[84]!==H||t[85]!==U||t[86]!==W?(G=(0,Y.jsxs)(S7,{children:[H,U,W]}),t[84]=H,t[85]=U,t[86]=W,t[87]=G):G=t[87];let K;return t[88]!==b||t[89]!==N||t[90]!==P||t[91]!==I||t[92]!==L||t[93]!==R||t[94]!==z||t[95]!==B||t[96]!==V||t[97]!==G?(K=(0,Y.jsxs)(y7,{className:N,"data-testid":P,handles:I,status:b,style:L,children:[R,z,B,V,G]}),t[88]=b,t[89]=N,t[90]=P,t[91]=I,t[92]=L,t[93]=R,t[94]=z,t[95]=B,t[96]=V,t[97]=G,t[98]=K):K=t[98],K});R7.displayName=`StandaloneActionNode`;var z7=(0,J.memo)(e=>{let t=(0,X.c)(4);if(e.parentId){let n;return t[0]===e?n=t[1]:(n=(0,Y.jsx)(Pye,{...e}),t[0]=e,t[1]=n),n}let n;return t[2]===e?n=t[3]:(n=(0,Y.jsx)(R7,{...e}),t[2]=e,t[3]=n),n});z7.displayName=`ActionNode`;function Fye(e){return e.name}function Iye(e){let t=(0,X.c)(3),{data:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(oy,{className:`size-4`}),t[0]=r):r=t[0];let i;return t[1]===n.onClick?i=t[2]:(i=(0,Y.jsx)(`div`,{className:`flex items-center justify-center rounded-lg border border-border border-dashed bg-background/50 p-8 backdrop-blur-sm`,children:(0,Y.jsxs)(pv,{className:`gap-2 shadow-lg`,onClick:n.onClick,size:`default`,children:[r,`Add a Step`]})}),t[1]=n.onClick,t[2]=i),i}var B7=(0,J.memo)(e=>{let t=(0,X.c)(19),{data:n,selected:r,id:i}=e;if(!n||!c1({data:n}))return null;let a=n.enabled===!1,o=r&&`border-primary`,s=a&&`opacity-50`,c;t[0]!==o||t[1]!==s?(c=Q(`flex h-full w-full flex-col rounded-md border-[1.5px] border-canvas-line bg-muted shadow-none`,o,s),t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=`group-node-${i}`,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(YD,{position:Yw.Top,type:`target`}),t[3]=u):u=t[3];let d;t[4]===a?d=t[5]:(d=a&&(0,Y.jsx)(`span`,{className:`rounded-full bg-muted-foreground/50 p-1`,children:(0,Y.jsx)(Vv,{className:`size-3.5 text-background`})}),t[4]=a,t[5]=d);let f=n.label||`Group`,p;t[6]!==d||t[7]!==f?(p=(0,Y.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-canvas-line/60 border-b px-3 font-medium text-sm`,children:[d,f]}),t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==n||t[10]!==i?(m=d1({data:n,id:i}),t[9]=n,t[10]=i,t[11]=m):m=t[11];let h;t[12]===m?h=t[13]:(h=(0,Y.jsx)(YD,{id:m,position:Yw.Bottom,type:`source`}),t[12]=m,t[13]=h);let g;return t[14]!==h||t[15]!==c||t[16]!==l||t[17]!==p?(g=(0,Y.jsxs)(`div`,{className:c,"data-testid":l,children:[u,p,h]}),t[14]=h,t[15]=c,t[16]=l,t[17]=p,t[18]=g):g=t[18],g});B7.displayName=`GroupNode`;var V7=`25%`,H7=`75%`;function Lye(e){let t=sQ(e);return t?.startEvents.length?`On ${t.startEvents.join(`, `)}`:dQ(t)?`Manual runs only`:`Nothing starts this yet`}var U7=(0,J.memo)(e=>{let t=(0,X.c)(33),{data:n,selected:r}=e;if(!n)return null;let i=n.label||`Lifecycle`,a;t[0]===n.config?a=t[1]:(a=Lye(n.config),t[0]=n.config,t[1]=a);let o=a,s=n.description||o,c=n.status,l;t[2]===n.config?l=t[3]:(l=cQ(n.config),t[2]=n.config,t[3]=l);let u=!l,d=r&&`border-primary`,f;t[4]===d?f=t[5]:(f=Q(d),t[4]=d,t[5]=f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p={id:w0,position:Yw.Bottom,style:{left:V7,width:12,height:12}},t[6]=p):p=t[6];let m;t[7]===u?m=t[8]:(m={target:!1,source:[p,{id:T0,position:Yw.Bottom,style:{left:H7,width:12,height:12,...u?{opacity:.45}:{}}}]},t[7]=u,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=D2(),t[9]=h):h=t[9];let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,style:{left:V7},children:`Started`}),t[10]=g):g=t[10];let _=u&&`opacity-50`,v;t[11]===_?v=t[12]:(v=Q(`pointer-events-none absolute -bottom-8 -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,_),t[11]=_,t[12]=v);let y;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(y={left:H7},t[13]=y):y=t[13];let b;t[14]===v?b=t[15]:(b=(0,Y.jsx)(`div`,{className:v,style:y,children:`Canceled`}),t[14]=v,t[15]=b);let x;t[16]===n.issues?x=t[17]:(x=(0,Y.jsx)(C7,{issues:n.issues}),t[16]=n.issues,t[17]=x);let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(ay,{className:Q(A2,`text-node-lifecycle`),strokeWidth:1.5}),t[18]=S):S=t[18];let C;t[19]===i?C=t[20]:(C=(0,Y.jsx)(b7,{children:i}),t[19]=i,t[20]=C);let w;t[21]===s?w=t[22]:(w=s&&(0,Y.jsx)(x7,{children:s}),t[21]=s,t[22]=w);let T;t[23]!==C||t[24]!==w?(T=(0,Y.jsxs)(S7,{children:[S,C,w]}),t[23]=C,t[24]=w,t[25]=T):T=t[25];let E;return t[26]!==c||t[27]!==b||t[28]!==x||t[29]!==T||t[30]!==f||t[31]!==m?(E=(0,Y.jsxs)(y7,{className:f,handles:m,status:c,style:h,children:[g,b,x,T]}),t[26]=c,t[27]=b,t[28]=x,t[29]=T,t[30]=f,t[31]=m,t[32]=E):E=t[32],E});U7.displayName=`LifecycleNode`;function Rye(e){let t=(0,X.c)(8),n=fA(p4),r=fA(m4),i=fA(h4),a=fA(Z2),o=vy(),s;t[0]!==o||t[1]!==n||t[2]!==i||t[3]!==a||t[4]!==r?(s=e=>{if(!(e.metaKey||e.ctrlKey)||e.shiftKey||e.altKey||g7(e.target))return;let t=e.key.toLowerCase();if(t===`c`){n()&&e.preventDefault();return}if(t===`v`){r()&&e.preventDefault();return}if(t===`d`){i()&&e.preventDefault();return}t===`g`&&a({catalog:o})&&e.preventDefault()},t[0]=o,t[1]=n,t[2]=i,t[3]=a,t[4]=r,t[5]=s):s=t[5];let c=s,l;t[6]===e?l=t[7]:(l={enabled:e},t[6]=e,t[7]=l),aq(window,`keydown`,c,l)}var W7=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G7=W7((e,t)=>{var n=Object.defineProperty,r=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=(e,t,n)=>r(e,typeof t==`symbol`?t:t+``,n),o=i((e,t)=>{var n=class{constructor(e){a(this,`_isDirected`,!0),a(this,`_isMultigraph`,!1),a(this,`_isCompound`,!1),a(this,`_label`),a(this,`_defaultNodeLabelFn`,()=>{}),a(this,`_defaultEdgeLabelFn`,()=>{}),a(this,`_nodes`,{}),a(this,`_in`,{}),a(this,`_preds`,{}),a(this,`_out`,{}),a(this,`_sucs`,{}),a(this,`_edgeObjs`,{}),a(this,`_edgeLabels`,{}),a(this,`_nodeCount`,0),a(this,`_edgeCount`,0),a(this,`_parent`),a(this,`_children`),e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){var t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,i,a=!1,c=arguments[0];typeof c==`object`&&c&&`v`in c?(e=c.v,t=c.w,n=c.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=c,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);var l=o(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(e,t,n);var u=s(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[l]=u,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n),a=this._edgeObjs[r];return a&&(e=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}};function r(e,t){e[t]?e[t]++:e[t]=1}function i(e,t){--e[t]||delete e[t]}function o(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+``+a+``+(r===void 0?`\0`:r)}function s(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function c(e,t){return o(e,t.v,t.w,t.name)}t.exports=n}),s=i((e,t)=>{t.exports=`3.0.2`}),c=i((e,t)=>{t.exports={Graph:o(),version:s()}}),l=i((e,t)=>{var n=o();t.exports={write:r,read:s};function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:a(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function i(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function a(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function s(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}),u=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r,a){return i(e,String(t),r||n,a||function(t){return e.outEdges(t)})}function i(e,t,n,r){var i={},a=!0,o=0,s=e.nodes(),c=function(e){var t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w;c({v:n,w:n===t.v?t.w:t.v})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0}});for(var u=s.length,d=1;d<u&&(a=!1,o++,l(),a);d++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}}),d=i((e,t)=>{t.exports=n;function n(e){var t={},n=[],r;function i(n){Object.hasOwn(t,n)||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}}),f=i((e,t)=>{t.exports=class{constructor(){a(this,`_arr`,[]),a(this,`_keyIndices`,{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){var n=this._keyIndices;if(e=String(e),!Object.hasOwn(n,e)){var r=this._arr,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error(`New priority is greater than current priority. Key: `+e+` Old: `+this._arr[n].priority+` New: `+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){for(var t=this._arr,n=t[e].priority,r;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){var n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}}}),p=i((e,t)=>{var n=f();t.exports=i;var r=()=>1;function i(e,t,n,i){return a(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function a(e,t,r,i){var a={},o=new n,s,c,l=function(e){var t=e.v===s?e.w:e.v,n=a[t],i=r(e),l=c.distance+i;if(i<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+i);l<n.distance&&(n.distance=l,n.predecessor=s,o.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;a[e]={distance:n},o.add(e,n)});o.size()>0&&(s=o.removeMin(),c=a[s],c.distance!==1/0);)i(s).forEach(l);return a}}),m=i((e,t)=>{var n=p();t.exports=r;function r(e,t,r){return e.nodes().reduce(function(i,a){return i[a]=n(e,a,t,r),i},{})}}),h=i((e,t)=>{t.exports=n;function n(e,t,n){if(e[t].predecessor!==void 0)throw Error(`Invalid source vertex`);if(e[n].predecessor===void 0&&n!==t)throw Error(`Invalid destination vertex`);return{weight:e[n].distance,path:r(e,t,n)}}function r(e,t,n){for(var r=[],i=n;i!==t;)r.push(i),i=e[i].predecessor;return r.push(t),r.reverse()}}),g=i((e,t)=>{t.exports=n;function n(e){var t=0,n=[],r={},i=[];function a(o){var s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){var c=[],l;do l=n.pop(),r[l].onStack=!1,c.push(l);while(o!==l);i.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(r,e)||a(e)}),i}}),_=i((e,t)=>{var n=g();t.exports=r;function r(e){return n(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}}),v=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r){return i(e,t||n,r||function(t){return e.outEdges(t)})}function i(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}}),y=i((e,t)=>{function n(e){var t={},n={},i=[];function a(o){if(Object.hasOwn(n,o))throw new r;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(a),delete n[o],i.push(o))}if(e.sinks().forEach(a),Object.keys(t).length!==e.nodeCount())throw new r;return i}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),b=i((e,t)=>{var n=y();t.exports=r;function r(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),x=i((e,t)=>{t.exports=n;function n(e,t,n,i,a){Array.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);a=r(e,t,n===`post`,s,o,i,a)}),a}function r(e,t,n,i,a,o,s){return Object.hasOwn(i,t)||(i[t]=!0,n||(s=o(s,t)),a(t).forEach(function(t){s=r(e,t,n,i,a,o,s)}),n&&(s=o(s,t))),s}}),S=i((e,t)=>{var n=x();t.exports=r;function r(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),C=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`post`)}}),w=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`pre`)}}),T=i((e,t)=>{var n=o(),r=f();t.exports=i;function i(e,t){var i=new n,a={},o=new r,s;function c(e){var n=e.v===s?e.w:e.v,r=o.priority(n);if(r!==void 0){var i=t(e);i<r&&(a[n]=s,o.decrease(n,i))}}if(e.nodeCount()===0)return i;e.nodes().forEach(function(e){o.add(e,1/0),i.setNode(e)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),Object.hasOwn(a,s))i.setEdge(s,a[s]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}e.nodeEdges(s).forEach(c)}return i}}),E=i((e,t)=>{var n=p(),r=u();t.exports=i;function i(e,t,n,r){return a(e,t,n,r||function(t){return e.outEdges(t)})}function a(e,t,i,a){if(i===void 0)return n(e,t,i,a);for(var o=!1,s=e.nodes(),c=0;c<s.length;c++){for(var l=a(s[c]),u=0;u<l.length;u++){var d=l[u],f=d.v===s[c]?d.v:d.w;i({v:f,w:f===d.v?d.w:d.v})<0&&(o=!0)}if(o)return r(e,t,i,a)}return n(e,t,i,a)}}),D=i((e,t)=>{t.exports={bellmanFord:u(),components:d(),dijkstra:p(),dijkstraAll:m(),extractPath:h(),findCycles:_(),floydWarshall:v(),isAcyclic:b(),postorder:C(),preorder:w(),prim:T(),shortestPaths:E(),reduce:x(),tarjan:g(),topsort:y()}}),O=c();t.exports={Graph:O.Graph,json:l(),alg:D(),version:O.version}}),zye=W7((e,t)=>{var n=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return`[`+e.join(`, `)+`]`}};function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if(e!==`_next`&&e!==`_prev`)return t}t.exports=n}),Bye=W7((e,t)=>{var n=G7().Graph,r=zye();t.exports=a;var i=()=>1;function a(e,t){if(e.nodeCount()<=1)return[];let n=c(e,t||i);return o(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))}function o(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)s(e,t,n,o);for(;o=i.dequeue();)s(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(s(e,t,n,o,!0));break}}}return r}function s(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,l(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,l(t,n,o)}),e.removeNode(r.v),a}function c(e,t){let i=new n,a=0,o=0;e.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let n=i.edge(e.v,e.w)||0,r=t(e),s=n+r;i.setEdge(e.v,e.w,s),o=Math.max(o,i.node(e.v).out+=r),a=Math.max(a,i.node(e.w).in+=r)});let s=u(o+a+3).map(()=>new r),c=a+1;return i.nodes().forEach(e=>{l(s,c,i.node(e))}),{graph:i,buckets:s,zeroIdx:c}}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function u(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}}),K7=W7((e,t)=>{var n=G7().Graph;t.exports={addBorderNode:f,addDummyNode:r,applyWithChunking:h,asNonCompoundGraph:a,buildLayerMatrix:l,intersectRect:c,mapValues:w,maxRank:g,normalizeRanks:u,notime:y,partition:_,pick:C,predecessorWeights:s,range:S,removeEmptyRanks:d,simplify:i,successorWeights:o,time:v,uniqueId:x,zipObject:T};function r(e,t,n,r){for(var i=r;e.hasNode(i);)i=x(r);return n.dummy=t,e.setNode(i,n),i}function i(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function a(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function o(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return T(e.nodes(),t)}function s(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return T(e.nodes(),t)}function c(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function l(e){let t=S(g(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function u(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=h(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function d(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=h(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function f(e,t,n,i){let a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(e,`border`,a,t)}function p(e,t=m){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var m=65535;function h(e,t){if(t.length>m){let n=p(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function g(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return h(Math.max,t)}function _(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function v(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function y(e,t){return t()}var b=0;function x(e){return e+(``+ ++b)}function S(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function C(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function w(e,t){let n=t;return typeof t==`string`&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function T(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),Vye=W7((e,t)=>{var n=Bye(),r=K7().uniqueId;t.exports={run:i,undo:o};function i(e){(e.graph().acyclicer===`greedy`?n(e,t(e)):a(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r(`rev`))});function t(e){return t=>e.edge(t).weight}}function a(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function o(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}),Hye=W7((e,t)=>{var n=K7();t.exports={run:r,undo:a};function r(e){e.graph().dummyChains=[],e.edges().forEach(t=>i(e,t))}function i(e,t){let r=t.v,i=e.node(r).rank,a=t.w,o=e.node(a).rank,s=t.name,c=e.edge(t),l=c.labelRank;if(o===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i<o;++f,++i)c.points=[],d={width:0,height:0,edgeLabel:c,edgeObj:t,rank:i},u=n.addDummyNode(e,`edge`,d,`_d`),i===l&&(d.width=c.width,d.height=c.height,d.dummy=`edge-label`,d.labelpos=c.labelpos),e.setEdge(r,u,{weight:c.weight},s),f===0&&e.graph().dummyChains.push(u),r=u;e.setEdge(r,a,{weight:c.weight},s)}function a(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}}),q7=W7((e,t)=>{var{applyWithChunking:n}=K7();t.exports={longestPath:r,slack:i};function r(e){var t={};function r(i){var a=e.node(i);if(Object.hasOwn(t,i))return a.rank;t[i]=!0;let o=e.outEdges(i).map(t=>t==null?1/0:r(t.w)-e.edge(t).minlen);var s=n(Math.min,o);return s===1/0&&(s=0),a.rank=s}e.sources().forEach(r)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}),J7=W7((e,t)=>{var n=G7().Graph,r=q7().slack;t.exports=i;function i(e){var t=new n({directed:!1}),i=e.nodes()[0],c=e.nodeCount();t.setNode(i,{});for(var l,u;a(t,e)<c;)l=o(t,e),u=t.hasNode(l.v)?r(e,l):-r(e,l),s(t,e,u);return t}function a(e,t){function n(i){t.nodeEdges(i).forEach(a=>{var o=a.v,s=i===o?a.w:o;!e.hasNode(s)&&!r(t,a)&&(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))})}return e.nodes().forEach(n),e.nodeCount()}function o(e,t){return t.edges().reduce((n,i)=>{let a=1/0;return e.hasNode(i.v)!==e.hasNode(i.w)&&(a=r(t,i)),a<n[0]?[a,i]:n},[1/0,null])[1]}function s(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}}),Uye=W7((e,t)=>{var n=J7(),r=q7().slack,i=q7().longestPath,a=G7().alg.preorder,o=G7().alg.postorder,s=K7().simplify;t.exports=c,c.initLowLimValues=f,c.initCutValues=l,c.calcCutValue=d,c.leaveEdge=m,c.enterEdge=h,c.exchangeEdges=g;function c(e){e=s(e),i(e);var t=n(e);f(t),l(t,e);for(var r,a;r=m(t);)a=h(t,e,r),g(t,e,r,a)}function l(e,t){var n=o(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>u(e,t,n))}function u(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)}function d(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,t.nodeEdges(n).forEach(a=>{var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,v(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,e.neighbors(r).forEach(i=>{Object.hasOwn(t,i)||(n=p(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function h(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var o=e.node(i),s=e.node(a),c=o,l=!1;return o.lim>s.lim&&(c=s,l=!0),t.edges().filter(t=>l===y(e,e.node(t.v),c)&&l!==y(e,e.node(t.w),c)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function g(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),f(e),l(e,t),_(e,t)}function _(e,t){var n=a(e,e.nodes().find(e=>!t.node(e).parent));n=n.slice(1),n.forEach(n=>{var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function v(e,t,n){return e.hasEdge(t,n)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}}),Wye=W7((e,t)=>{var n=q7().longestPath,r=J7(),i=Uye();t.exports=a;function a(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:c(e);break;case`tight-tree`:s(e);break;case`longest-path`:o(e);break;case`none`:break;default:c(e)}}var o=n;function s(e){n(e),r(e)}function c(e){i(e)}}),Gye=W7((e,t)=>{t.exports=n;function n(e){let t=i(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),a=i.edgeObj,o=r(e,t,a.v,a.w),s=o.path,c=o.lca,l=0,u=s[l],d=!0;for(;n!==a.w;){if(i=e.node(n),d){for(;(u=s[l])!==c&&e.node(u).maxRank<i.rank;)l++;u===c&&(d=!1)}if(!d){for(;l<s.length-1&&e.node(u=s[l+1]).minRank<=i.rank;)l++;u=s[l]}e.setParent(n,u),n=e.successors(n)[0]}})}function r(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function i(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}}),Kye=W7((e,t)=>{var n=K7();t.exports={run:r,cleanup:s};function r(e){let t=n.addDummyNode(e,`root`,{},`_root`),r=a(e),s=Object.values(r),c=n.applyWithChunking(Math.max,s)-1,l=2*c+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=l);let u=o(e)+1;e.children().forEach(n=>i(e,t,l,u,c,r,n)),e.graph().nodeRankFactor=l}function i(e,t,r,a,o,s,c){let l=e.children(c);if(!l.length){c!==t&&e.setEdge(t,c,{weight:0,minlen:r});return}let u=n.addBorderNode(e,`_bt`),d=n.addBorderNode(e,`_bb`),f=e.node(c);e.setParent(u,c),f.borderTop=u,e.setParent(d,c),f.borderBottom=d,l.forEach(n=>{i(e,t,r,a,o,s,n);let l=e.node(n),f=l.borderTop?l.borderTop:n,p=l.borderBottom?l.borderBottom:n,m=l.borderTop?a:2*a,h=f===p?o-s[c]+1:1;e.setEdge(u,f,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,d,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,u,{weight:0,minlen:o+s[c]})}function a(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function o(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function s(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}),qye=W7((e,t)=>{var n=K7();t.exports=r;function r(e){function t(n){let r=e.children(n),a=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(a,`minRank`)){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,r=a.maxRank+1;t<r;++t)i(e,`borderLeft`,`_bl`,n,a,t),i(e,`borderRight`,`_br`,n,a,t)}}e.children().forEach(t)}function i(e,t,r,i,a,o){let s={width:0,height:0,rank:o,borderType:t},c=a[t][o-1],l=n.addDummyNode(e,`border`,s,r);a[t][o]=l,e.setParent(l,i),c&&e.setEdge(c,l,{weight:1})}}),Jye=W7((e,t)=>{t.exports={adjust:n,undo:r};function n(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&i(e)}function r(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&o(e),(t===`lr`||t===`rl`)&&(c(e),i(e))}function i(e){e.nodes().forEach(t=>a(e.node(t))),e.edges().forEach(t=>a(e.edge(t)))}function a(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(s),Object.hasOwn(n,`y`)&&s(n)})}function s(e){e.y=-e.y}function c(e){e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(l),Object.hasOwn(n,`x`)&&l(n)})}function l(e){let t=e.x;e.x=e.y,e.y=t}}),Yye=W7((e,t)=>{var n=K7();t.exports=r;function r(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=n.applyWithChunking(Math.max,i),o=n.range(a+1).map(()=>[]);function s(n){if(t[n])return;t[n]=!0;let r=e.node(n);o[r.rank].push(n),e.successors(n).forEach(s)}return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(s),o}}),Xye=W7((e,t)=>{var n=K7().zipObject;t.exports=r;function r(e,t){let n=0;for(let r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}function i(e,t,r){let i=n(r,r.map((e,t)=>t)),a=t.flatMap(t=>e.outEdges(t).map(t=>({pos:i[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),o=1;for(;o<r.length;)o<<=1;let s=2*o-1;--o;let c=Array(s).fill(0),l=0;return a.forEach(e=>{let t=e.pos+o;c[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=c[t+1]),t=t-1>>1,c[t]+=e.weight;l+=e.weight*n}),l}}),Zye=W7((e,t)=>{t.exports=n;function n(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(n.length){let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}}),Qye=W7((e,t)=>{var n=K7();t.exports=r;function r(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(n[e.w]))}),i(Object.values(n).filter(e=>!e.indegree))}function i(e){let t=[];function r(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&a(e,t)}}function i(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(r(n)),n.out.forEach(i(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,[`vs`,`i`,`barycenter`,`weight`]))}function a(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}}),$ye=W7((e,t)=>{var n=K7();t.exports=r;function r(e,t){let r=n.partition(e,e=>Object.hasOwn(e,`barycenter`)),o=r.lhs,s=r.rhs.sort((e,t)=>t.i-e.i),c=[],l=0,u=0,d=0;o.sort(a(!!t)),d=i(c,s,d),o.forEach(e=>{d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,d=i(c,s,d)});let f={vs:c.flat(!0)};return u&&(f.barycenter=l/u,f.weight=u),f}function i(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function a(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}),ebe=W7((e,t)=>{var n=Zye(),r=Qye(),i=$ye();t.exports=a;function a(e,t,c,l){let u=e.children(t),d=e.node(t),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,m={};f&&(u=u.filter(e=>e!==f&&e!==p));let h=n(e,u);h.forEach(t=>{if(e.children(t.v).length){let n=a(e,t.v,c,l);m[t.v]=n,Object.hasOwn(n,`barycenter`)&&s(t,n)}});let g=r(h,c);o(g,m);let _=i(g,l);if(f&&(_.vs=[f,_.vs,p].flat(!0),e.predecessors(f).length)){let t=e.node(e.predecessors(f)[0]),n=e.node(e.predecessors(p)[0]);Object.hasOwn(_,`barycenter`)||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+t.order+n.order)/(_.weight+2),_.weight+=2}return _}function o(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function s(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}}),tbe=W7((e,t)=>{var n=G7().Graph,r=K7();t.exports=i;function i(e,t,r,i){i||=e.nodes();let o=a(e),s=new n({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let i=e.node(n),a=e.parent(n);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(s.setNode(n),s.setParent(n,a||o),e[r](n).forEach(t=>{let r=t.v===n?t.w:t.v,i=s.edge(r,n),a=i===void 0?0:i.weight;s.setEdge(r,n,{weight:e.edge(t).weight+a})}),Object.hasOwn(i,`minRank`)&&s.setNode(n,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))}),s}function a(e){for(var t;e.hasNode(t=r.uniqueId(`_root`)););return t}}),nbe=W7((e,t)=>{t.exports=n;function n(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}}),rbe=W7((e,t)=>{var n=Yye(),r=Xye(),i=ebe(),a=tbe(),o=nbe(),s=G7().Graph,c=K7();t.exports=l;function l(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,l);return}let i=c.maxRank(e),a=u(e,c.range(1,i+1),`inEdges`),o=u(e,c.range(i-1,-1,-1),`outEdges`),s=n(e);if(f(e,s),t.disableOptimalOrderHeuristic)return;let p=1/0,m,h=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){d(t%2?a:o,t%4>=2,h),s=c.buildLayerMatrix(e);let i=r(e,s);i<p?(n=0,m=Object.assign({},s),p=i):i===p&&(m=structuredClone(s))}f(e,m)}function u(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return a(e,t,n,r.get(t)||[])})}function d(e,t,n){let r=new s;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let a=e.graph().root,s=i(e,a,r,t);s.vs.forEach((t,n)=>e.node(t).order=n),o(e,r,s.vs)})}function f(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}}),ibe=W7((e,t)=>{var n=G7().Graph,r=K7();t.exports={positionX:h,findType1Conflicts:i,findType2Conflicts:a,addConflict:s,hasConflict:c,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:p,findSmallestWidthAlignment:f,balance:m};function i(e,t){let n={};function r(t,r){let i=0,a=0,c=t.length,l=r[r.length-1];return r.forEach((t,u)=>{let d=o(e,t),f=d?e.node(d).order:c;(d||t===l)&&(r.slice(a,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||f<o)&&!(a.dummy&&e.node(t).dummy)&&s(n,r,t)})}),a=u+1,i=f)}),r}return t.length&&t.reduce(r),n}function a(e,t){let n={};function i(t,i,a,o,c){let l;r.range(i,a).forEach(r=>{l=t[r],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<o||r.order>c)&&s(n,t,l)})})}function a(t,n){let r=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,i(n,o,c,r,a),o=c,r=a)}i(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(a),n}function o(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function s(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function c(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function l(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let l=Math.floor(r),u=Math.ceil(r);l<=u;++l){let r=s[l];a[e]===e&&t<o[r]&&!c(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function u(e,t,n,r,i){let a={},o=d(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>a[e]=a[n[e]]),a}function d(e,t,r,i){let a=new n,o=e.graph(),s=g(o.nodesep,o.edgesep,i);return t.forEach(t=>{let n;t.forEach(t=>{let i=r[t];if(a.setNode(i),n){var o=r[n],c=a.edge(o,i);a.setEdge(o,i,Math.max(s(e,t,n),c||0))}n=t})}),a}function f(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=_(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function p(e,t){let n=Object.values(t),i=r.applyWithChunking(Math.min,n),a=r.applyWithChunking(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(o=>{let s=n+o,c=e[s];if(c===t)return;let l=Object.values(c),u=i-r.applyWithChunking(Math.min,l);o!==`l`&&(u=a-r.applyWithChunking(Math.max,l)),u&&(e[s]=r.mapValues(c,e=>e+u))})})}function m(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}function h(e){let t=r.buildLayerMatrix(e),n=Object.assign(i(e,t),a(e,t)),o={},s;return[`u`,`d`].forEach(i=>{s=i===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(s=s.map(e=>Object.values(e).reverse()));let a=(i===`u`?e.predecessors:e.successors).bind(e),c=l(e,s,n,a),d=u(e,s,c.root,c.align,t===`r`);t===`r`&&(d=r.mapValues(d,e=>-e)),o[i+t]=d})}),p(o,f(e,o)),m(o,e.graph().align)}function g(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function _(e,t){return e.node(t).width}}),abe=W7((e,t)=>{var n=K7(),r=ibe().positionX;t.exports=i;function i(e){e=n.asNonCompoundGraph(e),a(e),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}function a(e){let t=n.buildLayerMatrix(e),r=e.graph().ranksep,i=e.graph().rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}}),obe=W7((e,t)=>{var n=Vye(),r=Hye(),i=Wye(),a=K7().normalizeRanks,o=Gye(),s=K7().removeEmptyRanks,c=Kye(),l=qye(),u=Jye(),d=rbe(),f=abe(),p=K7(),m=G7().Graph;t.exports=h;function h(e,t={}){let n=t.debugTiming?p.time:p.notime;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>E(e));return n(` runLayout`,()=>g(r,n,t)),n(` updateInputGraph`,()=>_(e,r)),r})}function g(e,t,m){t(` makeSpaceForEdgeLabels`,()=>D(e)),t(` removeSelfEdges`,()=>I(e)),t(` acyclic`,()=>n.run(e)),t(` nestingGraph.run`,()=>c.run(e)),t(` rank`,()=>i(p.asNonCompoundGraph(e))),t(` injectEdgeLabelProxies`,()=>O(e)),t(` removeEmptyRanks`,()=>s(e)),t(` nestingGraph.cleanup`,()=>c.cleanup(e)),t(` normalizeRanks`,()=>a(e)),t(` assignRankMinMax`,()=>k(e)),t(` removeEdgeLabelProxies`,()=>A(e)),t(` normalize.run`,()=>r.run(e)),t(` parentDummyChains`,()=>o(e)),t(` addBorderSegments`,()=>l(e)),t(` order`,()=>d(e,m)),t(` insertSelfEdges`,()=>L(e)),t(` adjustCoordinateSystem`,()=>u.adjust(e)),t(` position`,()=>f(e)),t(` positionSelfEdges`,()=>R(e)),t(` removeBorderNodes`,()=>F(e)),t(` normalize.undo`,()=>r.undo(e)),t(` fixupEdgeLabelCoords`,()=>N(e)),t(` undoCoordinateSystem`,()=>u.undo(e)),t(` translateGraph`,()=>j(e)),t(` assignNodeIntersects`,()=>M(e)),t(` reversePoints`,()=>P(e)),t(` acyclic.undo`,()=>n.undo(e))}function _(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var v=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],y={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`,rankalign:`center`},b=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],x=[`width`,`height`,`rank`],S={width:0,height:0},C=[`minlen`,`weight`,`width`,`height`,`labeloffset`],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},T=[`labelpos`];function E(e){let t=new m({multigraph:!0,compound:!0}),n=B(e.graph());return t.setGraph(Object.assign({},y,z(n,v),p.pick(n,b))),e.nodes().forEach(n=>{let r=z(B(e.node(n)),x);Object.keys(S).forEach(e=>{r[e]===void 0&&(r[e]=S[e])}),t.setNode(n,r),t.setParent(n,e.parent(n))}),e.edges().forEach(n=>{let r=B(e.edge(n));t.setEdge(n,Object.assign({},w,z(r,C),p.pick(r,T)))}),t}function D(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function O(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),r={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,`edge-proxy`,r,`_ep`)}})}function k(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function A(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function j(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function M(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(p.intersectRect(r,a)),n.points.push(p.intersectRect(i,o))})}function N(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function P(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function F(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function I(e){e.edges().forEach(t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function L(e){p.buildLayerMatrix(e).forEach(t=>{var n=0;t.forEach((t,r)=>{var i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{p.addDummyNode(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function R(e){e.nodes().forEach(t=>{var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function z(e,t){return p.mapValues(p.pick(e,t),Number)}function B(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}}),sbe=W7((e,t)=>{var n=K7(),r=G7().Graph;t.exports={debugOrdering:i};function i(e){let t=n.buildLayerMatrix(e),i=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{i.setNode(t,{label:t}),i.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let n=`layer`+t;i.setNode(n,{rank:`same`}),e.reduce((e,t)=>(i.setEdge(e,t,{style:`invis`}),t))}),i}}),cbe=W7((e,t)=>{t.exports=`2.0.4`}),Y7=W7((e,t)=>{t.exports={graphlib:G7(),layout:obe(),debug:sbe(),util:{time:K7().time,notime:K7().notime},version:cbe()}})();function lbe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ube(){return this.eachAfter(lbe)}function dbe(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function fbe(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function pbe(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function mbe(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function hbe(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function gbe(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function _be(e){for(var t=this,n=vbe(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function vbe(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ybe(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function bbe(){return Array.from(this)}function xbe(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Sbe(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Cbe(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function X7(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ebe)):t===void 0&&(t=Tbe);for(var n=new Z7(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new Z7(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(Obe)}function wbe(){return X7(this).eachBefore(Dbe)}function Tbe(e){return e.children}function Ebe(e){return Array.isArray(e)?e[1]:null}function Dbe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Obe(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Z7(e){this.data=e,this.depth=this.height=0,this.parent=null}Z7.prototype=X7.prototype={constructor:Z7,count:ube,each:dbe,eachAfter:pbe,eachBefore:fbe,find:mbe,sum:hbe,sort:gbe,path:_be,ancestors:ybe,descendants:bbe,leaves:xbe,links:Sbe,copy:wbe,[Symbol.iterator]:Cbe};function kbe(e,t){return e.parent===t.parent?1:2}function Q7(e){var t=e.children;return t?t[0]:e.t}function $7(e){var t=e.children;return t?t[t.length-1]:e.t}function Abe(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function jbe(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function Mbe(e,t,n){return e.a.parent===t.parent?e.a:n}function e9(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}e9.prototype=Object.create(Z7.prototype);function Nbe(e){for(var t=new e9(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new e9(a[o],o)),i.parent=n;return(t.parent=new e9(null,0)).children=[t],t}function Pbe(){var e=kbe,t=1,n=1,r=null;function i(i){var s=Nbe(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){jbe(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=$7(o),i=Q7(i),o&&i;)s=Q7(s),a=$7(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(Abe(Mbe(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!$7(a)&&(a.t=o,a.m+=u-l),i&&!Q7(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}var Fbe=`TB`,t9=40,n9=`__workflow-root__`;function Ibe(e,t){return e.x!==t.x||e.y!==t.y}function Lbe(e){return e.sourceHandle===`true`?4:e.sourceHandle===`false`?3:i6(e.sourceHandle)?4:6}function Rbe(e){return typeof e==`number`&&Number.isFinite(e)&&e<1024?{nodeSpacing:96,rankSpacing:72}:{nodeSpacing:132,rankSpacing:88}}function zbe(e,t){let n=e.node(t);return n?.x===void 0||n.y===void 0?null:{x:n.x,y:n.y}}var Bbe=[w0,T0],Vbe=[`true`,`false`],Hbe=2**53-1;function r9(e,t){return{width:192,height:112,outletHandles:e,holdsOutletsOpen:t}}function Ube(e){if(c1(e.node)){let t=e.nodes.filter(t=>t.parentId===e.node.id).map(e=>e.id),n=new Set(t),{bounds:r}=A1(t,e.edges.filter(e=>n.has(e.source)&&n.has(e.target)),l1(e.node)),i=O2(r.columns,r.rows);return{width:i.width,height:i.height,outletHandles:[],holdsOutletsOpen:!1}}if(dJ(e.node))return r9(Bbe,!0);if(fJ(e.node))return r9(Vbe,!0);if(!a6(e.node))return r9([],!1);let t=u6({targetNodeId:e.node.id,nodes:e.nodes,edges:e.edges,catalog:e.catalog});return{width:k2(t.length),height:112,outletHandles:t.map(e=>r6(e.name)),holdsOutletsOpen:!1}}function i9(e,t){return e.get(t??``)??Hbe}function Wbe(e){let t=t=>e.positionXById.get(t)??0;return e.edges.toSorted((n,r)=>{let i=i9(e.ranks,n.sourceHandle)-i9(e.ranks,r.sourceHandle);return i===0?t(n.target)-t(r.target):i})}function Gbe(e){let t=new Set(e.edges.map(e=>e.sourceHandle??``)),n=e.shape.holdsOutletsOpen?e.shape.outletHandles.filter(e=>!t.has(e)):[];return n.length===0||n.length===e.shape.outletHandles.length?e.edges.map(e=>e.target):[...e.edges.map(t=>({rank:i9(e.ranks,t.sourceHandle),child:t.target})),...n.map(t=>({rank:i9(e.ranks,t),child:null}))].toSorted((e,t)=>e.rank-t.rank).map(e=>e.child)}function Kbe(e){let t=new Map(e.nodes.map(e=>[e.id,e.position.x])),n=new Map(e.nodes.map(e=>[e.id,[]]));for(let t of e.edges)n.get(t.source)?.push(t);let r=new Map,i=new Map;for(let a of e.nodes){let o=Ube({node:a,nodes:e.allNodes,edges:e.allEdges,catalog:e.catalog});r.set(a.id,{width:o.width,height:o.height});let s=new Map(o.outletHandles.map((e,t)=>[e,t])),c=Wbe({edges:n.get(a.id)??[],ranks:s,positionXById:t});n.set(a.id,c),i.set(a.id,Gbe({edges:c,shape:o,ranks:s}))}return{nodes:e.nodes.toSorted((e,t)=>e.position.x-t.position.x),sizeById:r,outEdgesBySource:n,treeChildrenBySource:i}}function a9(e,t){return e.sizeById.get(t)??{width:192,height:112}}function qbe(e){let t=new Y7.graphlib.Graph({directed:!0,multigraph:!1,compound:!1});t.setGraph({rankdir:Fbe,nodesep:e.spacing.nodeSpacing,ranksep:e.spacing.rankSpacing,marginx:t9,marginy:t9}),t.setDefaultEdgeLabel(()=>({}));for(let n of e.model.nodes)t.setNode(n.id,a9(e.model,n.id));for(let n of e.model.nodes)for(let r of e.model.outEdgesBySource.get(n.id)??[])t.setEdge(r.source,r.target,{weight:Lbe(r)});Y7.layout(t);let n=new Map;for(let r of e.model.nodes){let i=zbe(t,r.id);if(!i)continue;let a=a9(e.model,r.id);n.set(r.id,{x:Math.round(i.x-a.width/2),y:Math.round(i.y-a.height/2)})}return n}function Jbe(e){let t=new Map(e.nodes.map(e=>[e.id,0]));for(let n of e.outEdgesBySource.values())for(let e of n)if(e.source===e.target||(t.set(e.target,(t.get(e.target)??0)+1),(t.get(e.target)??0)>1))return null;let n=e.nodes.filter(e=>(t.get(e.id)??0)===0);if(n.length===0)return null;let r=new Set,i=new Set;function a(t){if(i.has(t))return null;i.add(t),r.add(t);let n=[];for(let r of e.treeChildrenBySource.get(t)??[]){if(r===null){n.push({id:null});continue}let e=a(r);if(!e)return null;n.push(e)}return i.delete(t),n.length===0?{id:t}:{id:t,children:n}}let o=[];for(let e of n){let t=a(e.id);if(!t)return null;o.push(t)}return r.size===e.nodes.length?{id:n9,children:o}:null}function Ybe(e){let t=0;for(let n of e.placed)t=Math.max(t,n.depth);let n=Array.from({length:t},()=>0);for(let t of e.placed){let r=t.depth-1;n[r]=Math.max(n[r],e.heightOf(t.id))}let r=Array.from({length:t},()=>0),i=0;for(let a=0;a<t;a+=1)r[a]=i,i+=n[a]+e.rankSpacing;return{tops:r,heights:n}}function Xbe(e){let t=Jbe(e.model);if(!t)return null;let n=t=>t===null?192:a9(e.model,t).width,r=t=>a9(e.model,t).height,i=X7(t,e=>e.children??[]),a=192+e.spacing.nodeSpacing;Pbe().nodeSize([a,112+e.spacing.rankSpacing]).separation((t,r)=>{let i=t.parent===r.parent?e.spacing.nodeSpacing:e.spacing.nodeSpacing*2;return(n(t.data.id)/2+n(r.data.id)/2+i)/a})(i);let o=[];for(let e of i.descendants()){let t=e.data.id;t!==null&&t!==n9&&o.push({id:t,depth:e.depth,centerX:e.x??0})}if(o.length===0)return new Map;let s=Ybe({placed:o,heightOf:r,rankSpacing:e.spacing.rankSpacing}),c=new Map;for(let e of o){let t=e.depth-1;c.set(e.id,{x:e.centerX-n(e.id)/2,y:(s.tops[t]??0)+((s.heights[t]??0)-r(e.id))/2})}let l=Array.from(c.values()),u=Math.min(...l.map(e=>e.x)),d=Math.min(...l.map(e=>e.y)),f=new Map;for(let[e,t]of c)f.set(e,{x:Math.round(t.x-u+t9),y:Math.round(t.y-d+t9)});return f}function Zbe(e){return e.type!==`add`&&!e.parentId}function Qbe(e){let t=e.nodes.filter(Zbe);if(t.length===0)return{nodes:e.nodes,changed:!1};let n=new Set(t.map(e=>e.id)),r=x1(e.nodes,e.edges).filter(e=>n.has(e.source)&&n.has(e.target)),i=Rbe(e.availableWidth),a=Kbe({nodes:t,allNodes:e.nodes,edges:r,allEdges:e.edges,catalog:e.catalog}),o=Xbe({model:a,spacing:i})??qbe({model:a,spacing:i}),s=_ue(e.nodes.map(e=>{let t=o.get(e.id);return t?{...e,position:t}:e}),e.edges),c=new Map(e.nodes.map(e=>[e.id,e]));return{nodes:s,changed:s.some(e=>{let t=c.get(e.id);return!t||Ibe(t.position,e.position)||t.width!==e.width||t.height!==e.height})}}function $be(){return document.querySelector(`.react-flow`)?.getBoundingClientRect().width||(typeof window>`u`?void 0:window.innerWidth)}function o9(){let e=(0,X.c)(13),t=dA(e4),n=dA(t4),r=dA(i4),i=fA(zue),a=vy(),{fitView:o}=kD(),s;e[0]!==r||e[1]!==t?(s=!r&&t.filter(txe).length>1,e[0]=r,e[1]=t,e[2]=s):s=e[2];let c=s,l;e[3]!==i||e[4]!==c||e[5]!==a||e[6]!==n||e[7]!==o||e[8]!==t?(l=()=>{if(!c)return;let{nodes:e,changed:r}=Qbe({nodes:t,edges:n,availableWidth:$be(),catalog:a});r&&i(e),window.requestAnimationFrame(()=>{Promise.resolve(o({maxZoom:1,minZoom:.5,padding:.2,duration:300})).catch(exe)})},e[3]=i,e[4]=c,e[5]=a,e[6]=n,e[7]=o,e[8]=t,e[9]=l):l=e[9];let u=l,d;return e[10]!==c||e[11]!==u?(d={canReflow:c,reflow:u},e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function exe(){}function txe(e){return e.type!==`add`}function nxe(e,t){return fA((0,J.useMemo)(()=>tA(null,(t,n,...r)=>e(t,n,...r)),[e]),t)}function s9(e){let t=(0,X.c)(38),{overlayId:n,issues:r,onGoToStep:i,onRunAnyway:a,allowRunAnyway:o}=e,s=o!==void 0&&o,{push:c,closeAll:l}=Oq(),{pushSheet:u}=u7(),d=xq(),f=J4(),{brokenReferences:p,missingRequiredFields:m,missingIntegrations:h}=r,g=p.length+m.length+h.length,_;t[0]!==l||t[1]!==d||t[2]!==i||t[3]!==u?(_=(e,t)=>{i(e,t),d?u():l()},t[0]=l,t[1]=d,t[2]=i,t[3]=u,t[4]=_):_=t[4];let v=_,y;t[5]!==c||t[6]!==f?(y=e=>{c(G4,{type:e,onSuccess:()=>void f()})},t[5]=c,t[6]=f,t[7]=y):y=t[7];let b=y,x;t[8]!==l||t[9]!==a?(x=()=>{a&&(l(),a())},t[8]=l,t[9]=a,t[10]=x):x=t[10];let S=x,C=m.length+h.length,w;t[11]!==s||t[12]!==l||t[13]!==S||t[14]!==a?(w=s&&a?[{label:`Run Anyway`,variant:`outline`,onClick:S},{label:`Cancel`,onClick:l}]:[{label:`Close`,onClick:l}],t[11]=s,t[12]=l,t[13]=S,t[14]=a,t[15]=w):w=t[15];let T=`Workflow Issues (${g})`,E;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-warning`,children:[(0,Y.jsx)(fy,{className:`size-5`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This workflow has issues that may cause it to fail.`})]}),t[16]=E):E=t[16];let D;t[17]===C?D=t[18]:(D=C>0&&(0,Y.jsx)(`p`,{className:`mt-2 text-destructive text-sm`,children:`Resolve blocking issues before running this workflow.`}),t[17]=C,t[18]=D);let O;t[19]!==b||t[20]!==h?(O=h.length>0&&(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Missing Connections`}),h.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,Y.jsx)(H4,{className:`size-4 shrink-0`,integration:e.integrationType}),(0,Y.jsxs)(`p`,{className:`min-w-0 flex-1 text-sm`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.integrationLabel}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,e.nodeNames.length>3?`${e.nodeNames.slice(0,3).join(`, `)} +${e.nodeNames.length-3} more`:e.nodeNames.join(`, `)]})]}),(0,Y.jsx)(pv,{className:`shrink-0`,onClick:()=>b(e.integrationType),size:`sm`,variant:`outline`,children:`Add`})]},e.integrationType))]}),t[19]=b,t[20]=h,t[21]=O):O=t[21];let k;t[22]!==p||t[23]!==v?(k=p.length>0&&(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Broken References`}),p.map(e=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:e.nodeLabel}),(0,Y.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:e.brokenReferences.map(t=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 py-0.5 pl-3`,children:[(0,Y.jsxs)(`p`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:t.displayText}),` in `,t.fieldLabel]}),(0,Y.jsx)(pv,{className:`shrink-0`,onClick:()=>v(e.nodeId,t.fieldKey),size:`sm`,variant:`outline`,children:`Fix`})]},`${e.nodeId}-${t.fieldKey}-${t.displayText}-${t.fieldLabel}`))})]},e.nodeId))]}),t[22]=p,t[23]=v,t[24]=k):k=t[24];let A;t[25]!==v||t[26]!==m?(A=m.length>0&&(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Missing Required Fields`}),m.map(e=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`font-medium text-sm`,children:e.nodeLabel}),(0,Y.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:e.missingFields.map(t=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 py-0.5 pl-3`,children:[(0,Y.jsx)(`p`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:t.fieldLabel}),(0,Y.jsx)(pv,{className:`shrink-0`,onClick:()=>v(e.nodeId,t.fieldKey),size:`sm`,variant:`outline`,children:`Fix`})]},`${e.nodeId}-${t.fieldKey}`))})]},e.nodeId))]}),t[25]=v,t[26]=m,t[27]=A):A=t[27];let j;t[28]!==k||t[29]!==A||t[30]!==O?(j=(0,Y.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[O,k,A]}),t[28]=k,t[29]=A,t[30]=O,t[31]=j):j=t[31];let M;return t[32]!==n||t[33]!==j||t[34]!==w||t[35]!==T||t[36]!==D?(M=(0,Y.jsxs)(E4,{actions:w,overlayId:n,title:T,children:[E,D,j]}),t[32]=n,t[33]=j,t[34]=w,t[35]=T,t[36]=D,t[37]=M):M=t[37],M}var rxe=300;function ixe(){let e=(0,X.c)(8),t=dA(e4),n=vy(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=I$(),e[0]=r):r=e[0];let{data:i}=Ze(r),a=fA(T2),o=cq(t,rxe),s;bb0:{if(!i){s=w2;break bb0}let t;e[1]!==n||e[2]!==i||e[3]!==o?(t=x2({nodes:n$(o),catalog:n,integrations:i}),e[1]=n,e[2]=i,e[3]=o,e[4]=t):t=e[4],s=t}let c=s,l;e[5]!==c||e[6]!==a?(l=()=>{a(e=>fue(e,c)?e:c)},e[5]=c,e[6]=a,e[7]=l):l=e[7],oq(c,l)}function c9(){let e=(0,X.c)(5),t=fA(W2),n=fA(m0),[r,i]=(0,J.useState)(null),a;e[0]===r?a=e[1]:(a=()=>{if(!r)return;i(null);let e=document.getElementById(r);e&&(e.focus(),e.scrollIntoView({behavior:`smooth`,block:`center`}))},e[0]=r,e[1]=a),sq(r,a);let o;return e[2]!==n||e[3]!==t?(o=(e,r)=>{t(e),n(`properties`),i(r??null)},e[2]=n,e[3]=t,e[4]=o):o=e[4],o}function axe(){let e=(0,X.c)(9),t=vy(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=I$(),e[0]=n):n=e[0];let{data:r}=Ze(n),i;e[1]===r?i=e[2]:(i=r===void 0?[]:r,e[1]=r,e[2]=i);let a=i,{open:o}=Oq(),s=c9(),c=nxe(oxe),l;return e[3]!==t||e[4]!==s||e[5]!==a||e[6]!==o||e[7]!==c?(l=()=>{let e=x2({nodes:n$(c()),catalog:t,integrations:a});o(s9,{issues:C2(e),onGoToStep:s,allowRunAnyway:!1})},e[3]=t,e[4]=s,e[5]=a,e[6]=o,e[7]=c,e[8]=l):l=e[8],l}function oxe(e){return e(e4)}function sxe(e,t){return{workflowId:e,pages:[t],query:``}}function cxe(e){return e.pages[e.pages.length-1]}function l9(e){return e.pages.length>1}function lxe(e,t){return{...e,pages:[...e.pages,t],query:``}}function uxe(e){if(!l9(e))return null;let[t,...n]=e.pages.slice(0,-1);return t?{...e,pages:[t,...n],query:``}:null}function dxe(e,t){return{...e,query:t}}var u9=tA(null),d9=tA(e=>e(i4)?e(r4)?`Close the run on the canvas before adding a step.`:`Wait for the workflow to finish generating.`:null),f9=tA(e=>{let t=e(u9);return t&&t.workflowId===e(K1)?t:null},(e,t,n)=>{t(u9,n)}),p9=tA(null,(e,t,n)=>{let r=e(K1);return!r||e(d9)?!1:(t(u9,sxe(r,n)),!0)}),fxe=8,pxe=280;function mxe(e){let t=(0,X.c)(104),{menuState:n,onClose:r}=e,i=dA(e4),a=dA(t4),o=fA(_4),s=fA($2),c=fA(p9),l=fA(p4),u=fA(m4),d=fA(h4),f=fA(Z2),p=fA(Q2),m=dA(Rue),h=fA(W2),g=fA(m0),_=vy(),{open:v}=Oq(),{openSheet:y}=u7(),b=xq(),x=(0,J.useRef)(null),S;t[0]!==o||t[1]!==n||t[2]!==r||t[3]!==v?(S=()=>{if(n?.nodeId){let e=n.nodeId;r(),v(D4,{title:`Delete Step`,message:`Are you sure you want to delete this node? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{o(e)}})}},t[0]=o,t[1]=n,t[2]=r,t[3]=v,t[4]=S):S=t[4];let C=S,w;t[5]!==b||t[6]!==n||t[7]!==r||t[8]!==y||t[9]!==g||t[10]!==h?(w=()=>{if(n?.nodeId){let e=n.nodeId;r(),h(e),g(`properties`),b&&y()}},t[5]=b,t[6]=n,t[7]=r,t[8]=y,t[9]=g,t[10]=h,t[11]=w):w=t[11];let T=w,E;t[12]!==s||t[13]!==n||t[14]!==r||t[15]!==v?(E=()=>{if(n?.edgeId){let e=n.edgeId;r(),v(D4,{title:`Delete Connection`,message:`Are you sure you want to delete this connection? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{s(e)}})}},t[12]=s,t[13]=n,t[14]=r,t[15]=v,t[16]=E):E=t[16];let D=E,O;t[17]!==n||t[18]!==r||t[19]!==c?(O=()=>{n?.flowPosition&&c({id:`add-step`,at:{x:n.flowPosition.x,y:n.flowPosition.y-56}}),r()},t[17]=n,t[18]=r,t[19]=c,t[20]=O):O=t[20];let k=O,A;t[21]!==l||t[22]!==n||t[23]!==r?(A=()=>{n?.nodeId&&l(n.nodeId),r()},t[21]=l,t[22]=n,t[23]=r,t[24]=A):A=t[24];let j=A,M;t[25]!==d||t[26]!==n||t[27]!==r?(M=()=>{n?.nodeId&&d(n.nodeId),r()},t[25]=d,t[26]=n,t[27]=r,t[28]=M):M=t[28];let N=M,P;t[29]!==_||t[30]!==f||t[31]!==n||t[32]!==r?(P=()=>{if(n?.type!==`node`){r();return}f({catalog:_,selectedIds:n.selectedIds??new Set}),r()},t[29]=_,t[30]=f,t[31]=n,t[32]=r,t[33]=P):P=t[33];let F=P,I;t[34]!==n||t[35]!==r||t[36]!==p?(I=()=>{n?.nodeId&&p(n.nodeId),r()},t[34]=n,t[35]=r,t[36]=p,t[37]=I):I=t[37];let L=I,R;t[38]!==n?.flowPosition||t[39]!==r||t[40]!==u?(R=()=>{u(n?.flowPosition),r()},t[38]=n?.flowPosition,t[39]=r,t[40]=u,t[41]=R):R=t[41];let z=R,B;t[42]===r?B=t[43]:(B=e=>{let t=e.target;x.current&&!(t instanceof globalThis.Node&&x.current.contains(t))&&r()},t[42]=r,t[43]=B);let V=B,H;t[44]===r?H=t[45]:(H=e=>{e.key===`Escape`&&r()},t[44]=r,t[45]=H);let U=H,W=n!==null,G;t[46]===W?G=t[47]:(G={deferAttach:!0,enabled:W},t[46]=W,t[47]=G),aq(document,`mousedown`,V,G);let K;t[48]===W?K=t[49]:(K={enabled:W},t[48]=W,t[49]=K),aq(document,`keydown`,U,K);let ee;if(t[50]===W?ee=t[51]:(ee={enabled:W},t[50]=W,t[51]=ee),aq(window,`resize`,r,ee),!n)return null;let q,te,ne,re,ie,ae;if(t[52]!==_||t[53]!==a||t[54]!==n.nodeId||t[55]!==n.selectedIds||t[56]!==i){te=n.nodeId?i.find(e=>e.id===n.nodeId):void 0,re=te?.data.type===`lifecycle`;let e;t[63]===n.selectedIds?e=t[64]:(e=n.selectedIds??new Set,t[63]=n.selectedIds,t[64]=e);let r=e,o;t[65]!==_||t[66]!==a||t[67]!==r||t[68]!==i?(o=h1(i,a,r,_),t[65]=_,t[66]=a,t[67]=r,t[68]=i,t[69]=o):o=t[69],ne=o,q=ne.ok,ie=I2(te),ae=te?P2([te]):null,t[52]=_,t[53]=a,t[54]=n.nodeId,t[55]=n.selectedIds,t[56]=i,t[57]=q,t[58]=te,t[59]=ne,t[60]=re,t[61]=ie,t[62]=ae}else q=t[57],te=t[58],ne=t[59],re=t[60],ie=t[61],ae=t[62];let oe=ae,se=n.position.y+pxe+fxe>window.innerHeight,ce=te?.data.label||`Step`,le=`min(${n.position.x}px, calc(100vw - 296px))`,ue;t[70]!==n.position.y||t[71]!==se?(ue=se?{bottom:`calc(100vh - ${n.position.y}px)`}:{top:n.position.y},t[70]=n.position.y,t[71]=se,t[72]=ue):ue=t[72];let de;t[73]!==le||t[74]!==ue?(de={left:le,...ue},t[73]=le,t[74]=ue,t[75]=de):de=t[75];let fe;t[76]!==q||t[77]!==oe||t[78]!==ne.error||t[79]!==ne.ok||t[80]!==j||t[81]!==C||t[82]!==N||t[83]!==T||t[84]!==F||t[85]!==L||t[86]!==re||t[87]!==n.type||t[88]!==ce||t[89]!==ie?(fe=n.type===`node`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(h9,{icon:(0,Y.jsx)(jte,{className:`size-4`}),label:`Edit ${ce}`,onClick:T}),(0,Y.jsx)(h9,{disabled:re,icon:(0,Y.jsx)(Lv,{className:`size-4`}),label:`Copy`,onClick:j,shortcut:m9(`C`)}),(0,Y.jsx)(h9,{disabled:re,icon:(0,Y.jsx)(Iv,{className:`size-4`}),label:`Duplicate`,onClick:N,shortcut:m9(`D`)}),(0,Y.jsx)(h9,{disabled:!q,hint:!q&&!ne.ok?ne.error:void 0,icon:(0,Y.jsx)(Gv,{className:`size-4`}),label:`Group`,onClick:F,shortcut:m9(`G`)}),(0,Y.jsx)(h9,{disabled:!ie,icon:(0,Y.jsx)(py,{className:`size-4`}),label:`Ungroup`,onClick:L}),(0,Y.jsx)(h9,{disabled:re||!!oe,hint:oe??void 0,icon:(0,Y.jsx)(dy,{className:`size-4`}),label:`Delete ${ce}`,onClick:C,variant:`destructive`})]}),t[76]=q,t[77]=oe,t[78]=ne.error,t[79]=ne.ok,t[80]=j,t[81]=C,t[82]=N,t[83]=T,t[84]=F,t[85]=L,t[86]=re,t[87]=n.type,t[88]=ce,t[89]=ie,t[90]=fe):fe=t[90];let pe;t[91]!==D||t[92]!==n.type?(pe=n.type===`edge`&&(0,Y.jsx)(h9,{icon:(0,Y.jsx)(Yv,{className:`size-4`}),label:`Delete Connection`,onClick:D,variant:`destructive`}),t[91]=D,t[92]=n.type,t[93]=pe):pe=t[93];let me;t[94]!==k||t[95]!==z||t[96]!==m||t[97]!==n.type?(me=n.type===`pane`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(h9,{icon:(0,Y.jsx)(oy,{className:`size-4`}),label:`Add Step`,onClick:k}),(0,Y.jsx)(h9,{disabled:!m,icon:(0,Y.jsx)(Pv,{className:`size-4`}),label:`Paste`,onClick:z,shortcut:m9(`V`)})]}),t[94]=k,t[95]=z,t[96]=m,t[97]=n.type,t[98]=me):me=t[98];let he;return t[99]!==de||t[100]!==fe||t[101]!==pe||t[102]!==me?(he=(0,Zi.createPortal)((0,Y.jsxs)(`div`,{className:`fade-in-0 zoom-in-95 fixed z-50 max-h-[calc(100vh-1rem)] w-fit min-w-[8rem] max-w-72 animate-in overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,ref:x,style:de,children:[fe,pe,me]}),document.body),t[99]=de,t[100]=fe,t[101]=pe,t[102]=me,t[103]=he):he=t[103],he}function m9(e){return typeof navigator<`u`&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)?`⌘${e}`:`Ctrl+${e}`}function h9(e){let t=(0,X.c)(23),{icon:n,label:r,onClick:i,variant:a,disabled:o,hint:s,shortcut:c}=e,l=(a===void 0?`default`:a)===`destructive`&&`text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive`,u=o&&`pointer-events-none opacity-50`,d;t[0]!==l||t[1]!==u?(d=Q(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none`,`hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,l,u),t[0]=l,t[1]=u,t[2]=d):d=t[2];let f;t[3]===n?f=t[4]:(f=(0,Y.jsx)(`span`,{className:`shrink-0`,children:n}),t[3]=n,t[4]=f);let p;t[5]===r?p=t[6]:(p=(0,Y.jsx)(`span`,{className:`w-full truncate`,children:r}),t[5]=r,t[6]=p);let m;t[7]===s?m=t[8]:(m=s?(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs leading-tight`,children:s}):null,t[7]=s,t[8]=m);let h;t[9]!==p||t[10]!==m?(h=(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start text-left`,children:[p,m]}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]!==o||t[13]!==c?(g=c&&!o?(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 pl-4 text-muted-foreground text-xs tracking-widest`,children:c}):null,t[12]=o,t[13]=c,t[14]=g):g=t[14];let _;return t[15]!==o||t[16]!==s||t[17]!==i||t[18]!==d||t[19]!==f||t[20]!==h||t[21]!==g?(_=(0,Y.jsxs)(`button`,{className:d,disabled:o,onClick:i,title:s,type:`button`,children:[f,h,g]}),t[15]=o,t[16]=s,t[17]=i,t[18]=d,t[19]=f,t[20]=h,t[21]=g,t[22]=_):_=t[22],_}function hxe(e,t,n){let r=(0,X.c)(12),i;r[0]!==n||r[1]!==t?(i=(e,r)=>{e.preventDefault(),t({type:`node`,position:{x:e.clientX,y:e.clientY},nodeId:r.id,selectedIds:n()})},r[0]=n,r[1]=t,r[2]=i):i=r[2];let a=i,o;r[3]===t?o=r[4]:(o=(e,n)=>{e.preventDefault(),t({type:`edge`,position:{x:e.clientX,y:e.clientY},edgeId:n.id})},r[3]=t,r[4]=o);let s=o,c;r[5]!==e||r[6]!==t?(c=n=>{n.preventDefault();let r=e({x:n.clientX,y:n.clientY});t({type:`pane`,position:{x:n.clientX,y:n.clientY},flowPosition:r})},r[5]=e,r[6]=t,r[7]=c):c=r[7];let l=c,u;return r[8]!==s||r[9]!==a||r[10]!==l?(u={onNodeContextMenu:a,onEdgeContextMenu:s,onPaneContextMenu:l},r[8]=s,r[9]=a,r[10]=l,r[11]=u):u=r[11],u}var gxe={[e$]:Qve.Animated},_xe={type:e$},vxe={lifecycle:U7,action:z7,add:Iye,group:B7};function yxe(){let e=(0,X.c)(93),t=vy(),n=dA(Oue),r=dA(kue),i=dA(t4),a=dA(i4),o=dA(K1),[s]=pA(h0),c=xq(),{openSheet:l}=u7(),u=fA(Iue),d=fA(Lue),f=fA(W2),p=fA(G2),m=fA(f4),h=fA(Eue),g=fA(Fue),_=fA(Nue),v=fA(v4),y=fA(y4),b=fA(m0),{screenToFlowPosition:x,fitView:S}=kD(),{canReflow:C,reflow:w}=o9(),T=(0,J.useRef)(null),E=(0,J.useRef)(null),D=(0,J.useRef)(null),O=(0,J.useRef)(!1),[k,A]=(0,J.useState)(!1),[j,M]=(0,J.useState)(null),N;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(N=new Set,e[0]=N):N=e[0];let P=(0,J.useRef)(N),F;e[1]===n?F=e[2]:(F=e=>{e.button===2&&(P.current=new Set(n.filter(Cxe).map(Sxe)))},e[1]=n,e[2]=F);let I=!a,L;e[3]===I?L=e[4]:(L={capture:!0,enabled:I},e[3]=I,e[4]=L),aq(window,`pointerdown`,F,L);let R;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>P.current,e[5]=R):R=e[5];let{onNodeContextMenu:z,onEdgeContextMenu:B,onPaneContextMenu:V}=hxe(x,M,R),H;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{M(null)},e[6]=H):H=e[6];let U=H,W;e[7]===S?W=e[8]:(W=()=>{S({maxZoom:1,minZoom:.5,padding:.2,duration:0}),A(!0)},e[7]=S,e[8]=W),sq(o,W);let G;e[9]!==a||e[10]!==y||e[11]!==v?(G=e=>{!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||g7(e.target)||a||(e.preventDefault(),e.shiftKey?y():v())},e[9]=a,e[10]=y,e[11]=v,e[12]=G):G=e[12],aq(window,`keydown`,G),Rye(!a),ixe();let K;e[13]===S?K=e[14]:(K=e=>{(e.metaKey||e.ctrlKey)&&e.key===`/`&&(e.preventDefault(),S({padding:.2,duration:300}))},e[13]=S,e[14]=K),aq(window,`keydown`,K);let ee;e[15]===n?ee=e[16]:(ee=(e,t)=>{let r=n.find(t=>t.id===e);return!r||r.type===`add`||r.parentId?!1:t!==`target`||r.type!==`lifecycle`},e[15]=n,e[16]=ee);let q=ee,te;e[17]!==t||e[18]!==r||e[19]!==n||e[20]!==i?(te=e=>{let a=e.source,o=e.target;if(!(a&&o)||a===o)return!1;let s=n.find(e=>e.id===a),c=n.find(e=>e.id===o);if(s?.parentId||c?.parentId)return!1;let l=`id`in e&&typeof e.id==`string`?e.id:null,u=_7({nodes:n,edges:r,sourceNodeId:a,sourceHandle:`sourceHandle`in e?e.sourceHandle:void 0,catalog:t}),d=_1({nodes:n,edges:i,sourceId:a,targetId:o,sourceHandle:u,excludeEdgeId:l});if(d.length===0)return!1;let f=[...i.filter(e=>e.id!==l),...d];return!Yve({nodes:n,edges:f})},e[17]=t,e[18]=r,e[19]=n,e[20]=i,e[21]=te):te=e[21];let ne=te,re;e[22]!==t||e[23]!==r||e[24]!==n?(re=(e,i)=>_7({nodes:n,edges:r,sourceNodeId:e,sourceHandle:i,catalog:t}),e[22]=t,e[23]=r,e[24]=n,e[25]=re):re=e[25];let ie=re,ae;e[26]!==h||e[27]!==ne||e[28]!==ie?(ae=e=>{if(!(e.source&&e.target)||!ne(e))return;let t=ie(e.source,e.sourceHandle),n={id:G$(),...e,sourceHandle:t};h(n)},e[26]=h,e[27]=ne,e[28]=ie,e[29]=ae):ae=e[29];let oe=ae,se;e[30]===_?se=e[31]:(se=e=>{let{nodes:t,edges:n}=e;return!(t.some(xxe)||n.length>0)||F2(t)?Promise.resolve(!1):(_(),Promise.resolve(!0))},e[30]=_,e[31]=se);let ce=se,le;e[32]!==c||e[33]!==l||e[34]!==b||e[35]!==f?(le=(e,t)=>{f(t.id),b(`properties`),c&&l()},e[32]=c,e[33]=l,e[34]=b,e[35]=f,e[36]=le):le=e[36];let ue=le,de;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(de=(e,t)=>{T.current=t.nodeId,E.current=t.handleType,D.current=t.handleId??null},e[37]=de):de=e[37];let fe=de,pe=bxe,me;e[38]!==q||e[39]!==ie||e[40]!==oe?(me=e=>{let t=e.getAttribute(`data-id`),n=E.current===`source`,r=n?`target`:`source`,i=T.current;if(t&&i&&t!==i&&q(t,r)){let e=n?i:t,r=n?t:i,a=ie(e,n?D.current:null),o=n?null:D.current;oe({source:e,target:r,sourceHandle:a,targetHandle:o})}},e[38]=q,e[39]=ie,e[40]=oe,e[41]=me):me=e[41];let he=me,ge;e[42]!==m||e[43]!==ne||e[44]!==ie||e[45]!==oe||e[46]!==x||e[47]!==g||e[48]!==b||e[49]!==f?(ge=(e,t)=>{let n=T.current;if(!n)return;let r=E.current===`source`;if(!(r||ne({source:`__new_node__`,target:n,sourceHandle:null,targetHandle:null})))return;let i=x({x:e,y:t});i.y-=56;let a={id:G$(),type:`action`,position:i,data:{label:``,description:``,type:`action`,config:{},status:`idle`},selected:!0};m(a),f(a.id),b(`properties`),setTimeout(()=>{g(a.id)},50);let o=r?n:a.id,s=r?a.id:n,c=ie(o,r?D.current:null),l=r?null:D.current;oe({source:o,target:s,sourceHandle:c,targetHandle:l}),O.current=!0,setTimeout(()=>{O.current=!1},100)},e[42]=m,e[43]=ne,e[44]=ie,e[45]=oe,e[46]=x,e[47]=g,e[48]=b,e[49]=f,e[50]=ge):ge=e[50];let _e=ge,ve;e[51]!==he||e[52]!==_e?(ve=e=>{if(!T.current)return;let{clientX:t,clientY:n}=pe(e),r;if(r=`changedTouches`in e?document.elementFromPoint(t,n):e.target instanceof Element?e.target:null,!r){T.current=null,E.current=null,D.current=null;return}let i=r.closest(`.react-flow__node`),a=r.closest(`.react-flow__handle`);if(i&&!a&&E.current){he(i),T.current=null,E.current=null,D.current=null;return}i||a||_e(t,n),T.current=null,E.current=null,D.current=null},e[51]=he,e[52]=_e,e[53]=ve):ve=e[53];let ye=ve,be;e[54]!==p||e[55]!==f?(be=()=>{O.current||(f(null),p(null),U())},e[54]=p,e[55]=f,e[56]=be):be=e[56];let xe=be,Se;e[57]===f?Se=e[58]:(Se=e=>{let{nodes:t}=e;O.current&&t.length===0||(t.length===0?f(null):t.length===1&&f(t[0].id))},e[57]=f,e[58]=Se);let Ce=Se,we=+!!k,Te;e[59]===we?Te=e[60]:(Te={opacity:we,transition:`opacity 300ms`},e[59]=we,e[60]=Te);let Ee=!a,De=!a,Oe=!a,ke=a?void 0:oe,Ae=a?void 0:ye,je=a?void 0:fe,Me=a?void 0:B,Ne=a?void 0:d,Pe=a?void 0:ue,Fe=a?void 0:z,Ie=a?void 0:u,Le=a?void 0:V,Re=a?void 0:Ce,ze;e[61]!==C||e[62]!==w?(ze=(0,Y.jsx)($ve,{className:`border-none bg-transparent p-0`,position:`bottom-left`,children:(0,Y.jsx)(Uve,{canReflow:C,onReflow:w})}),e[61]=C,e[62]=w,e[63]=ze):ze=e[63];let Be;e[64]===s?Be=e[65]:(Be=s&&(0,Y.jsx)(Uk,{bgColor:`var(--sidebar)`,className:`rounded-lg border shadow-sm`,maskColor:`color-mix(in oklch, var(--muted) 60%, transparent)`,nodeColor:`var(--muted-foreground)`,nodeStrokeColor:`var(--border)`}),e[64]=s,e[65]=Be);let Ve;e[66]!==r||e[67]!==ne||e[68]!==n||e[69]!==ce||e[70]!==xe||e[71]!==Ee||e[72]!==De||e[73]!==Oe||e[74]!==ke||e[75]!==Ae||e[76]!==je||e[77]!==Me||e[78]!==Ne||e[79]!==Pe||e[80]!==Fe||e[81]!==Ie||e[82]!==Le||e[83]!==Re||e[84]!==ze||e[85]!==Be?(Ve=(0,Y.jsxs)(Rve,{className:`bg-background`,connectionLineComponent:Vve,connectionMode:Uw.Strict,defaultEdgeOptions:_xe,edges:r,edgeTypes:gxe,elementsSelectable:Ee,isValidConnection:ne,nodes:n,nodesConnectable:De,nodesDraggable:Oe,nodeTypes:vxe,onBeforeDelete:ce,onConnect:ke,onConnectEnd:Ae,onConnectStart:je,onEdgeContextMenu:Me,onEdgesChange:Ne,onNodeClick:Pe,onNodeContextMenu:Fe,onNodesChange:Ie,onPaneClick:xe,onPaneContextMenu:Le,onSelectionChange:Re,children:[ze,Be]}),e[66]=r,e[67]=ne,e[68]=n,e[69]=ce,e[70]=xe,e[71]=Ee,e[72]=De,e[73]=Oe,e[74]=ke,e[75]=Ae,e[76]=je,e[77]=Me,e[78]=Ne,e[79]=Pe,e[80]=Fe,e[81]=Ie,e[82]=Le,e[83]=Re,e[84]=ze,e[85]=Be,e[86]=Ve):Ve=e[86];let He;e[87]===j?He=e[88]:(He=(0,Y.jsx)(mxe,{menuState:j,onClose:U}),e[87]=j,e[88]=He);let Ue;return e[89]!==Te||e[90]!==Ve||e[91]!==He?(Ue=(0,Y.jsxs)(`div`,{className:`relative h-full w-full bg-background`,"data-testid":`workflow-canvas`,style:Te,children:[Ve,He]}),e[89]=Te,e[90]=Ve,e[91]=He,e[92]=Ue):Ue=e[92],Ue}function bxe(e){return{clientX:`changedTouches`in e?e.changedTouches[0].clientX:e.clientX,clientY:`changedTouches`in e?e.changedTouches[0].clientY:e.clientY}}function xxe(e){return e.data.type!==`lifecycle`}function Sxe(e){return e.id}function Cxe(e){return e.selected}function g9(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(tme,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function wxe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(pG,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Txe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(KK,{"data-slot":`alert-dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _9(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Txe,{}),t[4]=o):o=t[4];let s;t[5]===n?s=t[6]:(s=Q(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-3 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==a||t[9]!==s?(c=(0,Y.jsxs)(wxe,{children:[o,(0,Y.jsx)(qK,{"data-slot":`alert-dialog-content`,"data-size":a,className:s,...r})]}),t[7]=r,t[8]=a,t[9]=s,t[10]=c):c=t[10],c}function v9(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function y9(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function b9(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(iK,{"data-slot":`alert-dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function x9(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Q(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(sz,{"data-slot":`alert-dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function S9(e){let t=(0,X.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?`default`:a,c;t[5]===n?c=t[6]:(c=Q(n),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==o?(l=(0,Y.jsx)(pv,{variant:o,size:s}),t[7]=s,t[8]=o,t[9]=l):l=t[9];let u;return t[10]!==r||t[11]!==c||t[12]!==l?(u=(0,Y.jsx)(nz,{"data-slot":`alert-dialog-action`,className:c,render:l,...r}),t[10]=r,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function C9(e){let t=(0,X.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`outline`:i,s=a===void 0?`default`:a,c;t[5]===n?c=t[6]:(c=Q(n),t[5]=n,t[6]=c);let l;t[7]!==s||t[8]!==o?(l=(0,Y.jsx)(pv,{variant:o,size:s}),t[7]=s,t[8]=o,t[9]=l):l=t[9];let u;return t[10]!==r||t[11]!==c||t[12]!==l?(u=(0,Y.jsx)(nz,{"data-slot":`alert-dialog-cancel`,className:c,render:l,...r}),t[10]=r,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Exe(e){let t=(0,X.c)(18),{open:n,onOpenChange:r,onConfirm:i,title:a,description:o,confirmLabel:s}=e,c=a===void 0?`Delete`:a,l=o===void 0?`Are you sure? This action cannot be undone.`:o,u=s===void 0?`Delete`:s,d;t[0]===c?d=t[1]:(d=(0,Y.jsx)(b9,{children:c}),t[0]=c,t[1]=d);let f;t[2]===l?f=t[3]:(f=(0,Y.jsx)(x9,{children:l}),t[2]=l,t[3]=f);let p;t[4]!==d||t[5]!==f?(p=(0,Y.jsxs)(v9,{children:[d,f]}),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(C9,{children:`Cancel`}),t[7]=m):m=t[7];let h;t[8]!==u||t[9]!==i?(h=(0,Y.jsxs)(y9,{children:[m,(0,Y.jsx)(S9,{onClick:i,variant:`destructive`,children:u})]}),t[8]=u,t[9]=i,t[10]=h):h=t[10];let g;t[11]!==p||t[12]!==h?(g=(0,Y.jsxs)(_9,{children:[p,h]}),t[11]=p,t[12]=h,t[13]=g):g=t[13];let _;return t[14]!==r||t[15]!==n||t[16]!==g?(_=(0,Y.jsx)(g9,{onOpenChange:r,open:n,children:g}),t[14]=r,t[15]=n,t[16]=g,t[17]=_):_=t[17],_}var Dxe=4;function Oxe(){let e=(0,X.c)(11),[t,n]=(0,J.useState)(null),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={confirm:n,tabs:`top`},e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(c7,{frame:i}),e[1]=a):a=e[1];let o=t?.confirmLabel,s=t?.message,c;e[2]===t?c=e[3]:(c=()=>t?.onConfirm(),e[2]=t,e[3]=c);let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>{e||n(null)},e[4]=l):l=e[4];let u=t!==null,d=t?.title,f;return e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==d?(f=(0,Y.jsxs)(`aside`,{className:`flex size-full flex-col overflow-hidden bg-card`,children:[a,(0,Y.jsx)(Exe,{confirmLabel:o,description:s,onConfirm:c,onOpenChange:l,open:u,title:d})]}),e[5]=o,e[6]=s,e[7]=c,e[8]=u,e[9]=d,e[10]=f):f=e[10],f}function kxe(){let e=(0,X.c)(29),t=xq(),[n,r]=pA(tle),[i,a]=pA(nle),o=dA(W2),{hasOverlays:s}=Oq(),{openSheet:c}=u7(),l=U5(),u;e[0]!==s||e[1]!==t||e[2]!==c||e[3]!==o?(u=()=>{t&&o&&!s&&c()},e[0]=s,e[1]=t,e[2]=c,e[3]=o,e[4]=u):u=e[4],oq(t,u);let d;e[5]!==l||e[6]!==r?(d=e=>{e&&l(),r(e)},e[5]=l,e[6]=r,e[7]=d):d=e[7];let f=d,[p,m]=(0,J.useState)(!1),h=(0,J.useRef)(!1),g=(0,J.useRef)(null),_;e[8]!==n||e[9]!==f?(_=e=>{(e.metaKey||e.ctrlKey)&&e.key===`b`&&(e.preventDefault(),f(!n))},e[8]=n,e[9]=f,e[10]=_):_=e[10],aq(window,`keydown`,_);let v;e[11]!==n||e[12]!==f||e[13]!==a?(v=e=>{let t=g.current;if(!t)return;e.preventDefault(),h.current=!0,m(!0);let r=e.clientX,i=!1,o=e=>{if(!h.current||(Math.abs(e.clientX-r)>Dxe&&(i=!0),!i))return;let n=rle(),o=(t.getBoundingClientRect().right-e.clientX)/n*100;a(Math.min(50,Math.max(20,o)))},s=()=>{h.current=!1,m(!1),document.removeEventListener(`pointermove`,o),document.removeEventListener(`pointerup`,s),document.removeEventListener(`pointercancel`,s),document.body.style.cursor=``,document.body.style.userSelect=``,i||f(!n)};document.addEventListener(`pointermove`,o),document.addEventListener(`pointerup`,s),document.addEventListener(`pointercancel`,s),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},e[11]=n,e[12]=f,e[13]=a,e[14]=v):v=e[14];let y=v,b;e[15]!==t||e[16]!==n||e[17]!==f?(b=!t&&n&&(0,Y.jsx)(`button`,{className:`absolute top-1/2 right-0 z-20 flex size-6 -translate-y-1/2 items-center justify-center rounded-l-full border border-r-0 bg-background shadow-sm transition-colors hover:bg-muted`,onClick:()=>{f(!1)},type:`button`,children:(0,Y.jsx)(Dv,{className:`size-4`})}),e[15]=t,e[16]=n,e[17]=f,e[18]=b):b=e[18];let x;e[19]!==y||e[20]!==p||e[21]!==t||e[22]!==n||e[23]!==i||e[24]!==f?(x=!t&&(0,Y.jsx)(`div`,{className:`relative shrink-0`,ref:g,style:{width:n?0:v0(i)},children:(0,Y.jsxs)(`div`,{className:`workflow-sidebar-panel absolute inset-y-0 right-0 z-20 border-l bg-sidebar transition-transform duration-200 ease-out`,inert:n,style:{width:v0(i),transform:n?`translateX(100%)`:`translateX(0)`},children:[(0,Y.jsxs)(`div`,{"aria-label":`Resize properties panel. Click to collapse.`,"aria-orientation":`vertical`,"aria-valuenow":i,className:`group absolute inset-y-0 left-0 z-10 w-3 cursor-col-resize`,onPointerDown:y,role:`separator`,tabIndex:0,children:[(0,Y.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1 bg-transparent transition-colors group-hover:bg-ring group-active:bg-primary`}),!(p||n)&&(0,Y.jsx)(`button`,{"aria-label":`Collapse panel`,className:`absolute top-1/2 left-0 flex size-6 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border bg-background shadow-sm transition-opacity hover:bg-muted focus-visible:opacity-100 lg:opacity-0 lg:group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),f(!0)},onPointerDown:Axe,type:`button`,children:(0,Y.jsx)(Ov,{className:`size-4`})})]}),(0,Y.jsx)(Oxe,{})]})}),e[19]=y,e[20]=p,e[21]=t,e[22]=n,e[23]=i,e[24]=f,e[25]=x):x=e[25];let S;return e[26]!==b||e[27]!==x?(S=(0,Y.jsxs)(Y.Fragment,{children:[b,x]}),e[26]=b,e[27]=x,e[28]=S):S=e[28],S}function Axe(e){return e.stopPropagation()}function jxe(e){return`${e} ${e===1?`issue`:`issues`}`}function Mxe(){let e=(0,X.c)(11),t=dA(T2),n=dA(lue),r=dA(X1),i=axe();if(!r||t.length===0)return null;let a=n?`text-warning hover:bg-warning/10`:`hover:bg-accent hover:text-foreground`,o;e[0]===a?o=e[1]:(o=Q(`flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded px-1.5 py-0.5 font-medium transition-colors`,a),e[0]=a,e[1]=o);let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(fy,{className:`size-3 shrink-0`}),e[2]=s):s=e[2];let c;e[3]===t.length?c=e[4]:(c=jxe(t.length),e[3]=t.length,e[4]=c);let l;e[5]===c?l=e[6]:(l=(0,Y.jsx)(`span`,{className:`tabular-nums`,children:c}),e[5]=c,e[6]=l);let u;return e[7]!==i||e[8]!==o||e[9]!==l?(u=(0,Y.jsxs)(`button`,{className:o,onClick:i,title:`Show what is wrong with this workflow`,type:`button`,children:[s,l]}),e[7]=i,e[8]=o,e[9]=l,e[10]=u):u=e[10],u}function Nxe({isPublished:e,hasUnpublishedChanges:t}){return e?t?`Unpublished changes`:`Published`:`Never published`}function Pxe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:(n=Nxe(e),t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap`,children:n}),t[2]=n,t[3]=r),r}function Fxe(e){return e.isSaving?`saving`:e.lastSaveError?`failed`:e.hasUnsavedChanges?`unsaved`:`saved`}var Ixe={saving:`Saving`,unsaved:`Unsaved changes`,failed:`Save failed`,saved:`Saved`};function Lxe(e,t){return e===`saved`&&t?`Saved ${q5(t)}`:Ixe[e]}var Rxe={saving:``,unsaved:`text-warning`,failed:`text-destructive`,saved:``};function zxe(){let e=(0,X.c)(2),t=dA($1),n=dA(e0),r=dA(X1)&&(n||t),i;return e[0]===r?i=e[1]:(i={enabled:r},e[0]=r,e[1]=i),aq(window,`beforeunload`,Bxe,i),null}function Bxe(e){e.preventDefault()}function w9(){let e=(0,X.c)(15),t=dA($1),n=dA(e0),r=dA(n0),i=dA(t0),a=dA(X1),o,s,c,l;if(e[0]!==n||e[1]!==a||e[2]!==t||e[3]!==r||e[4]!==i){l=Symbol.for(`react.early_return_sentinel`);bb0:{let u=Fxe({isSaving:t,hasUnsavedChanges:n,lastSaveError:r});if(!a){l=null;break bb0}let d=Rxe[u];e[9]===d?o=e[10]:(o=Q(`flex shrink-0 items-center gap-1.5 whitespace-nowrap`,d),e[9]=d,e[10]=o),s=u===`saving`&&(0,Y.jsx)(Zv,{className:`size-3 animate-spin`}),c=Lxe(u,i)}e[0]=n,e[1]=a,e[2]=t,e[3]=r,e[4]=i,e[5]=o,e[6]=s,e[7]=c,e[8]=l}else o=e[5],s=e[6],c=e[7],l=e[8];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;return e[11]!==o||e[12]!==s||e[13]!==c?(u=(0,Y.jsxs)(`span`,{className:o,children:[s,c]}),e[11]=o,e[12]=s,e[13]=c,e[14]=u):u=e[14],u}var T9=8,Vxe=`No real email or SMS is sent unless a node is configured to route to a test recipient.`;function Hxe(e){return e===`test`?`Test mode`:`Live mode`}function Uxe(e){return e?e.startedAt?`${e.id.slice(0,T9)} · ${ive(e.startedAt)}`:e.id.slice(0,T9):``}function E9(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(f7,{className:`data-vertical:h-3 data-vertical:self-center bg-current opacity-20`,orientation:`vertical`}),e[0]=t):t=e[0],t}function D9(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:n}),t[0]=n,t[1]=r),r}function Wxe(e){let t=(0,X.c)(17),{mode:n}=e,r=n===`test`,i=r?`bg-warning`:`bg-success`,a;t[0]===i?a=t[1]:(a=Q(`size-1.5 rounded-full`,i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,Y.jsx)(`span`,{"aria-hidden":!0,className:a}),t[2]=a,t[3]=o);let s=r?`text-warning`:void 0,c;t[4]===n?c=t[5]:(c=Hxe(n),t[4]=n,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Y.jsx)(`span`,{className:s,children:c}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,Y.jsx)(I6,{render:(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 whitespace-nowrap`,children:[o,l]})}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d=r?Vxe:`Runs send real email and SMS. Switch to Test mode to try the workflow without that.`,f;t[12]===d?f=t[13]:(f=(0,Y.jsx)(L6,{children:(0,Y.jsx)(`p`,{children:d})}),t[12]=d,t[13]=f);let p;return t[14]!==u||t[15]!==f?(p=(0,Y.jsx)(P6,{children:(0,Y.jsxs)(F6,{children:[u,f]})}),t[14]=u,t[15]=f,t[16]=p):p=t[16],p}function Gxe(e){let t=(0,X.c)(14),{workflowId:n}=e,r=dA(Y1),i=n??``,a;t[0]===i?a=t[1]:(a=z$(i),t[0]=i,t[1]=a);let o=!!n,s;t[2]!==a||t[3]!==o?(s={...a,enabled:o},t[2]=a,t[3]=o,t[4]=s):s=t[4];let{data:c}=Ze(s),l;t[5]!==r||t[6]!==c?(l=c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Wxe,{mode:r}),(0,Y.jsx)(E9,{}),(0,Y.jsx)(Pxe,{hasUnpublishedChanges:c.hasUnpublishedChanges,isPublished:c.isPublished}),(0,Y.jsx)(E9,{})]}),t[5]=r,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(w9,{}),t[8]=u):u=t[8];let d;t[9]===l?d=t[10]:(d=(0,Y.jsxs)(D9,{children:[l,u]}),t[9]=l,t[10]=d);let f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(Mxe,{}),t[11]=f):f=t[11];let p;return t[12]===d?p=t[13]:(p=(0,Y.jsxs)(Y.Fragment,{children:[d,f]}),t[12]=d,t[13]=p),p}function Kxe(){let e=(0,X.c)(23),t=dA(C0),n=H5(),r;e[0]===t?r=e[1]:(r=F$.workflow.getExecutionLogs.queryOptions({input:{executionId:t??``},select:rde}),e[0]=t,e[1]=r);let i=t!==null,a;e[2]!==r||e[3]!==i?(a={...r,enabled:i,staleTime:1/0},e[2]=r,e[3]=i,e[4]=a):a=e[4];let{data:o}=Ze(a),s;e[5]===o?s=e[6]:(s=Uxe(o),e[5]=o,e[6]=s);let c=s,l;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 whitespace-nowrap font-medium`,children:[(0,Y.jsx)(Fv,{"aria-hidden":!0,className:`size-3`}),`Viewing a past run`]}),e[7]=l):l=e[7];let u;e[8]!==c||e[9]!==o?.id?(u=c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(E9,{}),(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap font-mono tabular-nums`,title:o?.id,children:c})]}),e[8]=c,e[9]=o?.id,e[10]=u):u=e[10];let d,f,p,m;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Y.jsx)(E9,{}),f=(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap`,children:`Editing is off`}),p=(0,Y.jsx)(E9,{}),m=(0,Y.jsx)(w9,{}),e[11]=d,e[12]=f,e[13]=p,e[14]=m):(d=e[11],f=e[12],p=e[13],m=e[14]);let h;e[15]===u?h=e[16]:(h=(0,Y.jsxs)(D9,{children:[l,u,d,f,p,m]}),e[15]=u,e[16]=h);let g;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(Cv,{className:`size-3`}),e[17]=g):g=e[17];let _;e[18]===n?_=e[19]:(_=(0,Y.jsxs)(pv,{className:`h-6 shrink-0 text-info hover:bg-info/10 hover:text-info`,onClick:n,size:`sm`,type:`button`,variant:`ghost`,children:[g,`Back to draft`]}),e[18]=n,e[19]=_);let v;return e[20]!==h||e[21]!==_?(v=(0,Y.jsxs)(Y.Fragment,{children:[h,_]}),e[20]=h,e[21]=_,e[22]=v):v=e[22],v}function qxe(e){let t=(0,X.c)(9),{workflowId:n}=e,r=dA(r4),i=r?`border-info/30 bg-info/5 text-info`:`bg-sidebar text-muted-foreground`,a;t[0]===i?a=t[1]:(a=Q(`workflow-status-strip flex h-8 shrink-0 items-center gap-2 border-t px-3 text-xs leading-none`,i),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(zxe,{}),t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=r?(0,Y.jsx)(Kxe,{}):(0,Y.jsx)(Gxe,{workflowId:n}),t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==a||t[7]!==s?(c=(0,Y.jsxs)(`output`,{"aria-live":`polite`,className:a,children:[o,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8],c}function O9(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}function Jxe(e){navigator.clipboard.writeText(e),wy.success(`Copied to clipboard`)}function Yxe(e){let t=(0,X.c)(19),{overlayId:n,onCreated:r}=e,{pop:i}=Oq(),a=Ie(),[o,s]=(0,J.useState)(``),c;t[0]!==r||t[1]!==i||t[2]!==a?(c=F$.apiKey.create.mutationOptions({onSuccess:async e=>{r(e.key),wy.success(`API key created successfully`),await a.invalidateQueries({queryKey:F$.apiKey.key()}),i()},meta:{errorMessage:`Failed to create API key`}}),t[0]=r,t[1]=i,t[2]=a,t[3]=c):c=t[3];let l=Qe(c),u;t[4]!==l||t[5]!==o?(u=()=>l.mutate({name:o||null}),t[4]=l,t[5]=o,t[6]=u):u=t[6];let d;t[7]!==l.isPending||t[8]!==u?(d=[{label:`Create`,onClick:u,loading:l.isPending}],t[7]=l.isPending,t[8]=u,t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Y.jsx)(`p`,{className:`mb-4 text-muted-foreground text-sm`,children:`Create a new API key for webhook authentication`}),t[10]=f):f=t[10];let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(V4,{htmlFor:`key-name`,children:`Label (optional)`}),t[11]=p):p=t[11];let m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>s(e.target.value),t[12]=m):m=t[12];let h;t[13]===o?h=t[14]:(h=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[p,(0,Y.jsx)(B4,{id:`key-name`,onChange:m,placeholder:`e.g., Production, Testing`,value:o})]}),t[13]=o,t[14]=h);let g;return t[15]!==n||t[16]!==d||t[17]!==h?(g=(0,Y.jsxs)(E4,{actions:d,overlayId:n,title:`Create API Key`,children:[f,h]}),t[15]=n,t[16]=d,t[17]=h,t[18]=g):g=t[18],g}function Xxe(e){let t=(0,X.c)(26),{overlayId:n}=e,{push:r,closeAll:i}=Oq(),a=Ie(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={...F$.apiKey.getAll.queryOptions({input:{}}),meta:{errorMessage:`Failed to load API keys`}},t[0]=o):o=t[0];let{data:s,isPending:c}=Ze(o),l;t[1]===s?l=t[2]:(l=s===void 0?[]:s,t[1]=s,t[2]=l);let u=l,[d,f]=(0,J.useState)(null),p;t[3]===a?p=t[4]:(p=F$.apiKey.delete.mutationOptions({onSuccess:async()=>{wy.success(`API key deleted`),await a.invalidateQueries({queryKey:F$.apiKey.key()})},meta:{errorMessage:`Failed to delete API key`}}),t[3]=a,t[4]=p);let m=Qe(p),h=m.isPending?m.variables?.keyId:void 0,g;t[5]!==m||t[6]!==r?(g=e=>{r(D4,{title:`Delete API Key`,message:`Are you sure you want to delete this API key? Any webhooks using this key will stop working immediately.`,confirmLabel:`Delete`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>m.mutate({keyId:e})})},t[5]=m,t[6]=r,t[7]=g):g=t[7];let _=g,v;t[8]===r?v=t[9]:(v={label:`New API Key`,variant:`outline`,onClick:()=>r(Yxe,{onCreated:f})},t[8]=r,t[9]=v);let y;t[10]===i?y=t[11]:(y={label:`Done`,onClick:i},t[10]=i,t[11]=y);let b;t[12]!==v||t[13]!==y?(b=[v,y],t[12]=v,t[13]=y,t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Manage API keys for webhook authentication`}),t[15]=x):x=t[15];let S;t[16]!==u||t[17]!==h||t[18]!==c||t[19]!==d||t[20]!==_?(S=c?(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Y.jsx)(gy,{})}):(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[d&&(0,Y.jsxs)(`div`,{className:`rounded-md border border-warning/50 bg-warning/10 p-3`,children:[(0,Y.jsx)(`p`,{className:`mb-2 font-medium text-sm text-warning`,children:`Copy your API key now. You won't be able to see it again!`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`code`,{className:`flex-1 rounded bg-muted px-2 py-1 font-mono text-xs`,children:d}),(0,Y.jsx)(pv,{onClick:()=>Jxe(d),size:`sm`,variant:`outline`,children:(0,Y.jsx)(Lv,{className:`size-4`})})]}),(0,Y.jsx)(pv,{className:`mt-2`,onClick:()=>f(null),size:`sm`,variant:`ghost`,children:`Dismiss`})]}),u.length===0?(0,Y.jsxs)(`div`,{className:`py-8 text-center text-muted-foreground text-sm`,children:[(0,Y.jsx)(Jv,{className:`mx-auto mb-2 size-8 opacity-50`}),(0,Y.jsx)(`p`,{children:`No API keys yet`}),(0,Y.jsx)(`p`,{className:`text-xs`,children:`Create an API key to authenticate webhook requests`})]}):(0,Y.jsx)(`div`,{className:`space-y-2`,children:u.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs`,children:[e.keyPrefix,`...`]}),e.name&&(0,Y.jsx)(`span`,{className:`truncate text-sm`,children:e.name})]}),(0,Y.jsxs)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:[`Created `,O9(e.createdAt),e.lastUsedAt&&` · Last used ${O9(e.lastUsedAt)}`]})]}),(0,Y.jsx)(pv,{disabled:h===e.id,onClick:()=>_(e.id),size:`sm`,variant:`ghost`,children:h===e.id?(0,Y.jsx)(gy,{className:`size-4`}):(0,Y.jsx)(dy,{className:`size-4 text-destructive`})})]},e.id))})]}),t[16]=u,t[17]=h,t[18]=c,t[19]=d,t[20]=_,t[21]=S):S=t[21];let C;return t[22]!==n||t[23]!==S||t[24]!==b?(C=(0,Y.jsxs)(E4,{actions:b,overlayId:n,title:`API Keys`,children:[x,S]}),t[22]=n,t[23]=S,t[24]=b,t[25]=C):C=t[25],C}function Zxe(e){let t=(0,X.c)(24),{filter:n}=e,r=n===void 0?``:n,i=vy(),{push:a}=Oq(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={...I$(),meta:{errorMessage:`Failed to load integrations`}},t[0]=o):o=t[0];let{data:s,isPending:c}=Ze(o),l;t[1]===s?l=t[2]:(l=s===void 0?[]:s,t[1]=s,t[2]=l);let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=F$.integration.testConnection.mutationOptions({onSuccess:W4,meta:{errorMessage:`Connection test failed`}}),t[3]=d):d=t[3];let f=Qe(d),p;if(t[4]!==i||t[5]!==r||t[6]!==u){let e=r.toLowerCase(),n;t[8]===i?n=t[9]:(n=e=>{let t=Py(i,e.type);return{...e,label:t?.label??e.type,hasTest:t?.hasTest===!0,known:t!==void 0}},t[8]=i,t[9]=n),p=u.map(n).filter(t=>!r||t.label.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.type.toLowerCase().includes(e)).toSorted(Qxe),t[4]=i,t[5]=r,t[6]=u,t[7]=p}else p=t[7];let m=p,h;t[10]===a?h=t[11]:(h=e=>{a(K4,{integration:e})},t[10]=a,t[11]=h);let g=h,_;t[12]===a?_=t[13]:(_=e=>{a(q4,{integration:e})},t[12]=a,t[13]=_);let v=_,y=f.isPending?f.variables?.integrationId:void 0;if(c){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Y.jsx)(gy,{})}),t[14]=e):e=t[14],e}let b;t[15]!==v||t[16]!==g||t[17]!==u.length||t[18]!==m||t[19]!==f||t[20]!==y?(b=()=>u.length===0?(0,Y.jsx)(`div`,{className:`py-8 text-center`,children:(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No connections configured yet`})}):m.length===0?(0,Y.jsx)(`div`,{className:`py-8 text-center`,children:(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No connections match your filter`})}):(0,Y.jsx)(`div`,{className:`space-y-1`,children:m.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded-md px-2 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(H4,{className:`size-4`,integration:e.type}),(0,Y.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),(0,Y.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:e.name}),e.known?null:(0,Y.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Not available in this build`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.hasTest&&(0,Y.jsx)(pv,{className:`h-7 px-2`,disabled:y===e.id,onClick:()=>f.mutate({integrationId:e.id}),size:`sm`,variant:`outline`,children:y===e.id?(0,Y.jsx)(gy,{className:`size-3`}):(0,Y.jsx)(`span`,{className:`text-xs`,children:`Test`})}),(0,Y.jsx)(pv,{className:`size-7`,onClick:()=>g(e),size:`icon`,variant:`outline`,children:(0,Y.jsx)(iy,{className:`size-3`})}),(0,Y.jsx)(pv,{className:`size-7`,onClick:()=>v(e),size:`icon`,variant:`outline`,children:(0,Y.jsx)(dy,{className:`size-3`})})]})]},e.id))}),t[15]=v,t[16]=g,t[17]=u.length,t[18]=m,t[19]=f,t[20]=y,t[21]=b):b=t[21];let x=b,S;return t[22]===x?S=t[23]:(S=(0,Y.jsx)(`div`,{className:`space-y-1`,children:x()}),t[22]=x,t[23]=S),S}function Qxe(e,t){let n=e.label.localeCompare(t.label);return n===0?e.name.localeCompare(t.name):n}function $xe(e){let t=(0,X.c)(25),{overlayId:n}=e,{push:r,closeAll:i}=Oq(),[a,o]=(0,J.useState)(``),s;t[0]===r?s=t[1]:(s=()=>{r(Fde,{})},t[0]=r,t[1]=s);let c=s,l;t[2]===i?l=t[3]:(l=()=>i(),t[2]=i,t[3]=l);let u=l,d;t[4]===c?d=t[5]:(d={label:`Add Connection`,variant:`outline`,onClick:c},t[4]=c,t[5]=d);let f;t[6]===u?f=t[7]:(f={label:`Done`,onClick:u},t[6]=u,t[7]=f);let p;t[8]!==d||t[9]!==f?(p=[d,f],t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Manage API keys and credentials used by your workflows`}),t[11]=m):m=t[11];let h;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(cy,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[12]=h):h=t[12];let g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>o(e.target.value),t[13]=g):g=t[13];let _;t[14]===a?_=t[15]:(_=(0,Y.jsxs)(`div`,{className:`relative`,children:[h,(0,Y.jsx)(B4,{className:`pl-9`,onChange:g,placeholder:`Filter connections...`,value:a})]}),t[14]=a,t[15]=_);let v;t[16]===a?v=t[17]:(v=(0,Y.jsx)(`div`,{className:`max-h-[300px] overflow-y-auto`,children:(0,Y.jsx)(Zxe,{filter:a})}),t[16]=a,t[17]=v);let y;t[18]!==v||t[19]!==_?(y=(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[_,v]}),t[18]=v,t[19]=_,t[20]=y):y=t[20];let b;return t[21]!==n||t[22]!==y||t[23]!==p?(b=(0,Y.jsxs)(E4,{actions:p,overlayId:n,title:`Connections`,children:[m,y]}),t[21]=n,t[22]=y,t[23]=p,t[24]=b):b=t[24],b}var eSe=()=>{let e=(0,X.c)(25),{theme:t,setTheme:n}=Wq(),{open:r}=Oq(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(T5,{render:(0,Y.jsx)(pv,{variant:`outline`}),children:`Settings`}),e[0]=i):i=e[0];let a;e[1]===r?a=e[2]:(a=()=>r($xe),e[1]=r,e[2]=a);let o,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Ote,{className:`size-4`}),s=(0,Y.jsx)(`span`,{children:`Connections`}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let c;e[5]===a?c=e[6]:(c=(0,Y.jsxs)(k5,{onClick:a,children:[o,s]}),e[5]=a,e[6]=c);let l;e[7]===r?l=e[8]:(l=()=>r(Xxe),e[7]=r,e[8]=l);let u,d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(Jv,{className:`size-4`}),d=(0,Y.jsx)(`span`,{children:`API Keys`}),e[9]=u,e[10]=d):(u=e[9],d=e[10]);let f;e[11]===l?f=e[12]:(f=(0,Y.jsxs)(k5,{onClick:l,children:[u,d]}),e[11]=l,e[12]=f);let p;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(j5,{}),e[13]=p):p=e[13];let m;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Y.jsxs)(w_e,{children:[(0,Y.jsx)(Nte,{className:`size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,Y.jsx)(ty,{className:`absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,Y.jsx)(`span`,{children:`Theme`})]}),e[14]=m):m=e[14];let h,g,_;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(A5,{value:`light`,children:`Light`}),g=(0,Y.jsx)(A5,{value:`dark`,children:`Dark`}),_=(0,Y.jsx)(A5,{value:`system`,children:`System`}),e[15]=h,e[16]=g,e[17]=_):(h=e[15],g=e[16],_=e[17]);let v;e[18]!==n||e[19]!==t?(v=(0,Y.jsxs)(C_e,{children:[m,(0,Y.jsx)(T_e,{children:(0,Y.jsxs)(E_e,{onValueChange:n,value:t,children:[h,g,_]})})]}),e[18]=n,e[19]=t,e[20]=v):v=e[20];let y;return e[21]!==v||e[22]!==c||e[23]!==f?(y=(0,Y.jsxs)(w5,{children:[i,(0,Y.jsxs)(E5,{align:`end`,className:`w-56`,children:[c,f,p,v]})]}),e[21]=v,e[22]=c,e[23]=f,e[24]=y):y=e[24],y};function tSe(e){let t=(0,X.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(`path`,{className:`fill-foreground`,d:`M125.776 0C120.929 1.64945e-05 117 3.9291 117 8.77539V61.4248C117 66.2711 120.929 70.2002 125.776 70.2002H160.875L161.253 70.2051C169.032 70.4023 175.301 76.6734 175.495 84.4531L175.5 84.8252V143.325C175.5 148.171 179.429 152.101 184.276 152.101H219.375L219.753 152.105C227.53 152.303 233.798 158.571 233.995 166.348L234 166.726V225.225C234 230.071 237.929 234 242.776 234H295.425C300.271 234 304.2 230.071 304.2 225.225V172.575C304.2 167.729 300.271 163.8 295.425 163.8H260.25C252.334 163.76 245.905 157.43 245.705 149.553L245.7 149.176V90.6758C245.7 85.8295 241.771 81.9004 236.925 81.9004H201.825C193.874 81.9004 187.405 75.5551 187.205 67.6523L187.2 67.2754V8.77539C187.2 3.9291 183.271 1.64951e-05 178.425 0H125.776Z`}),i=(0,Y.jsx)(`path`,{className:`fill-foreground`,d:`M67.2755 81.9004C62.4293 81.9004 58.5002 85.8295 58.5002 90.6758V143.325C58.5004 148.171 62.4294 152.101 67.2755 152.101H102.375L102.753 152.105C110.53 152.303 116.798 158.571 116.995 166.348L117 166.726V225.225C117 230.071 120.929 234 125.776 234H178.425C183.271 234 187.2 230.071 187.2 225.225V172.575C187.2 167.729 183.271 163.8 178.425 163.8H143.25C135.334 163.76 128.905 157.43 128.705 149.553L128.7 149.176V90.6758C128.7 85.8295 124.771 81.9004 119.925 81.9004H67.2755Z`}),a=(0,Y.jsx)(`path`,{className:`fill-foreground`,d:`M8.77454 163.8C3.92844 163.8 0.00012207 167.729 0.00012207 172.575V225.225C0.00012207 230.071 3.92844 234 8.77454 234H61.4249C66.2712 234 70.2003 230.071 70.2003 225.225V172.575C70.2003 167.729 66.2712 163.8 61.4249 163.8H8.77454Z`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,Y.jsxs)(`svg`,{className:n,fill:`none`,height:`16`,viewBox:`0 0 305 234`,width:`16`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a]}),t[3]=n,t[4]=o),o}var k9=20;function nSe(e,t=()=>void 0){let n=new Map(e.map(e=>[e.id,e]));return e.filter(e=>e.type!==`add`).map(e=>{let r=t(e.id),i=r?.x??e.position.x,a=r?.y??e.position.y;if(!r){let t=new Set([e.id]),r=e.parentId;for(;r&&!t.has(r);){t.add(r);let e=n.get(r);if(!e)break;i+=e.position.x,a+=e.position.y,r=e.parentId}}return{x:i,y:a,width:e.measured?.width??e.width??192,height:e.measured?.height??e.height??112}})}function rSe(e,t){let n={x:e.x,y:e.y},r=t.some(e=>n.x<e.x+e.width&&n.x+192>e.x&&n.y<e.y+e.height&&n.y+112>e.y);for(;r;)n.x+=k9,n.y+=k9,r=t.some(e=>n.x<e.x+e.width&&n.x+192>e.x&&n.y<e.y+e.height&&n.y+112>e.y);return n}function iSe(){let e=(0,X.c)(9),t=vy(),n=Ie(),r=oA(),i=fA(f4),a=fA(W2),o=fA(m0),{getInternalNode:s,screenToFlowPosition:c}=kD(),l;return e[0]!==i||e[1]!==t||e[2]!==s||e[3]!==n||e[4]!==c||e[5]!==o||e[6]!==a||e[7]!==r?(l=e=>{let{actionType:l,at:u}=e,d=u??aSe(r.get(e4),c,e=>s(e)?.internals.positionAbsolute);if(!d)return;let f={id:G$(),type:`action`,position:d,data:{label:``,description:``,type:`action`,config:l?{actionType:l}:{},status:`idle`}},p=n.getQueryData(I$().queryKey),m=p?hJ(t,f,p):f;i(m),a(m.id),o(`properties`)},e[0]=i,e[1]=t,e[2]=s,e[3]=n,e[4]=c,e[5]=o,e[6]=a,e[7]=r,e[8]=l):l=e[8],l}function aSe(e,t,n){let r=document.querySelector(`.react-flow`);if(!r)return null;let i=r.getBoundingClientRect(),a=t({x:i.left+i.width/2,y:i.top+i.height/2});return rSe({x:a.x-96,y:a.y-56},nSe(e,n))}var oSe=/mac|iphone|ipad|ipod/i;function A9(e){return oSe.test(e)}function j9(){return typeof navigator>`u`?``:(navigator.userAgentData?.platform??navigator.platform)||navigator.userAgent||``}function M9(e){return e?{run:`⌘↵`,undo:`⌘Z`,redo:`⇧⌘Z`,palette:`⌘K`}:{run:`Ctrl+Enter`,undo:`Ctrl+Z`,redo:`Ctrl+Shift+Z`,palette:`Ctrl+K`}}function N9({state:e,shortcuts:t,callbacks:n}){let r=e.isExecuting||!e.hasNodes||e.isGenerating||!e.currentWorkflowId,i=e.workflowMode===`live`?`test`:`live`;return[{id:`add-step`,group:`steps`,label:`Add step`,detail:`Pick what the new step does`,keywords:`Add step node action new create insert`,disabled:e.editingLocked,execute:n.addStep},{id:`run`,group:`workflow`,label:`Run workflow`,keywords:`Run workflow execute test start trigger`,hint:t.run,disabled:r,execute:n.run},...e.currentWorkflowId?[{id:`mode`,group:`workflow`,label:`Switch to ${i===`live`?`Live`:`Test`} mode`,keywords:`Switch mode live test ${i}`,disabled:e.isSaving||e.isGenerating,execute:()=>n.switchMode(i)}]:[],{id:`undo`,group:`workflow`,label:`Undo`,keywords:`Undo revert back`,hint:t.undo,disabled:!e.canUndo||e.editingLocked,execute:n.undo},{id:`redo`,group:`workflow`,label:`Redo`,keywords:`Redo forward again`,hint:t.redo,disabled:!e.canRedo||e.editingLocked,execute:n.redo},{id:`reflow`,group:`workflow`,label:`Tidy layout`,keywords:`Tidy layout arrange align auto layout clean up`,disabled:!e.canReflow,execute:n.reflow}]}function P9(e){let t=(0,X.c)(12),{id:n,className:r}=e;switch(n){case`add-step`:{let e;return t[0]===r?e=t[1]:(e=(0,Y.jsx)(oy,{className:r}),t[0]=r,t[1]=e),e}case`run`:{let e;return t[2]===r?e=t[3]:(e=(0,Y.jsx)(ay,{className:r}),t[2]=r,t[3]=e),e}case`mode`:{let e;return t[4]===r?e=t[5]:(e=(0,Y.jsx)(Sv,{className:r}),t[4]=r,t[5]=e),e}case`undo`:{let e;return t[6]===r?e=t[7]:(e=(0,Y.jsx)(Pte,{className:r}),t[6]=r,t[7]=e),e}case`redo`:{let e;return t[8]===r?e=t[9]:(e=(0,Y.jsx)(kte,{className:r}),t[8]=r,t[9]=e),e}case`reflow`:{let e;return t[10]===r?e=t[11]:(e=(0,Y.jsx)(sy,{className:r}),t[10]=r,t[11]=e),e}default:return null}}function sSe(e){return e.keywords}function cSe(e){return e.reduce((e,t)=>e+t.items.length,0)}function lSe(e){e.preventDefault()}var uSe=[],dSe=`command-palette-refused`;function fSe(e){let t=(0,X.c)(12),{state:n,actions:r}=e,i=dA(f9),a=fA(f9),o=fA(p9),s=dA(d9),c=dA(K1),l;t[0]===a?l=t[1]:(l=()=>a(null),t[0]=a,t[1]=l),oq(c,l);let u;t[2]!==o||t[3]!==i||t[4]!==s||t[5]!==a?(u=e=>{if((e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey&&e.key.toLowerCase()===`k`){if(i){e.preventDefault(),e.stopPropagation(),a(null);return}g7(e.target)||(e.preventDefault(),e.stopPropagation(),!o({id:`root`})&&s&&wy.info(s,{id:dSe}))}},t[2]=o,t[3]=i,t[4]=s,t[5]=a,t[6]=u):u=t[6];let d=u,f;if(t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f={capture:!0},t[7]=f):f=t[7],aq(document,`keydown`,d,f),!i)return null;let p;return t[8]!==r||t[9]!==i||t[10]!==n?(p=(0,Y.jsx)(pSe,{actions:r,palette:i,state:n}),t[8]=r,t[9]=i,t[10]=n,t[11]=p):p=t[11],p}function pSe(e){let t=(0,X.c)(83),{palette:n,state:r,actions:i}=e,a=fA(f9),o=(0,J.useRef)(null),s=vy(),c=dA(i4),{canReflow:l,reflow:u}=o9(),d=iSe(),f=(0,J.useId)(),p=(0,J.useId)(),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=M9(A9(j9())),t[0]=m):m=t[0];let h=m,g;t[1]===n?g=t[2]:(g=cxe(n),t[1]=n,t[2]=g);let _=g,v;t[3]===n?v=t[4]:(v=l9(n),t[3]=n,t[4]=v);let y=v,b;t[5]===a?b=t[6]:(b=()=>a(null),t[5]=a,t[6]=b);let x=b,S;t[7]!==n||t[8]!==a?(S=()=>{a(uxe(n)),o.current?.focus()},t[7]=n,t[8]=a,t[9]=S):S=t[9];let C=S,w=_.id===`add-step`,T=_.id===`add-step`?_.at:void 0,E;bb0:{if(!w){E=uSe;break bb0}let e;if(t[10]!==d||t[11]!==s||t[12]!==c||t[13]!==a||t[14]!==T){let n;t[16]!==d||t[17]!==c||t[18]!==a||t[19]!==T?(n=e=>({id:e.category,label:e.category,items:e.actions.map(e=>({id:e.id,label:e.label,detail:e.description,keywords:M5(e),disabled:c,icon:(0,Y.jsx)(P5,{action:e,className:`size-3.5`}),select:()=>{d({actionType:e.id,at:T}),a(null)}}))}),t[16]=d,t[17]=c,t[18]=a,t[19]=T,t[20]=n):n=t[20],e=N5(Fy(s)).map(n),t[10]=d,t[11]=s,t[12]=c,t[13]=a,t[14]=T,t[15]=e}else e=t[15];E=e}let D=E,O;if(t[21]!==i||t[22]!==l||t[23]!==x||t[24]!==c||t[25]!==n||t[26]!==u||t[27]!==a||t[28]!==r){let e=N9({state:{currentWorkflowId:r.currentWorkflowId,workflowMode:r.workflowMode,isExecuting:r.isExecuting,isGenerating:r.isGenerating,isSaving:r.isSaving,hasNodes:r.nodes.some(_Se),canUndo:r.canUndo,canRedo:r.canRedo,canReflow:l,editingLocked:c},shortcuts:h,callbacks:{addStep:()=>a(lxe(n,{id:`add-step`})),run:()=>{x(),i.handleExecute()},switchMode:e=>{x(),i.handleSetWorkflowMode(e)},undo:()=>{x(),r.undo()},redo:()=>{x(),r.redo()},reflow:()=>{x(),u()}}});O=[{id:`steps`,label:`Steps`},{id:`workflow`,label:`Workflow`}].map(t=>({...t,items:e.filter(e=>e.group===t.id).map(gSe)})),t[21]=i,t[22]=l,t[23]=x,t[24]=c,t[25]=n,t[26]=u,t[27]=a,t[28]=r,t[29]=O}else O=t[29];let k=O,A;A=w?D:k;let j=cSe(A)>0,M=_.id===`add-step`?`Add step. Choose what the new step does.`:`Commands.`,N;t[30]!==y||t[31]!==x||t[32]!==C?(N=(e,t)=>{if(!e){if(t.reason===`escape-key`&&y){t.cancel(),C();return}x()}},t[30]=y,t[31]=x,t[32]=C,t[33]=N):N=t[33];let P=N,F;t[34]!==y||t[35]!==C||t[36]!==n.query?(F=e=>{e.key===`Backspace`&&n.query===``&&y&&(e.preventDefault(),C())},t[34]=y,t[35]=C,t[36]=n.query,t[37]=F):F=t[37];let I=F,L,R;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Y.jsx)(nq,{className:`sr-only`,children:`Command palette`}),R=(0,Y.jsx)(ZK,{className:`sr-only`,children:`Close command palette`}),t[38]=L,t[39]=R):(L=t[38],R=t[39]);let z;t[40]===f?z=t[41]:(z=(0,Y.jsx)(`p`,{className:`sr-only`,id:f,children:`Type to search. Press Enter to choose the highlighted item. Press Escape, or Backspace on an empty box, to go back a page or close.`}),t[40]=f,t[41]=z);let B;t[42]!==M||t[43]!==p?(B=(0,Y.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,id:p,children:M}),t[42]=M,t[43]=p,t[44]=B):B=t[44];let V;t[45]!==n||t[46]!==a?(V=(e,t)=>{t.reason!==`item-press`&&a(dxe(n,e))},t[45]=n,t[46]=a,t[47]=V):V=t[47];let H;t[48]!==y||t[49]!==C?(H=y?(0,Y.jsx)(`button`,{"aria-label":`Back to commands`,className:`-ml-1 flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:C,onMouseDown:lSe,type:`button`,children:(0,Y.jsx)(Dv,{className:`size-3.5`})}):(0,Y.jsx)(cy,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),t[48]=y,t[49]=C,t[50]=H):H=t[50];let U;t[51]===_.id?U=t[52]:(U=_.id===`add-step`&&(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-xs`,children:`Add step`}),t[51]=_.id,t[52]=U);let W=`${p} ${f}`,G=_.id===`add-step`?`Search step types`:`Search commands, or add a step`,K;t[53]!==I||t[54]!==W||t[55]!==G?(K=(0,Y.jsx)(d8,{"aria-describedby":W,"aria-label":`Search commands and step types`,className:`h-full w-full min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,onKeyDown:I,placeholder:G,ref:o}),t[53]=I,t[54]=W,t[55]=G,t[56]=K):K=t[56];let ee;t[57]!==H||t[58]!==U||t[59]!==K?(ee=(0,Y.jsxs)(pme,{className:`flex h-11 items-center gap-2 border-b px-3`,children:[H,U,K]}),t[57]=H,t[58]=U,t[59]=K,t[60]=ee):ee=t[60];let q=j?`Nothing matches that.`:`No step types are available yet.`,te;t[61]===q?te=t[62]:(te=(0,Y.jsx)(C8,{children:(0,Y.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-xs`,children:q})}),t[61]=q,t[62]=te);let ne=_.id===`add-step`?`Step types`:`Commands`,re;t[63]===ne?re=t[64]:(re=(0,Y.jsx)(m8,{"aria-label":ne,className:`max-h-[min(24rem,50vh)] overflow-y-auto overscroll-contain p-1`,children:mSe}),t[63]=ne,t[64]=re);let ie;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Y.jsx)(`span`,{children:`↵ to choose`}),t[65]=ie):ie=t[65];let ae=y?`go back`:`close`,oe;t[66]===ae?oe=t[67]:(oe=(0,Y.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-center justify-end gap-3 border-t px-3 py-1.5 text-[0.625rem] text-muted-foreground`,children:[ie,(0,Y.jsxs)(`span`,{children:[`esc to `,ae]})]}),t[66]=ae,t[67]=oe);let se;t[68]!==A||t[69]!==n.query||t[70]!==V||t[71]!==ee||t[72]!==te||t[73]!==re||t[74]!==oe?(se=(0,Y.jsxs)(ome,{autoHighlight:`always`,inline:!0,items:A,itemToStringValue:sSe,onValueChange:V,open:!0,value:n.query,children:[ee,te,re,oe]}),t[68]=A,t[69]=n.query,t[70]=V,t[71]=ee,t[72]=te,t[73]=re,t[74]=oe,t[75]=se):se=t[75];let ce;t[76]!==z||t[77]!==B||t[78]!==se?(ce=(0,Y.jsxs)($K,{className:`top-[12vh] max-w-[min(36rem,calc(100%-2rem))] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-[min(36rem,calc(100%-2rem))]`,initialFocus:o,showCloseButton:!1,children:[L,R,z,B,se]}),t[76]=z,t[77]=B,t[78]=se,t[79]=ce):ce=t[79];let le;return t[80]!==P||t[81]!==ce?(le=(0,Y.jsx)(YK,{onOpenChange:P,open:!0,children:ce}),t[80]=P,t[81]=ce,t[82]=le):le=t[82],le}function mSe(e){return(0,Y.jsxs)(_8,{items:e.items,children:[(0,Y.jsx)(v8,{className:`px-2 pt-2 pb-1 font-medium text-[0.625rem] text-muted-foreground uppercase tracking-wider`,children:e.label}),(0,Y.jsx)(p8,{children:hSe})]},e.id)}function hSe(e){return(0,Y.jsxs)(Ame,{className:Q(`flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-xs/relaxed outline-none select-none`,`data-highlighted:bg-muted data-highlighted:text-foreground`,`data-disabled:pointer-events-none data-disabled:opacity-50`),disabled:e.disabled,onClick:e.select,value:e,children:[e.icon,(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`— `,e.detail]})]}),e.hint&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[0.625rem] text-muted-foreground tracking-widest`,children:e.hint})]},e.id)}function gSe(e){return{id:e.id,label:e.label,detail:e.detail,hint:e.id===`add-step`?`→`:e.hint,keywords:e.keywords,disabled:e.disabled,icon:(0,Y.jsx)(P9,{className:`size-3.5 text-muted-foreground`,id:e.id}),select:e.execute}}function _Se(e){return e.type!==`add`}function vSe(e){let t=new Set(e.map(e=>e.toLowerCase())),n=`New Workflow`;if(!t.has(`new workflow`))return n;let r=2;for(;t.has(`${n} (${r})`.toLowerCase());)r+=1;return`${n} (${r})`}function F9(e){let t=(0,X.c)(50),{open:n,onOpenChange:r,existingWorkflowNames:i,onCreated:a}=e,o;t[0]===i?o=t[1]:(o=()=>vSe(i),t[0]=i,t[1]=o);let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(null),d=Ie(),f;if(t[2]!==a||t[3]!==r||t[4]!==d){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{u(e instanceof s$?e.message:`Failed to create workflow`)},t[6]=e):e=t[6],f=F$.workflow.create.mutationOptions({onSuccess:async e=>{await B$(d),await a(e.id),r(!1),wy.success(`Workflow created`)},onError:e,meta:{errorShownByCaller:!0}}),t[2]=a,t[3]=r,t[4]=d,t[5]=f}else f=t[5];let p=Qe(f),m=p.isPending,h;t[7]!==p||t[8]!==s?(h=()=>{let e=s.trim();if(!e){u(`Workflow name is required.`);return}u(null),p.mutate({name:e,graph:ZQ({nodes:[],edges:[]})})},t[7]=p,t[8]=s,t[9]=h):h=t[9];let g=h,_;t[10]!==m||t[11]!==r?(_=e=>{e||m||r(!1)},t[10]=m,t[11]=r,t[12]=_):_=t[12];let v=_,y=!m,b;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsxs)(eq,{children:[(0,Y.jsx)(nq,{children:`Create Workflow`}),(0,Y.jsx)(rq,{children:`Choose a name for the new workflow.`})]}),t[13]=b):b=t[13];let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(V4,{htmlFor:`create-workflow-name`,children:`Name`}),t[14]=x):x=t[14];let S=l?!0:void 0,C;t[15]===l?C=t[16]:(C=e=>{c(e.target.value),l&&u(null)},t[15]=l,t[16]=C);let w;t[17]===g?w=t[18]:(w=e=>{e.key===`Enter`&&(e.preventDefault(),g())},t[17]=g,t[18]=w);let T;t[19]!==m||t[20]!==w||t[21]!==S||t[22]!==C||t[23]!==s?(T=(0,Y.jsx)(B4,{"aria-invalid":S,autoFocus:!0,disabled:m,id:`create-workflow-name`,onChange:C,onKeyDown:w,placeholder:`Workflow name`,value:s}),t[19]=m,t[20]=w,t[21]=S,t[22]=C,t[23]=s,t[24]=T):T=t[24];let E;t[25]===l?E=t[26]:(E=l?(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:l}):null,t[25]=l,t[26]=E);let D;t[27]!==T||t[28]!==E?(D=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[x,T,E]}),t[27]=T,t[28]=E,t[29]=D):D=t[29];let O;t[30]===r?O=t[31]:(O=()=>{r(!1)},t[30]=r,t[31]=O);let k;t[32]!==m||t[33]!==O?(k=(0,Y.jsx)(pv,{disabled:m,onClick:O,type:`button`,variant:`outline`,children:`Cancel`}),t[32]=m,t[33]=O,t[34]=k):k=t[34];let A=m?`Creating...`:`Create Workflow`,j;t[35]!==g||t[36]!==m||t[37]!==A?(j=(0,Y.jsx)(pv,{disabled:m,onClick:g,type:`button`,children:A}),t[35]=g,t[36]=m,t[37]=A,t[38]=j):j=t[38];let M;t[39]!==k||t[40]!==j?(M=(0,Y.jsxs)(tq,{children:[k,j]}),t[39]=k,t[40]=j,t[41]=M):M=t[41];let N;t[42]!==D||t[43]!==M||t[44]!==y?(N=(0,Y.jsxs)($K,{showCloseButton:y,children:[b,D,M]}),t[42]=D,t[43]=M,t[44]=y,t[45]=N):N=t[45];let P;return t[46]!==v||t[47]!==n||t[48]!==N?(P=(0,Y.jsx)(YK,{onOpenChange:v,open:n,children:N}),t[46]=v,t[47]=n,t[48]=N,t[49]=P):P=t[49],P}function ySe(e){let t=(0,X.c)(48),{open:n,onOpenChange:r,currentName:i,otherWorkflowNames:a}=e,[o,s]=(0,J.useState)(i),[c,l]=(0,J.useState)(null),[u,d]=(0,J.useState)(!1),f=fA(Jce),p;t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==f||t[4]!==o?(p=async()=>{let e=o.trim();if(!e){l(`Workflow name is required.`);return}if(e===i){r(!1);return}if(a.some(t=>t.toLowerCase()===e.toLowerCase())){l(`"${e}" is already taken.`);return}l(null),d(!0),await f(e),d(!1),r(!1)},t[0]=i,t[1]=r,t[2]=a,t[3]=f,t[4]=o,t[5]=p):p=t[5];let m=p,h;t[6]!==u||t[7]!==r?(h=e=>{e||u||r(!1)},t[6]=u,t[7]=r,t[8]=h):h=t[8];let g=h,_=!u,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Y.jsxs)(eq,{children:[(0,Y.jsx)(nq,{children:`Rename Workflow`}),(0,Y.jsx)(rq,{children:`The name identifies this workflow everywhere it is listed.`})]}),t[9]=v):v=t[9];let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Y.jsx)(V4,{htmlFor:`rename-workflow-name`,children:`Name`}),t[10]=y):y=t[10];let b=c?!0:void 0,x;t[11]===c?x=t[12]:(x=e=>{s(e.target.value),c&&l(null)},t[11]=c,t[12]=x);let S;t[13]===m?S=t[14]:(S=e=>{e.key===`Enter`&&(e.preventDefault(),m())},t[13]=m,t[14]=S);let C;t[15]!==u||t[16]!==b||t[17]!==x||t[18]!==S||t[19]!==o?(C=(0,Y.jsx)(B4,{"aria-invalid":b,autoFocus:!0,disabled:u,id:`rename-workflow-name`,onChange:x,onKeyDown:S,placeholder:`Workflow name`,value:o}),t[15]=u,t[16]=b,t[17]=x,t[18]=S,t[19]=o,t[20]=C):C=t[20];let w;t[21]===c?w=t[22]:(w=c?(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:c}):null,t[21]=c,t[22]=w);let T;t[23]!==w||t[24]!==C?(T=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[y,C,w]}),t[23]=w,t[24]=C,t[25]=T):T=t[25];let E;t[26]===r?E=t[27]:(E=()=>r(!1),t[26]=r,t[27]=E);let D;t[28]!==u||t[29]!==E?(D=(0,Y.jsx)(pv,{disabled:u,onClick:E,type:`button`,variant:`outline`,children:`Cancel`}),t[28]=u,t[29]=E,t[30]=D):D=t[30];let O;t[31]===m?O=t[32]:(O=()=>void m(),t[31]=m,t[32]=O);let k=u?`Renaming...`:`Rename`,A;t[33]!==u||t[34]!==O||t[35]!==k?(A=(0,Y.jsx)(pv,{disabled:u,onClick:O,type:`button`,children:k}),t[33]=u,t[34]=O,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==D||t[38]!==A?(j=(0,Y.jsxs)(tq,{children:[D,A]}),t[37]=D,t[38]=A,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j||t[42]!==_?(M=(0,Y.jsxs)($K,{showCloseButton:_,children:[v,T,j]}),t[40]=T,t[41]=j,t[42]=_,t[43]=M):M=t[43];let N;return t[44]!==g||t[45]!==n||t[46]!==M?(N=(0,Y.jsx)(YK,{onOpenChange:g,open:n,children:M}),t[44]=g,t[45]=n,t[46]=M,t[47]=N):N=t[47],N}async function bSe(e){try{await navigator.clipboard.writeText(e),wy.success(`Workflow ID copied`)}catch{wy.error(`Could not copy the workflow ID`)}}var I9=`default`;function xSe(){let e=(0,X.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=fv({size:`icon`,variant:`secondary`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(pa,{"aria-label":`Dashboard`,className:t,title:`Dashboard`,to:`/`,children:(0,Y.jsx)(tSe,{className:`size-3.5`})}),e[1]=n):n=e[1],n}function SSe(e){let t=(0,X.c)(7),{isPublishing:n,disabled:r,handlePublish:i}=e,a=r||n,o;t[0]===n?o=t[1]:(o=n?(0,Y.jsx)(Zv,{className:`size-3.5 animate-spin`,"data-icon":`inline-start`}):(0,Y.jsx)(Fte,{className:`size-3.5`,"data-icon":`inline-start`}),t[0]=n,t[1]=o);let s=n?`Publishing`:`Publish`,c;return t[2]!==i||t[3]!==a||t[4]!==o||t[5]!==s?(c=(0,Y.jsxs)(pv,{disabled:a,onClick:i,size:I9,variant:`default`,children:[o,s]}),t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function CSe(){let e=(0,X.c)(11),t=fA(p9),n=dA(d9),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=A9(j9()),i=M9(r),e[0]=r,e[1]=i):(r=e[0],i=e[1]);let a=i,o=n!==null,s;e[2]===t?s=e[3]:(s=()=>t({id:`root`}),e[2]=t,e[3]=s);let c=n??void 0,l,u,d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(cy,{className:`size-3.5`,"data-icon":`inline-start`}),u=(0,Y.jsx)(`span`,{className:`truncate`,children:`Search or add a step`}),d=(0,Y.jsx)(`kbd`,{"aria-hidden":`true`,className:`ml-auto shrink-0 rounded-sm bg-muted-foreground/10 px-1 font-sans text-[0.625rem]`,children:a.palette}),e[4]=l,e[5]=u,e[6]=d):(l=e[4],u=e[5],d=e[6]);let f;return e[7]!==o||e[8]!==s||e[9]!==c?(f=(0,Y.jsxs)(pv,{"aria-keyshortcuts":r?`Meta+K`:`Control+K`,className:`hidden w-64 min-w-0 shrink justify-start font-normal text-muted-foreground @3xl:inline-flex`,disabled:o,onClick:s,size:I9,title:c,variant:`outline`,children:[l,u,d]}),e[7]=o,e[8]=s,e[9]=c,e[10]=f):f=e[10],f}function wSe(e){let t=(0,X.c)(6),{isDuplicating:n,onDuplicate:r}=e,i;t[0]===n?i=t[1]:(i=n?(0,Y.jsx)(Zv,{className:`size-3.5 animate-spin`,"data-icon":`inline-start`}):(0,Y.jsx)(Lv,{className:`size-3.5`,"data-icon":`inline-start`}),t[0]=n,t[1]=i);let a;return t[2]!==n||t[3]!==r||t[4]!==i?(a=(0,Y.jsxs)(pv,{disabled:n,onClick:r,size:I9,title:`Duplicate to your workflows`,variant:`outline`,children:[i,`Duplicate`]}),t[2]=n,t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function TSe(e){let t=(0,X.c)(35),{state:n,actions:r,onAddStep:i}=e,a=dA(i4),{canReflow:o,reflow:s}=o9(),c,l,u,d,f,p;if(t[0]!==r||t[1]!==o||t[2]!==a||t[3]!==i||t[4]!==s||t[5]!==n.canRedo||t[6]!==n.canUndo||t[7]!==n.currentWorkflowId||t[8]!==n.isExecuting||t[9]!==n.isGenerating||t[10]!==n.isSaving||t[11]!==n.nodes||t[12]!==n.redo||t[13]!==n.undo||t[14]!==n.workflowMode){let e=M9(A9(j9())),m,h;t[21]===r?(m=t[22],h=t[23]):(m=()=>void r.handleExecute(),h=e=>void r.handleSetWorkflowMode(e),t[21]=r,t[22]=m,t[23]=h);let g=N9({state:{currentWorkflowId:n.currentWorkflowId,workflowMode:n.workflowMode,isExecuting:n.isExecuting,isGenerating:n.isGenerating,isSaving:n.isSaving,hasNodes:n.nodes.some(ESe),canUndo:n.canUndo,canRedo:n.canRedo,canReflow:o,editingLocked:a},shortcuts:e,callbacks:{addStep:i,run:m,switchMode:h,undo:n.undo,redo:n.redo,reflow:s}});l=w5;let _;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(pv,{size:I9,variant:`ghost`}),t[24]=_):_=t[24],t[25]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsxs)(T5,{render:_,children:[`Actions`,(0,Y.jsx)(Ev,{className:`size-3 opacity-50`,"data-icon":`inline-end`})]}),t[25]=p):p=t[25],c=E5,u=`start`,d=`w-60`,f=g.map((e,t)=>(0,Y.jsxs)(J.Fragment,{children:[t>0&&(e.group!==g[t-1]?.group||e.id===`undo`)?(0,Y.jsx)(j5,{}):null,(0,Y.jsxs)(k5,{disabled:e.disabled,onClick:e.execute,children:[(0,Y.jsx)(P9,{id:e.id}),e.label,e.hint?(0,Y.jsx)(D_e,{children:e.hint}):null]})]},e.id)),t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=s,t[5]=n.canRedo,t[6]=n.canUndo,t[7]=n.currentWorkflowId,t[8]=n.isExecuting,t[9]=n.isGenerating,t[10]=n.isSaving,t[11]=n.nodes,t[12]=n.redo,t[13]=n.undo,t[14]=n.workflowMode,t[15]=c,t[16]=l,t[17]=u,t[18]=d,t[19]=f,t[20]=p}else c=t[15],l=t[16],u=t[17],d=t[18],f=t[19],p=t[20];let m;t[26]!==c||t[27]!==u||t[28]!==d||t[29]!==f?(m=(0,Y.jsx)(c,{align:u,className:d,children:f}),t[26]=c,t[27]=u,t[28]=d,t[29]=f,t[30]=m):m=t[30];let h;return t[31]!==l||t[32]!==p||t[33]!==m?(h=(0,Y.jsxs)(l,{children:[p,m]}),t[31]=l,t[32]=p,t[33]=m,t[34]=h):h=t[34],h}function ESe(e){return e.type!==`add`}function DSe(e){let t=(0,X.c)(50),{workflowId:n,state:r,actions:i}=e,{push:a}=Oq(),{openSheet:o}=u7(),[s]=pA(W2),[c]=pA(G2),l=dA(e4),u=dA(t4),d=fA(_4),f=fA($2),p=fA(p9),m=xq(),h=dA(i4),g;if(t[0]!==l||t[1]!==s){let e;t[3]===s?e=t[4]:(e=e=>e.id===s,t[3]=s,t[4]=e),g=l.find(e),t[0]=l,t[1]=s,t[2]=g}else g=t[2];let _=g,v;if(t[5]!==u||t[6]!==c){let e;t[8]===c?e=t[9]:(e=e=>e.id===c,t[8]=c,t[9]=e),v=u.find(e),t[5]=u,t[6]=c,t[7]=v}else v=t[7];let y=_||v,b;t[10]!==h||t[11]!==r?(b=h||r.isSaving||!r.nodes.some(OSe),t[10]=h,t[11]=r,t[12]=b):b=t[12];let x=b;if(n&&!r.isOwner)return null;let S;t[13]!==f||t[14]!==d||t[15]!==a||t[16]!==c||t[17]!==s?(S=()=>{let e=s?`Node`:`Connection`;a(D4,{title:`Delete ${e}`,message:`Are you sure you want to delete this ${e.toLowerCase()}? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{s?d(s):c&&f(c)}})},t[13]=f,t[14]=d,t[15]=a,t[16]=c,t[17]=s,t[18]=S):S=t[18];let C=S,w;t[19]===p?w=t[20]:(w=()=>{p({id:`add-step`})},t[19]=p,t[20]=w);let T=w,E;t[21]!==i||t[22]!==T||t[23]!==r?(E=(0,Y.jsx)(TSe,{actions:i,onAddStep:T,state:r}),t[21]=i,t[22]=T,t[23]=r,t[24]=E):E=t[24];let D;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(CSe,{}),t[25]=D):D=t[25];let O;t[26]!==i||t[27]!==r?(O=(0,Y.jsx)(fSe,{actions:i,state:r}),t[26]=i,t[27]=r,t[28]=O):O=t[28];let k;t[29]!==i.handlePublish||t[30]!==i.isPublishing||t[31]!==x?(k=(0,Y.jsx)(SSe,{disabled:x,handlePublish:i.handlePublish,isPublishing:i.isPublishing}),t[29]=i.handlePublish,t[30]=i.isPublishing,t[31]=x,t[32]=k):k=t[32];let A=m?``:`hidden`,j;t[33]===A?j=t[34]:(j=Q(`flex`,A),t[33]=A,t[34]=j);let M;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Y.jsx)(ly,{className:`size-4`}),t[35]=M):M=t[35];let N;t[36]===o?N=t[37]:(N=(0,Y.jsx)(pv,{onClick:o,size:`icon`,title:`Configuration`,variant:`outline`,children:M}),t[36]=o,t[37]=N);let P;t[38]!==C||t[39]!==y?(P=y&&(0,Y.jsx)(pv,{onClick:C,size:`icon`,title:`Delete`,variant:`outline`,children:(0,Y.jsx)(dy,{className:`size-4`})}),t[38]=C,t[39]=y,t[40]=P):P=t[40];let F;t[41]!==j||t[42]!==N||t[43]!==P?(F=(0,Y.jsxs)(p7,{className:j,orientation:`horizontal`,children:[N,P]}),t[41]=j,t[42]=N,t[43]=P,t[44]=F):F=t[44];let I;return t[45]!==F||t[46]!==E||t[47]!==O||t[48]!==k?(I=(0,Y.jsxs)(Y.Fragment,{children:[E,D,O,k,F]}),t[45]=F,t[46]=E,t[47]=O,t[48]=k,t[49]=I):I=t[49],I}function OSe(e){return e.type!==`add`}function kSe(e){let t=(0,X.c)(62),{workflowId:n,state:r,actions:i}=e,a=Ki(),o=dA(i4),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(0),[p,m]=(0,J.useState)(0),h=!!n&&r.isOwner,g=r.currentWorkflowId,_;if(t[0]!==g||t[1]!==r.allWorkflows){let e;t[3]===g?e=t[4]:(e=e=>e.id!==g,t[3]=g,t[4]=e),_=r.allWorkflows.filter(e).map(PSe),t[0]=g,t[1]=r.allWorkflows,t[2]=_}else _=t[2];let v=_,y;t[5]===i?y=t[6]:(y=e=>e&&i.loadWorkflows(),t[5]=i,t[6]=y);let b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(pv,{className:`min-w-0 max-w-56 shrink`,size:I9,variant:`ghost`}),t[7]=b):b=t[7];let x=r.workflowName||void 0,S=r.workflowName||`Untitled workflow`,C;t[8]===S?C=t[9]:(C=(0,Y.jsx)(`span`,{className:`truncate`,children:S}),t[8]=S,t[9]=C);let w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Y.jsx)(Ev,{className:`size-3 opacity-50`,"data-icon":`inline-end`}),t[10]=w):w=t[10];let T;t[11]!==x||t[12]!==C?(T=(0,Y.jsxs)(T5,{render:b,title:x,children:[C,w]}),t[11]=x,t[12]=C,t[13]=T):T=t[13];let E;t[14]!==i||t[15]!==h?(E=h&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(k5,{onClick:()=>{m(NSe),u(!0)},children:[(0,Y.jsx)(iy,{}),`Rename`]}),(0,Y.jsxs)(k5,{disabled:i.isDuplicating,onClick:i.handleDuplicate,children:[i.isDuplicating?(0,Y.jsx)(Zv,{className:`animate-spin`}):(0,Y.jsx)(Lv,{}),`Duplicate workflow`]}),(0,Y.jsx)(j5,{})]}),t[14]=i,t[15]=h,t[16]=E):E=t[16];let D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(O5,{children:`Workflows`}),t[17]=D):D=t[17];let O;t[18]!==g||t[19]!==a||t[20]!==r.allWorkflows?(O=r.allWorkflows.length===0?(0,Y.jsx)(k5,{disabled:!0,children:`No workflows found`}):r.allWorkflows.filter(MSe).map(e=>(0,Y.jsxs)(k5,{className:`justify-between`,onClick:()=>a({to:`/workflows/$workflowId`,params:{workflowId:e.id}}),children:[(0,Y.jsx)(`span`,{className:`truncate`,children:e.name}),e.id===g&&(0,Y.jsx)(Tv,{className:`size-3.5 shrink-0`})]},e.id)),t[18]=g,t[19]=a,t[20]=r.allWorkflows,t[21]=O):O=t[21];let k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Y.jsxs)(k5,{onClick:()=>{f(jSe),c(!0)},children:[(0,Y.jsx)(oy,{}),`New workflow`]}),t[22]=k):k=t[22];let A;t[23]===O?A=t[24]:(A=(0,Y.jsxs)(D5,{children:[D,O,k]}),t[23]=O,t[24]=A);let j;t[25]!==i||t[26]!==o||t[27]!==r.isOwner?(j=r.isOwner&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j5,{}),(0,Y.jsxs)(k5,{disabled:o,onClick:i.handleClearWorkflow,children:[(0,Y.jsx)(Bv,{}),`Clear workflow`]})]}),t[25]=i,t[26]=o,t[27]=r.isOwner,t[28]=j):j=t[28];let M;t[29]!==i||t[30]!==h?(M=h&&(0,Y.jsxs)(k5,{onClick:i.handleDeleteWorkflow,variant:`destructive`,children:[(0,Y.jsx)(dy,{}),`Delete workflow`]}),t[29]=i,t[30]=h,t[31]=M):M=t[31];let N;t[32]===g?N=t[33]:(N=g&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(j5,{}),(0,Y.jsxs)(D5,{children:[(0,Y.jsx)(O5,{children:`Workflow ID`}),(0,Y.jsxs)(k5,{onClick:()=>void bSe(g),children:[(0,Y.jsx)(Lv,{}),(0,Y.jsx)(`span`,{className:`truncate font-mono`,children:g})]})]})]}),t[32]=g,t[33]=N);let P;t[34]!==A||t[35]!==j||t[36]!==M||t[37]!==N||t[38]!==E?(P=(0,Y.jsxs)(E5,{align:`start`,className:`w-64`,children:[E,A,j,M,N]}),t[34]=A,t[35]=j,t[36]=M,t[37]=N,t[38]=E,t[39]=P):P=t[39];let F;t[40]!==P||t[41]!==y||t[42]!==T?(F=(0,Y.jsxs)(w5,{onOpenChange:y,children:[T,P]}),t[40]=P,t[41]=y,t[42]=T,t[43]=F):F=t[43];let I=`create-${d}`,L;t[44]===r.allWorkflows?L=t[45]:(L=r.allWorkflows.map(ASe),t[44]=r.allWorkflows,t[45]=L);let R;t[46]===a?R=t[47]:(R=e=>a({to:`/workflows/$workflowId`,params:{workflowId:e}}),t[46]=a,t[47]=R);let z;t[48]!==s||t[49]!==I||t[50]!==L||t[51]!==R?(z=(0,Y.jsx)(F9,{existingWorkflowNames:L,onCreated:R,onOpenChange:c,open:s},I),t[48]=s,t[49]=I,t[50]=L,t[51]=R,t[52]=z):z=t[52];let B=`rename-${p}`,V;t[53]!==l||t[54]!==v||t[55]!==r.workflowName||t[56]!==B?(V=(0,Y.jsx)(ySe,{currentName:r.workflowName,otherWorkflowNames:v,onOpenChange:u,open:l},B),t[53]=l,t[54]=v,t[55]=r.workflowName,t[56]=B,t[57]=V):V=t[57];let H;return t[58]!==F||t[59]!==z||t[60]!==V?(H=(0,Y.jsxs)(Y.Fragment,{children:[F,z,V]}),t[58]=F,t[59]=z,t[60]=V,t[61]=H):H=t[61],H}function ASe(e){return e.name}function jSe(e){return e+1}function MSe(e){return e.name!==`__current__`}function NSe(e){return e+1}function PSe(e){return e.name}function FSe(e,t){if(!t)return;let n=t.trim();if(!n)return;let r=Ga(n.split(`.`)),i=e;for(let e of r){if(i==null)return;if(Array.isArray(i)){if(!/^\d+$/.test(e))return;let t=Number(e);if(!Number.isSafeInteger(t))return;i=i[t];continue}if(typeof i==`object`){i=i[e];continue}return}return i}function ISe(e,t,n){let r=Ga(t.trim().split(`.`)),i=r.pop();if(!i)return e;let a=e;for(let e of r){let t=a[e],n=typeof t==`object`&&t&&!Array.isArray(t)?t:{};a[e]=n,a=n}return a[i]=n,e}function LSe(e){return!e.path.includes(`[`)&&e.type!==`array`&&e.type!==`object`}function RSe(e){return e.enumValues&&e.enumValues.length>0?`select`:e.type===`boolean`?`checkbox`:e.type===`number`?`number`:e.type===`timestamp`?`datetime`:`text`}function L9(e){return e?e.payloadFields.filter(LSe).map(e=>({path:e.path,...e.description?{description:e.description}:{},control:RSe(e),...e.enumValues?{options:[...e.enumValues]}:{},optional:e.nullable===!0})):[]}function zSe(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function R9(e,t){let n={};for(let r of e){let e=FSe(t,r.path);if(e==null){n[r.path]=``;continue}let i=typeof e==`string`?e:JSON.stringify(e);n[r.path]=r.control===`datetime`?zSe(i):i}return n}function BSe(e,t){let n=t.trim();if(n){if(e.control===`checkbox`)return n===`true`;if(e.control===`number`){let e=Number(n);return Number.isFinite(e)?e:n}if(e.control===`datetime`){let e=new Date(n);return Number.isNaN(e.getTime())?n:vle(e)}return n}}function VSe(e,t,n={}){let r=structuredClone(n);for(let n of e){let e=BSe(n,t[n.path]??``);e!==void 0&&ISe(r,n.path,e)}return r}function z9(e){let t=e.trim();if(!t)return{ok:!0,payload:{}};let n;try{n=JSON.parse(t)}catch{return{ok:!1,error:`This is not valid JSON.`}}let r=CQ(n);return r?{ok:!0,payload:r}:{ok:!1,error:`A payload has to be a JSON object.`}}function B9(e){return e.find(e=>e.data.type===`lifecycle`)}function HSe(e){return sQ(B9(e)?.data.config)}function V9(e){return DQ(B9(e)?.data.config)??{}}function USe(e,t){return t.eventName?{...e,byEvent:{...e.byEvent,[t.eventName]:t.input}}:{...e,manual:t.input}}var H9=``;function U9(e,t){return My(e,t)?.label??t}function WSe(e){let t=(0,X.c)(34),{field:n,value:r,onChange:i}=e;if(n.control===`checkbox`){let e=r===`true`,a;t[0]===i?a=t[1]:(a=e=>i(e?`true`:`false`),t[0]=i,t[1]=a);let o;return t[2]!==n.path||t[3]!==e||t[4]!==a?(o=(0,Y.jsx)(L5,{checked:e,id:n.path,onCheckedChange:a}),t[2]=n.path,t[3]=e,t[4]=a,t[5]=o):o=t[5],o}if(n.control===`select`){let e;t[6]===n.options?e=t[7]:(e=n.options??[],t[6]=n.options,t[7]=e);let a;t[8]===e?a=t[9]:(a=e.map(KSe),t[8]=e,t[9]=a);let o=a,s;t[10]===i?s=t[11]:(s=e6(i),t[10]=i,t[11]=s);let c;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Y.jsx)(X3,{placeholder:`Choose a value`}),t[12]=c):c=t[12];let l;t[13]===n.path?l=t[14]:(l=(0,Y.jsx)(Z3,{className:`w-full`,id:n.path,children:c}),t[13]=n.path,t[14]=l);let u;t[15]===n.options?u=t[16]:(u=n.options??[],t[15]=n.options,t[16]=u);let d;t[17]===u?d=t[18]:(d=u.map(GSe),t[17]=u,t[18]=d);let f;t[19]===d?f=t[20]:(f=(0,Y.jsx)(Q3,{children:d}),t[19]=d,t[20]=f);let p;return t[21]!==o||t[22]!==s||t[23]!==l||t[24]!==f||t[25]!==r?(p=(0,Y.jsxs)(Y3,{items:o,onValueChange:s,value:r,children:[l,f]}),t[21]=o,t[22]=s,t[23]=l,t[24]=f,t[25]=r,t[26]=p):p=t[26],p}let a;t[27]===i?a=t[28]:(a=e=>i(e.target.value),t[27]=i,t[28]=a);let o=n.control===`number`?`number`:n.control===`datetime`?`datetime-local`:`text`,s;return t[29]!==n.path||t[30]!==a||t[31]!==o||t[32]!==r?(s=(0,Y.jsx)(B4,{id:n.path,onChange:a,type:o,value:r}),t[29]=n.path,t[30]=a,t[31]=o,t[32]=r,t[33]=s):s=t[33],s}function GSe(e){return(0,Y.jsx)($3,{value:e,children:e},e)}function KSe(e){return{label:e,value:e}}function qSe(e){let t=(0,X.c)(10),{fields:n,values:r,onChange:i}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This Event declares no payload field the form can draw. Use the JSON tab to write the payload.`}),t[0]=e):e=t[0],e}let a;if(t[1]!==n||t[2]!==i||t[3]!==r){let e;t[5]!==i||t[6]!==r?(e=e=>(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsxs)(V4,{className:`font-mono text-xs`,htmlFor:e.path,children:[e.path,e.optional&&(0,Y.jsx)(`span`,{className:`ml-2 font-sans text-muted-foreground`,children:`optional`})]}),(0,Y.jsx)(WSe,{field:e,onChange:t=>i(e.path,t),value:r[e.path]??``}),e.description&&(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description})]},e.path),t[5]=i,t[6]=r,t[7]=e):e=t[7],a=n.map(e),t[1]=n,t[2]=i,t[3]=r,t[4]=a}else a=t[4];let o;return t[8]===a?o=t[9]:(o=(0,Y.jsx)(`div`,{className:`space-y-4`,children:a}),t[8]=a,t[9]=o),o}function JSe(e){let t=(0,X.c)(101),{overlayId:n,startEvents:r,allowManualStart:i,hasEventSplit:a,savedPayloads:o,onRun:s}=e,c=vy(),{closeAll:l}=Oq(),[u,d]=(0,J.useState)(r[0]??H9),[f,p]=(0,J.useState)(`form`),m=u===H9?void 0:u,h;t[0]!==m||t[1]!==o?(h=OQ(o,m),t[0]=m,t[1]=o,t[2]=h):h=t[2];let g=h,_;t[3]!==c||t[4]!==m?(_=L9(m?My(c,m):void 0),t[3]=c,t[4]=m,t[5]=_):_=t[5];let v=_,y;t[6]!==v||t[7]!==g?(y=()=>R9(v,g),t[6]=v,t[7]=g,t[8]=y):y=t[8];let[b,x]=(0,J.useState)(y),S;t[9]===g?S=t[10]:(S=()=>JSON.stringify(g??{},null,2),t[9]=g,t[10]=S);let[C,w]=(0,J.useState)(S),[T,E]=(0,J.useState)(null),D;t[11]===g?D=t[12]:(D=()=>g??{},t[11]=g,t[12]=D);let[O,k]=(0,J.useState)(D),A;t[13]!==c||t[14]!==o?(A=e=>{d(e);let t=e===H9?void 0:e,n=OQ(o,t)??{},r=L9(t?My(c,t):void 0);x(R9(r,n)),w(JSON.stringify(n,null,2)),k(n),E(null)},t[13]=c,t[14]=o,t[15]=A):A=t[15];let j=A,M;t[16]!==O||t[17]!==v||t[18]!==b?(M=()=>VSe(v,b,O),t[16]=O,t[17]=v,t[18]=b,t[19]=M):M=t[19];let N=M,P;t[20]===N?P=t[21]:(P=()=>{w(JSON.stringify(N(),null,2)),E(null),p(`json`)},t[20]=N,t[21]=P);let F=P,I;t[22]!==v||t[23]!==C?(I=()=>{let e=z9(C);if(!e.ok){E(e.error);return}x(R9(v,e.payload)),k(e.payload),E(null),p(`form`)},t[22]=v,t[23]=C,t[24]=I):I=t[24];let L=I,R=!a||m!==void 0,z;t[25]!==l||t[26]!==N||t[27]!==m||t[28]!==C||t[29]!==s||t[30]!==f?(z=()=>{if(f===`json`){let e=z9(C);if(!e.ok){E(e.error);return}s({...m?{eventName:m}:{},input:e.payload}),l();return}s({...m?{eventName:m}:{},input:N()}),l()},t[25]=l,t[26]=N,t[27]=m,t[28]=C,t[29]=s,t[30]=f,t[31]=z):z=t[31];let B=z,V;if(t[32]!==i||t[33]!==c||t[34]!==r){let e;t[36]===c?e=t[37]:(e=e=>({label:U9(c,e),value:e}),t[36]=c,t[37]=e);let n;t[38]===i?n=t[39]:(n=i?[{label:`No Event (manual start)`,value:H9}]:[],t[38]=i,t[39]=n),V=[...r.map(e),...n],t[32]=i,t[33]=c,t[34]=r,t[35]=V}else V=t[35];let H=V,U;t[40]===l?U=t[41]:(U={label:`Cancel`,variant:`outline`,onClick:l},t[40]=l,t[41]=U);let W=!R,G;t[42]!==B||t[43]!==W?(G={label:`Run`,onClick:B,disabled:W},t[42]=B,t[43]=W,t[44]=G):G=t[44];let K;t[45]!==U||t[46]!==G?(K=[U,G],t[45]=U,t[46]=G,t[47]=K):K=t[47];let ee;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Y.jsx)(V4,{htmlFor:`testRunEvent`,children:`Which Event does this run stand in for?`}),t[48]=ee):ee=t[48];let q;t[49]===j?q=t[50]:(q=e6(j),t[49]=j,t[50]=q);let te;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Y.jsx)(Z3,{className:`w-full`,id:`testRunEvent`,children:(0,Y.jsx)(X3,{placeholder:`Choose an Event`})}),t[51]=te):te=t[51];let ne;if(t[52]!==c||t[53]!==r){let e;t[55]===c?e=t[56]:(e=e=>(0,Y.jsx)($3,{value:e,children:U9(c,e)},e),t[55]=c,t[56]=e),ne=r.map(e),t[52]=c,t[53]=r,t[54]=ne}else ne=t[54];let re;t[57]!==i||t[58]!==a?(re=i&&(0,Y.jsx)($3,{disabled:a,value:H9,children:`No Event (manual start)`}),t[57]=i,t[58]=a,t[59]=re):re=t[59];let ie;t[60]!==ne||t[61]!==re?(ie=(0,Y.jsxs)(Q3,{children:[ne,re]}),t[60]=ne,t[61]=re,t[62]=ie):ie=t[62];let ae;t[63]!==H||t[64]!==u||t[65]!==q||t[66]!==ie?(ae=(0,Y.jsxs)(Y3,{items:H,onValueChange:q,value:u,children:[te,ie]}),t[63]=H,t[64]=u,t[65]=q,t[66]=ie,t[67]=ae):ae=t[67];let oe;t[68]===a?oe=t[69]:(oe=a&&(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This workflow splits on the Event a run is on, so a run has to name one.`}),t[68]=a,t[69]=oe);let se;t[70]!==ae||t[71]!==oe?(se=(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[ee,ae,oe]}),t[70]=ae,t[71]=oe,t[72]=se):se=t[72];let ce;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Y.jsx)(`span`,{className:`font-medium text-sm`,children:`Payload`}),t[73]=ce):ce=t[73];let le=f===`form`?`secondary`:`ghost`,ue;t[74]!==L||t[75]!==le?(ue=(0,Y.jsx)(pv,{onClick:L,size:`sm`,variant:le,children:`Form`}),t[74]=L,t[75]=le,t[76]=ue):ue=t[76];let de=f===`json`?`secondary`:`ghost`,fe;t[77]!==F||t[78]!==de?(fe=(0,Y.jsx)(pv,{onClick:F,size:`sm`,variant:de,children:`JSON`}),t[77]=F,t[78]=de,t[79]=fe):fe=t[79];let pe;t[80]!==ue||t[81]!==fe?(pe=(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[ce,(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[ue,fe]})]}),t[80]=ue,t[81]=fe,t[82]=pe):pe=t[82];let me;t[83]!==v||t[84]!==C||t[85]!==f||t[86]!==b?(me=f===`form`?(0,Y.jsx)(qSe,{fields:v,onChange:(e,t)=>x(n=>({...n,[e]:t})),values:b}):(0,Y.jsx)(`textarea`,{"aria-label":`Payload JSON`,className:`min-h-64 w-full rounded-md border border-input bg-transparent p-3 font-mono text-xs shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,onChange:e=>{w(e.target.value),E(null)},spellCheck:!1,value:C}),t[83]=v,t[84]=C,t[85]=f,t[86]=b,t[87]=me):me=t[87];let he;t[88]===T?he=t[89]:(he=T&&(0,Y.jsx)(`p`,{className:`text-destructive text-xs`,children:T}),t[88]=T,t[89]=he);let ge;t[90]!==pe||t[91]!==me||t[92]!==he?(ge=(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[pe,me,he]}),t[90]=pe,t[91]=me,t[92]=he,t[93]=ge):ge=t[93];let _e;t[94]!==se||t[95]!==ge?(_e=(0,Y.jsxs)(`div`,{className:`space-y-6`,children:[se,ge]}),t[94]=se,t[95]=ge,t[96]=_e):_e=t[96];let ve;return t[97]!==n||t[98]!==K||t[99]!==_e?(ve=(0,Y.jsx)(E4,{actions:K,description:`A test run carries the payload an Event would have sent, so every template downstream resolves the way it will in production.`,overlayId:n,title:`Test run`,children:_e}),t[97]=n,t[98]=K,t[99]=_e,t[100]=ve):ve=t[100],ve}function YSe(){let e=(0,X.c)(3),t=Ie(),n=Ki(),r;return e[0]!==n||e[1]!==t?(r=F$.workflow.delete.mutationOptions({onSuccess:async()=>{wy.success(`Workflow deleted successfully`),await Promise.all([B$(t),H$(t)]),await n({to:`/`,replace:!0})},meta:{errorMessage:`Failed to delete workflow. Please try again.`}}),e[0]=n,e[1]=t,e[2]=r):r=e[2],Qe(r)}var XSe=Ay(`workflow`,`run`),ZSe={workflow_paused:`Workflow is paused and cannot start new runs.`,concurrency_first_wins:`A run for this entity is already going, and this workflow keeps the first one.`,entity_value_missing:`This payload carries nothing at the workflow's Correlation Path, and its Concurrency needs an entity to compare.`,manual_start_not_allowed:`This workflow does not list manual runs as a start source.`,start_event_required:`This workflow splits on the Event a run is on, so a run has to name one.`};function W9(e,t,n){t(e.map(e=>({nodeId:e.id,status:n})))}function QSe(e){let t=B9(e.nodes);t&&e.updateNodeData({id:t.id,data:{config:{...t.data.config,testPayloads:USe(V9(e.nodes),e.request)}}})}async function $Se({runWorkflow:e,nodes:t,setNodeStatuses:n,setIsExecuting:r,navigateToExecution:i}){W9(t,n,`idle`),n(t.filter(e=>e.data.type===`lifecycle`).map(e=>({nodeId:e.id,status:`running`})));try{let a=await e();if(a.status!==`running`||!a.executionId){wy.message(a.status===`ignored`?ZSe[a.reason]:`Execution completed without starting a new run.`),r(!1),W9(t,n,`idle`);return}if(typeof a.supersededExecutions==`number`&&a.supersededExecutions>0){let e=Array.isArray(a.failedToSupersede)?a.failedToSupersede.length:0,t=`Superseded ${a.supersededExecutions} run${a.supersededExecutions===1?``:`s`} for this entity and started a new one.`;e>0?wy.error(`${t} ${e} could not be signalled and may still be running. Cancel them from the Runs panel.`):wy.success(t)}await i(a.executionId)}catch(e){XSe.error(`Failed to execute the workflow`,{error:e}),W9(t,n,`error`),r(!1)}}function eCe(e){let t=(0,X.c)(29),{currentWorkflowId:n,nodes:r,updateNodeData:i,isExecuting:a,setIsExecuting:o,setActiveTab:s,setSelectedNodeId:c,userIntegrations:l}=e,u=vy(),d=c9(),{open:f}=Oq(),p=Ki(),m=Ie(),h=fA(Pue),g=fA(U2),_=fA(b4),v;t[0]===m?v=t[1]:(v=F$.workflow.execute.mutationOptions({onSuccess:()=>H$(m)}),t[0]=m,t[1]=v);let y=Qe(v),b;t[2]!==h||t[3]!==n||t[4]!==p||t[5]!==r||t[6]!==y||t[7]!==s||t[8]!==g||t[9]!==o||t[10]!==_||t[11]!==c||t[12]!==i?(b=async e=>{if(!n){wy.error(`Please save the workflow before executing`);return}QSe({nodes:r,updateNodeData:i,request:e}),s(`runs`),g(null),h(),c(null),o(!0),await $Se({runWorkflow:()=>y.mutateAsync({workflowId:n,input:e.input,...e.eventName?{eventName:e.eventName}:{}}),nodes:r,setNodeStatuses:_,setIsExecuting:o,navigateToExecution:e=>p({to:`/workflows/$workflowId`,params:{workflowId:n},search:{executionId:e}})})},t[2]=h,t[3]=n,t[4]=p,t[5]=r,t[6]=y,t[7]=s,t[8]=g,t[9]=o,t[10]=_,t[11]=c,t[12]=i,t[13]=b):b=t[13];let x=b,S;t[14]!==x||t[15]!==r||t[16]!==f?(S=()=>{let e=HSe(r)??aQ;f(JSe,{startEvents:e.startEvents,allowManualStart:dQ(e),hasEventSplit:r.some(a6),savedPayloads:V9(r),onRun:e=>{x(e)}})},t[14]=x,t[15]=r,t[16]=f,t[17]=S):S=t[17];let C=S,w;t[18]!==u||t[19]!==d||t[20]!==a||t[21]!==r||t[22]!==f||t[23]!==C||t[24]!==l?(w=async()=>{if(a)return;let e=x2({nodes:n$(r),catalog:u,integrations:l});if(e.length>0){let t=S2(e);f(s9,{issues:C2(e),onGoToStep:d,onRunAnyway:t?void 0:C,allowRunAnyway:!t});return}C()},t[18]=u,t[19]=d,t[20]=a,t[21]=r,t[22]=f,t[23]=C,t[24]=l,t[25]=w):w=t[25];let T=w,E;return t[26]!==T||t[27]!==d?(E={handleExecute:T,handleGoToStep:d},t[26]=T,t[27]=d,t[28]=E):E=t[28],E}function tCe(){let e=(0,X.c)(29),t=dA(e4),n=dA(t4),[r,i]=pA(y0),[a]=pA(b0),o=fA(Hue),s=fA(g4),[c]=pA(K1),l=dA(q1),[u,d]=pA(Y1),f=dA(X1),p=dA($1),m=dA(e0),h=fA(v4),g=fA(y4),[_]=pA(Uue),[v]=pA(Wue),y=fA(m0),b=fA(W2),x;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=I$(),e[0]=x):x=e[0];let{data:S}=Ze(x),C;e[1]===S?C=e[2]:(C=S===void 0?[]:S,e[1]=S,e[2]=C);let w=C,T;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(T=L$(),e[3]=T):T=e[3];let{data:E}=Ze(T),D;e[4]===E?D=e[5]:(D=E===void 0?[]:E,e[4]=E,e[5]=D);let O=D,k;return e[6]!==O||e[7]!==v||e[8]!==_||e[9]!==o||e[10]!==c||e[11]!==n||e[12]!==m||e[13]!==r||e[14]!==a||e[15]!==f||e[16]!==p||e[17]!==t||e[18]!==g||e[19]!==y||e[20]!==d||e[21]!==i||e[22]!==b||e[23]!==h||e[24]!==s||e[25]!==w||e[26]!==u||e[27]!==l?(k={nodes:t,edges:n,isExecuting:r,setIsExecuting:i,isGenerating:a,clearWorkflow:o,updateNodeData:s,currentWorkflowId:c,workflowName:l,workflowMode:u,setCurrentWorkflowMode:d,isOwner:f,isSaving:p,hasUnsavedChanges:m,undo:h,redo:g,canUndo:_,canRedo:v,allWorkflows:O,setActiveTab:y,setSelectedNodeId:b,userIntegrations:w},e[6]=O,e[7]=v,e[8]=_,e[9]=o,e[10]=c,e[11]=n,e[12]=m,e[13]=r,e[14]=a,e[15]=f,e[16]=p,e[17]=t,e[18]=g,e[19]=y,e[20]=d,e[21]=i,e[22]=b,e[23]=h,e[24]=s,e[25]=w,e[26]=u,e[27]=l,e[28]=k):k=e[28],k}function nCe(e){let t=(0,X.c)(55),n=vy(),{open:r}=Oq(),i=Ki(),a=Ie(),o=YSe(),s=fA(Yce),{currentWorkflowId:c,workflowName:l,workflowMode:u,setCurrentWorkflowMode:d,nodes:f,edges:p,updateNodeData:m,isExecuting:h,setIsExecuting:g,clearWorkflow:_,setActiveTab:v,setSelectedNodeId:y,userIntegrations:b}=e,x;t[0]!==c||t[1]!==h||t[2]!==f||t[3]!==v||t[4]!==g||t[5]!==y||t[6]!==m||t[7]!==b?(x={currentWorkflowId:c,nodes:f,updateNodeData:m,isExecuting:h,setIsExecuting:g,setActiveTab:v,setSelectedNodeId:y,userIntegrations:b},t[0]=c,t[1]=h,t[2]=f,t[3]=v,t[4]=g,t[5]=y,t[6]=m,t[7]=b,t[8]=x):x=t[8];let{handleExecute:S,handleGoToStep:C}=eCe(x),w;t[9]===S?w=t[10]:(w=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(g7(e.target)||(e.preventDefault(),e.stopPropagation(),S()))},t[9]=S,t[10]=w);let T=w,E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E={capture:!0},t[11]=E):E=t[11],aq(document,`keydown`,T,E);let D;t[12]!==_||t[13]!==r?(D=()=>{r(D4,{title:`Clear Workflow`,message:`Remove every step and connection? The Lifecycle Node is kept, and this saves right away.`,confirmLabel:`Clear Workflow`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>{_()}})},t[12]=_,t[13]=r,t[14]=D):D=t[14];let O=D,k;t[15]!==c||t[16]!==o||t[17]!==r||t[18]!==l?(k=()=>{r(D4,{title:`Delete Workflow`,message:`Are you sure you want to delete "${l}"? This will permanently delete the workflow. This cannot be undone.`,confirmLabel:`Delete Workflow`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>{c&&o.mutate({workflowId:c})}})},t[15]=c,t[16]=o,t[17]=r,t[18]=l,t[19]=k):k=t[19];let A=k,j;t[20]===a?j=t[21]:(j=()=>B$(a),t[20]=a,t[21]=j);let M=j,N;t[22]!==M||t[23]!==i?(N=F$.workflow.duplicate.mutationOptions({onSuccess:async e=>{wy.success(`Workflow duplicated successfully`),await M(),await i({to:`/workflows/$workflowId`,params:{workflowId:e.id}})},meta:{errorMessage:`Failed to duplicate workflow. Please try again.`}}),t[22]=M,t[23]=i,t[24]=N):N=t[24];let P=Qe(N),F;t[25]!==M||t[26]!==a?(F=F$.workflow.publish.mutationOptions({onSuccess:e=>{wy.success(`Published version ${e.publishedVersion}`),V$(a,e),M()}}),t[25]=M,t[26]=a,t[27]=F):F=t[27];let I=Qe(F),L;t[28]!==c||t[29]!==P?(L=()=>{c&&P.mutate({workflowId:c})},t[28]=c,t[29]=P,t[30]=L):L=t[30];let R=L,z;t[31]!==n||t[32]!==c||t[33]!==p||t[34]!==C||t[35]!==f||t[36]!==r||t[37]!==I||t[38]!==b?(z=()=>{if(!c)return;let e=x2({nodes:n$(f),catalog:n,integrations:b});if(S2(e)){r(s9,{issues:C2(e),onGoToStep:C,allowRunAnyway:!1});return}I.mutate({workflowId:c,graph:o$({nodes:f,edges:p})})},t[31]=n,t[32]=c,t[33]=p,t[34]=C,t[35]=f,t[36]=r,t[37]=I,t[38]=b,t[39]=z):z=t[39];let B=z,V;t[40]!==c||t[41]!==d||t[42]!==s||t[43]!==u?(V=async e=>{if(!c||u===e)return;let t=await s(e);if(!t?.ok){wy.error(`Failed to update workflow mode`);return}d(t.workflow.mode),wy.success(e===`test`?`Workflow set to Test mode`:`Workflow set to Live mode`)},t[40]=c,t[41]=d,t[42]=s,t[43]=u,t[44]=V):V=t[44];let H=V,U;return t[45]!==P.isPending||t[46]!==O||t[47]!==A||t[48]!==R||t[49]!==S||t[50]!==B||t[51]!==H||t[52]!==M||t[53]!==I.isPending?(U={handleExecute:S,handleClearWorkflow:O,handleDeleteWorkflow:A,loadWorkflows:M,handleDuplicate:R,isDuplicating:P.isPending,handlePublish:B,isPublishing:I.isPending,handleSetWorkflowMode:H},t[45]=P.isPending,t[46]=O,t[47]=A,t[48]=R,t[49]=S,t[50]=B,t[51]=H,t[52]=M,t[53]=I.isPending,t[54]=U):U=t[54],U}var rCe=e=>{let t=(0,X.c)(13),{workflowId:n}=e,r=tCe(),i=nCe(r),a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Y.jsx)(xSe,{}),o=(0,Y.jsx)(f7,{className:`data-vertical:h-4 data-vertical:self-center`,orientation:`vertical`}),t[0]=a,t[1]=o):(a=t[0],o=t[1]);let s,c,l;t[2]!==i||t[3]!==r||t[4]!==n?(s=(0,Y.jsx)(kSe,{actions:i,state:r,workflowId:n}),c=(0,Y.jsx)(DSe,{actions:i,state:r,workflowId:n}),l=n&&!r.isOwner&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`shrink-0 whitespace-nowrap text-muted-foreground text-xs`,children:`Read-only`}),(0,Y.jsx)(wSe,{isDuplicating:i.isDuplicating,onDuplicate:i.handleDuplicate})]}),t[2]=i,t[3]=r,t[4]=n,t[5]=s,t[6]=c,t[7]=l):(s=t[5],c=t[6],l=t[7]);let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(eSe,{}),t[8]=u):u=t[8];let d;return t[9]!==s||t[10]!==c||t[11]!==l?(d=(0,Y.jsx)(`div`,{className:`@container shrink-0`,children:(0,Y.jsxs)(`div`,{className:`flex h-11 items-center gap-2 overflow-x-auto border-b bg-background px-2.5 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:[a,o,s,c,l,u]})}),t[9]=s,t[10]=c,t[11]=l,t[12]=d):d=t[12],d},iCe=500,aCe=()=>{let e=(0,X.c)(42),t=dA(b0),n=dA(n0),r=dA(e4),i=dA(t4),[a]=pA(K1),[o]=pA(C0),s=dA(r4),c=fA(y0),l=fA(l0),u=fA(b4),d=dA(Z1),f=dA(Q1),p;e[0]===n?p=e[1]:(p=()=>{n&&wy.error(n.message||`Failed to save workflow`)},e[0]=n,e[1]=p),oq(n,p);let m;e[2]!==a||e[3]!==i||e[4]!==t||e[5]!==r||e[6]!==l?(m=async()=>{if(!a||t)return;let e=await l({nodes:r,edges:i},{immediate:!0});e&&!e.ok&&wy.error(e.error.message||`Failed to save workflow`)},e[2]=a,e[3]=i,e[4]=t,e[5]=r,e[6]=l,e[7]=m):m=e[7];let h=m,g;e[8]===h?g=e[9]:(g=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),e.stopPropagation(),h())},e[8]=h,e[9]=g);let _=g,v;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={capture:!0},e[10]=v):v=e[10],aq(document,`keydown`,_,v);let y;e[11]===o?y=e[12]:(y=F$.workflow.getExecutionStatus.queryOptions({input:{executionId:o??``}}),e[11]=o,e[12]=y);let b=o!==null,x;e[13]!==y||e[14]!==b?(x={...y,enabled:b,staleTime:0,refetchIntervalInBackground:!1,refetchInterval:oCe},e[13]=y,e[14]=b,e[15]=x):x=e[15];let S=Ze(x).data,C;e[16]===S?.nodeStatuses?C=e[17]:(C=S?.nodeStatuses.map(sCe).join(`,`)??``,e[16]=S?.nodeStatuses,e[17]=C);let w=C,T;e[18]!==S||e[19]!==r||e[20]!==o||e[21]!==c||e[22]!==u?(T=()=>{if(!o){u(r.map(cCe)),c(!1);return}S&&(u(S.nodeStatuses.map(lCe)),c(S4(S.status)))},e[18]=S,e[19]=r,e[20]=o,e[21]=c,e[22]=u,e[23]=T):T=e[23],oq(o===null?`idle`:`${o}:${s}:${S===void 0?`loading`:`${S.status}:${w}`}`,T);let E;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Y.jsx)(fde,{}),e[24]=E):E=e[24];let D;e[25]===d?D=e[26]:(D=d&&(0,Y.jsx)(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center`,children:(0,Y.jsxs)(`div`,{className:`rounded-lg border bg-background p-8 text-center shadow-lg`,children:[(0,Y.jsx)(`h1`,{className:`mb-2 font-semibold text-2xl`,children:`Workflow Not Found`}),(0,Y.jsx)(`p`,{className:`mb-6 text-muted-foreground`,children:`The workflow you're looking for doesn't exist or has been deleted.`}),(0,Y.jsx)(pv,{render:(0,Y.jsx)(pa,{to:`/`}),children:`Go to Dashboard`})]})}),e[25]=d,e[26]=D);let O;e[27]===f?O=e[28]:(O=f&&(0,Y.jsx)(`div`,{className:`absolute inset-0 z-20 flex items-center justify-center`,children:(0,Y.jsxs)(`div`,{className:`rounded-lg border bg-background p-8 text-center shadow-lg`,children:[(0,Y.jsx)(`h1`,{className:`mb-2 font-semibold text-2xl`,children:`Couldn't Load Workflow`}),(0,Y.jsx)(`p`,{className:`mb-6 text-muted-foreground`,children:f}),(0,Y.jsx)(pv,{onClick:uCe,children:`Try Again`})]})}),e[27]=f,e[28]=O);let k=a??void 0,A;e[29]===k?A=e[30]:(A=(0,Y.jsx)(rCe,{workflowId:k}),e[29]=k,e[30]=A);let j;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Y.jsx)(`div`,{className:`min-h-[min(20rem,40dvh)] flex-1`,children:(0,Y.jsx)(yxe,{})}),e[31]=j):j=e[31];let M=a??void 0,N;e[32]===M?N=e[33]:(N=(0,Y.jsx)(qxe,{workflowId:M}),e[32]=M,e[33]=N);let P;e[34]!==A||e[35]!==N?(P=(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[A,j,N]}),e[34]=A,e[35]=N,e[36]=P):P=e[36];let F;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Y.jsx)(kxe,{}),e[37]=F):F=e[37];let I;return e[38]!==D||e[39]!==O||e[40]!==P?(I=(0,Y.jsx)(`div`,{className:`h-dvh w-full bg-page p-[var(--editor-inset)]`,children:(0,Y.jsx)(`div`,{className:`size-full bg-background md:rounded-xl md:shadow-xs`,children:(0,Y.jsxs)(`div`,{className:`relative flex size-full overflow-hidden md:rounded-xl md:border md:[clip-path:inset(0_round_var(--editor-shell-radius))]`,children:[E,D,O,P,F]})})}),e[38]=D,e[39]=O,e[40]=P,e[41]=I):I=e[41],I};function oCe(e){return S4(e.state.data?.status)?iCe:!1}function sCe(e){return`${e.nodeId}=${e.status}`}function cCe(e){return{nodeId:e.id,status:`idle`}}function lCe(e){return{nodeId:e.nodeId,status:e.status===`pending`?`idle`:e.status}}function uCe(){return window.location.reload()}var dCe=Ay(`workflows`),G9=3,K9=[`running`,`waiting`,`failed`,`completed`,`canceled`,`pending`],fCe=[...K9,`superseded`];function pCe(e){if(!e)return`-`;let t=Number.parseInt(e,10);return Number.isNaN(t)?e:t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}var mCe=100;function hCe(e){return e.toSorted(gCe)}function gCe(e,t){return new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()}function _Ce(e){return e===`pause`?`Paused`:e===`resume`?`Resumed`:`Deleted`}function q9(e,t,n){return e===1?t:n}function vCe(){let e=(0,X.c)(165),t=Ki(),n=Ie(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,e[0]=r):r=e[0];let[i,a]=(0,J.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Set,e[1]=o):o=e[1];let[s,c]=(0,J.useState)(o),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(0),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(null),y;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=F$.workflow.getAll.queryOptions({input:{},select:hCe,meta:{errorMessage:`Failed to load workflows`}}),e[2]=y):y=e[2];let{data:b,isPending:x}=Ze(y),S;e[3]===b?S=e[4]:(S=b===void 0?[]:b,e[3]=b,e[4]=S);let C=S,w;e[5]===C?w=e[6]:(w=C.filter(kCe),e[5]=C,e[6]=w);let T=w,E;e[7]===i?E=e[8]:(E=Array.from(i),e[7]=i,e[8]=E);let D=E,O;e[9]!==D||e[10]!==T?(O=D.filter(e=>T.some(t=>t.id===e&&t.isOwner!==!1)),e[9]=D,e[10]=T,e[11]=O):O=e[11];let k=O,A;e[12]!==i||e[13]!==T?(A=T.length>0&&T.every(e=>i.has(e.id)),e[12]=i,e[13]=T,e[14]=A):A=e[14];let j=A,M=l&&k.length>0,N;e[15]!==M||e[16]!==k||e[17]!==s?(N=aX({workflowIds:M?k.toSorted():void 0,statuses:s.size>0?Array.from(s).toSorted():K9.toSorted(),limit:mCe},iX),e[15]=M,e[16]=k,e[17]=s,e[18]=N):N=e[18];let P=N,F;e[19]===P?F=e[20]:(F=F$.workflow.getExecutionsGlobal.infiniteOptions({input:e=>({...P,cursor:e}),initialPageParam:void 0,getNextPageParam:OCe,meta:{errorMessage:`Failed to load workflow runs`}}),e[19]=P,e[20]=F);let I=$e(F),L;e[21]===I.data?.pages?L=e[22]:(L=I.data?.pages.flatMap(DCe)??[],e[21]=I.data?.pages,e[22]=L);let R=L,z=I.isPending,B=I.isFetchingNextPage,V;e[23]===n?V=e[24]:(V=()=>B$(n),e[23]=n,e[24]=V);let H=V,U;e[25]===n?U=e[26]:(U=()=>H$(n),e[25]=n,e[26]=U);let W=U,G;e[27]===H?G=e[28]:(G=F$.workflow.update.mutationOptions({onSuccess:async(e,t)=>{let{mode:n}=t;await H(),wy.success(n===`test`?`Switched workflow to Test mode`:`Switched workflow to Live mode`)},meta:{errorMessage:`Failed to switch workflow mode`}}),e[27]=H,e[28]=G);let K=Qe(G),ee;e[29]===T?ee=e[30]:(ee=e=>{if(!e){a(new Set);return}a(new Set(T.map(ECe)))},e[29]=T,e[30]=ee);let q=ee,te;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(te=(e,t)=>{a(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},e[31]=te):te=e[31];let ne=te,re;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},e[32]=re):re=e[32];let ie=re,ae;e[33]===n?ae=e[34]:(ae=F$.workflow.bulkLifecycle.mutationOptions({onSuccess:async(e,t)=>{let{action:r}=t;if(e.summary.failed===0?wy.success(`${_Ce(r)} ${e.summary.succeeded} workflow${q9(e.summary.succeeded,``,`s`)}`):wy.error(`${r} finished with ${e.summary.failed} failure${q9(e.summary.failed,``,`s`)}`),await B$(n),r!==`delete`)return;let i=new Set(e.results.filter(TCe).map(wCe));a(e=>{let t=new Set;for(let n of e)i.has(n)||t.add(n);return t}),await H$(n)},onError:CCe,meta:{errorShownByCaller:!0}}),e[33]=n,e[34]=ae);let oe=Qe(ae),se=oe.isPending?oe.variables.action:null,ce=oe.mutate,le;e[35]===ce?le=e[36]:(le=(e,t)=>{t.length!==0&&ce({workflowIds:t,action:e})},e[35]=ce,e[36]=le);let ue=le,de;e[37]===C?de=e[38]:(de=e=>{if(e.length===0)return;let t=new Map(C.map(SCe)),n=e.map(e=>t.get(e)??`Untitled workflow`),r=e.length===1?`Delete Workflow`:`Delete Workflows`,i=e.length===1?`This will permanently delete "${n[0]}" and all of its runs and events. This cannot be undone.`:`This will permanently delete ${e.length} workflows and all of their runs and events. This cannot be undone.`;v({workflowIds:e,workflowNames:n,title:r,description:i})},e[37]=C,e[38]=de);let fe=de,pe;e[39]!==j||e[40]!==x||e[41]!==se||e[42]!==t||e[43]!==fe||e[44]!==ue||e[45]!==i||e[46]!==K||e[47]!==q||e[48]!==T?(pe=()=>x&&T.length===0?(0,Y.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`Loading workflows...`}):T.length===0?(0,Y.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`No workflows found.`}):(0,Y.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,Y.jsx)(`thead`,{className:`sticky top-0 bg-card`,children:(0,Y.jsxs)(`tr`,{className:`border-b`,children:[(0,Y.jsx)(`th`,{className:`w-10 px-4 py-2`,children:(0,Y.jsx)(L5,{"aria-label":`Select all workflows`,checked:j,onCheckedChange:e=>{q(e)}})}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Name`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`State`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Mode`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Updated`}),(0,Y.jsx)(`th`,{className:`w-10`})]})}),(0,Y.jsx)(`tbody`,{children:T.map(e=>{let n=i.has(e.id),r=e.isOwner!==!1,a=e.isPaused?`border-amber-500/30 bg-amber-500/10 text-amber-700`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,o=e.isPaused?`Paused`:`Active`,s=e.mode===`test`?`border-destructive/30 bg-destructive/10 text-destructive`:`border-border bg-muted text-muted-foreground`,c=e.mode===`test`?`Test`:`Live`,l=e.isPaused?`resume`:`pause`,u=e.isPaused?`Resume`:`Pause`;return(0,Y.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,Y.jsx)(`td`,{className:`px-4 py-3`,children:(0,Y.jsx)(L5,{"aria-label":`Select ${e.name}`,checked:n,onCheckedChange:t=>{ne(e.id,t)}})}),(0,Y.jsxs)(`td`,{className:`px-2 py-3`,children:[(0,Y.jsx)(`button`,{className:`text-left font-medium text-foreground hover:underline`,onClick:()=>{t({to:`/workflows/$workflowId`,params:{workflowId:e.id}})},type:`button`,children:e.name}),(0,Y.jsx)(`div`,{className:`font-mono text-muted-foreground text-xs`,children:e.id})]}),(0,Y.jsx)(`td`,{className:`px-2 py-3`,children:(0,Y.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs transition-colors duration-200 ${a}`,children:o})}),(0,Y.jsx)(`td`,{className:`px-2 py-3`,children:(0,Y.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs uppercase transition-colors duration-200 ${s}`,children:c})}),(0,Y.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:G5(e.updatedAt)}),(0,Y.jsx)(`td`,{className:`px-2 py-3`,children:(0,Y.jsxs)(w5,{children:[(0,Y.jsx)(T5,{className:`inline-flex size-8 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50`,disabled:!r||se!==null,children:(0,Y.jsx)(zv,{className:`size-4`})}),(0,Y.jsxs)(E5,{align:`end`,children:[(0,Y.jsx)(k5,{onClick:()=>{K.mutate({workflowId:e.id,mode:e.mode===`test`?`live`:`test`})},children:e.mode===`test`?`Switch to Live`:`Switch to Test`}),(0,Y.jsx)(k5,{onClick:()=>{ue(l,[e.id])},children:u}),(0,Y.jsx)(j5,{}),(0,Y.jsx)(k5,{onClick:()=>{fe([e.id])},variant:`destructive`,children:`Delete`})]})]})})]},e.id)})})]}),e[39]=j,e[40]=x,e[41]=se,e[42]=t,e[43]=fe,e[44]=ue,e[45]=i,e[46]=K,e[47]=q,e[48]=T,e[49]=pe):pe=e[49];let me=pe,he;e[50]!==z||e[51]!==t||e[52]!==R?(he=()=>z&&R.length===0?(0,Y.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`Loading runs...`}):R.length===0?(0,Y.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`No runs found.`}):(0,Y.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,Y.jsx)(`thead`,{className:`sticky top-0 bg-card`,children:(0,Y.jsxs)(`tr`,{className:`border-b`,children:[(0,Y.jsx)(`th`,{className:`px-4 py-2`,children:`Workflow`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Status`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Started`}),(0,Y.jsx)(`th`,{className:`px-2 py-2`,children:`Duration`}),(0,Y.jsx)(`th`,{className:`px-4 py-2 text-right`,children:`Open`})]})}),(0,Y.jsx)(`tbody`,{children:R.map(e=>(0,Y.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,Y.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-foreground text-sm`,children:e.workflowName}),(0,Y.jsx)(`div`,{className:`font-mono text-muted-foreground text-xs`,children:e.workflowId})]}),(0,Y.jsx)(`td`,{className:`px-2 py-3`,children:(0,Y.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs uppercase ${Q5(e.status)}`,children:e.status})}),(0,Y.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:G5(e.startedAt)}),(0,Y.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:pCe(e.duration)}),(0,Y.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(0,Y.jsx)(pv,{onClick:()=>{t({to:`/workflows/$workflowId`,params:{workflowId:e.workflowId},search:{executionId:e.id}})},size:`sm`,type:`button`,variant:`outline`,children:`Open`})})]},e.id))})]}),e[50]=z,e[51]=t,e[52]=R,e[53]=he):he=e[53];let ge=he,_e;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Y.jsx)(`h1`,{className:`font-semibold text-2xl text-foreground`,children:`Workflow Dashboard`}),e[54]=_e):_e=e[54];let ve;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[_e,(0,Y.jsx)(pv,{onClick:()=>{m(xCe),f(!0)},type:`button`,children:`New Workflow`})]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Manage workflows in bulk and review runs across every workflow. Paused workflows block new starts. Test mode makes runs execute with test-mode action behavior.`})]}),e[55]=ve):ve=e[55];let ye;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`font-medium text-foreground text-sm`,children:`Workflows`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Select one or more workflows to run bulk actions.`})]}),e[56]=ye):ye=e[56];let be=x||se!==null,xe;e[57]!==H||e[58]!==be?(xe=(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-4 py-3`,children:[ye,(0,Y.jsx)(pv,{disabled:be,onClick:H,size:`sm`,type:`button`,variant:`outline`,children:`Refresh`})]}),e[57]=H,e[58]=be,e[59]=xe):xe=e[59];let Se=k.length===0||se!==null,Ce;e[60]!==ue||e[61]!==k?(Ce=()=>{ue(`pause`,k)},e[60]=ue,e[61]=k,e[62]=Ce):Ce=e[62];let we;e[63]!==Se||e[64]!==Ce?(we=(0,Y.jsx)(pv,{disabled:Se,onClick:Ce,size:`sm`,type:`button`,variant:`outline`,children:`Pause Selected`}),e[63]=Se,e[64]=Ce,e[65]=we):we=e[65];let Te=k.length===0||se!==null,Ee;e[66]!==ue||e[67]!==k?(Ee=()=>{ue(`resume`,k)},e[66]=ue,e[67]=k,e[68]=Ee):Ee=e[68];let De;e[69]!==Te||e[70]!==Ee?(De=(0,Y.jsx)(pv,{disabled:Te,onClick:Ee,size:`sm`,type:`button`,variant:`outline`,children:`Resume Selected`}),e[69]=Te,e[70]=Ee,e[71]=De):De=e[71];let Oe=k.length===0||se!==null,ke;e[72]!==fe||e[73]!==k?(ke=()=>{fe(k)},e[72]=fe,e[73]=k,e[74]=ke):ke=e[74];let Ae;e[75]!==Oe||e[76]!==ke?(Ae=(0,Y.jsx)(pv,{disabled:Oe,onClick:ke,size:`sm`,type:`button`,variant:`destructive`,children:`Delete Selected`}),e[75]=Oe,e[76]=ke,e[77]=Ae):Ae=e[77];let je;e[78]!==we||e[79]!==De||e[80]!==Ae?(je=(0,Y.jsx)(`div`,{className:`border-b px-4 py-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[we,De,Ae]})}),e[78]=we,e[79]=De,e[80]=Ae,e[81]=je):je=e[81];let Me;e[82]===me?Me=e[83]:(Me=(0,Y.jsx)(`div`,{className:`max-h-[65vh] overflow-auto`,children:me()}),e[82]=me,e[83]=Me);let Ne;e[84]!==xe||e[85]!==je||e[86]!==Me?(Ne=(0,Y.jsxs)(`section`,{className:`rounded-xl border bg-card`,children:[xe,je,Me]}),e[84]=xe,e[85]=je,e[86]=Me,e[87]=Ne):Ne=e[87];let Pe;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`font-medium text-foreground text-sm`,children:`All Runs`}),(0,Y.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Combined run history across workflows.`})]}),e[88]=Pe):Pe=e[88];let Fe=z||B,Le;e[89]===W?Le=e[90]:(Le=()=>{W()},e[89]=W,e[90]=Le);let Re;e[91]!==Fe||e[92]!==Le?(Re=(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-4 py-3`,children:[Pe,(0,Y.jsx)(pv,{disabled:Fe,onClick:Le,size:`sm`,type:`button`,variant:`outline`,children:`Refresh`})]}),e[91]=Fe,e[92]=Le,e[93]=Re):Re=e[93];let ze;e[94]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>{c(new Set)},e[94]=ze):ze=e[94];let Be=s.size===0?`secondary`:`outline`,Ve;e[95]===Be?Ve=e[96]:(Ve=(0,Y.jsx)(pv,{onClick:ze,size:`sm`,type:`button`,variant:Be,children:`All statuses`}),e[95]=Be,e[96]=Ve);let He;e[97]===s?He=e[98]:(He=fCe.map(e=>(0,Y.jsx)(pv,{onClick:()=>{ie(e)},size:`sm`,type:`button`,variant:s.has(e)?`secondary`:`outline`,children:e},e)),e[97]=s,e[98]=He);let Ue=k.length===0,We;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(We=()=>{u(bCe)},e[99]=We):We=e[99];let Ge=l?`secondary`:`outline`,Ke=l?`Showing selected workflows`:`Show selected workflows only`,qe;e[100]!==Ue||e[101]!==Ge||e[102]!==Ke?(qe=(0,Y.jsx)(pv,{disabled:Ue,onClick:We,size:`sm`,type:`button`,variant:Ge,children:Ke}),e[100]=Ue,e[101]=Ge,e[102]=Ke,e[103]=qe):qe=e[103];let Je;e[104]!==Ve||e[105]!==He||e[106]!==qe?(Je=(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b px-4 py-2`,children:[Ve,He,qe]}),e[104]=Ve,e[105]=He,e[106]=qe,e[107]=Je):Je=e[107];let Ye;e[108]===ge?Ye=e[109]:(Ye=(0,Y.jsx)(`div`,{className:`max-h-[65vh] overflow-auto`,children:ge()}),e[108]=ge,e[109]=Ye);let Xe;e[110]!==B||e[111]!==I?(Xe=I.hasNextPage?(0,Y.jsx)(`div`,{className:`border-t px-4 py-3`,children:(0,Y.jsx)(pv,{disabled:B,onClick:()=>{I.fetchNextPage()},size:`sm`,type:`button`,variant:`outline`,children:B?`Loading...`:`Load more`})}):null,e[110]=B,e[111]=I,e[112]=Xe):Xe=e[112];let et;e[113]!==Re||e[114]!==Je||e[115]!==Ye||e[116]!==Xe?(et=(0,Y.jsxs)(`section`,{className:`rounded-xl border bg-card`,children:[Re,Je,Ye,Xe]}),e[113]=Re,e[114]=Je,e[115]=Ye,e[116]=Xe,e[117]=et):et=e[117];let tt;e[118]!==Ne||e[119]!==et?(tt=(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1600px] flex-col gap-6 p-6`,children:[ve,(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 xl:grid-cols-[1fr_1.5fr]`,children:[Ne,et]})]}),e[118]=Ne,e[119]=et,e[120]=tt):tt=e[120];let nt;e[121]===Symbol.for(`react.memo_cache_sentinel`)?(nt=e=>{e||(v(null),g(``))},e[121]=nt):nt=e[121];let rt=_!==null,it=_?.title,at;e[122]===it?at=e[123]:(at=(0,Y.jsx)(b9,{children:it}),e[122]=it,e[123]=at);let ot=_?.description,st;e[124]===ot?st=e[125]:(st=(0,Y.jsx)(x9,{children:ot}),e[124]=ot,e[125]=st);let ct;e[126]!==at||e[127]!==st?(ct=(0,Y.jsxs)(v9,{children:[at,st]}),e[126]=at,e[127]=st,e[128]=ct):ct=e[128];let lt;e[129]===_?lt=e[130]:(lt=_&&_.workflowNames.length>1?(0,Y.jsxs)(`ul`,{className:`list-disc pl-5 text-muted-foreground text-sm`,children:[_.workflowIds.slice(0,3).map((e,t)=>(0,Y.jsx)(`li`,{children:_.workflowNames[t]},e)),_.workflowNames.length>3?(0,Y.jsxs)(`li`,{children:[`and `,_.workflowNames.length-3,` more`]}):null]}):null,e[129]=_,e[130]=lt);let ut;e[131]!==_||e[132]!==h?(ut=_&&_.workflowIds.length>G9?(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsxs)(V4,{htmlFor:`delete-challenge`,children:[`Type `,_.workflowIds.length,` to confirm`]}),(0,Y.jsx)(B4,{autoComplete:`off`,id:`delete-challenge`,inputMode:`numeric`,onChange:e=>{g(e.target.value)},value:h})]}):null,e[131]=_,e[132]=h,e[133]=ut):ut=e[133];let dt;e[134]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,Y.jsx)(C9,{children:`Cancel`}),e[134]=dt):dt=e[134];let ft;e[135]!==_||e[136]!==h?(ft=_!==null&&_.workflowIds.length>G9&&h.trim()!==String(_.workflowIds.length),e[135]=_,e[136]=h,e[137]=ft):ft=e[137];let pt;e[138]!==_||e[139]!==ue?(pt=()=>{_&&(ue(`delete`,_.workflowIds),v(null),g(``))},e[138]=_,e[139]=ue,e[140]=pt):pt=e[140];let mt;e[141]!==ft||e[142]!==pt?(mt=(0,Y.jsxs)(y9,{children:[dt,(0,Y.jsx)(S9,{disabled:ft,onClick:pt,variant:`destructive`,children:`Delete`})]}),e[141]=ft,e[142]=pt,e[143]=mt):mt=e[143];let ht;e[144]!==ct||e[145]!==lt||e[146]!==ut||e[147]!==mt?(ht=(0,Y.jsxs)(_9,{children:[ct,lt,ut,mt]}),e[144]=ct,e[145]=lt,e[146]=ut,e[147]=mt,e[148]=ht):ht=e[148];let gt;e[149]!==rt||e[150]!==ht?(gt=(0,Y.jsx)(g9,{onOpenChange:nt,open:rt,children:ht}),e[149]=rt,e[150]=ht,e[151]=gt):gt=e[151];let _t;e[152]===C?_t=e[153]:(_t=C.map(yCe),e[152]=C,e[153]=_t);let vt;e[154]===t?vt=e[155]:(vt=e=>t({to:`/workflows/$workflowId`,params:{workflowId:e}}),e[154]=t,e[155]=vt);let yt;e[156]!==p||e[157]!==d||e[158]!==_t||e[159]!==vt?(yt=(0,Y.jsx)(F9,{existingWorkflowNames:_t,onCreated:vt,onOpenChange:f,open:d},p),e[156]=p,e[157]=d,e[158]=_t,e[159]=vt,e[160]=yt):yt=e[160];let bt;return e[161]!==tt||e[162]!==gt||e[163]!==yt?(bt=(0,Y.jsxs)(`div`,{className:`h-dvh overflow-auto bg-background`,children:[tt,gt,yt]}),e[161]=tt,e[162]=gt,e[163]=yt,e[164]=bt):bt=e[164],bt}function yCe(e){return e.name}function bCe(e){return!e}function xCe(e){return e+1}function SCe(e){return[e.id,e.name]}function CCe(e,t){let{action:n}=t;dCe.error(`Failed to ${n} workflows`,{action:n,error:e}),wy.error(`Failed to ${n} workflows`)}function wCe(e){return e.workflowId}function TCe(e){return e.ok&&e.deleted===!0}function ECe(e){return e.id}function DCe(e){return e.items}function OCe(e){return e.nextCursor??void 0}function kCe(e){return e.name!==`__current__`}function ACe(e){return{executionId:typeof e.executionId==`string`&&e.executionId.length>0?e.executionId:void 0}}function jCe(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(rk,{children:(0,Y.jsx)(Aa,{})}),e[0]=t):t=e[0],t}function MCe(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(Qq,{attribute:`class`,defaultTheme:`system`,disableTransitionOnChange:!0,enableSystem:!0,children:(0,Y.jsx)(Oae,{store:nJ,children:(0,Y.jsxs)(Tq,{children:[(0,Y.jsx)(jCe,{}),(0,Y.jsx)(tJ,{}),(0,Y.jsx)(Lq,{})]})})}),e[0]=t):t=e[0],t}function J9(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(aCe,{}),e[0]=t):t=e[0],t}var Y9=ba({component:MCe}),NCe=va({getParentRoute:()=>Y9,path:`/`,component:vCe}),PCe=va({getParentRoute:()=>Y9,path:`/workflows`,component:()=>(0,Y.jsx)(qi,{replace:!0,to:`/`})}),FCe=va({getParentRoute:()=>Y9,path:`/workflows/$workflowId`,validateSearch:ACe,beforeLoad:({search:e})=>{let t=Jue(e.executionId);t!==null&&nJ.set(m0,t)},loader:async({params:e})=>{nJ.set(Z1,!1),nJ.set(Q1,null);let[t,n]=await Promise.allSettled([jy.fetchQuery(F$.workflow.getById.queryOptions({input:{workflowId:e.workflowId},staleTime:0})),jy.fetchQuery(I$())]);if(t.status===`rejected`){let e=que(t.reason);throw nJ.set(Z1,e.notFound),nJ.set(Q1,e.message),t.reason}if(n.status===`rejected`)throw nJ.set(Q1,x4),n.reason;let r=_$(t.value);nJ.set(jue,{...r,nodes:gJ(By(),r.nodes,n.value)})},errorComponent:J9,component:J9}),ICe=Ia({routeTree:Y9.addChildren([NCe,PCe,FCe]),defaultPreload:`intent`,basepath:xy()}),X9=e=>typeof e==`string`&&e.includes(`ResizeObserver loop`);function LCe(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)return e.message}(()=>{if(window.__resizeObserverPatched||!window.ResizeObserver)return;let e=window.ResizeObserver;window.ResizeObserver=class extends e{constructor(e){super((t,n)=>{window.requestAnimationFrame(()=>e(t,n))})}},window.__resizeObserverPatched=!0})(),window.addEventListener(`error`,e=>{X9(e.message)&&(e.preventDefault(),e.stopImmediatePropagation())}),window.addEventListener(`unhandledrejection`,e=>{X9(LCe(e.reason))&&e.preventDefault()});var Z9=document.getElementById(`root`);if(!Z9)throw Error(`Root element not found`);var Q9=(0,zh.createRoot)(Z9);Q9.render((0,Y.jsx)(Rte,{}));var $9=await Vy();Q9.render($9.ok?(0,Y.jsx)(Hte,{value:By(),children:(0,Y.jsx)(Ute,{value:Qh,children:(0,Y.jsx)(Le,{client:jy,children:(0,Y.jsx)(za,{router:ICe})})})}):(0,Y.jsx)(Bte,{endpoint:`${xy()}/api/extensions`,reason:$9.reason}));
|