@banou/stub 0.0.59 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{anime-seasons-OlRPaNUG.js → anime-seasons-Sn5AGwGE.js} +1 -1
- package/build/assets/index-2HlB7SZv.js +2648 -0
- package/build/assets/{lib-worker--oXTPCmY.js → lib-worker-BndrZI3N.js} +1 -1
- package/build/assets/{lib-worker-CAtrMpYx.js → lib-worker-C98YLtbN.js} +1 -1
- package/build/assets/{lib-worker-anime-seasons-OlRPaNUG.js → lib-worker-anime-seasons-Sn5AGwGE.js} +1 -1
- package/build/assets/lib-worker-index-CDl3F6Py.js +2648 -0
- package/build/assets/{main-DnIv6GDX.js → main-CAGSHpO8.js} +56 -54
- package/build/assets/{worker-CwdUYmJH.js → worker-6zDaiXIC.js} +1 -1
- package/build/assets/{worker-CsKngzyA.js → worker-CNWgVhRO.js} +1 -1
- package/build/index.html +2 -2
- package/build/index.js +1413 -534
- package/fkn.json +1 -1
- package/package.json +1 -1
- package/build/assets/index-AaeFL1HL.js +0 -2654
- package/build/assets/lib-worker-index-C76K1LUo.js +0 -2654
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./worker-
|
|
2
|
-
import{o as e,r as t,s as n}from"./dist-sBTuRPnX.js";import{C as r,D as i,E as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,k as _,l as v,m as y,n as b,p as x,r as S,v as C,w,x as T}from"./embed-title-DRzWo9Be.js";import{$ as E,A as D,B as O,C as k,D as A,E as j,F as M,H as N,I as ee,J as te,K as P,L as ne,M as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./worker-6zDaiXIC.js","./worker-CNWgVhRO.js","./build-CHRBRLpA.js","./country-D8hYH8v4.js","./dist-sBTuRPnX.js","./theme-player-BsVznGeU.js","./player-volume-DTOJyhLh.js","./dist-B_MSi_-2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,r as t,s as n}from"./dist-sBTuRPnX.js";import{C as r,D as i,E as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,k as _,l as v,m as y,n as b,p as x,r as S,v as C,w,x as T}from"./embed-title-DRzWo9Be.js";import{$ as E,A as D,B as O,C as k,D as A,E as j,F as M,H as N,I as ee,J as te,K as P,L as ne,M as re,N as F,O as I,P as ie,Q as L,R as ae,S as oe,T as se,U as ce,V as le,W as ue,X as de,Y as fe,Z as pe,_ as me,a as R,at as z,c as he,ct as ge,d as _e,dt as ve,et as ye,f as be,ft as xe,g as Se,gt as Ce,h as we,ht as Te,i as Ee,it as B,j as De,k as Oe,l as ke,lt as V,m as Ae,mt as je,nt as Me,o as H,ot as U,p as Ne,pt as Pe,q as Fe,rt as Ie,s as W,st as G,t as Le,tt as K,u as Re,v as ze,w as Be,x as Ve,y as He,z as Ue}from"./player-volume-DTOJyhLh.js";import{B as We,D as Ge,G as Ke,J as qe,K as Je,L as Ye,M as Xe,N as Ze,O as Qe,R as $e,T as et,U as tt,V as nt,W as rt,a as it,c as at,d as ot,f as st,g as ct,h as lt,i as ut,k as dt,l as ft,m as pt,n as mt,o as ht,p as gt,q as _t,r as vt,s as yt,t as bt,u as xt,v as St,w as Ct,z as wt}from"./country-D8hYH8v4.js";import{A as Tt,C as Et,D as Dt,E as Ot,O as kt,S as At,T as jt,_ as Mt,a as Nt,b as Pt,c as Ft,f as It,g as Lt,h as Rt,i as zt,j as Bt,k as Vt,l as Ht,m as Ut,n as Wt,o as Gt,p as Kt,r as qt,s as Jt,t as Yt,v as Xt,w as Zt,x as Qt,y as $t}from"./worker-CNWgVhRO.js";import{t as en}from"./remote-D8UjjUy7.js";je();var tn={NAME:`Name`,DOCUMENT:`Document`,OPERATION_DEFINITION:`OperationDefinition`,VARIABLE_DEFINITION:`VariableDefinition`,SELECTION_SET:`SelectionSet`,FIELD:`Field`,ARGUMENT:`Argument`,FRAGMENT_SPREAD:`FragmentSpread`,INLINE_FRAGMENT:`InlineFragment`,FRAGMENT_DEFINITION:`FragmentDefinition`,VARIABLE:`Variable`,INT:`IntValue`,FLOAT:`FloatValue`,STRING:`StringValue`,BOOLEAN:`BooleanValue`,NULL:`NullValue`,ENUM:`EnumValue`,LIST:`ListValue`,OBJECT:`ObjectValue`,OBJECT_FIELD:`ObjectField`,DIRECTIVE:`Directive`,NAMED_TYPE:`NamedType`,LIST_TYPE:`ListType`,NON_NULL_TYPE:`NonNullType`},nn=class extends Error{constructor(e,t,n,r,i,a,o){super(e),this.name=`GraphQLError`,this.message=e,i&&(this.path=i),t&&(this.nodes=Array.isArray(t)?t:[t]),n&&(this.source=n),r&&(this.positions=r),a&&(this.originalError=a);var s=o;if(!s&&a){var c=a.extensions;c&&typeof c==`object`&&(s=c)}this.extensions=s||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return`GraphQLError`}},q,J;function rn(e){return new nn(`Syntax Error: Unexpected token at ${J} in ${e}`)}function an(e){if(e.lastIndex=J,e.test(q))return q.slice(J,J=e.lastIndex)}var on=/ +(?=[^\s])/y;function sn(e){for(var t=e.split(`
|
|
3
3
|
`),n=``,r=0,i=0,a=t.length-1,o=0;o<t.length;o++)on.lastIndex=0,on.test(t[o])&&(o&&(!r||on.lastIndex<r)&&(r=on.lastIndex),i||=o,a=o);for(var s=i;s<=a;s++)s!==i&&(n+=`
|
|
4
4
|
`),n+=t[s].slice(r).replace(/\\"""/g,`"""`);return n}function cn(){for(var e=0|q.charCodeAt(J++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|q.charCodeAt(J++))if(e===35)for(;(e=0|q.charCodeAt(J++))&&e!==10&&e!==13;);J--}function ln(){for(var e=J,t=0|q.charCodeAt(J++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|q.charCodeAt(J++));if(e===J-1)throw rn(`Name`);var n=q.slice(e,--J);return cn(),n}function un(){return{kind:`Name`,value:ln()}}var dn=/(?:"""|(?:[\s\S]*?[^\\])""")/y,fn=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function pn(e){var t;switch(q.charCodeAt(J)){case 91:J++,cn();for(var n=[];q.charCodeAt(J)!==93;)n.push(pn(e));return J++,cn(),{kind:`ListValue`,values:n};case 123:J++,cn();for(var r=[];q.charCodeAt(J)!==125;){var i=un();if(q.charCodeAt(J++)!==58)throw rn(`ObjectField`);cn(),r.push({kind:`ObjectField`,name:i,value:pn(e)})}return J++,cn(),{kind:`ObjectValue`,fields:r};case 36:if(e)throw rn(`Variable`);return J++,{kind:`Variable`,name:un()};case 34:if(q.charCodeAt(J+1)===34&&q.charCodeAt(J+2)===34){if(J+=3,(t=an(dn))==null)throw rn(`StringValue`);return cn(),{kind:`StringValue`,value:sn(t.slice(0,-3)),block:!0}}var a=J,o;J++;var s=!1;for(o=0|q.charCodeAt(J++);o===92&&(J++,s=!0)||o!==10&&o!==13&&o!==34&&o;o=0|q.charCodeAt(J++));if(o!==34)throw rn(`StringValue`);return t=q.slice(a,J),cn(),{kind:`StringValue`,value:s?JSON.parse(t):t.slice(1,-1),block:!1};case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var c=J++,l;(l=0|q.charCodeAt(J++))>=48&&l<=57;);var u=q.slice(c,--J);if((l=q.charCodeAt(J))===46||l===69||l===101){if((t=an(fn))==null)throw rn(`FloatValue`);return cn(),{kind:`FloatValue`,value:u+t}}return cn(),{kind:`IntValue`,value:u};case 110:if(q.charCodeAt(J+1)===117&&q.charCodeAt(J+2)===108&&q.charCodeAt(J+3)===108)return J+=4,cn(),{kind:`NullValue`};break;case 116:if(q.charCodeAt(J+1)===114&&q.charCodeAt(J+2)===117&&q.charCodeAt(J+3)===101)return J+=4,cn(),{kind:`BooleanValue`,value:!0};break;case 102:if(q.charCodeAt(J+1)===97&&q.charCodeAt(J+2)===108&&q.charCodeAt(J+3)===115&&q.charCodeAt(J+4)===101)return J+=5,cn(),{kind:`BooleanValue`,value:!1}}return{kind:`EnumValue`,value:ln()}}function mn(e){if(q.charCodeAt(J)===40){var t=[];J++,cn();do{var n=un();if(q.charCodeAt(J++)!==58)throw rn(`Argument`);cn(),t.push({kind:`Argument`,name:n,value:pn(e)})}while(q.charCodeAt(J)!==41);return J++,cn(),t}}function hn(e){if(q.charCodeAt(J)===64){var t=[];do J++,t.push({kind:`Directive`,name:un(),arguments:mn(e)});while(q.charCodeAt(J)===64);return t}}function gn(){for(var e=0;q.charCodeAt(J)===91;)e++,J++,cn();var t={kind:`NamedType`,name:un()};do if(q.charCodeAt(J)===33&&(J++,cn(),t={kind:`NonNullType`,type:t}),e){if(q.charCodeAt(J++)!==93)throw rn(`NamedType`);cn(),t={kind:`ListType`,type:t}}while(e--);return t}function _n(){if(q.charCodeAt(J++)!==123)throw rn(`SelectionSet`);return cn(),vn()}function vn(){var e=[];do if(q.charCodeAt(J)===46){if(q.charCodeAt(++J)!==46||q.charCodeAt(++J)!==46)throw rn(`SelectionSet`);switch(J++,cn(),q.charCodeAt(J)){case 64:e.push({kind:`InlineFragment`,typeCondition:void 0,directives:hn(!1),selectionSet:_n()});break;case 111:q.charCodeAt(J+1)===110?(J+=2,cn(),e.push({kind:`InlineFragment`,typeCondition:{kind:`NamedType`,name:un()},directives:hn(!1),selectionSet:_n()})):e.push({kind:`FragmentSpread`,name:un(),directives:hn(!1)});break;case 123:J++,cn(),e.push({kind:`InlineFragment`,typeCondition:void 0,directives:void 0,selectionSet:vn()});break;default:e.push({kind:`FragmentSpread`,name:un(),directives:hn(!1)})}}else{var t=un(),n=void 0;q.charCodeAt(J)===58&&(J++,cn(),n=t,t=un());var r=mn(!1),i=hn(!1),a=void 0;q.charCodeAt(J)===123&&(J++,cn(),a=vn()),e.push({kind:`Field`,alias:n,name:t,arguments:r,directives:i,selectionSet:a})}while(q.charCodeAt(J)!==125);return J++,cn(),{kind:`SelectionSet`,selections:e}}function yn(){if(cn(),q.charCodeAt(J)===40){var e=[];J++,cn();do{var t=void 0;if(q.charCodeAt(J)===34&&(t=pn(!0)),q.charCodeAt(J++)!==36)throw rn(`Variable`);var n=un();if(q.charCodeAt(J++)!==58)throw rn(`VariableDefinition`);cn();var r=gn(),i=void 0;q.charCodeAt(J)===61&&(J++,cn(),i=pn(!0)),cn();var a={kind:`VariableDefinition`,variable:{kind:`Variable`,name:n},type:r,defaultValue:i,directives:hn(!0)};t&&(a.description=t),e.push(a)}while(q.charCodeAt(J)!==41);return J++,cn(),e}}function bn(e){var t=un();if(q.charCodeAt(J++)!==111||q.charCodeAt(J++)!==110)throw rn(`FragmentDefinition`);cn();var n={kind:`FragmentDefinition`,name:t,typeCondition:{kind:`NamedType`,name:un()},directives:hn(!1),selectionSet:_n()};return e&&(n.description=e),n}function xn(){var e=[];do{var t=void 0;if(q.charCodeAt(J)===34&&(t=pn(!0)),q.charCodeAt(J)===123){if(t)throw rn(`Document`);J++,cn(),e.push({kind:`OperationDefinition`,operation:`query`,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:vn()})}else{var n=ln();switch(n){case`fragment`:e.push(bn(t));break;case`query`:case`mutation`:case`subscription`:var r,i=void 0;(r=q.charCodeAt(J))!==40&&r!==64&&r!==123&&(i=un());var a={kind:`OperationDefinition`,operation:n,name:i,variableDefinitions:yn(),directives:hn(!1),selectionSet:_n()};t&&(a.description=t),e.push(a);break;default:throw rn(`Document`)}}}while(J<q.length);return e}function Sn(e,t){return q=e.body?e.body:e,J=0,cn(),t&&t.noLocation?{kind:`Document`,definitions:xn()}:{kind:`Document`,definitions:xn(),loc:{start:0,end:q.length,startToken:void 0,endToken:void 0,source:{body:q,name:`graphql.web`,locationOffset:{line:1,column:1}}}}}function Cn(e,t,n){for(var r=``,i=0;i<e.length;i++)i&&(r+=t),r+=n(e[i]);return r}function wn(e){return JSON.stringify(e)}function Tn(e){return`"""
|
|
5
5
|
`+e.replace(/"""/g,`\\"""`)+`
|
|
@@ -19,7 +19,7 @@ import{o as e,r as t,s as n}from"./dist-sBTuRPnX.js";import{C as r,D as i,E as a
|
|
|
19
19
|
`)){var r=n.match(Vr);if(r){var i=r[1];try{yield t=JSON.parse(i)}catch(e){if(!t)throw e}if(t&&!1===t.hasNext)break}}t&&!1!==t.hasNext&&(yield{hasNext:!1})}(a):/text\//i.test(o)?async function*(e){var t=await e.text();try{yield JSON.parse(t)}catch{throw Error(t)}}(a):async function*(e){yield JSON.parse(await e.text())}(a),c;for await(var l of s)l.pending&&!i?c=l.pending:l.pending&&(c=[...c,...l.pending]),i=i?Nr(i,l,a,c):jr(e,l,a),r=!1,yield i,r=!0;i||(yield i=jr(e,{},a))}catch(t){if(!r)throw t;yield Pr(e,a&&(a.status<200||a.status>=300)&&a.statusText?Error(a.statusText):t,a)}}function Gr(e,t,n){var r;return typeof AbortController<`u`&&(n.signal=(r=new AbortController).signal),Hn((()=>{r&&r.abort()}))(Ln((e=>!!e))(Zn(Wr(e,t,n))))}function Kr(e){var t=t=>e(t);return t.toPromise=()=>sr(qn(1)(Ln((e=>!e.stale&&!e.hasNext))(t))),t.then=(e,n)=>t.toPromise().then(e,n),t.subscribe=e=>ar(e)(t),t}function qr(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Jr=()=>{},Yr=({forward:e,dispatchDebug:t})=>t=>Vn([zn((e=>{var n=Fr(e),r=Ir(e,n),i=zr(e,n);return Jn(Ln((t=>t.kind===`teardown`&&t.key===e.key))(t))(Gr(e,r,i))}))(Ln((e=>e.kind!==`teardown`&&(e.kind!==`subscription`||!!e.context.fetchSubscriptions)))(t)),e(Ln((e=>e.kind===`teardown`||e.kind===`subscription`&&!e.context.fetchSubscriptions))(t))]),Xr=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight(((e,n)=>n({client:t,forward(t){return Gn(e(Gn(t)))},dispatchDebug(e){}})),n),Zr=({onOperation:e,onResult:t,onError:n})=>({forward:r})=>i=>zn((e=>{n&&e.error&&n(e.error,e.operation);var r=t&&t(e)||e;return`then`in r?ir(r):er(r)}))(r(zn((t=>{var n=e&&e(t)||t;return`then`in n?ir(n):er(n)}))(i))),Qr=({dispatchDebug:e})=>e=>Ln((e=>!1))(e),$r=function e(t){var n=0,r=new Map,i=new Map,a=new Set,o=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||`cache-first`},c=nr();function l(e){e.kind!==`mutation`&&e.kind!==`teardown`&&a.has(e.key)||(e.kind===`teardown`?a.delete(e.key):e.kind!==`mutation`&&a.add(e.key),c.next(e))}var u=!1;function d(e){if(e&&l(e),!u){for(u=!0;u&&(e=o.shift());)l(e);u=!1}}var f=e=>{var t=Jn(Ln((t=>t.kind===`teardown`&&t.key===e.key))(c.source))(Ln((t=>t.operation.kind===e.kind&&t.operation.key===e.key&&(!t.operation.context._instance||t.operation.context._instance===e.context._instance)))(g));return t=e.kind===`query`?Kn((t=>{var n=er(t);return t.stale||t.hasNext?n:Vn([n,Rn((()=>(t.stale=!0,t)))(qn(1)(Ln((t=>t.key===e.key))(c.source)))])}))(t):Yn((e=>!!e.hasNext),!0)(t),t=e.kind===`mutation`?Wn((()=>{l(e)}))(t):Hn((()=>{a.delete(e.key),r.delete(e.key),i.delete(e.key),u=!1;for(var t=o.length-1;t>=0;t--)o[t].key===e.key&&o.splice(t,1);l(qr(`teardown`,e,e.context))}))(Un((t=>{if(t.stale){if(!t.hasNext)a.delete(e.key);else for(var n=0;n<o.length;n++){var i=o[n];if(i.key===t.operation.key){a.delete(i.key);break}}}else t.hasNext||a.delete(e.key);r.set(e.key,t)}))(t)),Gn(t)},p=this instanceof e?this:Object.create(e.prototype),m=Object.assign(p,{suspense:!!t.suspense,operations$:c.source,reexecuteOperation(e){if(e.kind===`teardown`)d(e);else if(e.kind===`mutation`)o.push(e),Promise.resolve().then(d);else if(i.has(e.key)){for(var t=!1,n=0;n<o.length;n++)o[n].key===e.key&&(o[n]=e,t=!0);t||a.has(e.key)&&e.context.requestPolicy!==`network-only`?(a.delete(e.key),Promise.resolve().then(d)):(o.push(e),Promise.resolve().then(d))}},createRequestOperation(e,t,r){return r||={},qr(e,t,{_instance:e===`mutation`?n=n+1|0:void 0,...s,...r,requestPolicy:r.requestPolicy||s.requestPolicy,suspense:r.suspense||!1!==r.suspense&&m.suspense})},executeRequestOperation(e){return e.kind===`mutation`?Kr(f(e)):Kr(Xn((()=>{var t=i.get(e.key);t||i.set(e.key,t=f(e)),t=Wn((()=>{d(e)}))(t);var n=r.get(e.key);return e.kind===`query`&&n&&(n.stale||n.hasNext)?Kn(er)(Vn([t,Ln((t=>t===r.get(e.key)))(er(n))])):t})))},executeQuery(e,t){var n=m.createRequestOperation(`query`,e,t);return m.executeRequestOperation(n)},executeSubscription(e,t){var n=m.createRequestOperation(`subscription`,e,t);return m.executeRequestOperation(n)},executeMutation(e,t){var n=m.createRequestOperation(`mutation`,e,t);return m.executeRequestOperation(n)},readQuery(e,t,n){var r=null;return ar((e=>{r=e}))(m.query(e,t,n)).unsubscribe(),r},query:(e,t,n)=>m.executeQuery(kr(e,t),n),subscription:(e,t,n)=>m.executeSubscription(kr(e,t),n),mutation:(e,t,n)=>m.executeMutation(kr(e,t),n)}),h=Jr,g=Gn(Xr(t.exchanges)({client:m,dispatchDebug:h,forward:Qr({dispatchDebug:h})})(c.source));return or(g),m};pe();var ei=xe({}),ti=ei.Provider;ei.Consumer,ei.displayName=`UrqlContext`;var ni=()=>ge(ei),ri={fetching:!1,stale:!1,hasNext:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0},ii=(e,t)=>e===t||!(!e||!t||e.key!==t.key),ai=(e,t)=>{var n={...e,...t,data:t.data!==void 0||t.error?t.data:e.data,fetching:!!t.fetching,stale:!!t.stale};return((e,t)=>{for(var n in e)if(!(n in t))return!0;for(var r in t)if(r===`operation`?!ii(e[r],t[r]):e[r]!==t[r])return!0;return!1})(e,n)?n:e},oi=(e,t)=>{for(var n=0,r=t.length;n<r;n++)if(e[n]!==t[n])return!0;return!1};function si(e,t){e(t)}function ci(e){var t=K(!0),n=ni(),[r,i]=U(ri),a=z(((r,a)=>(si(i,{...ri,fetching:!0}),sr(qn(1)(Ln((e=>!e.hasNext))(Un((e=>{t.current&&si(i,{fetching:!1,stale:e.stale,data:e.data,error:e.error,extensions:e.extensions,operation:e.operation,hasNext:e.hasNext})}))(n.executeMutation(kr(e,r),a||{}))))))),[n,e,i]);return B((()=>(t.current=!0,()=>{t.current=!1})),[]),[r,a]}function li(e,t){var n=K(void 0);return V((()=>{var r=kr(e,t);return n.current!==void 0&&n.current.key===r.key?n.current:(n.current=r,r)}),[e,t])}function ui(e,t){var n=ni(),r=li(e.query,e.variables),i=K(t);i.current=t;var a=V((()=>e.pause?null:n.executeSubscription(r,e.context)),[n,r,e.pause,e.context]),o=[n,r,e.context,e.pause],[s,c]=U((()=>[a,{...ri,fetching:!!a},o])),l=s[1];a!==s[0]&&oi(s[2],o)&&c([a,l=ai(s[1],{fetching:!!a}),o]),B((()=>{var e=e=>{si(c,(t=>{var n=ai(t[1],e);return t[1]===n?t:(i.current&&n.data!=null&&t[1].data!==n.data&&(n.data=i.current(t[1].data,n.data)),[t[0],n,t[2]])}))};if(s[0])return ar(e)(Hn((()=>{e({fetching:!!a})}))(s[0])).unsubscribe;e({fetching:!1})}),[s[0]]);var u=z((t=>{var i=n.executeSubscription(r,{...e.context,...t});si(c,(e=>[i,e[1],o]))}),[n,r,e.context,e.pause]);return[l,u]}G();var di=()=>`https://fkn.app/connect-button`,fi=`stub-source@1`,pi=`stub-enabled-plugins`,mi=`stub-account-plugins`,hi=()=>{try{return globalThis.localStorage}catch{return}},gi=e=>{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]},_i=(e,t)=>{try{let n=t?.getItem(e);return n==null?void 0:gi(n)}catch{return[]}},vi=(e=hi())=>[...new Set([...xi(e)??[],...yi(e)])],yi=(e=hi())=>_i(`stub-enabled-plugins`,e)??[],bi=(e,t=hi())=>{try{t?.setItem(pi,JSON.stringify(e))}catch{}},xi=(e=hi())=>_i(mi,e),Si=(e,t=hi())=>{try{e?t?.setItem(mi,JSON.stringify(e)):t?.removeItem(mi)}catch{}},Ci=[`mal`,`anilist`,`kitsu`,`anidb`],wi=function(e){return e.Anime=`ANIME`,e.Movie=`MOVIE`,e.Series=`SERIES`,e}({}),Ti=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),Ei=function(e){return e.Fall=`FALL`,e.Spring=`SPRING`,e.Summer=`SUMMER`,e.Winter=`WINTER`,e}({}),Di=function(e){return e.Popularity=`POPULARITY`,e.PopularityDesc=`POPULARITY_DESC`,e}({}),Oi=function(e){return e.Cancelled=`CANCELLED`,e.Finished=`FINISHED`,e.Hiatus=`HIATUS`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Releasing=`RELEASING`,e}({}),ki=function(e){return e.Anime=`ANIME`,e.LiveAction=`LIVE_ACTION`,e.Movie=`MOVIE`,e.Ona=`ONA`,e.Ova=`OVA`,e.Special=`SPECIAL`,e.Tv=`TV`,e.TvShort=`TV_SHORT`,e}({}),Ai=function(e){return e.IsApiOnly=`IS_API_ONLY`,e.IsNotApiOnly=`IS_NOT_API_ONLY`,e}({}),ji=function(e){return e.Ambiguous=`AMBIGUOUS`,e.Error=`ERROR`,e.Listed=`LISTED`,e.Loading=`LOADING`,e.NotListed=`NOT_LISTED`,e.NoId=`NO_ID`,e.Paused=`PAUSED`,e.SignedOut=`SIGNED_OUT`,e}({}),Mi={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Ni={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Pi={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},Fi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`MediaTracking`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`TrackingInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracking`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`disagreements`}},{kind:`Field`,name:{kind:`Name`,value:`summary`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}},{kind:`Field`,name:{kind:`Name`,value:`answers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`state`}},{kind:`Field`,name:{kind:`Name`,value:`candidates`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`tracker`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`canWrite`}},{kind:`Field`,name:{kind:`Name`,value:`statuses`}},{kind:`Field`,name:{kind:`Name`,value:`account`}},{kind:`Field`,name:{kind:`Name`,value:`scoreScale`}},{kind:`Field`,name:{kind:`Name`,value:`canClearScore`}}]}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]}}]},Ii={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`SaveListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`SaveListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`saveListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]},Li={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`DeleteListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`DeleteListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`deleteListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Ri={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`StubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`stubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},zi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`AddHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`addHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Bi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetReleasingMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Vi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaDetails`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`details`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}}},defaultValue:{kind:`BooleanValue`,value:!1}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`description`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`categories`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`endDate`}},{kind:`Field`,name:{kind:`Name`,value:`season`}},{kind:`Field`,name:{kind:`Name`,value:`seasonYear`}},{kind:`Field`,name:{kind:`Name`,value:`averageScore`}},{kind:`Field`,name:{kind:`Name`,value:`genres`}},{kind:`Field`,name:{kind:`Name`,value:`tags`}},{kind:`Field`,name:{kind:`Name`,value:`franchise`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`edges`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`from`}},{kind:`Field`,name:{kind:`Name`,value:`to`}},{kind:`Field`,name:{kind:`Name`,value:`relation`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`relations`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`runtime`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`settled`}},{kind:`Field`,name:{kind:`Name`,value:`seasons`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`number`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}}]}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}},{kind:`Field`,name:{kind:`Name`,value:`airingSchedule`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}},{kind:`Field`,name:{kind:`Name`,value:`duration`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}]},{kind:`Field`,name:{kind:`Name`,value:`sourceMaterial`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}]},{kind:`Field`,name:{kind:`Name`,value:`studios`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}]},{kind:`Field`,name:{kind:`Name`,value:`characters`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`image`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`role`}},{kind:`Field`,name:{kind:`Name`,value:`voiceActors`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`image`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`language`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`staff`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`image`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`roles`}}]}},{kind:`Field`,name:{kind:`Name`,value:`themes`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`kind`}},{kind:`Field`,name:{kind:`Name`,value:`sequence`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`artists`}},{kind:`Field`,name:{kind:`Name`,value:`video`}}]}},{kind:`Field`,name:{kind:`Name`,value:`ratings`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`include`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`details`}}}]}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`source`}},{kind:`Field`,name:{kind:`Name`,value:`value`}},{kind:`Field`,name:{kind:`Name`,value:`scale`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Hi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`OriginFragment`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},Ui={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`SearchMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`genres`}},{kind:`Field`,name:{kind:`Name`,value:`tags`}},{kind:`Field`,name:{kind:`Name`,value:`averageScore`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`season`}},{kind:`Field`,name:{kind:`Name`,value:`seasonYear`}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Wi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchMedia`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`categories`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`settled`}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}},{kind:`Field`,name:{kind:`Name`,value:`seasons`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`number`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}}]}},{kind:`Field`,name:{kind:`Name`,value:`relations`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`embedUrl`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}}]}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Gi={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]}}]}}]},Ki=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Ji.unregister(this),e}free(){let e=this.__destroy_into_raw();Y.__wbg_haystacks_free(e,0)}bytesView(){return Y.haystacks_bytesView(this.__wbg_ptr)}clear(){Y.haystacks_clear(this.__wbg_ptr)}commit(e,t){let n=Y.haystacks_commit(this.__wbg_ptr,e,t);if(n[1])throw aa(n[0])}get length(){return Y.haystacks_length(this.__wbg_ptr)>>>0}constructor(e){var t=na(e)?0:ra(e,Y.__wbindgen_malloc),n=sa;let r=Y.haystacks_new(t,n);return this.__wbg_ptr=r,Ji.register(this,this.__wbg_ptr,this),this}offsetsView(){return Y.haystacks_offsetsView(this.__wbg_ptr)}push(e){let t=ra(e,Y.__wbindgen_malloc),n=sa;Y.haystacks_push(this.__wbg_ptr,t,n)}reserve(e,t){Y.haystacks_reserve(this.__wbg_ptr,e,t)}};Symbol.dispose&&(Ki.prototype[Symbol.dispose]=Ki.prototype.free);var qi=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,Yi.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Yi.unregister(this),e}free(){let e=this.__destroy_into_raw();Y.__wbg_matcher_free(e,0)}static fromPatterns(t,n){let r=Y.matcher_fromPatterns(t,na(n)?0:Xi(n));if(r[2])throw aa(r[1]);return e.__wrap(r[0])}static fromQuery(t,n){let r=ia(t,Y.__wbindgen_malloc,Y.__wbindgen_realloc),i=sa,a=Y.matcher_fromQuery(r,i,na(n)?0:Xi(n));if(a[2])throw aa(a[1]);return e.__wrap(a[0])}matchHaystacks(e){return Zi(e,Ki),Y.matcher_matchHaystacks(this.__wbg_ptr,e.__wbg_ptr)}matchHaystacksIndices(e){return Zi(e,Ki),Y.matcher_matchHaystacksIndices(this.__wbg_ptr,e.__wbg_ptr)}matchList(e){let t=ra(e,Y.__wbindgen_malloc),n=sa;return Y.matcher_matchList(this.__wbg_ptr,t,n)}matchListIndices(e){let t=ra(e,Y.__wbindgen_malloc),n=sa;return Y.matcher_matchListIndices(this.__wbg_ptr,t,n)}matchOne(e,t){let n=ia(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),r=sa;return Y.matcher_matchOne(this.__wbg_ptr,n,r,t)}matchOneIndices(e,t){let n=ia(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),r=sa;return Y.matcher_matchOneIndices(this.__wbg_ptr,n,r,t)}constructor(e,t){let n=ia(e,Y.__wbindgen_malloc,Y.__wbindgen_realloc),r=sa,i=Y.matcher_new(n,r,na(t)?0:Xi(t));if(i[2])throw aa(i[1]);return this.__wbg_ptr=i[0],Yi.register(this,this.__wbg_ptr,this),this}setConfig(e){let t=Y.matcher_setConfig(this.__wbg_ptr,e);if(t[1])throw aa(t[0])}setPattern(e){let t=Y.matcher_setPattern(this.__wbg_ptr,e);if(t[1])throw aa(t[0])}setPatterns(e){let t=Y.matcher_setPatterns(this.__wbg_ptr,e);if(t[1])throw aa(t[0])}};Symbol.dispose&&(qi.prototype[Symbol.dispose]=qi.prototype.free);var Ji=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>Y.__wbg_haystacks_free(e,1)),Yi=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>Y.__wbg_matcher_free(e,1));function Xi(e){let t=Y.__externref_table_alloc();return Y.__wbindgen_externrefs.set(t,e),t}function Zi(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}var Qi=null;function $i(){return(Qi===null||Qi.buffer.detached===!0||Qi.buffer.detached===void 0&&Qi.buffer!==Y.memory.buffer)&&(Qi=new DataView(Y.memory.buffer)),Qi}var ea=null;function ta(){return(ea===null||ea.byteLength===0)&&(ea=new Uint8Array(Y.memory.buffer)),ea}function na(e){return e==null}function ra(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=Xi(e[t]);$i().setUint32(n+4*t,r,!0)}return sa=e.length,n}function ia(e,t,n){if(n===void 0){let n=oa.encode(e),r=t(n.length,1)>>>0;return ta().subarray(r,r+n.length).set(n),sa=n.length,r}let r=e.length,i=t(r,1)>>>0,a=ta(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=ta().subarray(i+o,i+r),a=oa.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return sa=o,i}function aa(e){let t=Y.__wbindgen_externrefs.get(e);return Y.__externref_table_dealloc(e),t}new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode();var oa=new TextEncoder;`encodeInto`in oa||(oa.encodeInto=function(e,t){let n=oa.encode(e);return t.set(n),{read:e.length,written:n.length}});var sa=0,Y,ca=new TextEncoder;function la(e,t){let n=0;for(let e of t)n+=e.length*3;e.reserve(n,t.length);let r=e.bytesView(),i=e.offsetsView(),a=0;for(let e=0;e<t.length;e++)a+=ca.encodeInto(t[e],r.subarray(a)).written,i[e]=a;return e.commit(a,t.length),e}var ua=class extends Ki{constructor(e){super(),e?.length&&la(this,e)}push(e){la(this,e)}},da;function fa(e){return da??=new ua,da.clear(),la(da,e)}qi.prototype.matchList=function(e){return this.matchHaystacks(e instanceof Ki?e:fa(e))},qi.prototype.matchListIndices=function(e){return this.matchHaystacksIndices(e instanceof Ki?e:fa(e))};var pa=[`winter`,`spring`,`summer`,`fall`],ma=(e=new Date)=>({season:pa[Math.floor(e.getMonth()/3)],year:e.getFullYear()}),ha=e=>e.toUpperCase(),ga=(e=new Date)=>{let{season:t,year:n}=ma(e);return{season:ha(t),year:n}},_a=String.raw`(?:\s|<\/?br\s*\/?>)*`,va=String.raw`(?:\(Source:[^()]*\)|\[Written by MAL Rewrite\]|(?<=[\n>])Source:[^\n<]*)`;RegExp(`${_a}${va}(?:${_a}$|(?=${_a}<(?:i|em)>))`,`i`);var ya=`\\u002d\\u2013\\u2014\\u007e\\uff5e\\u301c`;RegExp(`(?:^|\\s)([${ya}])\\s*[^${ya}]{2,}\\s*\\1\\s*$`),ki.Tv,ki.TvShort,ki.Movie,ki.Ova,ki.Ona,ki.Special,new Set(Ci);var ba=`tracking/v1/`,xa=18e4,Sa={changed:!0},Ca=()=>{let e=0;return{moved:()=>{e+=1},begin:()=>{let t=e,n=()=>e===t;return{call:e=>n()?e():Promise.resolve(Sa),current:n}}}},wa=`sources/v1/list.json`,Ta=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ea=({cloud:e,onAccountChange:t,lock:n,storage:r,onList:i})=>{let a=Ca(),o=vi(r),s=new Set,c=async()=>{let{call:t,current:n}=a.begin(),c=vi(r),l=await e.availability();if(l===`unknown`)return;let u;if(l===`connected`){if(!await e.unlocked())return;let n=await t(()=>e.read(wa));if(!(`ok`in n)&&!(`missing`in n))return;let i=`ok`in n?gi(n.ok):[],a=[...s],o=[...new Set([...i,...yi(r)])].filter(e=>!a.includes(e));if(!Ta(o,i)&&!(`ok`in await t(()=>e.write(`sources/v1/list.json`,JSON.stringify(o)))))return;for(let e of a)s.delete(e);u=o}if(!Ta(vi(r),c)||(u&&bi(yi(r).filter(e=>!u.includes(e)),r),!n()))return;Si(u,r);let d=vi(r);if(Ta(d,o))return;let f=o;o=d,i(f,d)},l=e=>n(e).catch(e=>console.warn(`sources: account list`,e));return t(()=>{a.moved(),l(c)}),{check:()=>l(c),add:e=>(s.delete(e),bi([...new Set([...yi(r),e])],r),o=[...new Set([...o,e])],l(c)),remove:e=>{bi(yi(r).filter(t=>t!==e),r);let t=xi(r);return t&&(Si(t.filter(t=>t!==e),r),s.add(e)),o=o.filter(t=>t!==e),l(c)}}},Da=`FKN_E2E_LOCKED`,Oa=`FKN_STORAGE_NOT_FOUND`,ka=`FKN_ACCOUNT_CHANGED`,Aa=`fkn:account-changed`,ja=`FKN_ACCOUNT_PIN_UNSUPPORTED`,Ma=`FKN has to update before this list can reach your FKN account`,Na=e=>{let t=e?.code,n=e instanceof Error?e.message:String(e);return t===Da?{locked:!0}:t===Oa?{missing:!0}:t===ka||n.startsWith(Aa)?{changed:!0}:t===ja?{error:Ma}:{error:n}},Pa=((e,{timeoutMs:t=8e3}={})=>{let n=(e,n)=>new Promise(r=>{let i=setTimeout(()=>r(n),t);new Promise(t=>t(e())).then(e=>{clearTimeout(i),r(e)},()=>{clearTimeout(i),r(n)})}),r=e=>new Promise(n=>{let r=setTimeout(()=>n({error:`FKN storage did not answer`}),t);new Promise(t=>t(e())).then(e=>{clearTimeout(r),n({ok:e})},e=>{clearTimeout(r),n(Na(e))})});return{availability:()=>n(()=>e.availability(),`unknown`),unlocked:()=>n(async()=>(await e.encryption()).unlocked===!0,!1),list:()=>r(async()=>(await e.list()).filter(e=>e.path.startsWith(ba)).map(({path:e,updatedAt:t})=>({path:e,updatedAt:t}))),read:t=>r(async()=>{let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}),write:(t,n)=>r(async()=>(await e.writeFile(t,n),!0))}})({availability:Je,list:rt,encryption:_t,readFile:e=>tt.readFile(e,{encoding:`utf8`}),writeFile:(e,t)=>tt.writeFile(e,t)}),Fa=We,Ia=()=>Ke().catch(()=>!1),La=3e3,Ra=new Map,za=new Set,Ba=()=>za.forEach(e=>{try{e()}catch{}}),Va=e=>(za.add(e),()=>{za.delete(e)}),Ha=()=>vi().map(e=>Ra.get(e)??{uri:e,state:`connecting`}),Ua=()=>vi(),Wa=(e,t)=>{Ra.set(e,{uri:e,...t}),Ba()},Ga=45e3,Ka=(e,t)=>Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(t)),Ga))]),qa=new Set,Ja=new Map,Ya=3e4,Xa=(e,t)=>{if(!vi().includes(e)||qa.has(e)||Ja.has(e))return;Ra.get(e)?.state!==`error`&&Wa(e,{state:`connecting`});let n=Math.min(La*t,Ya),r=setTimeout(()=>{Ja.delete(e),Za(e,t+1).catch(()=>{})},n);Ja.set(e,r)},Za=async(e,t=1)=>{if(!qa.has(e)){qa.add(e),Wa(e,{state:`connecting`});try{let{port:t,closed:n}=await Ka(wt.connect(e,{protocol:fi,raw:!0}),`connecting to '${e}' timed out`);n.then(()=>{qa.delete(e),Ut(e),Xa(e,1)});let r=await Ka(Promise.race([Gt(t,e),n.then(()=>({error:`the plugin closed while connecting`}))]),`'${e}' did not finish connecting`);if(`error`in r)throw Error(r.error);Wa(e,{state:`connected`,sources:r.ok.sources,rejected:r.ok.rejected})}catch(n){throw qa.delete(e),console.warn(`Plugin '${e}' failed to connect:`,n),Wa(e,{state:`error`}),Xa(e,t+1),n}}},Qa=e=>{let t=Ja.get(e);t!==void 0&&(clearTimeout(t),Ja.delete(e))},$a=e=>{Qa(e),qa.delete(e),Ra.delete(e),Ut(e)},eo=Ea({cloud:Pa,onAccountChange:Fa,lock:e=>typeof navigator<`u`&&navigator.locks?navigator.locks.request(`stub:source-list`,e):e(),onList:(e,t)=>{for(let n of e)t.includes(n)||($a(n),wt.uninstall(n).catch(()=>{}));Ba();for(let n of t)e.includes(n)||wt.install(n,{noConfirm:!0}).then(e=>{if(!e)throw Error(`FKN did not install '${n}'`);Za(n).catch(()=>{})}).catch(e=>{console.warn(`Plugin '${n}' could not be installed:`,e),Wa(n,{state:`error`})})}}),to=()=>eo.check(),no=async(e,t)=>{let n=await wt.install(e,t);return n?(eo.add(n.uri),n.uri):null},ro=async e=>{let t=await no(e);return t&&Za(t).catch(()=>{}),t},io=async(e,t)=>{let n=await no(e,t);return n&&await Za(n),n},ao=async e=>{eo.remove(e),$a(e),Ba(),await wt.uninstall(e).catch(()=>{})},oo=async()=>{let e=await wt.pick({type:`plugin`,id:`stub`},{multiple:!0,title:`Add stub sources`});for(let t of e)await io(t.uri).catch(()=>{})};for(let e of vi())Za(e).catch(()=>{});var so=`stub.sources.hidden-icons`,co=()=>{try{let e=JSON.parse(ot.getItem(`stub.sources.hidden-icons`)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}},lo=(e,t)=>{let n=new Set(co());t?n.delete(e):n.add(e);try{n.size?ot.setItem(so,JSON.stringify([...n])):ot.removeItem(so)}catch{}},uo=e=>ot.watch(so,e),fo=()=>{let[e,t]=U(()=>new Set(co()));return B(()=>uo(()=>t(new Set(co()))),[]),e},po=`stub.sources.play-order`,mo=[`cr`,`amazon`,`nf`],ho=()=>{try{let e=JSON.parse(ot.getItem(`stub.sources.play-order`)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}},go=e=>{try{ot.setItem(po,JSON.stringify(e))}catch{}},_o=e=>ot.watch(po,e),vo=(e,t)=>[...new Set([...e,...mo,...t])],yo=(e,t,n,r=e)=>{let i=r[r.indexOf(t)+n];if(!i||!r.includes(t))return[...e];let a=e.filter(e=>e!==t);return a.splice(a.indexOf(i)+ +(n>0),0,t),a},bo=`stub.tracking.compact`,xo={targets:{}},So=e=>{try{let t=JSON.parse(e??`null`);return{targets:Object.fromEntries(Object.entries(t?.targets??{}).filter(([,e])=>typeof e==`boolean`))}}catch{return xo}},Co=((e=ot)=>{let t;return{read:()=>{if(t)return t;try{return So(e?.getItem(bo))}catch{return xo}},write:n=>{try{if(!e)throw Error(`No storage`);e.setItem(bo,JSON.stringify(n)),t=void 0}catch{t=n}}}})(),wo=e=>ot.watch(bo,e),To=`stub.player.autoplay`,Eo=()=>ot.getItem(To)!==`off`,Do=e=>{try{e?ot.removeItem(To):ot.setItem(To,`off`)}catch{}},Oo=e=>ot.watch(To,e),ko=e=>Math.max(1,e),Ao={POINT_100:{step:1,native:e=>Math.round(e),raw:e=>e},POINT_10_DECIMAL:{step:1,native:e=>Math.round(e)/10,raw:e=>Math.round(e*10)},POINT_10:{step:10,native:e=>ko(Math.floor(e/10)),raw:e=>e*10},POINT_5:{step:20,native:e=>ko(Math.round(e/20)),raw:e=>e*20},POINT_3:{step:33,native:e=>e<36?1:e<61?2:3,raw:e=>[30,50,85][e-1]??85}},jo=e=>Ao[e??``]??Ao.POINT_100,Mo=e=>e!=null&&e>0,No=(e,t)=>jo(t).native(e),Po=(e,t)=>{let{native:n,raw:r}=jo(t);return r(n(e))},Fo=(e,t)=>jo(t).step>jo(e).step?t:e,Io={WATCHING:`Watching`,REWATCHING:`Rewatching`,PLANNING:`Plan to watch`,COMPLETED:`Completed`,PAUSED:`Paused`,DROPPED:`Dropped`},Lo=new Set([`LISTED`,`NOT_LISTED`]),Ro=e=>e.tracker.canWrite&&Lo.has(e.state),zo=e=>e.error||(e.state===`PAUSED`?`Paused for a while`:`Could not answer`),Bo=(e,t)=>{let n=e?.summary;return{status:n?.status??null,progress:n?.progress??0,score:Mo(n?.score)?n.score:null,total:n?.episodeCount??t??null,differs:[...e?.disagreements??[]]}},Vo=e=>e.entry?.episodeCount??e.episodeCount,Ho=(e,t)=>({status:e.entry?.status??null,progress:e.entry?.progress??0,score:Mo(e.entry?.score)?e.entry.score:null,total:Vo(e)??t,differs:[]}),Uo=(e,t={})=>({...e,...t.status===void 0?{}:{status:t.status},...t.progress===void 0?{}:{progress:t.progress},...t.score===void 0?{}:{score:t.score}}),Wo=(e,t)=>{let n={...e};return n.status===t.status&&delete n.status,n.progress===t.progress&&delete n.progress,n.score!==void 0&&(n.score??null)===t.score&&delete n.score,n},Go=(e,t)=>{switch(e.state){case`LOADING`:return{kind:`loading`};case`SIGNED_OUT`:return{kind:`login`};case`AMBIGUOUS`:return{kind:`cannot`,reason:`Names ${e.candidates.join(` and `)}, cannot tell which`}}let n=t??!0;return{kind:`check`,checked:n,sendable:n&&Ro(e)}},Ko=(e,t)=>{let n=Vo(e);return n!=null&&t!=null&&n!==t},qo=e=>e.state===`LISTED`&&(!e.tracker.statuses||!!e.entry?.status),Jo=(e,t,n)=>{if(t.remove)return qo(e)?{remove:!0}:void 0;let{statuses:r}=e.tracker,i=`score`in t?t.score:n.score,a=e.state===`LISTED`||r?{...t}:{status:t.status??n.status??`WATCHING`,progress:t.progress??n.progress,...Mo(i)?{score:i}:{}};return a.status!==void 0&&r&&!r.includes(a.status)&&delete a.status,a.progress!==void 0&&(Ko(e,n.total)?delete a.progress:a.progress=Math.max(0,Math.min(n.total??1/0,a.progress))),Object.keys(a).length?a:void 0},Yo=(e,t)=>!!e?.answers.find(e=>e.tracker.id===t)?.tracker.statuses,Xo={POINT_3:[30,50,85],POINT_5:[20,40,60,80,100],POINT_10:[10,20,30,40,50,60,70,80,90,100],POINT_10_DECIMAL:[10,20,30,40,50,60,70,80,90,100],POINT_100:[10,20,30,40,50,60,70,80,90,100]},Zo=e=>{if(!e.length)return;let t=e.map(e=>e&&Xo[e]?e:`POINT_100`);return{scale:t.reduce((e,t)=>Fo(e,t)??`POINT_100`,`POINT_100`),mixed:new Set(t).size>1}},Qo=(e,t)=>Po(e,t),$o=(e,t)=>t?e?.remove||t.remove?t:{...e,...t}:e??{},es=({send:e,onChange:t=()=>{},shape:n=(e,t)=>t,steps:r=()=>!1,delay:i=1e3,timers:a={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)}})=>{let o=new Map,s=new Map,c=new Set,l=new Map,u=new Map,d=new Map,f,p=(e,...t)=>t.reduce((t,n)=>{let i=t.at(-1);return n?r(e)&&i?.progress!==void 0&&n.progress!==void 0&&n.progress>i.progress?[...t,n]:[...t.slice(0,-1),$o(i,n)]:t},[]),m=e=>{let t=u.get(e);return t?.unsent?t.saves.map(t=>n(e,t)):t?.saves??[]},h=n=>{let[i,...a]=o.get(n)??[];if(!i||!c.has(n)||l.has(n))return;a.length?o.set(n,a):(o.delete(n),s.delete(n),c.delete(n)),l.set(n,i);let f=(e,a)=>{if(l.delete(n),e===`SAVED`||e===`QUEUED`)u.delete(n);else if(e===`REFUSED`)d.set(n,a??`Refused`);else{let e=r(n)?o.get(n)??[]:[];e.length&&o.delete(n),u.set(n,{saves:[i,...e],error:a??`Did not save`});let t=o.get(n);t&&o.set(n,p(n,i,...t))}t({tracker:n,outcome:e,fields:i,error:a}),h(n)};e(n,i).then(({outcome:e,error:t})=>f(e,t),e=>f(`FAILED`,e instanceof Error?e.message:String(e))),t()},g=()=>{f!==void 0&&a.clear(f),f=void 0;for(let e of o.keys())c.add(e);for(let e of[...c])h(e)};return{stage:(e,n,r=!1)=>{for(let[t,n]of Object.entries(e)){let e=m(t);u.delete(t),d.delete(t),o.set(t,p(t,...e,...o.get(t)??[],n)),r&&s.set(t,p(t,...s.get(t)??[],n))}n?g():(f!==void 0&&a.clear(f),f=a.set(g,i),t())},flush:g,fail:(e,n,r)=>{u.set(e,{saves:p(e,...u.get(e)?.saves??[],n),error:r,unsent:!0}),t({tracker:e,outcome:`FAILED`,fields:n,error:r})},retry:e=>{if(!u.has(e))return;let n=p(e,...m(e),...o.get(e)??[]);u.delete(e),n.length&&(o.set(e,n),c.add(e),h(e)),t()},drop:e=>{let n=s.get(e);n?o.set(e,n):(o.delete(e),c.delete(e)),u.delete(e),d.delete(e),t()},dismiss:e=>{d.delete(e),t()},state:e=>{let t=u.get(e);return{busy:l.has(e)||o.has(e),failed:t&&{fields:t.saves[0],error:t.error},refused:d.get(e)}},idle:()=>!l.size&&!o.size}},ts=({played:e,episode:t,movie:n},r)=>{if(!(e<.85||r.status===`COMPLETED`)){if(n)return{status:`COMPLETED`,progress:1};if(!(t==null||!Number.isInteger(t)||t<=r.progress||r.total!=null&&t>r.total))return t===r.total?{progress:t,status:`COMPLETED`}:{progress:t,...r.status===`WATCHING`||r.status===`REWATCHING`?{}:{status:`WATCHING`}}}},ns=(e,t,n,r)=>{let i=Bo(t,r);if(i.status===`COMPLETED`)return{};let a={};for(let r of t.answers){if(r.state===`NO_ID`)continue;let t=Go(r,n[r.tracker.id]);if(t.kind!==`check`||!t.checked||Ko(r,i.total))continue;let o=ts(e,Ho(r,i.total));o&&(a[r.tracker.id]=o)}return a};G();var rs=`stub.player.positions`,is=`stub.player.positions.account`,as=e=>e.length===2?e[1]:e[3],os=e=>{if(!Array.isArray(e)||typeof e[0]!=`string`||!e.slice(1).every(e=>typeof e==`number`))return[];let[t,...n]=e;return n.length===1?[[t,n[0]]]:n.length===2||n.length===3?[[t,n[0],n[1],n[2]??0]]:[]},ss=e=>{try{let t=JSON.parse(e??`[]`);return Array.isArray(t)?t.flatMap(os):[]}catch{return[]}},cs=(e,t)=>{let n=new Map;for(let r of[...ss(e),...ss(t)]){let e=n.get(r[0]);e&&as(e)>as(r)||(n.delete(r[0]),n.set(r[0],r))}let r=[...n.values()].sort((e,t)=>as(e)-as(t)),i=new Set([...r.filter(e=>e.length===4).slice(-200),...r.filter(e=>e.length===2).slice(-200)]);return JSON.stringify(r.filter(e=>i.has(e)))},ls=(e=>ft(e,{accountKey:is,merge:cs}))(),us=()=>ss(ls.getItem(rs)),ds=(e,t=us())=>{let n=t.findLast(([t])=>e.includes(t));return n?.length===4?n:void 0},fs=()=>{let[e,t]=U(us);return B(()=>ls.watch(rs,()=>t(us())),[]),e},ps=(e,{time:t,duration:n,ended:r=!1})=>{let i=r||n!==void 0&&n>0&&t/n>=.85;if(!i&&(t<30||n===0)||i&&us().find(([t])=>t===e)?.length===2)return;let a=i?[e,Date.now()]:[e,t,n??0,Date.now()];try{ls.setItem(rs,JSON.stringify([a]))}catch{}},ms=[{value:`grid`,label:`Covers`},{value:`card`,label:`Cards`},{value:`list`,label:`List`}],hs=`grid`,gs=`stub-search-display-mode`,_s=ms.map(e=>e.value),vs=e=>_s.includes(e)?e:hs,ys=(e=ot)=>{try{return vs(e?.getItem(gs))}catch{return hs}},bs=(e,t=ot)=>{try{t?.setItem(gs,e)}catch{}},xs=`settings/v1/settings.json`,Ss=`positions/v1/positions.json`,Cs=3e4,ws=[Rt,so],Ts=[...ws,mt,To,gs,bo,po],Es=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ds=e=>{try{return gi(e??`[]`)}catch{return[]}},Os=(e,t)=>JSON.stringify([...new Set([...Ds(e),...Ds(t)])]),ks=({settings:e,cloud:t,onAccountChange:n,lock:r,path:i=xs,keys:a=Ts,paceMs:o})=>{let{raw:s,write:c,edits:l,tell:u,onEdit:d,accountKey:f,merge:p}=e.internal,m=Ca(),h=(e,t)=>{let n={...e};for(let[e,r]of t)n[e]=p?p(n[e]??null,r):r;return n},g=async()=>{let{call:n,current:r}=m.begin(),o=new Map(a.map(t=>[t,e.getItem(t)])),d=s(f),g=await t.availability();if(g===`unknown`)return;let _;if(g===`connected`){if(!await t.unlocked())return;let e=await n(()=>t.read(i));if(!(`ok`in e)&&!(`missing`in e))return;let r=`ok`in e?xt(e.ok):{};if(p)for(let[e,t]of l)p(r[e]??null,t)===r[e]&&l.delete(e);let o=new Map(a.map(e=>[e,s(e)])),u=new Map(l);_={...r};for(let[e,t]of o)t!==null&&(_[e]=p?p(r[e]??null,t):ws.includes(e)?Os(r[e],t):e in r?r[e]??null:t);if(_=h(_,[...u].filter(([e])=>a.includes(e))),!Es(_,r)&&!(`ok`in await n(()=>t.write(i,JSON.stringify(_)))))return;if(!p)for(let[e,t]of u)l.get(e)===t&&l.delete(e);try{for(let[e,t]of o)s(e)===t&&c(e,null)}catch{}}else l.clear();if(r()&&s(f)===d){try{c(f,_?JSON.stringify(h(_,l)):null)}catch{}for(let t of a)e.getItem(t)!==o.get(t)&&u(t)}},_=!1,v=Promise.resolve(),y=()=>_?v:(_=!0,v=r(()=>(_=!1,g())).catch(e=>console.warn(`settings: account file`,e))),b,x=-1/0,S=()=>(clearTimeout(b),b=void 0,x=Date.now(),y());return d(e=>{e?l.size&&S():o===void 0?y():b??=setTimeout(S,Math.max(0,x+o-Date.now()))}),n(e=>{m.moved(),e?.switched!==!1&&l.clear(),y()}),{check:y}},As=e=>ks({...e,path:Ss,keys:[rs],paceMs:Cs}),js=({check:e,focused:t,page:n=globalThis,document:r=globalThis.document,intervalMs:i=6e4})=>{let a=e=>()=>{e().catch(e=>console.warn(`tracking: account link`,e))},o=()=>r?.visibilityState!==`hidden`,s=a(e),c=a(t);s(),n.addEventListener(`online`,s),n.addEventListener(`focus`,c),r?.addEventListener(`visibilitychange`,()=>{o()&&c()});let l=setInterval(()=>{o()&&c()},i);return()=>clearInterval(l)},Ms=e=>t=>typeof navigator<`u`&&navigator.locks?navigator.locks.request(e,t):t(),Ns=ks({settings:ot,cloud:Pa,onAccountChange:Fa,lock:Ms(`stub:settings`)}).check,Ps=As({settings:ls,cloud:Pa,onAccountChange:Fa,lock:Ms(`stub:positions`)}).check,Fs=(e,t={})=>{let n=()=>Promise.all([e(),Ns(),Ps()]);return js({check:n,focused:n,intervalMs:xa,...t})};function Is(e){var t=e.forward;return function(e){return cr(e,t)}}var Ls=function(){return typeof navigator>`u`||navigator==null||navigator.product,Is}(),Rs=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},zs=new Set,Bs=new WeakMap,Vs=(e,t)=>{if(e===null||zs.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return Vs(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=Vs(e[r],t)||`null`;return n+=`]`}if(!t&&(Ws!==Us&&e instanceof Ws||Gs!==Us&&e instanceof Gs))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=Bs.get(e)||Math.random().toString(36).slice(2);return Bs.set(e,o),Vs({__key:o},t)}zs.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=Vs(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=Vs(a[c],t)+`:`+u)}return zs.delete(e),s+=`}`},Hs=(e,t)=>(zs.clear(),Vs(e,t||!1)),Us=class{},Ws=typeof File<`u`?File:Us,Gs=typeof Blob<`u`?Blob:Us,Ks=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,qs=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,Js=(e,t)=>t%2==0?e.replace(qs,`
|
|
20
20
|
`):e,Ys=e=>e.split(Ks).map(Js).join(``).trim(),Xs=new Map,Zs=new Map,Qs=e=>{var t;return typeof e==`string`?t=Ys(e):e.loc&&Zs.get(e.__key)===e?t=e.loc.source.body:(t=Xs.get(e)||Ys(kn(e)),Xs.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},$s=e=>{var t;if(e.documentId)t=Rs(e.documentId);else if(t=Rs(Qs(e)),e.definitions){var n=nc(e);n&&(t=Rs(`\n# ${n}`,t))}return t},ec=e=>{var t,n;return typeof e==`string`?(t=$s(e),n=Zs.get(t)||Sn(e,{noLocation:!0})):(t=e.__key||$s(e),n=Zs.get(t)||e),n.loc||Qs(n),n.__key=t,Zs.set(t,n),n},tc=(e,t,n)=>{var r=t||{},i=ec(e),a=Hs(r,!0),o=i.__key;return a!==`{}`&&(o=Rs(a,o)),{key:o,query:i,variables:r,extensions:n}},nc=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===tn.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},rc=e=>{if(`definitions`in e){for(var t=[],n=0,r=e.definitions.length;n<r;n++){var i=rc(e.definitions[n]);t.push(i)}return{...e,definitions:t}}if(`directives`in e&&e.directives&&e.directives.length){for(var a=[],o={},s=0,c=e.directives.length;s<c;s++){var l=e.directives[s],u=l.name.value;u[0]===`_`?u=u.slice(1):a.push(l),o[u]=l}e={...e,directives:a,_directives:o}}if(`selectionSet`in e){var d=[],f=e.kind===tn.OPERATION_DEFINITION;if(e.selectionSet){for(var p=0,m=e.selectionSet.selections.length;p<m;p++){var h=e.selectionSet.selections[p];f||=h.kind===tn.FIELD&&h.name.value===`__typename`&&!h.alias;var g=rc(h);d.push(g)}return f||d.push({kind:tn.FIELD,name:{kind:tn.NAME,value:`__typename`},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:d}}}}return e},ic=new Map,ac=e=>{var t=ec(e),n=ic.get(t.__key);return n||(ic.set(t.__key,n=rc(t)),Object.defineProperty(n,"__key",{value:t.__key,enumerable:!1})),n};function oc(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var sc=`
|
|
21
21
|
https://bit.ly/2XbVrpR#`;function cc(e,t,n){if(!e){var r=t||`Minfied Error #`+n+`
|
|
22
|
-
`,i=Error(r+sc+n);throw i.name=`Graphcache Error`,i}}var lc={},uc=e=>e._directives||lc,dc=e=>e.name.value,fc=e=>e.typeCondition.name.value,pc=e=>e.alias?e.alias.value:e.name.value,mc=[],hc=e=>e.selectionSet?e.selectionSet.selections:mc,gc=e=>e.typeCondition?e.typeCondition.name.value:null,_c=(e,t)=>{var n=null;if(e.arguments)for(var r=0,i=e.arguments.length;r<i;r++){var a=e.arguments[r],o=An(a.value,t);o!=null&&(n||={},n[dc(a)]=o)}return n},vc=(e,t)=>{if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=dc(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},yc=(e,t)=>{var n={};if(!t)return n;if(e.variableDefinitions)for(var r=0,i=e.variableDefinitions.length;r<i;r++){var a=e.variableDefinitions[r],o=dc(a.variable);n[o]=t[o]===void 0&&a.defaultValue?An(a.defaultValue,t):t[o]}for(var s in t)s in n||(n[s]=t[s]);return n};function bc(e){for(var t=0;t<e.definitions.length;t++)if(e.definitions[t].kind===tn.OPERATION_DEFINITION)return e.definitions[t];cc(!1,``,1)}var xc=e=>{for(var t={},n=0;n<e.definitions.length;n++){var r=e.definitions[n];r.kind===tn.FRAGMENT_DEFINITION&&(t[dc(r)]=r)}return t},Sc=(e,t)=>{var n=uc(e);if(n.include||n.skip)for(var r in n){var i=n[r];if(i&&(r===`include`||r===`skip`)&&i.arguments&&i.arguments[0]&&dc(i.arguments[0])===`if`){var a=An(i.arguments[0].value,t);return r===`include`?!!a:!a}}return!0},Cc=(e,t)=>{var{defer:n}=uc(e);if(n){for(var r of n.arguments||[])if(dc(r)===`if`)return!!An(r.value,t);return!0}return!1},wc=e=>{var{optional:t,required:n}=uc(e);if(n)return!1;if(t)return!0},Tc=`__`,Ec=(e,t,n,r)=>{var i=kc(e,t,n,r);return!!i&&i.type.kind!==`NON_NULL`},Dc=(e,t,n,r)=>{var i=kc(e,t,n,r);if(!i)return!1;var a=i.type.kind===`NON_NULL`?i.type.ofType:i.type;return a.kind===`LIST`&&a.ofType.kind!==`NON_NULL`},Oc=(e,t,n)=>{if(!n)return!1;var r=gc(t);return!r||n===r?!0:e.types.has(r)&&e.types.get(r).kind===`OBJECT`?r===n:((function(e,t){cc(e.types.has(t)&&(e.types.get(t).kind===`INTERFACE`||e.types.get(t).kind===`UNION`),``,5)})(e,r),Ac(e,n),e.isSubType(r,n))},kc=(e,t,n,r)=>{if(n.indexOf(Tc)!==0&&t.indexOf(Tc)!==0)return Ac(e,t),e.types.get(t).fields()[n]};function Ac(e,t){cc(e.types.has(t)&&e.types.get(t).kind===`OBJECT`,``,3)}var jc=(e,t)=>t?`${e}(${Hs(t)})`:e,Mc=(e,t)=>`${e}.${t}`,Nc=e=>{var t=e.indexOf(`(`);return t>-1?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},Pc=e=>{var t=e.indexOf(`.`);return{entityKey:e.slice(0,t).replace(/%2e/g,`.`),fieldKey:e.slice(t+1)}},Fc=null,Ic=null,X=null,Lc=null,Rc=null,zc=null,Bc=!1,Vc=!1;function Hc(e,t){var n;if(e){if(Fc.has(e))return e;n=Ic.get(e)}return n??=t?[]:{},e&&Ic.set(e,n),Fc.add(n),n}var Uc=e=>!!e&&Fc.has(e),Wc=(e,t,n,r,i)=>{Fc=new WeakSet,Ic=new WeakMap,Rc=e,X=t,zc=new Set,Vc=!!r,Bc=!!i,n?Rc===`read`?Lc=n:r||t.hydrating||t.optimisticOrder.length>1?(!r&&!t.commutativeKeys.has(n)?ll(t,n):r&&(t.optimisticOrder.indexOf(n)!==-1&&!t.commutativeKeys.has(n)&&t.optimisticOrder.splice(t.optimisticOrder.indexOf(n),1),t.commutativeKeys.delete(n)),Lc=n,ul(t,n)):(Lc=null,fl(t,n)):Lc=null},Gc=()=>{var e=X,t=Lc;if(Vc=!1,Lc=null,!e.hydrating&&t&&e.optimisticOrder.indexOf(t)>-1)for(var n=e.optimisticOrder.length;--n>=0&&e.dirtyKeys.has(e.optimisticOrder[n])&&e.commutativeKeys.has(e.optimisticOrder[n]);)pl(e.optimisticOrder[n]);Fc=null,Ic=null,Rc=null,X=null,zc=null,e.defer||!e.storage&&e.optimisticOrder.length||(e.defer=!0,setTimeout((()=>{Wc(`read`,e,null),el(),hl(),Gc(),e.defer=!1})))},Kc=(e,t,n)=>{t&&!n&&e.deferredKeys.delete(t),Wc(`write`,e,t,n),Gc()},qc=new Set,Jc=(e,t,n,r)=>{var i=Lc?e.optimistic.get(Lc):e.base,a=i.get(t);a===void 0&&i.set(t,a=Object.create(null)),r===void 0&&!Lc?delete a[n]:a[n]=r},Yc=(e,t,n)=>{for(var r,i=!Vc&&Rc===`read`&&Lc&&X.commutativeKeys.has(Lc),a=0,o=X.optimisticOrder.length;a<o;a++){var s=X.optimisticOrder[a],c=e.optimistic.get(s);if(i&&=s!==Lc,c&&(!i||!X.commutativeKeys.has(s))&&(!Vc||Rc===`write`||X.commutativeKeys.has(s))&&(r=c.get(t))!==void 0&&n in r)return r[n]}return(r=e.base.get(t))===void 0?void 0:r[n]};function Xc(e){return X.refCount.get(e)||0}var Zc=(e,t)=>{if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)Zc(e[n],t);else typeof e==`string`&&((e,t)=>{var n=Xc(e),r=n+t>0?n+t:0;X.refCount.set(e,r),r?!n&&r&&X.gc.delete(e):X.gc.add(e)})(e,t)},Qc=(e,t,n)=>{if(n!==void 0)for(var r in n)t.has(r)||(e.push(Nc(r)),t.add(r))},$c=(e,t,n,r)=>{Qc(e,t,r.base.get(n));for(var i=0,a=X.optimisticOrder.length;i<a;i++){var o=r.optimistic.get(X.optimisticOrder[i]);o!==void 0&&Qc(e,t,o.get(n))}},el=()=>{if(!X.optimisticOrder.length){for(var e of X.gc.keys())if(X.gc.delete(e),!(Xc(e)>0)){var t=X.records.base.get(e);X.refCount.delete(e),X.records.base.delete(e);var n=t&&t.__typename;if(n){var r=X.types.get(n);r&&r.delete(e)}var i=X.links.base.get(e);if(i)for(var a in X.links.base.delete(e),i)Zc(i[a],-1)}}},tl=(e,t)=>{e===X.queryRootKey?t!==void 0&&t!==`__typename`&&zc.add(Mc(e,t)):zc.add(e)},nl=(e,t)=>{!Vc&&X.storage&&X.persist.add(((e,t)=>`${e.replace(/\./g,`%2e`)}.${t}`)(e,t))},rl=(e,t)=>(Rc===`read`&&tl(e,t),Yc(X.records,e,t)),il=(e,t)=>(Rc===`read`&&tl(e,t),Yc(X.links,e,t)),al=(e,t)=>{var n=X.abstractToConcreteMap.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),X.abstractToConcreteMap.set(e,r)}},ol=(e,t,n)=>{gl(Yc(X.records,e,t),n)||(tl(e,t),nl(e,t)),Jc(X.records,e,t,n)},sl=(e,t)=>rl(e,t)!==void 0||il(e,t)!==void 0,cl=(e,t,n)=>{var r=Lc?X.links.optimistic.get(Lc):X.links.base;if(!Lc){var i=r&&r.get(e);Zc(i&&i[t],-1),Zc(n,1)}gl(Yc(X.links,e,t),n)||(tl(e,t),nl(e,t)),Jc(X.links,e,t,n)},ll=(e,t,n)=>{var r=e.optimisticOrder.indexOf(t);if(r>-1&&e.optimisticOrder.splice(r,1),n)for(e.deferredKeys.add(t),r=r>-1?r:0;r<e.optimisticOrder.length&&!e.deferredKeys.has(e.optimisticOrder[r])&&(!e.dirtyKeys.has(e.optimisticOrder[r])||!e.commutativeKeys.has(e.optimisticOrder[r]));r++);else e.deferredKeys.delete(t),r>-1&&!e.commutativeKeys.has(t)&&dl(e,t),r=0;e.optimisticOrder.splice(r,0,t),e.commutativeKeys.add(t)},ul=(e,t)=>{e.optimisticOrder.indexOf(t)===-1&&e.optimisticOrder.unshift(t),e.dirtyKeys.has(t)||(e.dirtyKeys.add(t),e.links.optimistic.set(t,new Map),e.records.optimistic.set(t,new Map))},dl=(e,t)=>{e.dirtyKeys.has(t)&&(e.dirtyKeys.delete(t),e.records.optimistic.delete(t),e.links.optimistic.delete(t),e.deferredKeys.delete(t))},fl=(e,t)=>{var n=e.optimisticOrder.indexOf(t);n>-1&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),dl(e,t)},pl=e=>{var t=zc;zc=new Set,Rc=`write`;var n=X.links.optimistic.get(e);if(n)for(var r of n.entries()){var i=r[0],a=r[1];for(var o in a)cl(i,o,a[o])}var s=X.records.optimistic.get(e);if(s)for(var c of s.entries()){var l=c[0],u=c[1];for(var d in u)ol(l,d,u[d])}zc=t,fl(X,e)},ml=e=>{var{links:t,records:n}=X,r=[],i=new Set;return tl(e),$c(r,i,e,t),$c(r,i,e,n),r},hl=()=>{if(X.storage){Vc=!0,Rc=`read`;var e={};for(var t of X.persist.keys()){var{entityKey:n,fieldKey:r}=Pc(t),i=void 0;e[t]=(i=il(n,r))===void 0?(i=rl(n,r))===void 0?void 0:Hs(i):`:${Hs(i)}`}Vc=!1,X.storage.writeData(e),X.persist.clear()}};function gl(e,t){return typeof e!=typeof t||e!==t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&!e.some(((e,n)=>e!==t[n])):!0}var _l=null,vl=!1,yl=void 0,bl=e=>e.__internal.path.length>0&&e.__internal.errorMap?e.__internal.errorMap[e.__internal.path.join(`.`)]:void 0,xl=(e,t,n,r,i,a)=>{var o={store:e,variables:t,fragments:n,parent:{__typename:r},parentTypeName:r,parentKey:i,parentFieldKey:``,fieldName:``,error:void 0,partial:!1,hasNext:!1,optimistic:Vc,__internal:{path:[],errorMap:void 0}};if(a&&a.graphQLErrors)for(var s=0;s<a.graphQLErrors.length;s++){var c=a.graphQLErrors[s];c.path&&c.path.length&&(o.__internal.errorMap||(o.__internal.errorMap=Object.create(null)),o.__internal.errorMap[c.path.join(`.`)]=c)}return o},Sl=(e,t,n,r,i,a)=>{_l=e,e.parent=t,e.parentTypeName=n,e.parentKey=r,e.parentFieldKey=i,e.fieldName=a,e.error=bl(e)},Cl=(e,t,n,r,i)=>{if(!t)return!1;var a=gc(e);return!a||t===a||!hc(e).some((e=>e.kind===tn.FIELD&&!sl(n,jc(dc(e),_c(e,r)))))},wl=class{constructor(e,t,n,r,i,a){this.typename=e,this.entityKey=t,this.ctx=a,this.stack=[{selectionSet:i,index:0,defer:n,optional:r}]}next(){for(;this.stack.length>0;){for(var e=this.stack[this.stack.length-1];e.index<e.selectionSet.length;){var t=e.selectionSet[e.index++];if(Sc(t,this.ctx.variables)){if(t.kind!==tn.FIELD){var n=t.kind===tn.INLINE_FRAGMENT?t:this.ctx.fragments[dc(t)];if(n){var r=!n.typeCondition||(this.ctx.store.schema?Oc(this.ctx.store.schema,n,this.typename):this.ctx.store.possibleTypeMap?Tl(this.ctx.store.possibleTypeMap,n.typeCondition.name.value,this.typename):Rc===`read`&&El(n.typeCondition.name.value,this.typename)||Cl(n,this.typename,this.entityKey,this.ctx.variables,this.ctx.store.logger));if(r||Rc===`write`&&!this.ctx.store.schema){var i=wc(t);r&&n.typeCondition&&this.typename!==n.typeCondition.name.value&&al(n.typeCondition.name.value,this.typename),this.stack.push(e={selectionSet:hc(n),index:0,defer:e.defer||Cc(t,this.ctx.variables),optional:i===void 0?e.optional:i})}}}else if(Rc===`write`||!t._generated)return vl=e.defer,yl=e.optional,t}}this.stack.pop()}}},Tl=(e,t,n)=>{if(!n)return!1;if(t===n)return!0;var r=e.get(t);return r&&r.has(n)},El=(e,t)=>{if(!t)return!1;if(e===t)return!0;if((e=>X.types.has(e))(e))return!1;var n=(e=>X.abstractToConcreteMap.get(e)||qc)(e);return n.size&&n.has(t)},Dl=e=>e??null,Ol=(e,t)=>{if(!t)return t||null;if(Array.isArray(t)){for(var n=Array(t.length),r=0,i=n.length;r<i;r++)n[r]=Ol(e,t[r]);return n}return e.keyOfEntity(t)},kl=(e,t,n,r)=>{var i=ac(t.query),a=bc(i),o=e.rootFields[a.operation],s=hc(a),c=xl(e,yc(a,t.variables),xc(i),o,o,r),l=o===c.store.rootFields.query?Nl(c,o,s,n||Hc()):Al(c,o,s,n||Hc());return{dependencies:zc,partial:c.partial||!l,hasNext:c.hasNext,data:l||null}},Al=(e,t,n,r)=>{if(typeof(e.store.rootNames[t]?t:r.__typename)!=`string`)return r;for(var i=new wl(t,t,!1,void 0,n,e),a,o=Bc,s=Hc(r);a=i.next();){var c=pc(a),l=r[c];e.__internal.path.push(c);var u=void 0;u=a.selectionSet&&l!==null?jl(e,hc(a),Dl(l)):l,o||=u!==l,u!==void 0&&(s[c]=u),e.__internal.path.pop()}return o?s:r},jl=(e,t,n)=>{if(Array.isArray(n)){for(var r=Array(n.length),i=Bc,a=0,o=n.length;a<o;a++)e.__internal.path.push(a),r[a]=jl(e,t,n[a]),i||=r[a]!==n[a],e.__internal.path.pop();return i?r:n}if(n===null)return null;var s=e.store.keyOfEntity(n);return s===null?Al(e,n.__typename,t,n):Nl(e,s,t,n)||null};function Ml(e,t,n,r){var i=r.store.resolvers[t],a=i&&i[n],o;for(var s in e){var c=e[s];if(c&&s!==`include`&&s!==`skip`&&r.store.directives[s])return o=r.store.directives[s](_c(c,r.variables)),o}return o||a}var Nl=(e,t,n,r,i)=>{var{store:a}=e,o=t===a.rootFields.query,s=i&&a.keyOfEntity(i)||t,c=o?t:rl(s,`__typename`)||i&&i.__typename;if(typeof c==`string`&&!(i&&c!==i.__typename)){for(var l=new wl(c,s,!1,void 0,n,e),u=!1,d=!1,f=Bc,p,m=e.partial,h=Hc(r);(p=l.next())!==void 0;){var g=dc(p),_=_c(p,e.variables),v=pc(p),y=uc(p),b=Ml(y,c,g,e),x=jc(g,_),S=Mc(s,x),C=rl(s,x),w=i?i[g]:void 0;e.__internal.path.push(v);var T=void 0;if(g===`__typename`)T=c;else if(w!==void 0&&p.selectionSet===void 0)T=w;else if(Rc===`read`&&b){var E=h;if(p.selectionSet===void 0&&C!==void 0&&(E={...h,[v]:C,[g]:C}),Sl(e,E,c,s,x,g),T=b(E,_||{},a,e),p.selectionSet&&(T=Pl(e,c,g,S,hc(p),h[v]===void 0?r[v]:h[v],T,Uc(r))),a.schema&&T===null&&!Ec(a.schema,c,g,e.store.logger))return}else if(!p.selectionSet)T=C;else if(w!==void 0)T=Pl(e,c,g,S,hc(p),h[v]===void 0?r[v]:h[v],w,Uc(r));else{var D=il(s,x);D===void 0?typeof C==`object`&&C&&(T=C):T=Fl(e,D,c,g,hc(p),h[v]===void 0?r[v]:h[v],Uc(r))}if(!vl&&T===void 0&&(y.optional||yl&&!y.required||bl(e)||!y.required&&a.schema&&Ec(a.schema,c,g,e.store.logger))?(e.partial=!0,T=null):T===null&&(y.required||!1===yl)?(e.store.logger,T=void 0):u||=g!==`__typename`,e.__internal.path.pop(),f||=T!==r[v],T!==void 0)h[v]=T;else if(vl)d=!0;else{e.store.logger,e.partial=m;return}}return e.partial=e.partial||m,e.hasNext=e.hasNext||d,o&&e.partial&&!u?void 0:f?h:r}},Pl=(e,t,n,r,i,a,o,s)=>{if(Array.isArray(o)){for(var{store:c}=e,l=c.schema?Dc(c.schema,t,n,e.store.logger):!1,u=e.partial,d=Hc(a,!0),f=Bc||!Array.isArray(a)||o.length!==a.length,p=0,m=o.length;p<m;p++){e.__internal.path.push(p);var h=Pl(e,t,n,Mc(r,`${p}`),i,a?.[p],o[p],s);if(e.__internal.path.pop(),h===void 0&&!l){e.partial=u;return}e.partial=e.partial||h===void 0&&l,d[p]=h??null,f||=d[p]!==a[p]}return f?d:a}if(o==null)return o;if(s&&a===null)return null;if(Il(o)){var g=a||Hc(a);return typeof o==`string`?Nl(e,o,i,g):Nl(e,r,i,g,o)}},Fl=(e,t,n,r,i,a,o)=>{if(Array.isArray(t)){for(var{store:s}=e,c=s.schema?Dc(s.schema,n,r,e.store.logger):!1,l=Hc(a,!0),u=e.partial,d=Bc||!Array.isArray(a)||t.length!==a.length,f=0,p=t.length;f<p;f++){e.__internal.path.push(f);var m=Fl(e,t[f],n,r,i,a?.[f],o);if(e.__internal.path.pop(),m===void 0&&!c){e.partial=u;return}e.partial=e.partial||m===void 0&&c,l[f]=m||null,d||=l[f]!==a[f]}return d?l:a}return t===null||a===null&&o?null:Nl(e,t,i,a||Hc(a))},Il=e=>typeof e==`string`||typeof e==`object`&&typeof e.__typename==`string`,Ll=(e,t,n)=>{for(var r=t?[{fieldKey:jc(t,n)}]:ml(e),i=0,a=r.length;i<a;i++){var{fieldKey:o}=r[i];il(e,o)===void 0?ol(e,o,void 0):cl(e,o,void 0)}},Rl=(e,t)=>{for(var n of(e=>X.types.get(e)||qc)(e))t.includes(n)||Ll(n)},zl=(e,t,n,r)=>{var i=ac(t.query),a=bc(i),o={data:n||Hc(),dependencies:zc},s=e.rootFields[a.operation];return Bl(xl(e,yc(a,t.variables),xc(i),s,s,r),s,hc(a),o.data),o},Bl=(e,t,n,r)=>{var i=e.store.rootNames[t]||`query`,a=!!e.store.rootNames[t],o=a?t:r.__typename;if(!o&&t&&e.optimistic&&(o=rl(t,`__typename`)),o)!a&&t&&(ol(t,`__typename`,o),((e,t)=>{var n=X.types.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),X.types.set(e,r)}})(o,t));else return;for(var s=e.store.updates[o],c=new wl(o,t||o,!1,void 0,n,e),l;l=c.next();){var u=dc(l),d=_c(l,e.variables),f=jc(u,d),p=pc(l),m=r[e.optimistic?u:p];if(!(u===`__typename`||m===void 0&&(vl||e.optimistic&&i===`query`))){e.__internal.path.push(p);var h=void 0;if(e.optimistic&&i===`mutation`){if(!(h=e.store.optimisticMutations[u]))continue}else e.optimistic&&typeof m==`function`&&(h=m);if(h&&(Sl(e,r,o,t||o,f,u),m=Dl(h(d||{},e.store,e))),m!==void 0){if(l.selectionSet){if(t&&i===`query`){var g=Mc(t,f),_=Vl(e,hc(l),Dl(m),g,e.optimistic?il(t||o,f):void 0);cl(t||o,f,_)}else Vl(e,hc(l),Dl(m))}else t&&i===`query`&&ol(t||o,f,m!==null||!bl(e)?m:void 0);var v=s&&s[u];if(v)Sl(e,r,o,t||o,f,u),r[u]=m,v(r,d||{},e.store,e);else if(o===e.store.rootFields.mutation&&!e.optimistic){if(m&&Array.isArray(m))for(var y=m.map((t=>e.store.keyOfEntity(t)||``)),b=0,x=m.length;b<x;b++){var S=y[b];if(S&&m[b].__typename){var C=rl(S,`__typename`),w=Xc(S);C&&!w&&Rl(m[b].__typename,y)}}else if(m&&typeof m==`object`){var T=e.store.keyOfEntity(m);if(T){var E=rl(T,`__typename`),D=Xc(T);E&&D||!m.__typename||Rl(m.__typename,[T])}}}e.__internal.path.pop()}}}},Vl=(e,t,n,r,i)=>{if(Array.isArray(n)){for(var a=Array(n.length),o=0,s=n.length;o<s;o++){e.__internal.path.push(o);var c=r?Mc(r,`${o}`):void 0,l=Vl(e,t,n[o],c,i?.[o]);a[o]=l,e.__internal.path.pop()}return a}if(n===null)return bl(e)?void 0:null;var u=e.store.keyOfEntity(n)||(typeof i==`string`?i:null);n.__typename;var d=u||r;return Bl(e,d,t,n),d||null},Hl=class{constructor(e){e||={},this.logger=e.logger,this.resolvers=e.resolvers||{},this.directives=e.directives||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.globalIDs=Array.isArray(e.globalIDs)?new Set(e.globalIDs):!!e.globalIDs;var t=`Query`,n=`Mutation`,r=`Subscription`;if(e.schema){var i=(({__schema:e})=>{var t=new Map,n=e=>{var t;return()=>{if(!t){t={};for(var n=0;n<e.length;n++)t[e[n].name]=e[n]}return t}},r=e=>{switch(e.kind){case`OBJECT`:case`INTERFACE`:return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map((e=>({name:e.name,type:e.type,args:n(e.args)}))))};case`UNION`:return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},i={query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:void 0,isSubType(e,n){var r=t.get(e),i=t.get(n);return!r||!i?!1:r.kind===`UNION`?!!r.types()[n]:r.kind!==`OBJECT`&&i.kind===`OBJECT`?!!i.interfaces()[e]:e===n}};if(e.types){i.types=t;for(var a=0;a<e.types.length;a++){var o=e.types[a];if(o&&o.name){var s=r(o);s&&t.set(o.name,s)}}}return i})(e.schema);t=i.query||t,n=i.mutation||n,r=i.subscription||r,i.types&&(this.schema=i)}if(!this.schema&&e.possibleTypes){this.possibleTypeMap=new Map;for(var a of Object.entries(e.possibleTypes)){var[o,s]=a;this.possibleTypeMap.set(o,new Set(s))}}this.updates=e.updates||{},this.rootFields={query:t,mutation:n,subscription:r},this.rootNames={[t]:`query`,[n]:`mutation`,[r]:`subscription`},this.data=(c=t,{hydrating:!1,defer:!1,gc:new Set,types:new Map,persist:new Set,queryRootKey:c,refCount:new Map,links:{optimistic:new Map,base:new Map},abstractToConcreteMap:new Map,records:{optimistic:new Map,base:new Map},deferredKeys:new Set,commutativeKeys:new Set,dirtyKeys:new Set,optimisticOrder:[],storage:null});var c;this.schema}keyOfField(e,t){return jc(e,t)}keyOfEntity(e){if(_l&&e===_l.parent)return _l.parentKey;if(e==null||typeof e==`string`)return e||null;if(!e.__typename)return null;if(this.rootNames[e.__typename])return e.__typename;var t=null;this.keys[e.__typename]?t=this.keys[e.__typename](e)||null:e.id==null?e._id!=null&&(t=`${e._id}`):t=`${e.id}`;var n=e.__typename;return!0===this.globalIDs||this.globalIDs&&this.globalIDs.has(n)||!t?t:`${n}:${t}`}resolve(e,t,n){var r=this.keyOfEntity(e);if(r){var i=jc(t,n),a=rl(r,i);if(a!==void 0)return a;var o=il(r,i);return o!==void 0&&(o=Ol(this,o)),o}}invalidate(e,t,n){var r=this.keyOfEntity(e);e&&typeof e==`string`&&!t&&!n&&!this.resolve(e,`__typename`)?Rl(e,[]):(cc(r,``,19),Ll(r,t,n))}inspectFields(e){var t=this.keyOfEntity(e);return t?ml(t):[]}updateQuery(e,t){var n=tc(e.query,e.variables),r=t(this.readQuery(n));r!==null&&zl(this,n,r,void 0)}readQuery(e){var t=tc(e.query,e.variables);return kl(this,t,void 0,void 0).data}readFragment(e,t,n,r){return((e,t,n,r,i)=>{var a=xc(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=fc(o);typeof n!=`string`&&!n.__typename&&(n.__typename=s);var c=e.keyOfEntity(n);return c&&Nl(xl(e,r||{},a,s,c,void 0),c,hc(o),Hc())||null})(this,ac(e),t,n,r)}writeFragment(e,t,n,r){((e,t,n,r,i)=>{var a=xc(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=fc(o),c={__typename:s,...n},l=e.keyOfEntity(c);l&&Bl(xl(e,r||{},a,s,l,void 0),l,hc(o),c)})(this,ac(e),t,n,r)}link(e,t,...n){var r=n.length===2?n[0]:null,i=n.length===2?n[1]:n[0],a=this.keyOfEntity(e);a&&cl(a,jc(t,r),Ol(this,i))}},Ul=(e,t)=>oc(e.kind,e,{...e.context,meta:{...e.context.meta,...t}}),Wl=(e,t)=>oc(e.kind,e,{...e.context,requestPolicy:t}),Gl=e=>({forward:t,client:n,dispatchDebug:r})=>{var i=new Hl(e);e&&e.storage&&(i.data.hydrating=!0,e.storage.readData().then((t=>{((e,t,n)=>{for(var r in Wc(`write`,e,null),n){var i=n[r];if(i!==void 0){var{entityKey:a,fieldKey:o}=Pc(r);i[0]===`:`?il(a,o)===void 0&&cl(a,o,JSON.parse(i.slice(1))):rl(a,o)===void 0&&ol(a,o,JSON.parse(i))}}e.storage=t,e.hydrating=!1,Gc()})(i.data,e.storage,t),e.storage.onCacheHydrated&&e.storage.onCacheHydrated()})));var a=new Map,o=[],s=new Map,c=new Map,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=e=>{for(var t of e.values())if(l.has(t))return!0;return!1},h=(e,t)=>{if(t)for(var n of t.values()){var r=d.get(n);if(r)for(var i of r.values())e.add(i)}},g=(e,t,r)=>{for(var i of t.values())if(i!==e.key){var a=s.get(i);if(a){e.kind===`query`&&p.add(i);var o=`cache-first`;u.has(i)&&(u.delete(i),o=`cache-and-network`),n.reexecuteOperation(Wl(a,o))}}if(!r){var c=f;f=p,e.kind===`query`&&f.add(e.key),(p=c).clear()}},_=e=>{var t=!1;if(e.kind===`query`)ll(i.data,e.key),s.set(e.key,e);else if(e.kind===`teardown`)return s.delete(e.key),c.delete(e.key),f.delete(e.key),Kc(i.data,e.key),e;else if(e.kind===`mutation`&&e.context.requestPolicy!==`network-only`){s.set(e.key,e),Wc(`write`,i.data,e.key,!0,!1);var{dependencies:n}=zl(i,e,void 0,void 0);if(Gc(),n.size){for(var r of n.values())l.add(r);a.set(e.key,n);var o=new Set;h(o,n),g(e,o,!0),t=!0}}return oc(e.kind,{key:e.key,query:ac(e.query),variables:e.variables?vc(bc(e.query),e.variables):e.variables},{...e.context,optimistic:t})},v=(e,t)=>{for(var n of t.values()){var r=d.get(n);r||d.set(n,r=new Set),r.add(e.key)}},y=e=>{Wc(`read`,i.data,void 0,!1,!1);var t=kl(i,e,c.get(e.key),void 0);Gc();var n=t.data?!t.partial&&!t.hasNext?`hit`:`partial`:`miss`;return c.set(e.key,t.data),s.set(e.key,e),v(e,t.dependencies),{outcome:n,operation:e,data:t.data,dependencies:t.dependencies,hasNext:t.hasNext}},b=(e,t)=>{var n=s.get(e.operation.key)||e.operation;n.kind===`mutation`&&(h(t,a.get(n.key)),a.delete(n.key)),(n.kind===`subscription`||e.hasNext)&&ll(i.data,n.key,!0);var r,o=e.data;if(o){Wc(`write`,i.data,n.key,!1,!1);var l=zl(i,n,o,e.error).dependencies;Gc(),h(t,l);var u=n.kind===`query`?c.get(n.key):null;Wc(`read`,i.data,n.key,!1,u!==o);var d=kl(i,n,u||o,e.error);Gc(),o=d.data,n.kind===`query`&&(h(t,r=d.dependencies),c.set(n.key,o))}else Kc(i.data,n.key);return r&&v(e.operation,r),{operation:n,data:o,error:e.error,extensions:e.extensions,hasNext:e.hasNext,stale:e.stale}};return e=>{var r=Gn(Rn(y)(Ln((e=>e.kind===`query`&&e.context.requestPolicy!==`network-only`))(e))),c=Ln((e=>e.kind!==`query`||e.context.requestPolicy===`network-only`))(e),d=Rn((e=>Ul(e.operation,{cacheOutcome:`miss`})))(Ln((e=>e.outcome===`miss`&&e.operation.context.requestPolicy!==`cache-only`&&!m(e.dependencies)&&!f.has(e.operation.key)))(r)),p=Rn((e=>{var{requestPolicy:t}=e.operation.context,r=t!==`cache-only`&&(e.hasNext||t===`cache-and-network`||t===`cache-first`&&e.outcome===`partial`&&!f.has(e.operation.key)),a=t!==`cache-only`&&(r||e.outcome===`partial`&&f.has(e.operation.key)&&((o=i.data).commutativeKeys.has(c=e.operation.key)||o.optimisticOrder.indexOf(c)>-1)),o,c,l={operation:Ul(e.operation,{cacheOutcome:e.outcome}),data:e.data,error:e.error,extensions:e.extensions,stale:a&&!e.hasNext,hasNext:r&&e.hasNext};return r&&(m(e.dependencies)?t===`cache-and-network`&&u.add(e.operation.key):n.reexecuteOperation(Wl(s.get(e.operation.key)||e.operation,`network-only`))),l}))(Ln((e=>e.outcome!==`miss`||e.operation.context.requestPolicy===`cache-only`))(r)),h=t(Rn(_)(Vn([c,d])));return Vn([Rn((e=>{var t=new Set,n=b(e,t);return g(e.operation,t,!1),n}))(Ln((e=>!a.has(e.operation.key)))(h)),zn((e=>{if(o.push(e)<a.size)return rr;for(var t=0;t<o.length;t++)ll(i.data,o[t].operation.key);l.clear();for(var n=[],r=new Set,s;s=o.shift();)n.push(b(s,r));return g(e.operation,r,!1),$n(n)}))(Ln((e=>a.has(e.operation.key)))(h)),p])}},Kl={Media:e=>e._id,MediaHandle:()=>null,MediaRelationEdge:()=>null,MediaFranchise:()=>null,MediaFranchiseNode:()=>null,MediaFranchiseEdge:()=>null,EpisodeHandle:()=>null,MediaTitle:()=>null,MediaDescription:()=>null,MediaShortDescription:()=>null,MediaCover:()=>null,MediaBanner:()=>null,MediaAiringEpisode:()=>null,MediaFieldProvenance:()=>null,MediaAnomaly:()=>null,MediaPerson:()=>null,MediaCharacter:()=>null,MediaTheme:()=>null,MediaRating:()=>null,MediaSeasonLink:()=>null,MediaTrailer:e=>e.uri,Episode:e=>e._id,EpisodeTitle:()=>null,EpisodeDescription:()=>null,EpisodeShortDescription:()=>null,EpisodeThumbnail:()=>null,PlaybackSource:e=>e.uri,Tracking:e=>String(e._id),TrackerAnswer:e=>String(e._id),Tracker:e=>e.id,ListEntry:e=>String(e._id),FuzzyDate:()=>null,WriteOutcome:()=>null,StubTrackerStorage:()=>null},ql=()=>{let e=new Map;return{exchange:({forward:t})=>n=>cr(t(cr(n,Un(t=>{t.kind===`teardown`&&e.delete(t.key)}))),Un(t=>{t.operation.kind===`subscription`&&e.set(t.operation.key,t)})),replay:t=>{let n=t.executeRequestOperation.bind(t);return t.executeRequestOperation=(t=>{let r=n(t);if(t.kind!==`subscription`)return r;let i=Xn(()=>{let n=e.get(t.key);return n?Vn([er(n),r]):r}),a=()=>sr(cr(i,Ln(e=>!e.stale&&!e.hasNext),qn(1)));return Object.assign(i,{toPromise:a,then:((e,t)=>a().then(e,t)),subscribe:e=>cr(i,ar(e))})}),t}}},Jl=Gl({schema:{__schema:JSON.parse(`{"queryType":{"name":"Query","kind":"OBJECT"},"mutationType":{"name":"Mutation","kind":"OBJECT"},"subscriptionType":{"name":"Subscription","kind":"OBJECT"},"types":[{"kind":"OBJECT","name":"Episode","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"absoluteEpisodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"absoluteNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"embedUrl","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"mediaUri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relativeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"releaseDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"runtime","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"thumbnails","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeThumbnail","ofType":null}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeHandle","fields":[{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeThumbnail","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"FuzzyDate","fields":[{"name":"day","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"month","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"year","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"ListEntry","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"completedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"cover","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"mediaUri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"progress","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"rewatchCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"updatedAt","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Media","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"airingSchedule","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null}}},"args":[]},{"name":"anomalies","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAnomaly","ofType":null}}},"args":[]},{"name":"averageScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"banners","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaBanner","ofType":null}}}},"args":[]},{"name":"categories","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"characters","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCharacter","ofType":null}}},"args":[]},{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"duration","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"endDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}}}},"args":[]},{"name":"franchise","type":{"kind":"OBJECT","name":"MediaFranchise","ofType":null},"args":[]},{"name":"genres","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isAdult","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"kind","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextAiringEpisode","type":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"popularity","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"provenance","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFieldProvenance","ofType":null}}},"args":[]},{"name":"ratings","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRating","ofType":null}}},"args":[]},{"name":"relations","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRelationEdge","ofType":null}}}},"args":[]},{"name":"scope","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"season","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonYear","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasons","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaSeasonLink","ofType":null}}},"args":[]},{"name":"settled","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"sourceMaterial","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"staff","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPerson","ofType":null}}},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"studios","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"tags","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"themes","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTheme","ofType":null}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"trailers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTrailer","ofType":null}}}},"args":[]},{"name":"type","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAiringEpisode","fields":[{"name":"airingAt","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"episodeNumber","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAnomaly","fields":[{"name":"detail","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaBanner","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCharacter","fields":[{"name":"image","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"role","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"voiceActors","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPerson","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCover","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFieldProvenance","fields":[{"name":"answerSeq","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"field","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tier","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uris","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"witnesses","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchise","fields":[{"name":"edges","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseEdge","ofType":null}}}},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseNode","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseEdge","fields":[{"name":"from","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"to","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseNode","fields":[{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaHandle","fields":[{"name":"by","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"provenance","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"via","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPerson","fields":[{"name":"image","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"roles","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRating","fields":[{"name":"scale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"source","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"value","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRelationEdge","fields":[{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaSeasonLink","fields":[{"name":"number","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTheme","fields":[{"name":"artists","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"kind","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"sequence","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"video","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTrailer","fields":[{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"thumbnail","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Mutation","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"addHeldStubEntries","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"deleteListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"saveListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Origin","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isApiOnly","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"OriginPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Origin","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"PlaybackSource","fields":[{"name":"Episode","type":{"kind":"OBJECT","name":"Episode","ofType":null},"args":[]},{"name":"data","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"type","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Query","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"StubTrackerStorage","fields":[{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"held","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"location","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"locked","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"waiting","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Subscription","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"containingMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"media","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"mediaPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"origin","type":{"kind":"OBJECT","name":"Origin","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"originPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"OriginPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"similarMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"stubTrackerStorage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"tracking","type":{"kind":"OBJECT","name":"Tracking","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracker","fields":[{"name":"account","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canClearScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canWrite","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"scoreScale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"statuses","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"TrackerAnswer","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"candidates","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"state","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Tracker","ofType":null}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracking","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"answers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"TrackerAnswer","ofType":null}}}},"args":[]},{"name":"disagreements","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"summary","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"WriteOutcome","fields":[{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"outcome","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"SCALAR","name":"Any"}],"directives":[]}`)},keys:Kl,resolvers:{}}),Yl=ql(),Xl=Yl.replay(new $r({url:`http://d/graphql`,exchanges:[Yl.exchange,Zr({onError(e,t){for(let n of e.graphQLErrors)console.error(Error(n.message,{cause:`GQL Error originated from ${t.query.definitions.find(e=>e.kind===`OperationDefinition`)?.name?.value}`}))}}),Ls,Jl,Yr],fetchSubscriptions:!0,fetch:async(e,t)=>Nt(e,t)}));function Zl(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Ql=t((t=>{var n=(pe(),e(fe));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.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),$l=t(((e,t)=>{t.exports=Ql()}));pe();var eu=$l(),tu=E,nu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?ye:B,ru=tu||nu,iu=e=>{let t=K([e,(...e)=>t[0](...e)]).current;return ru(()=>{t[0]=e}),t[1]},au=`popstate`,ou=`pushState`,su=`replaceState`,cu=[au,ou,su,`hashchange`],lu=e=>{for(let t of cu)addEventListener(t,e);return()=>{for(let t of cu)removeEventListener(t,e)}},uu=(e,t)=>(0,eu.useSyncExternalStore)(lu,e,t),du=()=>location.search,fu=({ssrSearch:e=``}={})=>uu(du,()=>e),pu=()=>location.pathname,mu=({ssrPath:e}={})=>uu(pu,e?()=>e:pu),hu=(e,{replace:t=!1,state:n=null}={})=>history[t?su:ou](n,``,e),gu=(e={})=>[mu(e),hu],_u=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[_u]===void 0){for(let e of[ou,su]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,_u,{value:!0})}var vu=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,yu=(e=``)=>e===`/`?``:e,bu=(e,t)=>e[0]===`~`?e.slice(1):yu(t)+e,xu=(e=``,t)=>vu(Cu(yu(e)),Cu(t)),Su=e=>e[0]===`?`?e.slice(1):e,Cu=e=>{try{return decodeURI(e)}catch{return e}},wu=e=>Cu(Su(e)),Tu={hook:gu,searchHook:fu,parser:Zl,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},Eu=xe(Tu),Du=()=>ge(Eu),Ou={},ku=xe(Ou),Au=()=>ge(ku),ju=e=>{let[t,n]=e.hook(e);return[xu(e.base,t),iu((t,r)=>n(bu(t,e.base),r))]},Mu=()=>ju(Du()),Nu=()=>{let e=Du();return wu(e.searchHook(e))},Pu=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Fu=e=>Pu(Du().parser,e,Mu()[0]),Iu=({children:e,...t})=>{let n=Du(),r=t.hook?Tu:n,i=r,[a,o]=t.ssrPath?.split(`?`)??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=K({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]||``):t[e]||r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return Pe(Eu.Provider,{value:i,children:e})},Lu=({children:e,component:t},n)=>t?Pe(t,{params:n}):typeof e==`function`?e(n):e,Ru=e=>{let t=K(Ou),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},zu=({path:e,nest:t,match:n,...r})=>{let i=Du(),[a]=ju(i),[o,s,c]=n??Pu(i.parser,e,a,t),l=Ru({...Au(),...s});if(!o)return null;let u=c?Pe(Iu,{base:c},Lu(r,l)):Lu(r,l);return Pe(ku.Provider,{value:l,children:u})},Bu=Fe((e,t)=>{let n=Du(),[r,i]=ju(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,...p}=e,m=iu(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),h=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&ie(l)?de(l,{onClick:m,href:h}):Pe(`a`,{...p,onClick:m,href:h,className:u?.call?u(r===o):u,children:l,ref:t})}),Vu=e=>Array.isArray(e)?e.flatMap(e=>Vu(e&&e.type===Te?e.props.children:e)):[e],Hu=({children:e,location:t})=>{let n=Du(),[r]=ju(n);for(let i of Vu(e)){let e=0;if(ie(i)&&(e=Pu(n.parser,i.props.path,t||r,i.props.nest))[0])return de(i,{match:e})}return null},Uu=e=>{let{to:t,href:n=t}=e,r=Du(),[,i]=ju(r),a=iu(()=>i(t||n,e)),{ssrContext:o}=r;return nu(()=>{a()},[]),o&&(o.redirectTo=t),null},Z=function(e){return e.HOME=`HOME`,e.MEDIA=`MEDIA`,e.MEDIA_EPISODE=`MEDIA_EPISODE`,e.TITLE=`TITLE`,e.SEARCH=`SEARCH`,e.SEARCH_LEGACY=`SEARCH_LEGACY`,e.LEGAL=`LEGAL`,e.PRIVACY=`PRIVACY`,e.SETTINGS=`SETTINGS`,e.WATCH=`WATCH`,e.PARTY=`PARTY`,e.DEBUG_TRACE=`DEBUG_TRACE`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({}),Wu={HOME:()=>`/`,MEDIA:({uri:e})=>`/media/${e}`,MEDIA_EPISODE:({uri:e,mediaUri:t})=>`/media/${e}/${t}`,TITLE:({uri:e})=>`/title/${e}`,SEARCH:()=>`/search`,SEARCH_LEGACY:({query:e})=>`/search/${encodeURIComponent(e)}`,LEGAL:()=>`/legal`,PRIVACY:()=>`/privacy`,SETTINGS:()=>`/settings`,WATCH:({mediaUri:e,episodeUri:t,sourceUri:n})=>`/watch/${e}/${t}${n?`/${n}`:``}`,PARTY:()=>`/party`,DEBUG_TRACE:()=>`/debug/trace`,LOGIN_CALLBACK:()=>`/login/callback`},Gu={HOME:`/`,MEDIA:`/media/:uri`,MEDIA_EPISODE:`/media/:uri/:mediaUri`,TITLE:`/title/:uri`,SEARCH:`/search`,SEARCH_LEGACY:`/search/:query`,LEGAL:`/legal`,PRIVACY:`/privacy`,SETTINGS:`/settings`,WATCH:`/watch/:mediaUri/:episodeUri/:sourceUri?`,PARTY:`/party`,DEBUG_TRACE:`/debug/trace`,LOGIN_CALLBACK:`/login/callback`},Ku=e=>Gu[e],qu=(e,t)=>Wu[e](t),Ju={"Action & Adventure":`act`,Animation:`ani`,Comedy:`cmy`,Crime:`crm`,Documentary:`doc`,Drama:`drm`,Fantasy:`fnt`,History:`hst`,Horror:`hrr`,"Kids & Family":`fml`,"Music & Musical":`msc`,"Mystery & Thriller":`trl`,"Reality TV":`rly`,Romance:`rma`,"Science-Fiction":`scf`,Sport:`spt`,"War & Military":`war`,Western:`wsn`},Yu={query:`q`,category:`category`,status:`status`,season:`season`,year:`year`,format:`format`,genre:`genre`,tag:`tag`},Xu=[{value:ki.Tv,label:`TV Show`},{value:ki.Movie,label:`Movie`},{value:ki.TvShort,label:`TV Short`},{value:ki.Special,label:`Special`},{value:ki.Ova,label:`OVA`},{value:ki.Ona,label:`ONA`}],Zu=[{value:Oi.Releasing,label:`Airing`},{value:Oi.Finished,label:`Finished`},{value:Oi.NotYetReleased,label:`Not yet aired`},{value:Oi.Cancelled,label:`Cancelled`},{value:Oi.Hiatus,label:`Hiatus`}],Qu=[{value:Ei.Winter,label:`Winter`},{value:Ei.Spring,label:`Spring`},{value:Ei.Summer,label:`Summer`},{value:Ei.Fall,label:`Fall`}],$u=[{value:wi.Anime,label:`Anime`},{value:wi.Series,label:`Series`},{value:wi.Movie,label:`Movies`}],ed=[`Action`,`Adventure`,`Comedy`,`Drama`,`Ecchi`,`Fantasy`,`Horror`,`Mahou Shoujo`,`Mecha`,`Music`,`Mystery`,`Psychological`,`Romance`,`Sci-Fi`,`Slice of Life`,`Sports`,`Supernatural`,`Thriller`],td={anime:ed,movie:Object.keys(Ju),series:Object.keys(Ju),stub:[...new Set([...ed,...Object.keys(Ju)])]},nd=(e,t)=>e.find(e=>e===t)??null,rd=(e,t)=>t.map(t=>nd(e,t)).filter(e=>e!==null),id=e=>Qu.map(e=>e.value).find(t=>t===e)??null,ad=Xu.map(e=>e.value),od=Zu.map(e=>e.value),sd=Qu.map(e=>e.value),cd=$u.map(e=>e.value),ld=1917,ud=(e=new Date)=>e.getFullYear()+5,dd=(e,t=new Date)=>{if(!e||!/^\d{4}$/.test(e))return null;let n=Number(e);return n>=1917&&n<=ud(t)?n:null},fd=(e,t=new Date)=>{let n=new URLSearchParams(e);return{query:(n.get(Yu.query)??``).trim(),category:nd(cd,n.get(Yu.category)),status:nd(od,n.get(Yu.status)),season:nd(sd,n.get(Yu.season)),year:dd(n.get(Yu.year),t),formats:rd(ad,n.getAll(Yu.format)),genres:pd(n.getAll(Yu.genre)),tags:pd(n.getAll(Yu.tag))}},pd=e=>{let t=new Set,n=[];for(let r of e){let e=r.trim(),i=e.toLowerCase();e&&!t.has(i)&&(t.add(i),n.push(e))}return n},md=e=>{let t=new URLSearchParams,n=e.query?.trim();n&&t.set(Yu.query,n),e.category&&t.set(Yu.category,e.category),e.status&&t.set(Yu.status,e.status),e.season&&t.set(Yu.season,e.season),e.year&&t.set(Yu.year,String(e.year));for(let n of e.formats??[])t.append(Yu.format,n);for(let n of e.genres??[])t.append(Yu.genre,n);for(let n of e.tags??[])t.append(Yu.tag,n);return t.toString()},hd=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return e}},gd=(e={})=>{let t=md(e);return t?`/search?${t}`:`/search`},_d=e=>{if(e.query)return`Results for \u201C${e.query}\u201D`;let t=Qu.find(t=>t.value===e.season)?.label;return t&&e.year?`${t} ${e.year}`:t?`${t} seasons`:e.year?String(e.year):xd(e)?`Browsing`:`Search`},vd=e=>Xu.find(t=>t.value===e)?.label,yd=e=>Zu.find(t=>t.value===e)?.label,bd=(e,t)=>{let n=Qu.find(t=>t.value===e)?.label;return n&&t?`${n} ${t}`:t?String(t):void 0},xd=e=>!!(e.query||e.category||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),Sd=e=>!!(e.query||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),Cd=`plugins`,wd=`plugin`,Td=(e,t)=>{try{return new URL(e,t)}catch{return}},Ed=e=>{let t=new Set;return e.filter(e=>{let n=Dd(e);return!n||t.has(n)?!1:(t.add(n),!0)})},Dd=e=>e.trim().replace(/\/+$/,``).replace(/@\d[^@/]*$/,``),Od=(e,t)=>{let n=Td(e,t);return n?Ed([...n.searchParams].filter(([e])=>e===`plugins`||e===wd).map(([,e])=>e.trim())):[]},kd=e=>encodeURIComponent(e).replace(/%3A/g,`:`).replace(/%2F/g,`/`).replace(/%40/g,`@`),Ad=(e,t,n)=>{let r=Td(e,n),i=Td(n);return!r||!i||r.origin!==i.origin?e:(r.searchParams.delete(Cd),r.searchParams.delete(wd),r.search=[r.searchParams.toString(),Ed(t.map(e=>e.trim())).sort().map(e=>`${Cd}=${kd(e)}`).join(`&`)].filter(Boolean).join(`&`),r.href)},jd=new Map,Md=new Set,Nd=new Set,Pd=()=>Nd.forEach(e=>{try{e()}catch{}}),Fd=e=>(Nd.add(e),()=>{Nd.delete(e)}),Id=()=>[...jd.values()],Ld=()=>[...jd.keys()],Rd=()=>new Set(Ua().map(Dd)),zd=e=>{let t=Rd(),n=!1;for(let r of e){let e=Dd(r);!e||t.has(e)||Md.has(e)||jd.has(r)||(jd.set(r,{uri:r,state:`offered`}),n=!0)}n&&Pd()};Va(()=>{let e=Rd(),t=!1;for(let[n,r]of jd)r.state===`offered`&&e.has(Dd(n))&&(jd.delete(n),t=!0);t&&Pd()});var Bd=()=>{if(jd.size){for(let e of jd.keys())Md.add(Dd(e));jd.clear(),Pd()}},Vd=async()=>{let e=[...jd.keys()];if(e.length){for(let t of e)jd.set(t,{uri:t,state:`installing`});Pd();for(let t of e){try{await io(t,{noConfirm:!0})||Md.add(Dd(t)),jd.delete(t)}catch(e){console.warn(`Source '${t}' could not be added:`,e),jd.set(t,{uri:t,state:`error`})}Pd()}}},Hd=e=>{jd.delete(e)&&(Md.add(Dd(e)),Pd())},Ud=()=>[...Ua(),...Ld()],Wd=()=>{let e=Ad(location.href,Ud(),location.href);e!==location.href&&history.replaceState(history.state,``,e)},Gd=()=>zd(Od(location.href)),Kd=e=>{let t=Ad(e,Ud(),location.href);return t.startsWith(location.origin)?t.slice(location.origin.length):t},qd=e=>{let t=history[e];history[e]=function(e,n,r){let i=r==null?location.href:String(r);return t.call(this,e,n,Ad(i,Ud(),location.href))}},Jd=Symbol.for(`stub_plugin_url`);Jd in globalThis||(Object.defineProperty(globalThis,Jd,{value:!0}),qd(`pushState`),qd(`replaceState`),addEventListener(`popstate`,()=>{Gd(),Wd()}),Va(Wd),Fd(Wd),Gd(),Wd());var Yd=`input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])`,Xd=typeof Element>`u`,Zd=Xd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qd=!Xd&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},$d=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},ef=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},tf=function(e,t,n){if($d(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Yd));return t&&Zd.call(e,Yd)&&r.unshift(e),r=r.filter(n),r},nf=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!$d(o,!1)){if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{Zd.call(o,Yd)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!$d(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}}return i},rf=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},af=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ef(e))&&!rf(e)?0:e.tabIndex},of=function(e,t){var n=af(e);return n<0&&t&&!rf(e)?0:n},sf=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},cf=function(e){return e.tagName===`INPUT`},lf=function(e){return cf(e)&&e.type===`hidden`},uf=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},df=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},ff=function(e){if(!e.name)return!0;var t=e.form||Qd(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=df(r,e.form);return!i||i===e},pf=function(e){return cf(e)&&e.type===`radio`},mf=function(e){return pf(e)&&!ff(e)},hf=function(e){var t=e&&Qd(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Qd(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},gf=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},_f=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Zd.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Zd.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Qd(e);if(o&&!o.shadowRoot&&r(o)===!0)return gf(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(hf(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return gf(e);return!1},vf=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Zd.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},yf=function(e,t){return!(t.disabled||$d(t)||lf(t)||_f(t,e)||uf(t)||vf(t))},bf=function(e,t){return!(mf(t)||af(t)<0||!yf(e,t))},xf=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Sf=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=of(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(sf).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Cf=function(e,t){return t||={},Sf(t.getShadowRoot?nf([e],t.includeContainer,{filter:bf.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xf}):tf(e,t.includeContainer,bf.bind(null,t)))},wf=function(e,t){return t||={},t.getShadowRoot?nf([e],t.includeContainer,{filter:yf.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):tf(e,t.includeContainer,yf.bind(null,t))},Tf=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Zd.call(e,Yd)!==!1&&bf(t,e)};pe();function Ef(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Df(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function Of(){return/apple/i.test(navigator.vendor)}function kf(){let e=/android/i;return e.test(Ef())||e.test(Df())}function Af(){return Ef().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function jf(){return Df().includes(`jsdom/`)}var Mf=`data-floating-ui-focusable`,Nf=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Pf(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ff(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ne(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function If(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Lf(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 Rf(e){return e.matches(`html,body`)}function zf(e){return e?.ownerDocument||document}function Bf(e){return re(e)&&e.matches(Nf)}function Vf(e){return e?e.getAttribute(`role`)===`combobox`&&Bf(e):!1}function Hf(e){if(!e||jf())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Uf(e){return e?e.hasAttribute(Mf)?e:e.querySelector(`[`+Mf+`]`)||e:null}function Wf(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Wf(e,t.id,n)])}function Gf(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 Kf(e){e.preventDefault(),e.stopPropagation()}function qf(e){return`nativeEvent`in e}function Jf(e){return e.mozInputSource===0&&e.isTrusted?!0:kf()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Yf(e){return jf()?!1:!kf()&&e.width===0&&e.height===0||kf()&&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 Xf(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Zf=typeof document<`u`?ye:function(){},Qf={...fe};function $f(e){let t=K(e);return Zf(()=>{t.current=e}),t}var ep=Qf.useInsertionEffect||(e=>e());function tp(e){let t=K(()=>{});return ep(()=>{t.current=e}),z(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var np=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function rp(e,t){let n=Cf(e,np()),r=n.length;if(r===0)return;let i=Pf(zf(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ip(e){return rp(zf(e).body,1)||e}function ap(e){return rp(zf(e).body,-1)||e}function op(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ff(n,r)}function sp(e){Cf(e,np()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function cp(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}pe();var lp=typeof document<`u`?ye:function(){};function up(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(!up(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)&&!up(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fp(e,t){let n=dp(e);return Math.round(t*n)/n}function pp(e){let t=K(e);return lp(()=>{t.current=e}),t}function mp(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]=U({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=U(r);up(f,r)||p(r);let[m,h]=U(null),[g,_]=U(null),v=z(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K(null),C=K(null),w=K(u),T=c!=null,E=pp(c),D=pp(i),O=pp(l),k=z(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),oe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!up(w.current,t)&&(w.current=t,te(()=>{d(t)}))})},[f,t,n,D,O]);lp(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K(!1);lp(()=>(A.current=!0,()=>{A.current=!1}),[]),lp(()=>{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=V(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=V(()=>({reference:b,floating:x}),[b,x]),N=V(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=fp(M.floating,u.x),r=fp(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dp(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return V(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var hp=(e,t)=>({...Be(e),options:[e,t]}),gp=(e,t)=>({...se(e),options:[e,t]}),_p=(e,t)=>({...k(e),options:[e,t]}),vp=(e,t)=>({...j(e),options:[e,t]});pe(),je();function yp(e){let t=K(void 0),n=z(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return V(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var bp=`data-floating-ui-focusable`,xp=`active`,Sp=`selected`,Cp=`ArrowLeft`,wp=`ArrowRight`,Tp=`ArrowUp`,Ep=`ArrowDown`,Dp=[Cp,wp],Op=[Tp,Ep];[...Dp,...Op];var kp={...fe},Ap=!1,jp=0,Mp=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+jp++;function Np(){let[e,t]=U(()=>Ap?Mp():void 0);return Zf(()=>{e??t(Mp())},[]),B(()=>{Ap=!0},[]),e}var Pp=kp.useId||Np;function Fp(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Ip=xe(null),Lp=xe(null),Rp=()=>ge(Ip)?.id||null,zp=()=>ge(Lp);function Bp(e){return`data-floating-ui-`+e}function Vp(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Hp=Bp(`safe-polygon`);function Up(e,t,n){if(n&&!Xf(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Wp(e){return typeof e==`function`?e():e}function Gp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=zp(),m=Rp(),h=$f(l),g=$f(c),_=$f(n),v=$f(d),y=K(),b=K(-1),x=K(),S=K(-1),C=K(!0),w=K(!1),T=K(()=>{}),E=K(!1),D=tp(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});B(()=>{if(!s)return;function e(e){let{open:t}=e;t||(Vp(b),Vp(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),B(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=zf(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=z(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Up(g.current,`close`,y.current);i&&!x.current?(Vp(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(Vp(b),r(!1,e,n))},[g,r]),k=tp(()=>{T.current(),x.current=void 0}),A=tp(()=>{if(w.current){let e=zf(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(Hp),w.current=!1}}),j=tp(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);B(()=>{if(!s)return;function e(e){if(Vp(b),C.current=!1,u&&!Xf(y.current)||Wp(v.current)>0&&!Up(g.current,`open`))return;let t=Up(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(j()){A();return}T.current();let t=zf(o.floating);if(Vp(S),E.current=!1,h.current&&i.current.floatingContext){n||Vp(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),j()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)}}else y.current===`touch`&&Ff(o.floating,e.relatedTarget)||O(e)}function a(e){j()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),j()||O(e)}})(e))}function c(){Vp(b)}function l(e){j()||O(e,!1)}if(I(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,O,k,A,r,n,_,p,g,h,i,j,v]),Zf(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(I(o.domReference)&&e){var t;let n=zf(o.floating).body;n.setAttribute(Hp,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,D]),Zf(()=>{n||(y.current=void 0,E.current=!1,k(),A())},[n,k,A]),B(()=>()=>{k(),Vp(b),Vp(S),A()},[s,o.domReference,k,A]);let M=V(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Xf(y.current)||n||Wp(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(Vp(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,Wp(v.current))))}}},[u,r,n,_,v]);return V(()=>s?{reference:M}:{},[s,M])}var Kp=0;function qp(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Kp);let a=()=>e?.focus({preventScroll:n});i?a():Kp=requestAnimationFrame(a)}function Jp(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ne(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Yp(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Xp(e){return e?.ownerDocument||document}var Zp={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qp(e){return e===`inert`?Zp.inert:e===`aria-hidden`?Zp[`aria-hidden`]:Zp.none}var $p=new WeakSet,em={},tm=0,nm=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,rm=e=>e&&(e.host||rm(e.parentNode)),im=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=rm(t);return e.contains(n)?n:null}).filter(e=>e!=null);function am(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=im(t,e),s=new Set,c=new Set(o),l=[];em[i]||(em[i]=new WeakMap);let u=em[i];o.forEach(d),f(t),s.clear();function d(e){e&&!s.has(e)&&(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){e&&!c.has(e)&&[].forEach.call(e.children,e=>{if(Oe(e)!==`script`){if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Qp(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&$p.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}}})}return tm++,()=>{l.forEach(e=>{let t=Qp(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!$p.has(e)&&a&&e.removeAttribute(a),$p.delete(e)),r||e.removeAttribute(i)}),tm--,tm||(Zp.inert=new WeakMap,Zp[`aria-hidden`]=new WeakMap,Zp.none=new WeakMap,$p=new WeakSet,em={})}}function om(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Xp(e[0]).body;return am(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var sm={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},cm=Fe(function(e,t){let[n,r]=U();Zf(()=>{Of()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Bp(`focus-guard`)]:``,style:sm};return A(`span`,{...e,...i})}),lm=xe(null),um=Bp(`portal`);function dm(e){e===void 0&&(e={});let{id:t,root:n}=e,r=Pp(),i=pm(),[a,o]=U(null),s=K(null);return Zf(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Zf(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(um,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Zf(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!ee(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(um,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function fm(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=dm({id:n,root:r}),[o,s]=U(null),c=K(null),l=K(null),u=K(null),d=K(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return B(()=>{if(!a||!i||f)return;function e(e){a&&op(e)&&(e.type===`focusin`?cp:sp)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),B(()=>{a&&(p||cp(a))},[p,a]),A(lm.Provider,{value:V(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&A(cm,{"data-type":`outside`,ref:c,onFocus:e=>{if(op(e,a)){var t;(t=u.current)==null||t.focus()}else ap(o?o.domReference:null)?.focus()}}),m&&a&&A(`span`,{"aria-owns":a.id,style:sm}),a&&P(t,a),m&&a&&A(cm,{"data-type":`outside`,ref:l,onFocus:e=>{if(op(e,a)){var t;(t=d.current)==null||t.focus()}else ip(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var pm=()=>ge(lm);function mm(e){return V(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var hm=20,gm=[];function _m(){gm=gm.filter(e=>e.isConnected)}function vm(e){_m(),e&&Oe(e)!==`body`&&(gm.push(e),gm.length>hm&&(gm=gm.slice(-20)))}function ym(){return _m(),gm[gm.length-1]}function bm(e){let t=np();return Tf(e,t)?e:Cf(e,t)[0]||e}function xm(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=np(),i=wf(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Tf(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Sm=Fe(function(e,t){return A(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:sm})});function Cm(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:h,events:g,dataRef:_,elements:{domReference:v,floating:y}}=t,b=tp(()=>_.current.floatingContext?.nodeId),x=tp(p),S=typeof o==`number`&&o<0,C=Vf(v)&&S,w=nm(),T=!w||a,E=!T||w&&f,D=$f(i),O=$f(o),k=$f(s),j=zp(),M=pm(),N=K(null),ee=K(null),te=K(!1),P=K(!1),ne=K(-1),F=K(-1),I=M!=null,L=Uf(y),ie=tp(function(e){return e===void 0&&(e=L),e?Cf(e,np()):[]}),ae=tp(e=>{let t=ie(e);return D.current.map(e=>v&&e===`reference`?v:L&&e===`floating`?L:t).filter(Boolean).flat()});B(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){Ff(L,Pf(zf(L)))&&ie().length===0&&!C&&Kf(e);let t=ae(),n=If(e);D.current[0]===`reference`&&n===v&&(Kf(e),e.shiftKey?qp(t[t.length-1]):qp(t[1])),D.current[1]===`floating`&&n===L&&e.shiftKey&&(Kf(e),qp(t[0]))}}let t=zf(L);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,L,l,D,C,ie,ae]),B(()=>{if(r||!y)return;function e(e){let t=If(e),n=ie().indexOf(t);n!==-1&&(ne.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,ie]),B(()=>{if(r||!d)return;function e(){P.current=!0,setTimeout(()=>{P.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=If(e);queueMicrotask(()=>{let i=b(),a=!(Ff(v,t)||Ff(y,t)||Ff(t,y)||Ff(M?.portalNode,t)||t!=null&&t.hasAttribute(Bp(`focus-guard`))||j&&(Wf(j.nodesRef.current,i).find(e=>Ff(e.context?.elements.floating,t)||Ff(e.context?.elements.domReference,t))||Gf(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,Uf(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&L&&xm(L,D),c&&n!==v&&!(r!=null&&r.isConnected)&&Pf(zf(L))===zf(L).body){re(L)&&L.focus();let e=ne.current,t=ie(),n=t[e]||t[t.length-1]||L;re(n)&&n.focus()}_.current.insideReactTree?_.current.insideReactTree=!1:(C||!l)&&t&&a&&!P.current&&t!==ym()&&(te.current=!0,h(!1,e,`focus-out`))})}let n=!(j||!M);function i(){Vp(F),_.current.insideReactTree=!0,F.current=window.setTimeout(()=>{_.current.insideReactTree=!1})}if(y&&re(v))return v.addEventListener(`focusout`,t),v.addEventListener(`pointerdown`,e),y.addEventListener(`focusout`,t),n&&y.addEventListener(`focusout`,i,!0),()=>{v.removeEventListener(`focusout`,t),v.removeEventListener(`pointerdown`,e),y.removeEventListener(`focusout`,t),n&&y.removeEventListener(`focusout`,i,!0)}},[r,v,y,L,l,j,M,h,d,c,ie,C,b,D,_]);let oe=K(null),se=K(null),ce=mm([oe,M?.beforeInsideRef]),le=mm([se,M?.afterInsideRef]);B(()=>{var e,t;if(r||!y)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+Bp(`portal`)+`]`))||[]),i=(t=(j?Gf(j.nodesRef.current,b()):[]).find(e=>Vf(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[y,i,...n,...x(),N.current,ee.current,oe.current,se.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,D.current.includes(`reference`)||C?v:null].filter(e=>e!=null),o=l||C?om(a,!E,E):om(a);return()=>{o()}},[r,v,y,l,D,M,C,T,E,j,b,x]),Zf(()=>{if(r||!re(L))return;let e=Pf(zf(L));queueMicrotask(()=>{let t=ae(L),n=O.current,r=(typeof n==`number`?t[n]:n.current)||L,i=Ff(L,e);!S&&!i&&m&&qp(r,{preventScroll:r===L})})},[r,m,L,S,ae,O]),Zf(()=>{if(r||!L)return;let e=zf(L);vm(Pf(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(te.current=!0),t===`outside-press`){if(r)te.current=!1;else if(Jf(n)||Yf(n))te.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?te.current=!1:te.current=!0}}}g.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,sm),I&&v&&v.insertAdjacentElement(`afterend`,n);function i(){if(typeof k.current==`boolean`){let e=v||ym();return e&&e.isConnected?e:n}return k.current.current||n}return()=>{g.off(`openchange`,t);let r=Pf(e),a=Ff(y,r)||j&&Wf(j.nodesRef.current,b(),!1).some(e=>Ff(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=bm(o);k.current&&!te.current&&re(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,L,k,_,g,j,I,v,b]),B(()=>(queueMicrotask(()=>{te.current=!1}),()=>{queueMicrotask(_m)}),[r]),Zf(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:d,open:m,onOpenChange:h,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,l,m,h,d,v]),Zf(()=>{r||L&&xm(L,D)},[r,L,D]);function ue(e){return r||!u||!l?null:A(Sm,{ref:e===`start`?N:ee,onClick:e=>h(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let de=!r&&T&&(!l||!C)&&(I||l);return A(Te,{children:[de&&A(cm,{"data-type":`inside`,ref:ce,onFocus:e=>{if(l){let e=ae();qp(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(te.current=!1,op(e,M.portalNode))ip(v)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}}),!C&&ue(`start`),n,ue(`end`),de&&A(cm,{"data-type":`inside`,ref:le,onFocus:e=>{if(l)qp(ae()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(d&&(te.current=!0),op(e,M.portalNode))ap(v)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}}})]})}var wm=0,Tm=`--floating-ui-scrollbar-width`;function Em(){let e=Ef(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(Tm,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(Tm),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var Dm=()=>{},Om=Fe(function(e,t){let{lockScroll:n=!1,...r}=e;return Zf(()=>{if(n)return wm++,wm===1&&(Dm=Em()),()=>{wm--,wm===0&&Dm()}},[n]),A(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function km(e){return re(e.target)&&e.target.tagName===`BUTTON`}function Am(e){return re(e.target)&&e.target.tagName===`A`}function jm(e){return Bf(e)}function Mm(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=K(),p=K(!1),m=V(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current;e.button===0&&s!==`click`&&(Xf(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=f.current;s===`mousedown`&&f.current?f.current=void 0:Xf(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){f.current=void 0,!(e.defaultPrevented||!u||km(e))&&(e.key===` `&&!jm(a)&&(e.preventDefault(),p.current=!0),!Am(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||km(e)||jm(a)||e.key===` `&&p.current&&(p.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,d,c]);return V(()=>o?{reference:m}:{},[o,m])}var Nm={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Pm={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Fm=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Im(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=zp(),g=tp(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=K(!1),{escapeKey:y,outsidePress:b}=Fm(p),{escapeKey:x,outsidePress:S}=Fm(m),C=K(!1),w=tp(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Wf(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}r(!1,qf(e)?e.nativeEvent:e,`escape-key`)}),T=tp(e=>{var t;let n=()=>{var t;w(e),(t=If(e))==null||t.removeEventListener(`keydown`,n)};(t=If(e))==null||t.addEventListener(`keydown`,n)}),E=tp(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=If(e),s=`[`+Bp(`inert`)+`]`,c=zf(i.floating).querySelectorAll(s),u=I(o)?o:null;for(;u&&!M(u);){let e=De(u);if(M(e)||!I(e))break;u=e}if(c.length&&I(o)&&!Rf(o)&&!Ff(o,i.floating)&&Array.from(c).every(e=>!Ff(u,e)))return;if(re(o)&&A){let t=M(o),n=L(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Wf(h.nodesRef.current,d).some(t=>Lf(e,t.context?.elements.floating));if(Lf(e,i.floating)||Lf(e,i.domReference)||f)return;let p=h?Wf(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r(!1,e,`outside-press`)}),O=tp(e=>{var t;let n=()=>{var t;E(e),(t=If(e))==null||t.removeEventListener(l,n)};(t=If(e))==null||t.addEventListener(l,n)});B(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},ae()?5:0)}let d=zf(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(I(i.domReference)&&(p=D(i.domReference)),I(i.floating)&&(p=p.concat(D(i.floating))),!I(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(D(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),B(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=V(()=>({onKeyDown:w,...u&&{[Nm[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=V(()=>({onKeyDown:w,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[Pm[l]]:()=>{a.current.insideReactTree=!0}}),[w,l,a]);return V(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Lm(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=Pp(),a=K({}),[o]=U(()=>Fp()),s=Rp()!=null,[c,l]=U(r.reference),u=tp((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=V(()=>({setPositionReference:l}),[]),f=V(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return V(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Rm(e){e===void 0&&(e={});let{nodeId:t}=e,n=Lm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=U(null),[s,c]=U(null),l=i?.domReference||a,u=K(null),d=zp();Zf(()=>{l&&(u.current=l)},[l]);let f=mp({...e,elements:{...i,...s&&{reference:s}}}),p=z(e=>{let t=I(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=z(e=>{(I(e)||e===null)&&(u.current=e,o(e)),(I(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!I(e))&&f.refs.setReference(e)},[f.refs]),h=V(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=V(()=>({...f.elements,domReference:l}),[f.elements,l]),_=V(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Zf(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),V(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function zm(){return Af()&&Of()}function Bm(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=K(!1),u=K(-1),d=K(!0);B(()=>{if(!s)return;let e=F(o.domReference);function t(){!n&&re(o.domReference)&&o.domReference===Pf(zf(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),zm()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),zm()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),B(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),B(()=>()=>{Vp(u)},[]);let f=V(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=If(e.nativeEvent);if(c&&I(t)){if(zm()&&!e.relatedTarget){if(!d.current&&!Bf(t))return}else if(!Hf(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=I(t)&&t.hasAttribute(Bp(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Pf(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||Ff(a.current.floatingContext?.refs.floating.current,e)||Ff(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return V(()=>s?{reference:f}:{},[s,f])}function Vm(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[xp]:t,[Sp]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[bp]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[xp,Sp].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Hm(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=z(t=>Vm(t,e,`reference`),t),a=z(t=>Vm(t,e,`floating`),n),o=z(t=>Vm(t,e,`item`),r);return V(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Um=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Wm(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=Pp(),c=r.domReference?.id||s,l=V(()=>Uf(r.floating)?.id||i,[r.floating,i]),u=Um.get(o)??o,d=Rp()!=null,f=V(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=V(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=z(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return V(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var Gm=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function Km(e,t){return typeof e==`function`?e(t):e}function qm(e,t){let[n,r]=U(e);return e&&!n&&r(!0),B(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function Jm(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=U(`unmounted`),c=qm(n,a);return!c&&o===`close`&&s(`unmounted`),Zf(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{te(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Ym(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=V(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=U(()=>({...Km(a,l),...Km(n,l)})),{isMounted:h,status:g}=Jm(e,{duration:o}),_=$f(n),v=$f(r),y=$f(i),b=$f(a);return Zf(()=>{let e=Km(_.current,l),t=Km(y.current,l),n=Km(b.current,l),r=Km(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(Gm).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(Gm).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function Xm(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Xm(e,t.id,n)])}function Zm(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Qm(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function $m(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){Vp(i),u()}if(Vp(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Yp(e),v=e.type===`mouseleave`,y=Jp(c.floating,_),b=Jp(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Qm(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&I(e.relatedTarget)&&Jp(c.floating,e.relatedTarget)||f&&Xm(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function ee(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Zm([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Zm([m,h],ee([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var eh=He(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),th=He(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),nh=He(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),rh=He(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ih=He(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ah=He(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),oh=He(`clapperboard`,[[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z`,key:`1tn4o7`}],[`path`,{d:`m6.2 5.3 3.1 3.9`,key:`iuk76l`}],[`path`,{d:`m12.4 3.4 3.1 4`,key:`6hsd6n`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`,key:`ltgou9`}]]),sh=He(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ch=He(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),lh=He(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),uh=He(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),dh=He(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),fh=He(`grid-3x2`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ph=He(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),mh=He(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),hh=He(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),gh=He(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),_h=He(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),vh=He(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),yh=He(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),bh=He(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),xh=He(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Sh=He(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ch=He(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),wh=He(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Th=He(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Eh=He(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Dh=He(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Oh=He(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),kh=He(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ah=He(`volume`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}]]),jh=He(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Mh=e=>e===`/`||e===`/media`||e.startsWith(`/media/`),Nh=e=>e.startsWith(`/title/`),Ph=({from:e,to:t,kind:n,asked:r=!1})=>r?!0:n===`pop`||Mh(e.pathname)&&Mh(t.pathname)?!1:n!==`replace`||e.pathname!==t.pathname&&!(Nh(e.pathname)&&Nh(t.pathname)),Fh=()=>{window.scrollTo({top:0,left:0,behavior:`instant`})},Ih=0,Lh=()=>{Rh(),Ih=requestAnimationFrame(()=>{Ih=0,Fh()})},Rh=()=>{cancelAnimationFrame(Ih),Ih=0},zh=!1,Bh=()=>{zh=!0},Vh=()=>{let e=zh;return zh=!1,e};pe();var Hh=({className:e,style:t}={})=>Pe(`iframe`,{src:di(),title:`Sign in to FKN`,className:e,style:{border:`none`,width:150,height:40,background:`transparent`,colorScheme:`normal`,...t}}),Uh=8e3,Wh=async(e,t=Uh)=>{let n,r=new Promise(e=>{n=setTimeout(()=>e(`timeout`),t)});try{return await Promise.race([Promise.resolve().then(e).then(()=>`settled`,()=>`settled`),r])}finally{clearTimeout(n)}};G();var Gh=()=>Promise.race([nt.info(),new Promise(e=>setTimeout(()=>e(null),4e3))]),Kh=()=>{let[e,t]=U(null),[n,r]=U(!1),i=z(()=>Gh().then(e=>{t(e),r(!0)}).catch(()=>r(!0)),[]);return B(()=>{let e=!1,t=nt.onChange(()=>{e||i()});i();let n=window.setInterval(()=>{e||i()},3e4);return()=>{e=!0,window.clearInterval(n),t.then(e=>e()).catch(()=>{})}},[i]),{info:e,ready:n,logout:z(async()=>{let e=await Wh(()=>nt.logout());return await i(),e},[i])}},qh={categoryBar:1,hoverCard:150,sourcePopup:300,filterMenu:500,mediaModal:1e3,header:1100,headerPopup:1150,franchiseDialog:1200,pluginPrompt:2e3,partyCursor:3e3};G();var Jh=`https://fkn.app/account`,Yh=150,Xh=40,Zh=O`
|
|
22
|
+
`,i=Error(r+sc+n);throw i.name=`Graphcache Error`,i}}var lc={},uc=e=>e._directives||lc,dc=e=>e.name.value,fc=e=>e.typeCondition.name.value,pc=e=>e.alias?e.alias.value:e.name.value,mc=[],hc=e=>e.selectionSet?e.selectionSet.selections:mc,gc=e=>e.typeCondition?e.typeCondition.name.value:null,_c=(e,t)=>{var n=null;if(e.arguments)for(var r=0,i=e.arguments.length;r<i;r++){var a=e.arguments[r],o=An(a.value,t);o!=null&&(n||={},n[dc(a)]=o)}return n},vc=(e,t)=>{if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=dc(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},yc=(e,t)=>{var n={};if(!t)return n;if(e.variableDefinitions)for(var r=0,i=e.variableDefinitions.length;r<i;r++){var a=e.variableDefinitions[r],o=dc(a.variable);n[o]=t[o]===void 0&&a.defaultValue?An(a.defaultValue,t):t[o]}for(var s in t)s in n||(n[s]=t[s]);return n};function bc(e){for(var t=0;t<e.definitions.length;t++)if(e.definitions[t].kind===tn.OPERATION_DEFINITION)return e.definitions[t];cc(!1,``,1)}var xc=e=>{for(var t={},n=0;n<e.definitions.length;n++){var r=e.definitions[n];r.kind===tn.FRAGMENT_DEFINITION&&(t[dc(r)]=r)}return t},Sc=(e,t)=>{var n=uc(e);if(n.include||n.skip)for(var r in n){var i=n[r];if(i&&(r===`include`||r===`skip`)&&i.arguments&&i.arguments[0]&&dc(i.arguments[0])===`if`){var a=An(i.arguments[0].value,t);return r===`include`?!!a:!a}}return!0},Cc=(e,t)=>{var{defer:n}=uc(e);if(n){for(var r of n.arguments||[])if(dc(r)===`if`)return!!An(r.value,t);return!0}return!1},wc=e=>{var{optional:t,required:n}=uc(e);if(n)return!1;if(t)return!0},Tc=`__`,Ec=(e,t,n,r)=>{var i=kc(e,t,n,r);return!!i&&i.type.kind!==`NON_NULL`},Dc=(e,t,n,r)=>{var i=kc(e,t,n,r);if(!i)return!1;var a=i.type.kind===`NON_NULL`?i.type.ofType:i.type;return a.kind===`LIST`&&a.ofType.kind!==`NON_NULL`},Oc=(e,t,n)=>{if(!n)return!1;var r=gc(t);return!r||n===r?!0:e.types.has(r)&&e.types.get(r).kind===`OBJECT`?r===n:((function(e,t){cc(e.types.has(t)&&(e.types.get(t).kind===`INTERFACE`||e.types.get(t).kind===`UNION`),``,5)})(e,r),Ac(e,n),e.isSubType(r,n))},kc=(e,t,n,r)=>{if(n.indexOf(Tc)!==0&&t.indexOf(Tc)!==0)return Ac(e,t),e.types.get(t).fields()[n]};function Ac(e,t){cc(e.types.has(t)&&e.types.get(t).kind===`OBJECT`,``,3)}var jc=(e,t)=>t?`${e}(${Hs(t)})`:e,Mc=(e,t)=>`${e}.${t}`,Nc=e=>{var t=e.indexOf(`(`);return t>-1?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},Pc=e=>{var t=e.indexOf(`.`);return{entityKey:e.slice(0,t).replace(/%2e/g,`.`),fieldKey:e.slice(t+1)}},Fc=null,Ic=null,X=null,Lc=null,Rc=null,zc=null,Bc=!1,Vc=!1;function Hc(e,t){var n;if(e){if(Fc.has(e))return e;n=Ic.get(e)}return n??=t?[]:{},e&&Ic.set(e,n),Fc.add(n),n}var Uc=e=>!!e&&Fc.has(e),Wc=(e,t,n,r,i)=>{Fc=new WeakSet,Ic=new WeakMap,Rc=e,X=t,zc=new Set,Vc=!!r,Bc=!!i,n?Rc===`read`?Lc=n:r||t.hydrating||t.optimisticOrder.length>1?(!r&&!t.commutativeKeys.has(n)?ll(t,n):r&&(t.optimisticOrder.indexOf(n)!==-1&&!t.commutativeKeys.has(n)&&t.optimisticOrder.splice(t.optimisticOrder.indexOf(n),1),t.commutativeKeys.delete(n)),Lc=n,ul(t,n)):(Lc=null,fl(t,n)):Lc=null},Gc=()=>{var e=X,t=Lc;if(Vc=!1,Lc=null,!e.hydrating&&t&&e.optimisticOrder.indexOf(t)>-1)for(var n=e.optimisticOrder.length;--n>=0&&e.dirtyKeys.has(e.optimisticOrder[n])&&e.commutativeKeys.has(e.optimisticOrder[n]);)pl(e.optimisticOrder[n]);Fc=null,Ic=null,Rc=null,X=null,zc=null,e.defer||!e.storage&&e.optimisticOrder.length||(e.defer=!0,setTimeout((()=>{Wc(`read`,e,null),el(),hl(),Gc(),e.defer=!1})))},Kc=(e,t,n)=>{t&&!n&&e.deferredKeys.delete(t),Wc(`write`,e,t,n),Gc()},qc=new Set,Jc=(e,t,n,r)=>{var i=Lc?e.optimistic.get(Lc):e.base,a=i.get(t);a===void 0&&i.set(t,a=Object.create(null)),r===void 0&&!Lc?delete a[n]:a[n]=r},Yc=(e,t,n)=>{for(var r,i=!Vc&&Rc===`read`&&Lc&&X.commutativeKeys.has(Lc),a=0,o=X.optimisticOrder.length;a<o;a++){var s=X.optimisticOrder[a],c=e.optimistic.get(s);if(i&&=s!==Lc,c&&(!i||!X.commutativeKeys.has(s))&&(!Vc||Rc===`write`||X.commutativeKeys.has(s))&&(r=c.get(t))!==void 0&&n in r)return r[n]}return(r=e.base.get(t))===void 0?void 0:r[n]};function Xc(e){return X.refCount.get(e)||0}var Zc=(e,t)=>{if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)Zc(e[n],t);else typeof e==`string`&&((e,t)=>{var n=Xc(e),r=n+t>0?n+t:0;X.refCount.set(e,r),r?!n&&r&&X.gc.delete(e):X.gc.add(e)})(e,t)},Qc=(e,t,n)=>{if(n!==void 0)for(var r in n)t.has(r)||(e.push(Nc(r)),t.add(r))},$c=(e,t,n,r)=>{Qc(e,t,r.base.get(n));for(var i=0,a=X.optimisticOrder.length;i<a;i++){var o=r.optimistic.get(X.optimisticOrder[i]);o!==void 0&&Qc(e,t,o.get(n))}},el=()=>{if(!X.optimisticOrder.length){for(var e of X.gc.keys())if(X.gc.delete(e),!(Xc(e)>0)){var t=X.records.base.get(e);X.refCount.delete(e),X.records.base.delete(e);var n=t&&t.__typename;if(n){var r=X.types.get(n);r&&r.delete(e)}var i=X.links.base.get(e);if(i)for(var a in X.links.base.delete(e),i)Zc(i[a],-1)}}},tl=(e,t)=>{e===X.queryRootKey?t!==void 0&&t!==`__typename`&&zc.add(Mc(e,t)):zc.add(e)},nl=(e,t)=>{!Vc&&X.storage&&X.persist.add(((e,t)=>`${e.replace(/\./g,`%2e`)}.${t}`)(e,t))},rl=(e,t)=>(Rc===`read`&&tl(e,t),Yc(X.records,e,t)),il=(e,t)=>(Rc===`read`&&tl(e,t),Yc(X.links,e,t)),al=(e,t)=>{var n=X.abstractToConcreteMap.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),X.abstractToConcreteMap.set(e,r)}},ol=(e,t,n)=>{gl(Yc(X.records,e,t),n)||(tl(e,t),nl(e,t)),Jc(X.records,e,t,n)},sl=(e,t)=>rl(e,t)!==void 0||il(e,t)!==void 0,cl=(e,t,n)=>{var r=Lc?X.links.optimistic.get(Lc):X.links.base;if(!Lc){var i=r&&r.get(e);Zc(i&&i[t],-1),Zc(n,1)}gl(Yc(X.links,e,t),n)||(tl(e,t),nl(e,t)),Jc(X.links,e,t,n)},ll=(e,t,n)=>{var r=e.optimisticOrder.indexOf(t);if(r>-1&&e.optimisticOrder.splice(r,1),n)for(e.deferredKeys.add(t),r=r>-1?r:0;r<e.optimisticOrder.length&&!e.deferredKeys.has(e.optimisticOrder[r])&&(!e.dirtyKeys.has(e.optimisticOrder[r])||!e.commutativeKeys.has(e.optimisticOrder[r]));r++);else e.deferredKeys.delete(t),r>-1&&!e.commutativeKeys.has(t)&&dl(e,t),r=0;e.optimisticOrder.splice(r,0,t),e.commutativeKeys.add(t)},ul=(e,t)=>{e.optimisticOrder.indexOf(t)===-1&&e.optimisticOrder.unshift(t),e.dirtyKeys.has(t)||(e.dirtyKeys.add(t),e.links.optimistic.set(t,new Map),e.records.optimistic.set(t,new Map))},dl=(e,t)=>{e.dirtyKeys.has(t)&&(e.dirtyKeys.delete(t),e.records.optimistic.delete(t),e.links.optimistic.delete(t),e.deferredKeys.delete(t))},fl=(e,t)=>{var n=e.optimisticOrder.indexOf(t);n>-1&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),dl(e,t)},pl=e=>{var t=zc;zc=new Set,Rc=`write`;var n=X.links.optimistic.get(e);if(n)for(var r of n.entries()){var i=r[0],a=r[1];for(var o in a)cl(i,o,a[o])}var s=X.records.optimistic.get(e);if(s)for(var c of s.entries()){var l=c[0],u=c[1];for(var d in u)ol(l,d,u[d])}zc=t,fl(X,e)},ml=e=>{var{links:t,records:n}=X,r=[],i=new Set;return tl(e),$c(r,i,e,t),$c(r,i,e,n),r},hl=()=>{if(X.storage){Vc=!0,Rc=`read`;var e={};for(var t of X.persist.keys()){var{entityKey:n,fieldKey:r}=Pc(t),i=void 0;e[t]=(i=il(n,r))===void 0?(i=rl(n,r))===void 0?void 0:Hs(i):`:${Hs(i)}`}Vc=!1,X.storage.writeData(e),X.persist.clear()}};function gl(e,t){return typeof e!=typeof t||e!==t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&!e.some(((e,n)=>e!==t[n])):!0}var _l=null,vl=!1,yl=void 0,bl=e=>e.__internal.path.length>0&&e.__internal.errorMap?e.__internal.errorMap[e.__internal.path.join(`.`)]:void 0,xl=(e,t,n,r,i,a)=>{var o={store:e,variables:t,fragments:n,parent:{__typename:r},parentTypeName:r,parentKey:i,parentFieldKey:``,fieldName:``,error:void 0,partial:!1,hasNext:!1,optimistic:Vc,__internal:{path:[],errorMap:void 0}};if(a&&a.graphQLErrors)for(var s=0;s<a.graphQLErrors.length;s++){var c=a.graphQLErrors[s];c.path&&c.path.length&&(o.__internal.errorMap||(o.__internal.errorMap=Object.create(null)),o.__internal.errorMap[c.path.join(`.`)]=c)}return o},Sl=(e,t,n,r,i,a)=>{_l=e,e.parent=t,e.parentTypeName=n,e.parentKey=r,e.parentFieldKey=i,e.fieldName=a,e.error=bl(e)},Cl=(e,t,n,r,i)=>{if(!t)return!1;var a=gc(e);return!a||t===a||!hc(e).some((e=>e.kind===tn.FIELD&&!sl(n,jc(dc(e),_c(e,r)))))},wl=class{constructor(e,t,n,r,i,a){this.typename=e,this.entityKey=t,this.ctx=a,this.stack=[{selectionSet:i,index:0,defer:n,optional:r}]}next(){for(;this.stack.length>0;){for(var e=this.stack[this.stack.length-1];e.index<e.selectionSet.length;){var t=e.selectionSet[e.index++];if(Sc(t,this.ctx.variables)){if(t.kind!==tn.FIELD){var n=t.kind===tn.INLINE_FRAGMENT?t:this.ctx.fragments[dc(t)];if(n){var r=!n.typeCondition||(this.ctx.store.schema?Oc(this.ctx.store.schema,n,this.typename):this.ctx.store.possibleTypeMap?Tl(this.ctx.store.possibleTypeMap,n.typeCondition.name.value,this.typename):Rc===`read`&&El(n.typeCondition.name.value,this.typename)||Cl(n,this.typename,this.entityKey,this.ctx.variables,this.ctx.store.logger));if(r||Rc===`write`&&!this.ctx.store.schema){var i=wc(t);r&&n.typeCondition&&this.typename!==n.typeCondition.name.value&&al(n.typeCondition.name.value,this.typename),this.stack.push(e={selectionSet:hc(n),index:0,defer:e.defer||Cc(t,this.ctx.variables),optional:i===void 0?e.optional:i})}}}else if(Rc===`write`||!t._generated)return vl=e.defer,yl=e.optional,t}}this.stack.pop()}}},Tl=(e,t,n)=>{if(!n)return!1;if(t===n)return!0;var r=e.get(t);return r&&r.has(n)},El=(e,t)=>{if(!t)return!1;if(e===t)return!0;if((e=>X.types.has(e))(e))return!1;var n=(e=>X.abstractToConcreteMap.get(e)||qc)(e);return n.size&&n.has(t)},Dl=e=>e??null,Ol=(e,t)=>{if(!t)return t||null;if(Array.isArray(t)){for(var n=Array(t.length),r=0,i=n.length;r<i;r++)n[r]=Ol(e,t[r]);return n}return e.keyOfEntity(t)},kl=(e,t,n,r)=>{var i=ac(t.query),a=bc(i),o=e.rootFields[a.operation],s=hc(a),c=xl(e,yc(a,t.variables),xc(i),o,o,r),l=o===c.store.rootFields.query?Nl(c,o,s,n||Hc()):Al(c,o,s,n||Hc());return{dependencies:zc,partial:c.partial||!l,hasNext:c.hasNext,data:l||null}},Al=(e,t,n,r)=>{if(typeof(e.store.rootNames[t]?t:r.__typename)!=`string`)return r;for(var i=new wl(t,t,!1,void 0,n,e),a,o=Bc,s=Hc(r);a=i.next();){var c=pc(a),l=r[c];e.__internal.path.push(c);var u=void 0;u=a.selectionSet&&l!==null?jl(e,hc(a),Dl(l)):l,o||=u!==l,u!==void 0&&(s[c]=u),e.__internal.path.pop()}return o?s:r},jl=(e,t,n)=>{if(Array.isArray(n)){for(var r=Array(n.length),i=Bc,a=0,o=n.length;a<o;a++)e.__internal.path.push(a),r[a]=jl(e,t,n[a]),i||=r[a]!==n[a],e.__internal.path.pop();return i?r:n}if(n===null)return null;var s=e.store.keyOfEntity(n);return s===null?Al(e,n.__typename,t,n):Nl(e,s,t,n)||null};function Ml(e,t,n,r){var i=r.store.resolvers[t],a=i&&i[n],o;for(var s in e){var c=e[s];if(c&&s!==`include`&&s!==`skip`&&r.store.directives[s])return o=r.store.directives[s](_c(c,r.variables)),o}return o||a}var Nl=(e,t,n,r,i)=>{var{store:a}=e,o=t===a.rootFields.query,s=i&&a.keyOfEntity(i)||t,c=o?t:rl(s,`__typename`)||i&&i.__typename;if(typeof c==`string`&&!(i&&c!==i.__typename)){for(var l=new wl(c,s,!1,void 0,n,e),u=!1,d=!1,f=Bc,p,m=e.partial,h=Hc(r);(p=l.next())!==void 0;){var g=dc(p),_=_c(p,e.variables),v=pc(p),y=uc(p),b=Ml(y,c,g,e),x=jc(g,_),S=Mc(s,x),C=rl(s,x),w=i?i[g]:void 0;e.__internal.path.push(v);var T=void 0;if(g===`__typename`)T=c;else if(w!==void 0&&p.selectionSet===void 0)T=w;else if(Rc===`read`&&b){var E=h;if(p.selectionSet===void 0&&C!==void 0&&(E={...h,[v]:C,[g]:C}),Sl(e,E,c,s,x,g),T=b(E,_||{},a,e),p.selectionSet&&(T=Pl(e,c,g,S,hc(p),h[v]===void 0?r[v]:h[v],T,Uc(r))),a.schema&&T===null&&!Ec(a.schema,c,g,e.store.logger))return}else if(!p.selectionSet)T=C;else if(w!==void 0)T=Pl(e,c,g,S,hc(p),h[v]===void 0?r[v]:h[v],w,Uc(r));else{var D=il(s,x);D===void 0?typeof C==`object`&&C&&(T=C):T=Fl(e,D,c,g,hc(p),h[v]===void 0?r[v]:h[v],Uc(r))}if(!vl&&T===void 0&&(y.optional||yl&&!y.required||bl(e)||!y.required&&a.schema&&Ec(a.schema,c,g,e.store.logger))?(e.partial=!0,T=null):T===null&&(y.required||!1===yl)?(e.store.logger,T=void 0):u||=g!==`__typename`,e.__internal.path.pop(),f||=T!==r[v],T!==void 0)h[v]=T;else if(vl)d=!0;else{e.store.logger,e.partial=m;return}}return e.partial=e.partial||m,e.hasNext=e.hasNext||d,o&&e.partial&&!u?void 0:f?h:r}},Pl=(e,t,n,r,i,a,o,s)=>{if(Array.isArray(o)){for(var{store:c}=e,l=c.schema?Dc(c.schema,t,n,e.store.logger):!1,u=e.partial,d=Hc(a,!0),f=Bc||!Array.isArray(a)||o.length!==a.length,p=0,m=o.length;p<m;p++){e.__internal.path.push(p);var h=Pl(e,t,n,Mc(r,`${p}`),i,a?.[p],o[p],s);if(e.__internal.path.pop(),h===void 0&&!l){e.partial=u;return}e.partial=e.partial||h===void 0&&l,d[p]=h??null,f||=d[p]!==a[p]}return f?d:a}if(o==null)return o;if(s&&a===null)return null;if(Il(o)){var g=a||Hc(a);return typeof o==`string`?Nl(e,o,i,g):Nl(e,r,i,g,o)}},Fl=(e,t,n,r,i,a,o)=>{if(Array.isArray(t)){for(var{store:s}=e,c=s.schema?Dc(s.schema,n,r,e.store.logger):!1,l=Hc(a,!0),u=e.partial,d=Bc||!Array.isArray(a)||t.length!==a.length,f=0,p=t.length;f<p;f++){e.__internal.path.push(f);var m=Fl(e,t[f],n,r,i,a?.[f],o);if(e.__internal.path.pop(),m===void 0&&!c){e.partial=u;return}e.partial=e.partial||m===void 0&&c,l[f]=m||null,d||=l[f]!==a[f]}return d?l:a}return t===null||a===null&&o?null:Nl(e,t,i,a||Hc(a))},Il=e=>typeof e==`string`||typeof e==`object`&&typeof e.__typename==`string`,Ll=(e,t,n)=>{for(var r=t?[{fieldKey:jc(t,n)}]:ml(e),i=0,a=r.length;i<a;i++){var{fieldKey:o}=r[i];il(e,o)===void 0?ol(e,o,void 0):cl(e,o,void 0)}},Rl=(e,t)=>{for(var n of(e=>X.types.get(e)||qc)(e))t.includes(n)||Ll(n)},zl=(e,t,n,r)=>{var i=ac(t.query),a=bc(i),o={data:n||Hc(),dependencies:zc},s=e.rootFields[a.operation];return Bl(xl(e,yc(a,t.variables),xc(i),s,s,r),s,hc(a),o.data),o},Bl=(e,t,n,r)=>{var i=e.store.rootNames[t]||`query`,a=!!e.store.rootNames[t],o=a?t:r.__typename;if(!o&&t&&e.optimistic&&(o=rl(t,`__typename`)),o)!a&&t&&(ol(t,`__typename`,o),((e,t)=>{var n=X.types.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),X.types.set(e,r)}})(o,t));else return;for(var s=e.store.updates[o],c=new wl(o,t||o,!1,void 0,n,e),l;l=c.next();){var u=dc(l),d=_c(l,e.variables),f=jc(u,d),p=pc(l),m=r[e.optimistic?u:p];if(!(u===`__typename`||m===void 0&&(vl||e.optimistic&&i===`query`))){e.__internal.path.push(p);var h=void 0;if(e.optimistic&&i===`mutation`){if(!(h=e.store.optimisticMutations[u]))continue}else e.optimistic&&typeof m==`function`&&(h=m);if(h&&(Sl(e,r,o,t||o,f,u),m=Dl(h(d||{},e.store,e))),m!==void 0){if(l.selectionSet){if(t&&i===`query`){var g=Mc(t,f),_=Vl(e,hc(l),Dl(m),g,e.optimistic?il(t||o,f):void 0);cl(t||o,f,_)}else Vl(e,hc(l),Dl(m))}else t&&i===`query`&&ol(t||o,f,m!==null||!bl(e)?m:void 0);var v=s&&s[u];if(v)Sl(e,r,o,t||o,f,u),r[u]=m,v(r,d||{},e.store,e);else if(o===e.store.rootFields.mutation&&!e.optimistic){if(m&&Array.isArray(m))for(var y=m.map((t=>e.store.keyOfEntity(t)||``)),b=0,x=m.length;b<x;b++){var S=y[b];if(S&&m[b].__typename){var C=rl(S,`__typename`),w=Xc(S);C&&!w&&Rl(m[b].__typename,y)}}else if(m&&typeof m==`object`){var T=e.store.keyOfEntity(m);if(T){var E=rl(T,`__typename`),D=Xc(T);E&&D||!m.__typename||Rl(m.__typename,[T])}}}e.__internal.path.pop()}}}},Vl=(e,t,n,r,i)=>{if(Array.isArray(n)){for(var a=Array(n.length),o=0,s=n.length;o<s;o++){e.__internal.path.push(o);var c=r?Mc(r,`${o}`):void 0,l=Vl(e,t,n[o],c,i?.[o]);a[o]=l,e.__internal.path.pop()}return a}if(n===null)return bl(e)?void 0:null;var u=e.store.keyOfEntity(n)||(typeof i==`string`?i:null);n.__typename;var d=u||r;return Bl(e,d,t,n),d||null},Hl=class{constructor(e){e||={},this.logger=e.logger,this.resolvers=e.resolvers||{},this.directives=e.directives||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.globalIDs=Array.isArray(e.globalIDs)?new Set(e.globalIDs):!!e.globalIDs;var t=`Query`,n=`Mutation`,r=`Subscription`;if(e.schema){var i=(({__schema:e})=>{var t=new Map,n=e=>{var t;return()=>{if(!t){t={};for(var n=0;n<e.length;n++)t[e[n].name]=e[n]}return t}},r=e=>{switch(e.kind){case`OBJECT`:case`INTERFACE`:return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map((e=>({name:e.name,type:e.type,args:n(e.args)}))))};case`UNION`:return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},i={query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:void 0,isSubType(e,n){var r=t.get(e),i=t.get(n);return!r||!i?!1:r.kind===`UNION`?!!r.types()[n]:r.kind!==`OBJECT`&&i.kind===`OBJECT`?!!i.interfaces()[e]:e===n}};if(e.types){i.types=t;for(var a=0;a<e.types.length;a++){var o=e.types[a];if(o&&o.name){var s=r(o);s&&t.set(o.name,s)}}}return i})(e.schema);t=i.query||t,n=i.mutation||n,r=i.subscription||r,i.types&&(this.schema=i)}if(!this.schema&&e.possibleTypes){this.possibleTypeMap=new Map;for(var a of Object.entries(e.possibleTypes)){var[o,s]=a;this.possibleTypeMap.set(o,new Set(s))}}this.updates=e.updates||{},this.rootFields={query:t,mutation:n,subscription:r},this.rootNames={[t]:`query`,[n]:`mutation`,[r]:`subscription`},this.data=(c=t,{hydrating:!1,defer:!1,gc:new Set,types:new Map,persist:new Set,queryRootKey:c,refCount:new Map,links:{optimistic:new Map,base:new Map},abstractToConcreteMap:new Map,records:{optimistic:new Map,base:new Map},deferredKeys:new Set,commutativeKeys:new Set,dirtyKeys:new Set,optimisticOrder:[],storage:null});var c;this.schema}keyOfField(e,t){return jc(e,t)}keyOfEntity(e){if(_l&&e===_l.parent)return _l.parentKey;if(e==null||typeof e==`string`)return e||null;if(!e.__typename)return null;if(this.rootNames[e.__typename])return e.__typename;var t=null;this.keys[e.__typename]?t=this.keys[e.__typename](e)||null:e.id==null?e._id!=null&&(t=`${e._id}`):t=`${e.id}`;var n=e.__typename;return!0===this.globalIDs||this.globalIDs&&this.globalIDs.has(n)||!t?t:`${n}:${t}`}resolve(e,t,n){var r=this.keyOfEntity(e);if(r){var i=jc(t,n),a=rl(r,i);if(a!==void 0)return a;var o=il(r,i);return o!==void 0&&(o=Ol(this,o)),o}}invalidate(e,t,n){var r=this.keyOfEntity(e);e&&typeof e==`string`&&!t&&!n&&!this.resolve(e,`__typename`)?Rl(e,[]):(cc(r,``,19),Ll(r,t,n))}inspectFields(e){var t=this.keyOfEntity(e);return t?ml(t):[]}updateQuery(e,t){var n=tc(e.query,e.variables),r=t(this.readQuery(n));r!==null&&zl(this,n,r,void 0)}readQuery(e){var t=tc(e.query,e.variables);return kl(this,t,void 0,void 0).data}readFragment(e,t,n,r){return((e,t,n,r,i)=>{var a=xc(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=fc(o);typeof n!=`string`&&!n.__typename&&(n.__typename=s);var c=e.keyOfEntity(n);return c&&Nl(xl(e,r||{},a,s,c,void 0),c,hc(o),Hc())||null})(this,ac(e),t,n,r)}writeFragment(e,t,n,r){((e,t,n,r,i)=>{var a=xc(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=fc(o),c={__typename:s,...n},l=e.keyOfEntity(c);l&&Bl(xl(e,r||{},a,s,l,void 0),l,hc(o),c)})(this,ac(e),t,n,r)}link(e,t,...n){var r=n.length===2?n[0]:null,i=n.length===2?n[1]:n[0],a=this.keyOfEntity(e);a&&cl(a,jc(t,r),Ol(this,i))}},Ul=(e,t)=>oc(e.kind,e,{...e.context,meta:{...e.context.meta,...t}}),Wl=(e,t)=>oc(e.kind,e,{...e.context,requestPolicy:t}),Gl=e=>({forward:t,client:n,dispatchDebug:r})=>{var i=new Hl(e);e&&e.storage&&(i.data.hydrating=!0,e.storage.readData().then((t=>{((e,t,n)=>{for(var r in Wc(`write`,e,null),n){var i=n[r];if(i!==void 0){var{entityKey:a,fieldKey:o}=Pc(r);i[0]===`:`?il(a,o)===void 0&&cl(a,o,JSON.parse(i.slice(1))):rl(a,o)===void 0&&ol(a,o,JSON.parse(i))}}e.storage=t,e.hydrating=!1,Gc()})(i.data,e.storage,t),e.storage.onCacheHydrated&&e.storage.onCacheHydrated()})));var a=new Map,o=[],s=new Map,c=new Map,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=e=>{for(var t of e.values())if(l.has(t))return!0;return!1},h=(e,t)=>{if(t)for(var n of t.values()){var r=d.get(n);if(r)for(var i of r.values())e.add(i)}},g=(e,t,r)=>{for(var i of t.values())if(i!==e.key){var a=s.get(i);if(a){e.kind===`query`&&p.add(i);var o=`cache-first`;u.has(i)&&(u.delete(i),o=`cache-and-network`),n.reexecuteOperation(Wl(a,o))}}if(!r){var c=f;f=p,e.kind===`query`&&f.add(e.key),(p=c).clear()}},_=e=>{var t=!1;if(e.kind===`query`)ll(i.data,e.key),s.set(e.key,e);else if(e.kind===`teardown`)return s.delete(e.key),c.delete(e.key),f.delete(e.key),Kc(i.data,e.key),e;else if(e.kind===`mutation`&&e.context.requestPolicy!==`network-only`){s.set(e.key,e),Wc(`write`,i.data,e.key,!0,!1);var{dependencies:n}=zl(i,e,void 0,void 0);if(Gc(),n.size){for(var r of n.values())l.add(r);a.set(e.key,n);var o=new Set;h(o,n),g(e,o,!0),t=!0}}return oc(e.kind,{key:e.key,query:ac(e.query),variables:e.variables?vc(bc(e.query),e.variables):e.variables},{...e.context,optimistic:t})},v=(e,t)=>{for(var n of t.values()){var r=d.get(n);r||d.set(n,r=new Set),r.add(e.key)}},y=e=>{Wc(`read`,i.data,void 0,!1,!1);var t=kl(i,e,c.get(e.key),void 0);Gc();var n=t.data?!t.partial&&!t.hasNext?`hit`:`partial`:`miss`;return c.set(e.key,t.data),s.set(e.key,e),v(e,t.dependencies),{outcome:n,operation:e,data:t.data,dependencies:t.dependencies,hasNext:t.hasNext}},b=(e,t)=>{var n=s.get(e.operation.key)||e.operation;n.kind===`mutation`&&(h(t,a.get(n.key)),a.delete(n.key)),(n.kind===`subscription`||e.hasNext)&&ll(i.data,n.key,!0);var r,o=e.data;if(o){Wc(`write`,i.data,n.key,!1,!1);var l=zl(i,n,o,e.error).dependencies;Gc(),h(t,l);var u=n.kind===`query`?c.get(n.key):null;Wc(`read`,i.data,n.key,!1,u!==o);var d=kl(i,n,u||o,e.error);Gc(),o=d.data,n.kind===`query`&&(h(t,r=d.dependencies),c.set(n.key,o))}else Kc(i.data,n.key);return r&&v(e.operation,r),{operation:n,data:o,error:e.error,extensions:e.extensions,hasNext:e.hasNext,stale:e.stale}};return e=>{var r=Gn(Rn(y)(Ln((e=>e.kind===`query`&&e.context.requestPolicy!==`network-only`))(e))),c=Ln((e=>e.kind!==`query`||e.context.requestPolicy===`network-only`))(e),d=Rn((e=>Ul(e.operation,{cacheOutcome:`miss`})))(Ln((e=>e.outcome===`miss`&&e.operation.context.requestPolicy!==`cache-only`&&!m(e.dependencies)&&!f.has(e.operation.key)))(r)),p=Rn((e=>{var{requestPolicy:t}=e.operation.context,r=t!==`cache-only`&&(e.hasNext||t===`cache-and-network`||t===`cache-first`&&e.outcome===`partial`&&!f.has(e.operation.key)),a=t!==`cache-only`&&(r||e.outcome===`partial`&&f.has(e.operation.key)&&((o=i.data).commutativeKeys.has(c=e.operation.key)||o.optimisticOrder.indexOf(c)>-1)),o,c,l={operation:Ul(e.operation,{cacheOutcome:e.outcome}),data:e.data,error:e.error,extensions:e.extensions,stale:a&&!e.hasNext,hasNext:r&&e.hasNext};return r&&(m(e.dependencies)?t===`cache-and-network`&&u.add(e.operation.key):n.reexecuteOperation(Wl(s.get(e.operation.key)||e.operation,`network-only`))),l}))(Ln((e=>e.outcome!==`miss`||e.operation.context.requestPolicy===`cache-only`))(r)),h=t(Rn(_)(Vn([c,d])));return Vn([Rn((e=>{var t=new Set,n=b(e,t);return g(e.operation,t,!1),n}))(Ln((e=>!a.has(e.operation.key)))(h)),zn((e=>{if(o.push(e)<a.size)return rr;for(var t=0;t<o.length;t++)ll(i.data,o[t].operation.key);l.clear();for(var n=[],r=new Set,s;s=o.shift();)n.push(b(s,r));return g(e.operation,r,!1),$n(n)}))(Ln((e=>a.has(e.operation.key)))(h)),p])}},Kl={Media:e=>e._id,MediaHandle:()=>null,MediaRelationEdge:()=>null,MediaFranchise:()=>null,MediaFranchiseNode:()=>null,MediaFranchiseEdge:()=>null,EpisodeHandle:()=>null,MediaTitle:()=>null,MediaDescription:()=>null,MediaShortDescription:()=>null,MediaCover:()=>null,MediaBanner:()=>null,MediaAiringEpisode:()=>null,MediaFieldProvenance:()=>null,MediaAnomaly:()=>null,MediaPerson:()=>null,MediaCharacter:()=>null,MediaTheme:()=>null,MediaRating:()=>null,MediaSeasonLink:()=>null,MediaTrailer:e=>e.uri,Episode:e=>e._id,EpisodeTitle:()=>null,EpisodeDescription:()=>null,EpisodeShortDescription:()=>null,EpisodeThumbnail:()=>null,PlaybackSource:e=>e.uri,Tracking:e=>String(e._id),TrackerAnswer:e=>String(e._id),Tracker:e=>e.id,ListEntry:e=>String(e._id),FuzzyDate:()=>null,WriteOutcome:()=>null,StubTrackerStorage:()=>null},ql=()=>{let e=new Map;return{exchange:({forward:t})=>n=>cr(t(cr(n,Un(t=>{t.kind===`teardown`&&e.delete(t.key)}))),Un(t=>{t.operation.kind===`subscription`&&e.set(t.operation.key,t)})),replay:t=>{let n=t.executeRequestOperation.bind(t);return t.executeRequestOperation=(t=>{let r=n(t);if(t.kind!==`subscription`)return r;let i=Xn(()=>{let n=e.get(t.key);return n?Vn([er(n),r]):r}),a=()=>sr(cr(i,Ln(e=>!e.stale&&!e.hasNext),qn(1)));return Object.assign(i,{toPromise:a,then:((e,t)=>a().then(e,t)),subscribe:e=>cr(i,ar(e))})}),t}}},Jl=Gl({schema:{__schema:JSON.parse(`{"queryType":{"name":"Query","kind":"OBJECT"},"mutationType":{"name":"Mutation","kind":"OBJECT"},"subscriptionType":{"name":"Subscription","kind":"OBJECT"},"types":[{"kind":"OBJECT","name":"Episode","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"absoluteEpisodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"absoluteNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"embedUrl","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"mediaUri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relativeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"releaseDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"runtime","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"thumbnails","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeThumbnail","ofType":null}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeHandle","fields":[{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeThumbnail","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"FuzzyDate","fields":[{"name":"day","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"month","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"year","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"ListEntry","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"completedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"cover","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"mediaUri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"progress","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"rewatchCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"updatedAt","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Media","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"airingSchedule","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null}}},"args":[]},{"name":"anomalies","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAnomaly","ofType":null}}},"args":[]},{"name":"averageScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"banners","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaBanner","ofType":null}}}},"args":[]},{"name":"categories","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"characters","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCharacter","ofType":null}}},"args":[]},{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"duration","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"endDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}}}},"args":[]},{"name":"franchise","type":{"kind":"OBJECT","name":"MediaFranchise","ofType":null},"args":[]},{"name":"genres","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isAdult","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"kind","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextAiringEpisode","type":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"popularity","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"provenance","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFieldProvenance","ofType":null}}},"args":[]},{"name":"ratings","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRating","ofType":null}}},"args":[]},{"name":"relations","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRelationEdge","ofType":null}}}},"args":[]},{"name":"scope","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"season","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonYear","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasons","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaSeasonLink","ofType":null}}},"args":[]},{"name":"settled","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"sourceMaterial","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"staff","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPerson","ofType":null}}},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"studios","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"tags","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"themes","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTheme","ofType":null}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"trailers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTrailer","ofType":null}}}},"args":[]},{"name":"type","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAiringEpisode","fields":[{"name":"airingAt","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"episodeNumber","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAnomaly","fields":[{"name":"detail","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaBanner","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCharacter","fields":[{"name":"image","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"role","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"voiceActors","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPerson","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCover","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFieldProvenance","fields":[{"name":"answerSeq","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"field","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tier","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uris","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"witnesses","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchise","fields":[{"name":"edges","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseEdge","ofType":null}}}},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseNode","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseEdge","fields":[{"name":"from","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"to","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseNode","fields":[{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaHandle","fields":[{"name":"by","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"provenance","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"via","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPerson","fields":[{"name":"image","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"roles","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRating","fields":[{"name":"scale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"source","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"value","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRelationEdge","fields":[{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaSeasonLink","fields":[{"name":"number","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTheme","fields":[{"name":"artists","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"kind","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"sequence","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"video","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTrailer","fields":[{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"thumbnail","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Mutation","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"addHeldStubEntries","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"deleteListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"saveListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Origin","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isApiOnly","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"OriginPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Origin","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"PlaybackSource","fields":[{"name":"Episode","type":{"kind":"OBJECT","name":"Episode","ofType":null},"args":[]},{"name":"data","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"type","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Query","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"StubTrackerStorage","fields":[{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"held","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"location","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"locked","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"waiting","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Subscription","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"containingMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"media","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"mediaPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"origin","type":{"kind":"OBJECT","name":"Origin","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"originPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"OriginPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"similarMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"stubTrackerStorage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"tracking","type":{"kind":"OBJECT","name":"Tracking","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracker","fields":[{"name":"account","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canClearScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canWrite","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"scoreScale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"statuses","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"TrackerAnswer","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"candidates","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"state","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Tracker","ofType":null}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracking","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"answers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"TrackerAnswer","ofType":null}}}},"args":[]},{"name":"disagreements","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"summary","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"WriteOutcome","fields":[{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"outcome","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"SCALAR","name":"Any"}],"directives":[]}`)},keys:Kl,resolvers:{}}),Yl=ql(),Xl=Yl.replay(new $r({url:`http://d/graphql`,exchanges:[Yl.exchange,Zr({onError(e,t){for(let n of e.graphQLErrors)console.error(Error(n.message,{cause:`GQL Error originated from ${t.query.definitions.find(e=>e.kind===`OperationDefinition`)?.name?.value}`}))}}),Ls,Jl,Yr],fetchSubscriptions:!0,fetch:async(e,t)=>Nt(e,t)}));function Zl(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Ql=t((t=>{var n=(pe(),e(fe));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.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),$l=t(((e,t)=>{t.exports=Ql()}));pe();var eu=$l(),tu=E,nu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?ye:B,ru=tu||nu,iu=e=>{let t=K([e,(...e)=>t[0](...e)]).current;return ru(()=>{t[0]=e}),t[1]},au=`popstate`,ou=`pushState`,su=`replaceState`,cu=[au,ou,su,`hashchange`],lu=e=>{for(let t of cu)addEventListener(t,e);return()=>{for(let t of cu)removeEventListener(t,e)}},uu=(e,t)=>(0,eu.useSyncExternalStore)(lu,e,t),du=()=>location.search,fu=({ssrSearch:e=``}={})=>uu(du,()=>e),pu=()=>location.pathname,mu=({ssrPath:e}={})=>uu(pu,e?()=>e:pu),hu=(e,{replace:t=!1,state:n=null}={})=>history[t?su:ou](n,``,e),gu=(e={})=>[mu(e),hu],_u=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[_u]===void 0){for(let e of[ou,su]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,_u,{value:!0})}var vu=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,yu=(e=``)=>e===`/`?``:e,bu=(e,t)=>e[0]===`~`?e.slice(1):yu(t)+e,xu=(e=``,t)=>vu(Cu(yu(e)),Cu(t)),Su=e=>e[0]===`?`?e.slice(1):e,Cu=e=>{try{return decodeURI(e)}catch{return e}},wu=e=>Cu(Su(e)),Tu={hook:gu,searchHook:fu,parser:Zl,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},Eu=xe(Tu),Du=()=>ge(Eu),Ou={},ku=xe(Ou),Au=()=>ge(ku),ju=e=>{let[t,n]=e.hook(e);return[xu(e.base,t),iu((t,r)=>n(bu(t,e.base),r))]},Mu=()=>ju(Du()),Nu=()=>{let e=Du();return wu(e.searchHook(e))},Pu=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Fu=e=>Pu(Du().parser,e,Mu()[0]),Iu=({children:e,...t})=>{let n=Du(),r=t.hook?Tu:n,i=r,[a,o]=t.ssrPath?.split(`?`)??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=K({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]||``):t[e]||r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return Pe(Eu.Provider,{value:i,children:e})},Lu=({children:e,component:t},n)=>t?Pe(t,{params:n}):typeof e==`function`?e(n):e,Ru=e=>{let t=K(Ou),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},zu=({path:e,nest:t,match:n,...r})=>{let i=Du(),[a]=ju(i),[o,s,c]=n??Pu(i.parser,e,a,t),l=Ru({...Au(),...s});if(!o)return null;let u=c?Pe(Iu,{base:c},Lu(r,l)):Lu(r,l);return Pe(ku.Provider,{value:l,children:u})},Bu=Fe((e,t)=>{let n=Du(),[r,i]=ju(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,...p}=e,m=iu(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),h=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n);return c&&L(l)?de(l,{onClick:m,href:h}):Pe(`a`,{...p,onClick:m,href:h,className:u?.call?u(r===o):u,children:l,ref:t})}),Vu=e=>Array.isArray(e)?e.flatMap(e=>Vu(e&&e.type===Te?e.props.children:e)):[e],Hu=({children:e,location:t})=>{let n=Du(),[r]=ju(n);for(let i of Vu(e)){let e=0;if(L(i)&&(e=Pu(n.parser,i.props.path,t||r,i.props.nest))[0])return de(i,{match:e})}return null},Uu=e=>{let{to:t,href:n=t}=e,r=Du(),[,i]=ju(r),a=iu(()=>i(t||n,e)),{ssrContext:o}=r;return nu(()=>{a()},[]),o&&(o.redirectTo=t),null},Z=function(e){return e.HOME=`HOME`,e.MEDIA=`MEDIA`,e.MEDIA_EPISODE=`MEDIA_EPISODE`,e.TITLE=`TITLE`,e.SEARCH=`SEARCH`,e.SEARCH_LEGACY=`SEARCH_LEGACY`,e.LEGAL=`LEGAL`,e.PRIVACY=`PRIVACY`,e.SETTINGS=`SETTINGS`,e.WATCH=`WATCH`,e.PARTY=`PARTY`,e.DEBUG_TRACE=`DEBUG_TRACE`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({}),Wu={HOME:()=>`/`,MEDIA:({uri:e})=>`/media/${e}`,MEDIA_EPISODE:({uri:e,mediaUri:t})=>`/media/${e}/${t}`,TITLE:({uri:e})=>`/title/${e}`,SEARCH:()=>`/search`,SEARCH_LEGACY:({query:e})=>`/search/${encodeURIComponent(e)}`,LEGAL:()=>`/legal`,PRIVACY:()=>`/privacy`,SETTINGS:()=>`/settings`,WATCH:({mediaUri:e,episodeUri:t,sourceUri:n})=>`/watch/${e}/${t}${n?`/${n}`:``}`,PARTY:()=>`/party`,DEBUG_TRACE:()=>`/debug/trace`,LOGIN_CALLBACK:()=>`/login/callback`},Gu={HOME:`/`,MEDIA:`/media/:uri`,MEDIA_EPISODE:`/media/:uri/:mediaUri`,TITLE:`/title/:uri`,SEARCH:`/search`,SEARCH_LEGACY:`/search/:query`,LEGAL:`/legal`,PRIVACY:`/privacy`,SETTINGS:`/settings`,WATCH:`/watch/:mediaUri/:episodeUri/:sourceUri?`,PARTY:`/party`,DEBUG_TRACE:`/debug/trace`,LOGIN_CALLBACK:`/login/callback`},Ku=e=>Gu[e],qu=(e,t)=>Wu[e](t),Ju={"Action & Adventure":`act`,Animation:`ani`,Comedy:`cmy`,Crime:`crm`,Documentary:`doc`,Drama:`drm`,Fantasy:`fnt`,History:`hst`,Horror:`hrr`,"Kids & Family":`fml`,"Music & Musical":`msc`,"Mystery & Thriller":`trl`,"Reality TV":`rly`,Romance:`rma`,"Science-Fiction":`scf`,Sport:`spt`,"War & Military":`war`,Western:`wsn`},Yu={query:`q`,category:`category`,status:`status`,season:`season`,year:`year`,format:`format`,genre:`genre`,tag:`tag`},Xu=[{value:ki.Tv,label:`TV Show`},{value:ki.Movie,label:`Movie`},{value:ki.TvShort,label:`TV Short`},{value:ki.Special,label:`Special`},{value:ki.Ova,label:`OVA`},{value:ki.Ona,label:`ONA`}],Zu=[{value:Oi.Releasing,label:`Airing`},{value:Oi.Finished,label:`Finished`},{value:Oi.NotYetReleased,label:`Not yet aired`},{value:Oi.Cancelled,label:`Cancelled`},{value:Oi.Hiatus,label:`Hiatus`}],Qu=[{value:Ei.Winter,label:`Winter`},{value:Ei.Spring,label:`Spring`},{value:Ei.Summer,label:`Summer`},{value:Ei.Fall,label:`Fall`}],$u=[{value:wi.Anime,label:`Anime`},{value:wi.Series,label:`Series`},{value:wi.Movie,label:`Movies`}],ed=[`Action`,`Adventure`,`Comedy`,`Drama`,`Ecchi`,`Fantasy`,`Horror`,`Mahou Shoujo`,`Mecha`,`Music`,`Mystery`,`Psychological`,`Romance`,`Sci-Fi`,`Slice of Life`,`Sports`,`Supernatural`,`Thriller`],td={anime:ed,movie:Object.keys(Ju),series:Object.keys(Ju),stub:[...new Set([...ed,...Object.keys(Ju)])]},nd=(e,t)=>e.find(e=>e===t)??null,rd=(e,t)=>t.map(t=>nd(e,t)).filter(e=>e!==null),id=e=>Qu.map(e=>e.value).find(t=>t===e)??null,ad=Xu.map(e=>e.value),od=Zu.map(e=>e.value),sd=Qu.map(e=>e.value),cd=$u.map(e=>e.value),ld=1917,ud=(e=new Date)=>e.getFullYear()+5,dd=(e,t=new Date)=>{if(!e||!/^\d{4}$/.test(e))return null;let n=Number(e);return n>=1917&&n<=ud(t)?n:null},fd=(e,t=new Date)=>{let n=new URLSearchParams(e);return{query:(n.get(Yu.query)??``).trim(),category:nd(cd,n.get(Yu.category)),status:nd(od,n.get(Yu.status)),season:nd(sd,n.get(Yu.season)),year:dd(n.get(Yu.year),t),formats:rd(ad,n.getAll(Yu.format)),genres:pd(n.getAll(Yu.genre)),tags:pd(n.getAll(Yu.tag))}},pd=e=>{let t=new Set,n=[];for(let r of e){let e=r.trim(),i=e.toLowerCase();e&&!t.has(i)&&(t.add(i),n.push(e))}return n},md=e=>{let t=new URLSearchParams,n=e.query?.trim();n&&t.set(Yu.query,n),e.category&&t.set(Yu.category,e.category),e.status&&t.set(Yu.status,e.status),e.season&&t.set(Yu.season,e.season),e.year&&t.set(Yu.year,String(e.year));for(let n of e.formats??[])t.append(Yu.format,n);for(let n of e.genres??[])t.append(Yu.genre,n);for(let n of e.tags??[])t.append(Yu.tag,n);return t.toString()},hd=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return e}},gd=(e={})=>{let t=md(e);return t?`/search?${t}`:`/search`},_d=e=>{if(e.query)return`Results for \u201C${e.query}\u201D`;let t=Qu.find(t=>t.value===e.season)?.label;return t&&e.year?`${t} ${e.year}`:t?`${t} seasons`:e.year?String(e.year):xd(e)?`Browsing`:`Search`},vd=e=>Xu.find(t=>t.value===e)?.label,yd=e=>Zu.find(t=>t.value===e)?.label,bd=(e,t)=>{let n=Qu.find(t=>t.value===e)?.label;return n&&t?`${n} ${t}`:t?String(t):void 0},xd=e=>!!(e.query||e.category||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),Sd=e=>!!(e.query||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),Cd=`plugins`,wd=`plugin`,Td=(e,t)=>{try{return new URL(e,t)}catch{return}},Ed=e=>{let t=new Set;return e.filter(e=>{let n=Dd(e);return!n||t.has(n)?!1:(t.add(n),!0)})},Dd=e=>e.trim().replace(/\/+$/,``).replace(/@\d[^@/]*$/,``),Od=(e,t)=>{let n=Td(e,t);return n?Ed([...n.searchParams].filter(([e])=>e===`plugins`||e===wd).map(([,e])=>e.trim())):[]},kd=e=>encodeURIComponent(e).replace(/%3A/g,`:`).replace(/%2F/g,`/`).replace(/%40/g,`@`),Ad=(e,t,n)=>{let r=Td(e,n),i=Td(n);return!r||!i||r.origin!==i.origin?e:(r.searchParams.delete(Cd),r.searchParams.delete(wd),r.search=[r.searchParams.toString(),Ed(t.map(e=>e.trim())).sort().map(e=>`${Cd}=${kd(e)}`).join(`&`)].filter(Boolean).join(`&`),r.href)},jd=new Map,Md=new Set,Nd=new Set,Pd=()=>Nd.forEach(e=>{try{e()}catch{}}),Fd=e=>(Nd.add(e),()=>{Nd.delete(e)}),Id=()=>[...jd.values()],Ld=()=>[...jd.keys()],Rd=()=>new Set(Ua().map(Dd)),zd=e=>{let t=Rd(),n=!1;for(let r of e){let e=Dd(r);!e||t.has(e)||Md.has(e)||jd.has(r)||(jd.set(r,{uri:r,state:`offered`}),n=!0)}n&&Pd()};Va(()=>{let e=Rd(),t=!1;for(let[n,r]of jd)r.state===`offered`&&e.has(Dd(n))&&(jd.delete(n),t=!0);t&&Pd()});var Bd=()=>{if(jd.size){for(let e of jd.keys())Md.add(Dd(e));jd.clear(),Pd()}},Vd=async()=>{let e=[...jd.keys()];if(e.length){for(let t of e)jd.set(t,{uri:t,state:`installing`});Pd();for(let t of e){try{await io(t,{noConfirm:!0})||Md.add(Dd(t)),jd.delete(t)}catch(e){console.warn(`Source '${t}' could not be added:`,e),jd.set(t,{uri:t,state:`error`})}Pd()}}},Hd=e=>{jd.delete(e)&&(Md.add(Dd(e)),Pd())},Ud=()=>[...Ua(),...Ld()],Wd=()=>{let e=Ad(location.href,Ud(),location.href);e!==location.href&&history.replaceState(history.state,``,e)},Gd=()=>zd(Od(location.href)),Kd=e=>{let t=Ad(e,Ud(),location.href);return t.startsWith(location.origin)?t.slice(location.origin.length):t},qd=e=>{let t=history[e];history[e]=function(e,n,r){let i=r==null?location.href:String(r);return t.call(this,e,n,Ad(i,Ud(),location.href))}},Jd=Symbol.for(`stub_plugin_url`);Jd in globalThis||(Object.defineProperty(globalThis,Jd,{value:!0}),qd(`pushState`),qd(`replaceState`),addEventListener(`popstate`,()=>{Gd(),Wd()}),Va(Wd),Fd(Wd),Gd(),Wd());var Yd=`input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])`,Xd=typeof Element>`u`,Zd=Xd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Qd=!Xd&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},$d=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},ef=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},tf=function(e,t,n){if($d(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Yd));return t&&Zd.call(e,Yd)&&r.unshift(e),r=r.filter(n),r},nf=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!$d(o,!1)){if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{Zd.call(o,Yd)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!$d(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}}return i},rf=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},af=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ef(e))&&!rf(e)?0:e.tabIndex},of=function(e,t){var n=af(e);return n<0&&t&&!rf(e)?0:n},sf=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},cf=function(e){return e.tagName===`INPUT`},lf=function(e){return cf(e)&&e.type===`hidden`},uf=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},df=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},ff=function(e){if(!e.name)return!0;var t=e.form||Qd(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=df(r,e.form);return!i||i===e},pf=function(e){return cf(e)&&e.type===`radio`},mf=function(e){return pf(e)&&!ff(e)},hf=function(e){var t=e&&Qd(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Qd(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},gf=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},_f=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Zd.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Zd.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Qd(e);if(o&&!o.shadowRoot&&r(o)===!0)return gf(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(hf(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return gf(e);return!1},vf=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Zd.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},yf=function(e,t){return!(t.disabled||$d(t)||lf(t)||_f(t,e)||uf(t)||vf(t))},bf=function(e,t){return!(mf(t)||af(t)<0||!yf(e,t))},xf=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Sf=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=of(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(sf).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Cf=function(e,t){return t||={},Sf(t.getShadowRoot?nf([e],t.includeContainer,{filter:bf.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xf}):tf(e,t.includeContainer,bf.bind(null,t)))},wf=function(e,t){return t||={},t.getShadowRoot?nf([e],t.includeContainer,{filter:yf.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):tf(e,t.includeContainer,yf.bind(null,t))},Tf=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Zd.call(e,Yd)!==!1&&bf(t,e)};pe();function Ef(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Df(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function Of(){return/apple/i.test(navigator.vendor)}function kf(){let e=/android/i;return e.test(Ef())||e.test(Df())}function Af(){return Ef().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function jf(){return Df().includes(`jsdom/`)}var Mf=`data-floating-ui-focusable`,Nf=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Pf(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ff(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ne(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function If(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Lf(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 Rf(e){return e.matches(`html,body`)}function zf(e){return e?.ownerDocument||document}function Bf(e){return ie(e)&&e.matches(Nf)}function Vf(e){return e?e.getAttribute(`role`)===`combobox`&&Bf(e):!1}function Hf(e){if(!e||jf())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Uf(e){return e?e.hasAttribute(Mf)?e:e.querySelector(`[`+Mf+`]`)||e:null}function Wf(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Wf(e,t.id,n)])}function Gf(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 Kf(e){e.preventDefault(),e.stopPropagation()}function qf(e){return`nativeEvent`in e}function Jf(e){return e.mozInputSource===0&&e.isTrusted?!0:kf()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Yf(e){return jf()?!1:!kf()&&e.width===0&&e.height===0||kf()&&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 Xf(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Zf=typeof document<`u`?ye:function(){},Qf={...fe};function $f(e){let t=K(e);return Zf(()=>{t.current=e}),t}var ep=Qf.useInsertionEffect||(e=>e());function tp(e){let t=K(()=>{});return ep(()=>{t.current=e}),z(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var np=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function rp(e,t){let n=Cf(e,np()),r=n.length;if(r===0)return;let i=Pf(zf(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ip(e){return rp(zf(e).body,1)||e}function ap(e){return rp(zf(e).body,-1)||e}function op(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ff(n,r)}function sp(e){Cf(e,np()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function cp(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}pe();var lp=typeof document<`u`?ye:function(){};function up(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(!up(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)&&!up(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function dp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fp(e,t){let n=dp(e);return Math.round(t*n)/n}function pp(e){let t=K(e);return lp(()=>{t.current=e}),t}function mp(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]=U({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=U(r);up(f,r)||p(r);let[m,h]=U(null),[g,_]=U(null),v=z(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=K(null),C=K(null),w=K(u),T=c!=null,E=pp(c),D=pp(i),O=pp(l),k=z(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),oe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!up(w.current,t)&&(w.current=t,te(()=>{d(t)}))})},[f,t,n,D,O]);lp(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=K(!1);lp(()=>(A.current=!0,()=>{A.current=!1}),[]),lp(()=>{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=V(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=V(()=>({reference:b,floating:x}),[b,x]),N=V(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=fp(M.floating,u.x),r=fp(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...dp(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return V(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var hp=(e,t)=>({...Be(e),options:[e,t]}),gp=(e,t)=>({...se(e),options:[e,t]}),_p=(e,t)=>({...k(e),options:[e,t]}),vp=(e,t)=>({...j(e),options:[e,t]});pe(),je();function yp(e){let t=K(void 0),n=z(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return V(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var bp=`data-floating-ui-focusable`,xp=`active`,Sp=`selected`,Cp=`ArrowLeft`,wp=`ArrowRight`,Tp=`ArrowUp`,Ep=`ArrowDown`,Dp=[Cp,wp],Op=[Tp,Ep];[...Dp,...Op];var kp={...fe},Ap=!1,jp=0,Mp=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+jp++;function Np(){let[e,t]=U(()=>Ap?Mp():void 0);return Zf(()=>{e??t(Mp())},[]),B(()=>{Ap=!0},[]),e}var Pp=kp.useId||Np;function Fp(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Ip=xe(null),Lp=xe(null),Rp=()=>ge(Ip)?.id||null,zp=()=>ge(Lp);function Bp(e){return`data-floating-ui-`+e}function Vp(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Hp=Bp(`safe-polygon`);function Up(e,t,n){if(n&&!Xf(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Wp(e){return typeof e==`function`?e():e}function Gp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=zp(),m=Rp(),h=$f(l),g=$f(c),_=$f(n),v=$f(d),y=K(),b=K(-1),x=K(),S=K(-1),C=K(!0),w=K(!1),T=K(()=>{}),E=K(!1),D=tp(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});B(()=>{if(!s)return;function e(e){let{open:t}=e;t||(Vp(b),Vp(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),B(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=zf(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=z(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Up(g.current,`close`,y.current);i&&!x.current?(Vp(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(Vp(b),r(!1,e,n))},[g,r]),k=tp(()=>{T.current(),x.current=void 0}),A=tp(()=>{if(w.current){let e=zf(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(Hp),w.current=!1}}),j=tp(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);B(()=>{if(!s)return;function e(e){if(Vp(b),C.current=!1,u&&!Xf(y.current)||Wp(v.current)>0&&!Up(g.current,`open`))return;let t=Up(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(j()){A();return}T.current();let t=zf(o.floating);if(Vp(S),E.current=!1,h.current&&i.current.floatingContext){n||Vp(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),j()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)}}else y.current===`touch`&&Ff(o.floating,e.relatedTarget)||O(e)}function a(e){j()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){A(),k(),j()||O(e)}})(e))}function c(){Vp(b)}function l(e){j()||O(e,!1)}if(F(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,O,k,A,r,n,_,p,g,h,i,j,v]),Zf(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(F(o.domReference)&&e){var t;let n=zf(o.floating).body;n.setAttribute(Hp,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,D]),Zf(()=>{n||(y.current=void 0,E.current=!1,k(),A())},[n,k,A]),B(()=>()=>{k(),Vp(b),Vp(S),A()},[s,o.domReference,k,A]);let M=V(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Xf(y.current)||n||Wp(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(Vp(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,Wp(v.current))))}}},[u,r,n,_,v]);return V(()=>s?{reference:M}:{},[s,M])}var Kp=0;function qp(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Kp);let a=()=>e?.focus({preventScroll:n});i?a():Kp=requestAnimationFrame(a)}function Jp(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ne(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Yp(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Xp(e){return e?.ownerDocument||document}var Zp={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qp(e){return e===`inert`?Zp.inert:e===`aria-hidden`?Zp[`aria-hidden`]:Zp.none}var $p=new WeakSet,em={},tm=0,nm=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,rm=e=>e&&(e.host||rm(e.parentNode)),im=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=rm(t);return e.contains(n)?n:null}).filter(e=>e!=null);function am(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=im(t,e),s=new Set,c=new Set(o),l=[];em[i]||(em[i]=new WeakMap);let u=em[i];o.forEach(d),f(t),s.clear();function d(e){e&&!s.has(e)&&(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){e&&!c.has(e)&&[].forEach.call(e.children,e=>{if(Oe(e)!==`script`){if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Qp(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&$p.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}}})}return tm++,()=>{l.forEach(e=>{let t=Qp(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!$p.has(e)&&a&&e.removeAttribute(a),$p.delete(e)),r||e.removeAttribute(i)}),tm--,tm||(Zp.inert=new WeakMap,Zp[`aria-hidden`]=new WeakMap,Zp.none=new WeakMap,$p=new WeakSet,em={})}}function om(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Xp(e[0]).body;return am(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var sm={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},cm=Fe(function(e,t){let[n,r]=U();Zf(()=>{Of()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Bp(`focus-guard`)]:``,style:sm};return A(`span`,{...e,...i})}),lm=xe(null),um=Bp(`portal`);function dm(e){e===void 0&&(e={});let{id:t,root:n}=e,r=Pp(),i=pm(),[a,o]=U(null),s=K(null);return Zf(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Zf(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(um,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Zf(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!ee(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(um,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function fm(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=dm({id:n,root:r}),[o,s]=U(null),c=K(null),l=K(null),u=K(null),d=K(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return B(()=>{if(!a||!i||f)return;function e(e){a&&op(e)&&(e.type===`focusin`?cp:sp)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),B(()=>{a&&(p||cp(a))},[p,a]),A(lm.Provider,{value:V(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&A(cm,{"data-type":`outside`,ref:c,onFocus:e=>{if(op(e,a)){var t;(t=u.current)==null||t.focus()}else ap(o?o.domReference:null)?.focus()}}),m&&a&&A(`span`,{"aria-owns":a.id,style:sm}),a&&P(t,a),m&&a&&A(cm,{"data-type":`outside`,ref:l,onFocus:e=>{if(op(e,a)){var t;(t=d.current)==null||t.focus()}else ip(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var pm=()=>ge(lm);function mm(e){return V(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var hm=20,gm=[];function _m(){gm=gm.filter(e=>e.isConnected)}function vm(e){_m(),e&&Oe(e)!==`body`&&(gm.push(e),gm.length>hm&&(gm=gm.slice(-20)))}function ym(){return _m(),gm[gm.length-1]}function bm(e){let t=np();return Tf(e,t)?e:Cf(e,t)[0]||e}function xm(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=np(),i=wf(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Tf(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Sm=Fe(function(e,t){return A(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:sm})});function Cm(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:h,events:g,dataRef:_,elements:{domReference:v,floating:y}}=t,b=tp(()=>_.current.floatingContext?.nodeId),x=tp(p),S=typeof o==`number`&&o<0,C=Vf(v)&&S,w=nm(),T=!w||a,E=!T||w&&f,D=$f(i),O=$f(o),k=$f(s),j=zp(),M=pm(),N=K(null),ee=K(null),te=K(!1),P=K(!1),ne=K(-1),re=K(-1),F=M!=null,I=Uf(y),L=tp(function(e){return e===void 0&&(e=I),e?Cf(e,np()):[]}),ae=tp(e=>{let t=L(e);return D.current.map(e=>v&&e===`reference`?v:I&&e===`floating`?I:t).filter(Boolean).flat()});B(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){Ff(I,Pf(zf(I)))&&L().length===0&&!C&&Kf(e);let t=ae(),n=If(e);D.current[0]===`reference`&&n===v&&(Kf(e),e.shiftKey?qp(t[t.length-1]):qp(t[1])),D.current[1]===`floating`&&n===I&&e.shiftKey&&(Kf(e),qp(t[0]))}}let t=zf(I);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,I,l,D,C,L,ae]),B(()=>{if(r||!y)return;function e(e){let t=If(e),n=L().indexOf(t);n!==-1&&(ne.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,L]),B(()=>{if(r||!d)return;function e(){P.current=!0,setTimeout(()=>{P.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=If(e);queueMicrotask(()=>{let i=b(),a=!(Ff(v,t)||Ff(y,t)||Ff(t,y)||Ff(M?.portalNode,t)||t!=null&&t.hasAttribute(Bp(`focus-guard`))||j&&(Wf(j.nodesRef.current,i).find(e=>Ff(e.context?.elements.floating,t)||Ff(e.context?.elements.domReference,t))||Gf(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,Uf(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&I&&xm(I,D),c&&n!==v&&!(r!=null&&r.isConnected)&&Pf(zf(I))===zf(I).body){ie(I)&&I.focus();let e=ne.current,t=L(),n=t[e]||t[t.length-1]||I;ie(n)&&n.focus()}_.current.insideReactTree?_.current.insideReactTree=!1:(C||!l)&&t&&a&&!P.current&&t!==ym()&&(te.current=!0,h(!1,e,`focus-out`))})}let n=!(j||!M);function i(){Vp(re),_.current.insideReactTree=!0,re.current=window.setTimeout(()=>{_.current.insideReactTree=!1})}if(y&&ie(v))return v.addEventListener(`focusout`,t),v.addEventListener(`pointerdown`,e),y.addEventListener(`focusout`,t),n&&y.addEventListener(`focusout`,i,!0),()=>{v.removeEventListener(`focusout`,t),v.removeEventListener(`pointerdown`,e),y.removeEventListener(`focusout`,t),n&&y.removeEventListener(`focusout`,i,!0)}},[r,v,y,I,l,j,M,h,d,c,L,C,b,D,_]);let oe=K(null),se=K(null),ce=mm([oe,M?.beforeInsideRef]),le=mm([se,M?.afterInsideRef]);B(()=>{var e,t;if(r||!y)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+Bp(`portal`)+`]`))||[]),i=(t=(j?Gf(j.nodesRef.current,b()):[]).find(e=>Vf(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[y,i,...n,...x(),N.current,ee.current,oe.current,se.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,D.current.includes(`reference`)||C?v:null].filter(e=>e!=null),o=l||C?om(a,!E,E):om(a);return()=>{o()}},[r,v,y,l,D,M,C,T,E,j,b,x]),Zf(()=>{if(r||!ie(I))return;let e=Pf(zf(I));queueMicrotask(()=>{let t=ae(I),n=O.current,r=(typeof n==`number`?t[n]:n.current)||I,i=Ff(I,e);!S&&!i&&m&&qp(r,{preventScroll:r===I})})},[r,m,I,S,ae,O]),Zf(()=>{if(r||!I)return;let e=zf(I);vm(Pf(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(te.current=!0),t===`outside-press`){if(r)te.current=!1;else if(Jf(n)||Yf(n))te.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?te.current=!1:te.current=!0}}}g.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,sm),F&&v&&v.insertAdjacentElement(`afterend`,n);function i(){if(typeof k.current==`boolean`){let e=v||ym();return e&&e.isConnected?e:n}return k.current.current||n}return()=>{g.off(`openchange`,t);let r=Pf(e),a=Ff(y,r)||j&&Wf(j.nodesRef.current,b(),!1).some(e=>Ff(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=bm(o);k.current&&!te.current&&ie(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,I,k,_,g,j,F,v,b]),B(()=>(queueMicrotask(()=>{te.current=!1}),()=>{queueMicrotask(_m)}),[r]),Zf(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:d,open:m,onOpenChange:h,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,l,m,h,d,v]),Zf(()=>{r||I&&xm(I,D)},[r,I,D]);function ue(e){return r||!u||!l?null:A(Sm,{ref:e===`start`?N:ee,onClick:e=>h(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let de=!r&&T&&(!l||!C)&&(F||l);return A(Te,{children:[de&&A(cm,{"data-type":`inside`,ref:ce,onFocus:e=>{if(l){let e=ae();qp(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(te.current=!1,op(e,M.portalNode))ip(v)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}}),!C&&ue(`start`),n,ue(`end`),de&&A(cm,{"data-type":`inside`,ref:le,onFocus:e=>{if(l)qp(ae()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(d&&(te.current=!0),op(e,M.portalNode))ap(v)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}}})]})}var wm=0,Tm=`--floating-ui-scrollbar-width`;function Em(){let e=Ef(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(Tm,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(Tm),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var Dm=()=>{},Om=Fe(function(e,t){let{lockScroll:n=!1,...r}=e;return Zf(()=>{if(n)return wm++,wm===1&&(Dm=Em()),()=>{wm--,wm===0&&Dm()}},[n]),A(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function km(e){return ie(e.target)&&e.target.tagName===`BUTTON`}function Am(e){return ie(e.target)&&e.target.tagName===`A`}function jm(e){return Bf(e)}function Mm(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=K(),p=K(!1),m=V(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current;e.button===0&&s!==`click`&&(Xf(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=f.current;s===`mousedown`&&f.current?f.current=void 0:Xf(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){f.current=void 0,!(e.defaultPrevented||!u||km(e))&&(e.key===` `&&!jm(a)&&(e.preventDefault(),p.current=!0),!Am(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||km(e)||jm(a)||e.key===` `&&p.current&&(p.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,d,c]);return V(()=>o?{reference:m}:{},[o,m])}var Nm={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Pm={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Fm=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Im(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=zp(),g=tp(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=K(!1),{escapeKey:y,outsidePress:b}=Fm(p),{escapeKey:x,outsidePress:S}=Fm(m),C=K(!1),w=tp(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Wf(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}r(!1,qf(e)?e.nativeEvent:e,`escape-key`)}),T=tp(e=>{var t;let n=()=>{var t;w(e),(t=If(e))==null||t.removeEventListener(`keydown`,n)};(t=If(e))==null||t.addEventListener(`keydown`,n)}),E=tp(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=If(e),s=`[`+Bp(`inert`)+`]`,c=zf(i.floating).querySelectorAll(s),u=F(o)?o:null;for(;u&&!M(u);){let e=De(u);if(M(e)||!F(e))break;u=e}if(c.length&&F(o)&&!Rf(o)&&!Ff(o,i.floating)&&Array.from(c).every(e=>!Ff(u,e)))return;if(ie(o)&&A){let t=M(o),n=I(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Wf(h.nodesRef.current,d).some(t=>Lf(e,t.context?.elements.floating));if(Lf(e,i.floating)||Lf(e,i.domReference)||f)return;let p=h?Wf(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r(!1,e,`outside-press`)}),O=tp(e=>{var t;let n=()=>{var t;E(e),(t=If(e))==null||t.removeEventListener(l,n)};(t=If(e))==null||t.addEventListener(l,n)});B(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},ae()?5:0)}let d=zf(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(F(i.domReference)&&(p=D(i.domReference)),F(i.floating)&&(p=p.concat(D(i.floating))),!F(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(D(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),B(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=V(()=>({onKeyDown:w,...u&&{[Nm[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=V(()=>({onKeyDown:w,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[Pm[l]]:()=>{a.current.insideReactTree=!0}}),[w,l,a]);return V(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Lm(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=Pp(),a=K({}),[o]=U(()=>Fp()),s=Rp()!=null,[c,l]=U(r.reference),u=tp((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=V(()=>({setPositionReference:l}),[]),f=V(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return V(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Rm(e){e===void 0&&(e={});let{nodeId:t}=e,n=Lm({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=U(null),[s,c]=U(null),l=i?.domReference||a,u=K(null),d=zp();Zf(()=>{l&&(u.current=l)},[l]);let f=mp({...e,elements:{...i,...s&&{reference:s}}}),p=z(e=>{let t=F(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=z(e=>{(F(e)||e===null)&&(u.current=e,o(e)),(F(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!F(e))&&f.refs.setReference(e)},[f.refs]),h=V(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=V(()=>({...f.elements,domReference:l}),[f.elements,l]),_=V(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Zf(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),V(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function zm(){return Af()&&Of()}function Bm(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=K(!1),u=K(-1),d=K(!0);B(()=>{if(!s)return;let e=re(o.domReference);function t(){!n&&ie(o.domReference)&&o.domReference===Pf(zf(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),zm()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),zm()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),B(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),B(()=>()=>{Vp(u)},[]);let f=V(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=If(e.nativeEvent);if(c&&F(t)){if(zm()&&!e.relatedTarget){if(!d.current&&!Bf(t))return}else if(!Hf(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=F(t)&&t.hasAttribute(Bp(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Pf(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||Ff(a.current.floatingContext?.refs.floating.current,e)||Ff(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return V(()=>s?{reference:f}:{},[s,f])}function Vm(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[xp]:t,[Sp]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[bp]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[xp,Sp].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Hm(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=z(t=>Vm(t,e,`reference`),t),a=z(t=>Vm(t,e,`floating`),n),o=z(t=>Vm(t,e,`item`),r);return V(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Um=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Wm(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=Pp(),c=r.domReference?.id||s,l=V(()=>Uf(r.floating)?.id||i,[r.floating,i]),u=Um.get(o)??o,d=Rp()!=null,f=V(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=V(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=z(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return V(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var Gm=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function Km(e,t){return typeof e==`function`?e(t):e}function qm(e,t){let[n,r]=U(e);return e&&!n&&r(!0),B(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function Jm(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=U(`unmounted`),c=qm(n,a);return!c&&o===`close`&&s(`unmounted`),Zf(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{te(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Ym(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=V(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=U(()=>({...Km(a,l),...Km(n,l)})),{isMounted:h,status:g}=Jm(e,{duration:o}),_=$f(n),v=$f(r),y=$f(i),b=$f(a);return Zf(()=>{let e=Km(_.current,l),t=Km(y.current,l),n=Km(b.current,l),r=Km(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(Gm).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(Gm).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function Xm(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Xm(e,t.id,n)])}function Zm(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Qm(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function $m(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){Vp(i),u()}if(Vp(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Yp(e),v=e.type===`mouseleave`,y=Jp(c.floating,_),b=Jp(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Qm(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&F(e.relatedTarget)&&Jp(c.floating,e.relatedTarget)||f&&Xm(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function ee(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Zm([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Zm([m,h],ee([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var eh=He(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),th=He(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),nh=He(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),rh=He(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ih=He(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ah=He(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),oh=He(`clapperboard`,[[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z`,key:`1tn4o7`}],[`path`,{d:`m6.2 5.3 3.1 3.9`,key:`iuk76l`}],[`path`,{d:`m12.4 3.4 3.1 4`,key:`6hsd6n`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z`,key:`ltgou9`}]]),sh=He(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ch=He(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),lh=He(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),uh=He(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),dh=He(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),fh=He(`grid-3x2`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ph=He(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),mh=He(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),hh=He(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),gh=He(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),_h=He(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),vh=He(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),yh=He(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),bh=He(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),xh=He(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Sh=He(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ch=He(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),wh=He(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Th=He(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Eh=He(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Dh=He(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Oh=He(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),kh=He(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ah=He(`volume`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}]]),jh=He(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Mh=e=>e===`/`||e===`/media`||e.startsWith(`/media/`),Nh=e=>e.startsWith(`/title/`),Ph=({from:e,to:t,kind:n,asked:r=!1})=>r?!0:n===`pop`||Mh(e.pathname)&&Mh(t.pathname)?!1:n!==`replace`||e.pathname!==t.pathname&&!(Nh(e.pathname)&&Nh(t.pathname)),Fh=()=>{window.scrollTo({top:0,left:0,behavior:`instant`})},Ih=0,Lh=()=>{Rh(),Ih=requestAnimationFrame(()=>{Ih=0,Fh()})},Rh=()=>{cancelAnimationFrame(Ih),Ih=0},zh=!1,Bh=()=>{zh=!0},Vh=()=>{let e=zh;return zh=!1,e};pe();var Hh=({className:e,style:t}={})=>Pe(`iframe`,{src:di(),title:`Sign in to FKN`,className:e,style:{border:`none`,width:150,height:40,background:`transparent`,colorScheme:`normal`,...t}}),Uh=8e3,Wh=async(e,t=Uh)=>{let n,r=new Promise(e=>{n=setTimeout(()=>e(`timeout`),t)});try{return await Promise.race([Promise.resolve().then(e).then(()=>`settled`,()=>`settled`),r])}finally{clearTimeout(n)}};G();var Gh=()=>Promise.race([nt.info(),new Promise(e=>setTimeout(()=>e(null),4e3))]),Kh=()=>{let[e,t]=U(null),[n,r]=U(!1),i=z(()=>Gh().then(e=>{t(e),r(!0)}).catch(()=>r(!0)),[]);return B(()=>{let e=!1,t=nt.onChange(()=>{e||i()});i();let n=window.setInterval(()=>{e||i()},3e4);return()=>{e=!0,window.clearInterval(n),t.then(e=>e()).catch(()=>{})}},[i]),{info:e,ready:n,logout:z(async()=>{let e=await Wh(()=>nt.logout());return await i(),e},[i])}},qh={categoryBar:1,hoverCard:150,sourcePopup:300,filterMenu:500,mediaModal:1e3,header:1100,headerPopup:1150,franchiseDialog:1200,pluginPrompt:2e3,partyCursor:3e3};G();var Jh=`https://fkn.app/account`,Yh=150,Xh=40,Zh=O`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
gap: 0.8rem;
|
|
@@ -111,7 +111,7 @@ https://bit.ly/2XbVrpR#`;function cc(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
|
|
|
111
111
|
`,$h=O`
|
|
112
112
|
width: ${Yh}px;
|
|
113
113
|
height: ${Xh}px;
|
|
114
|
-
`,eg=()=>{let{info:e,ready:t,logout:n}=Kh(),[r,i]=U(!1),[a,o]=U(!1),{refs:s,floatingStyles:c,context:l}=Rm({open:r,onOpenChange:i,placement:`bottom-end`,middleware:[hp(8),_p(),gp({padding:8})],whileElementsMounted:Ve}),{getReferenceProps:u,getFloatingProps:d}=Hm([Mm(l),Im(l),Wm(l,{role:`menu`})]);B(()=>{e||(i(!1),o(!1))},[e]);let f=async()=>{o(!0);try{await n()}finally{o(!1),i(!1)}};return t?e?W(R,{children:[W(`button`,{ref:s.setReference,css:Zh,type:`button`,"aria-label":`FKN account: ${e.name||`Account`}`,...u(),children:[W(`span`,{className:`who`,children:[H(`span`,{className:`name`,children:e.name||`Account`}),H(`span`,{className:`tier ${e.premium?`premium`:`free`}`,children:e.premium?`Premium`:`Free`})]}),H(nh,{size:16,className:`chevron`})]}),r?H(fm,{children:H(Cm,{context:l,modal:!1,children:W(`div`,{ref:s.setFloating,style:c,css:Qh,...d(),children:[W(`a`,{className:`item`,href:Jh,target:`_blank`,rel:`noreferrer`,children:[H(sh,{size:16}),`Manage account`]}),W(`button`,{className:`item`,type:`button`,disabled:a,onClick:f,children:[H(hh,{size:16}),a?`Disconnecting...`:`Disconnect`]})]})})}):void 0]}):H(Hh,{style:{flex:`none`,width:Yh,height:Xh}}):H(`div`,{css:$h})},tg=[`ready`,`loading`,`away`],ng=[`play`,`seek`,`go`,`rate`,`subs`,`audio`],rg={subtitles:`subs`,audio:`audio`},ig={all:[],by:{}},ag=(e,t,n)=>e.by[t]?.[n]??e.all.includes(n),og=new Set([`nav`,`scroll`,`cursor`,`playback`,`state`,`pong`]),sg=e=>og.has(e.t),cg=e=>e.trim().slice(0,500)||void 0,lg=e=>e.trim().replace(/\s+/g,` `).slice(0,32)||void 0,ug=e=>JSON.stringify({v:1,...e}),dg=e=>{let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;let n=t;if(n.v===1)switch(n.t){case`nav`:return yg(n.path)?{t:`nav`,path:n.path}:void 0;case`scroll`:return Cg(n.y)?{t:`scroll`,y:n.y}:void 0;case`cursor`:return Cg(n.x)&&Cg(n.y)?{t:`cursor`,x:n.x,y:n.y}:void 0;case`chat`:{let e=typeof n.text==`string`?cg(n.text):void 0;return e?{t:`chat`,text:e}:void 0}case`name`:{let e=typeof n.name==`string`?lg(n.name):void 0;return e?{t:`name`,name:e}:void 0}case`ping`:return xg(n.n)&&xg(n.at)?{t:`ping`,n:n.n,at:n.at}:void 0;case`pong`:return xg(n.n)&&xg(n.at)&&xg(n.host)?{t:`pong`,n:n.n,at:n.at,host:n.host}:void 0;case`playback`:return wg(n.s)?{t:`playback`,s:n.s}:void 0;case`state`:{if(!yg(n.path)||!Cg(n.y)||n.s!==void 0&&!wg(n.s))return;let e=pg(n.grants),t=hg(n.sub),r=hg(n.audio);return{t:`state`,path:n.path,y:n.y,...n.s?{s:n.s}:{},...e?{grants:e}:{},...t===void 0?{}:{sub:t},...r===void 0?{}:{audio:r}}}case`status`:{if(!tg.includes(n.s)||n.path!==void 0&&!bg(n.path))return;let e=Sg(n.time)&&typeof n.rate==`number`&&n.rate>=0&&n.rate<=16;return!e&&(n.time!==void 0||n.rate!==void 0)?void 0:{t:`status`,s:n.s,...n.path===void 0?{}:{path:n.path},...e?{time:n.time,rate:n.rate}:{}}}case`ask`:if(n.c===`go`)return bg(n.path)?{t:`ask`,c:`go`,path:n.path}:void 0;if(n.c===`subs`){let e=hg(n.sub);return e===void 0?void 0:{t:`ask`,c:`subs`,sub:e}}if(n.c===`audio`){let e=hg(n.audio);return e===void 0?void 0:{t:`ask`,c:`audio`,audio:e}}return fg(n.c)&&yg(n.path)&&wg(n.s)?{t:`ask`,c:n.c,path:n.path,s:n.s}:void 0;default:return}},fg=e=>ng.includes(e),pg=e=>{if(!e||typeof e!=`object`)return;let{all:t,by:n}=e;if(!Array.isArray(t)||!n||typeof n!=`object`||Array.isArray(n))return;let r=Object.entries(n);if(r.length>mg)return;let i={all:t.filter(fg),by:{}};for(let[e,t]of r){if(!e||e.length>128||!t||typeof t!=`object`)return;i.by[e]=Object.fromEntries(Object.entries(t).filter(([e,t])=>fg(e)&&typeof t==`boolean`))}return i},mg=100,hg=e=>{if(e===null)return null;if(typeof e!=`string`)return;let t=e.replace(/\s+/g,` `).trim();return t&&t.length<=64?t:void 0},gg=e=>e.c===`go`?`changed the episode`:e.c===`subs`?_g(`subtitles`,e.sub):e.c===`audio`?_g(`audio`,e.audio):e.c===`seek`?`skipped to ${vg(e.s.time)}`:e.c===`rate`?`set speed to ${Number(e.s.rate.toFixed(2))}x`:e.s.paused?`paused`:`resumed`,_g=(e,t)=>t===null?`turned ${e} off`:`set ${e} to ${t}`,vg=e=>{let t=Math.floor(e),n=e=>String(e).padStart(2,`0`),r=Math.floor(t/60)%60;return t>=3600?`${Math.floor(t/3600)}:${n(r)}:${n(t%60)}`:`${r}:${n(t%60)}`},yg=e=>typeof e==`string`&&e.length>0&&e.length<=2048&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!/[\r\n\t]/.test(e),bg=e=>yg(e)&&new URL(e,`https://stub.invalid`).pathname.startsWith(`/watch/`),xg=e=>typeof e==`number`&&Number.isFinite(e),Sg=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0,Cg=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1,wg=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.paused==`boolean`&&Sg(t.time)&&typeof t.rate==`number`&&Number.isFinite(t.rate)&&t.rate>0&&t.rate<=16&&typeof t.at==`number`&&Number.isFinite(t.at)},Tg=1.05,Eg=5e3,Dg=(e,t,n=!1)=>{if(e.paused)return e.time;let r=Math.max(t-e.at,0),i=(n?r:Math.min(r,Og))/1e3;return e.time+i*e.rate},Og=2e3,kg=(e,t,n,r=!1)=>{let i={},a=Dg(t,n,r),o=a-e.time;Math.abs(o)>.5&&(i.seek=a),t.paused&&!e.paused&&(i.pause=!0),!t.paused&&e.paused&&(i.play=!0);let s=!t.paused&&i.seek===void 0&&Math.abs(o)>=.05&&jg(e.rate,t.rate)?t.rate*(o>0?Tg:1/Tg):t.rate;return Ag(e.rate,s)||(i.rate=s),i},Ag=(e,t)=>Math.abs(e-t)<=.001,jg=(e,t)=>e<=t*1.05+.001&&e>=t/1.05-.001,Mg=(e,t,n)=>({...e,time:e.paused?e.time:e.time+Math.max(0,n-t)/1e3*e.rate,at:n}),Ng=2e3,Pg=3e3,Fg=(e,t,n)=>{let r=[];return t.paused!==e.paused&&t.paused!==n.paused&&r.push(`play`),(t.time<e.time-.05||t.time>Dg(e,t.at,!0)+.5)&&Math.abs(t.time-n.time)>.5&&r.push(`seek`),!jg(t.rate,e.rate)&&!jg(t.rate,n.rate)&&r.push(`rate`),r},Ig=(e,t,n)=>{let r=Mg(e,e.at,n);if(t.c===`play`)return e.paused===t.s.paused?void 0:{...r,paused:t.s.paused};if(t.c===`rate`)return Ag(e.rate,t.s.rate)?void 0:{...r,rate:t.s.rate};let i=Dg(t.s,n);return Math.abs(i-r.time)<=.5?void 0:{...r,time:i}},Lg=1e3,Rg=1,zg=(e,t)=>{let n=e.find(([e,n])=>e-.5<=t&&t<n);return n?n[1]-t:0},Bg=(e,t,n,r=0)=>{if(!t||t.readyState<3)return`loading`;let i=e===`ready`?2:10,a=r>0&&Number.isFinite(r)?r-n:1/0;return zg(t.ranges,n)>=Math.min(i,a)?`ready`:`loading`},Vg=(e,t)=>e.time===void 0?void 0:e.time+Math.max(0,t)/1e3*(e.rate??0),Hg=(e,t,n)=>{if(e.s!==t.s||e.path!==t.path||!e.rate!=!t.rate)return!0;let r=Vg(e,n);return r===void 0||t.time===void 0?r!==t.time:Math.abs(r-t.time)>Rg},Ug=(e,t,n)=>{if(e.path!==n)return{s:e.s===`away`?`away`:`loading`};let r=Vg(e,t);return r===void 0?{s:e.s}:{s:e.s,time:r}},Wg=(e,t,n)=>({rtt:n-e,offset:t-(e+n)/2}),Gg=e=>e.length?e.reduce((e,t)=>t.rtt<e.rtt?t:e):void 0,Kg=(e,t)=>e-t,qg=(e,t)=>e+t,Jg=4e3,Yg=`stub-party-invite`,Xg=`stub-party-name`,Zg=1e4,Qg=3e4,$g=2e3,e_=1e4,t_=6e4,n_={subtitles:`party`,audio:`party`},r_=()=>{try{return globalThis.sessionStorage}catch{return}},i_=e=>e instanceof Error&&typeof e.code==`string`,a_=(e,t=r_())=>{let n={status:`idle`},r,i,a={path:`/`,y:0},o=new Set,s=new Set,c,l,u=new Map,d=new Map,f=[],p,m=ig,h=!0,g={},_={},v=n_,y,b,x,S,C=new Map,w=1,T,E,D,O,k=new Map,A=(()=>{try{return t?.getItem(`stub-party-name`)??void 0}catch{return}})(),j=e=>{n=e;for(let e of o)e(n)},M=e=>{try{t?.setItem(Yg,e)}catch{}},N=()=>{try{t?.removeItem(Yg)}catch{}},ee=()=>{try{return t?.getItem(`stub-party-invite`)??void 0}catch{return}},te=e=>e.owner===e.self.id?`host`:`guest`,P=(e,t)=>{for(let n of s)n(e,t)},ne=async e=>{let t=await e.members().catch(()=>void 0);r===e&&n.status===`active`&&t&&j({...n,members:t.length})},F=e=>{r&&n.status===`active`&&(sg(e)&&n.role!==`host`||r.send(ug(e)).catch(()=>{}))},I=()=>{if(!r||n.status!==`active`||n.role!==`guest`)return;let e=r,t=[];x=t;for(let n=0;n<5;n++)setTimeout(()=>{if(x!==t||r!==e)return;let n=Date.now(),i=w++;C.set(i,n),setTimeout(()=>C.delete(i),Jg),F({t:`ping`,n:i,at:n})},n*400);setTimeout(()=>{if(x!==t||r!==e)return;x=void 0;let n=Gg(t);n&&(b=n)},2e3+Jg)},L=()=>({t:`state`,path:a.path,y:a.y,...a.playback?{s:Mg(a.playback,a.playbackAt??Date.now(),Date.now())}:{},...p?{grants:p}:{},...g.subtitles===void 0?{}:{sub:g.subtitles},...g.audio===void 0?{}:{audio:g.audio}}),re=({grants:e=ig,sub:t,audio:r})=>{let i={subtitles:t,audio:r};JSON.stringify([e,i])!==JSON.stringify([m,_])&&(m=e,_=i,n.status===`active`&&j({...n}))},ie=(e,t)=>{g={...g,[e]:t},F(L())},ae=()=>{if(D=void 0,!T)return;let e=Date.now(),t=Vg(T.status,e-T.at);E={status:t===void 0?T.status:{...T.status,time:t},at:e},F({t:`status`,...E.status})},oe=e=>{if(!T||D||!e&&E&&!Hg(E.status,T.status,T.at-E.at))return;let t=(E?.at??-1/0)+$g-Date.now();t<=0?ae():D=setTimeout(ae,t)},se=()=>[...u.values()].filter(e=>`path`in e).at(-1)?.path,ce=()=>{let e=u.get(`state`),t=u.get(`scroll`);if(e?.t!==`state`||t?.t!==`scroll`)return e;let n=[...u.keys()];return n.indexOf(`scroll`)>n.indexOf(`state`)?{...e,y:t.y}:e},le=()=>{i?.(),i=void 0,r=void 0,c&&clearInterval(c),c=void 0,l&&clearInterval(l),l=void 0,S&&clearInterval(S),S=void 0,clearTimeout(D),D=void 0,clearInterval(O),O=void 0,T=void 0,E=void 0,k.clear(),x=void 0,b=void 0,C.clear(),v=n_},ue=async e=>{r=e;let t=te(e);d.clear(),f.length=0,p=void 0,m=ig,h=!0,g={},_={},j({status:`active`,role:t,invite:e.invite,members:1,self:e.self.id,owner:e.owner}),M(e.invite),i=await e.on(i=>{if(r===e)switch(i.type){case`message`:{let n=dg(i.message.text);if(!n)return;let r=i.message.from,a=r===e.self.id;if(n.t===`ping`){t===`host`&&!a&&F({t:`pong`,n:n.n,at:n.at,host:Date.now()});return}if(n.t===`pong`){if(t!==`guest`||r!==e.owner)return;let i=C.get(n.n);if(i===void 0||i!==n.at)return;C.delete(n.n);let a=Wg(i,n.host,Date.now());if(a.rtt>4e3)return;x?.push(a),b||=a;return}if(sg(n)){if(r!==e.owner||(n.t===`state`&&re(n),t===`host`))return;u.delete(n.t),u.set(n.t,n),P(n,{replayed:!1,from:r,self:a});return}if(n.t===`ask`){if(!ag(m,r,n.c))return;let e=f.at(-1);e?.from===r&&e.action===n.c&&f.pop(),t===`host`&&n.c===`subs`&&ie(`subtitles`,n.sub),t===`host`&&n.c===`audio`&&ie(`audio`,n.audio)}if(n.t===`name`&&d.set(r,n.name),n.t===`status`&&t===`host`&&!a){let{t:e,...t}=n;k.set(r,{status:t,at:Date.now()})}if(n.t===`chat`||n.t===`ask`){let e=n.t===`chat`?{text:n.text}:{text:gg(n),action:n.c};f.push({seq:i.message.seq,from:r,name:d.get(r),at:i.message.at,self:a,...e}),f.length>200&&f.splice(0,f.length-200)}P(n,{replayed:!1,from:r,self:a});return}case`joined`:t===`host`&&F(L()),A&&F({t:`name`,name:A}),ne(e);return;case`left`:{if(t===`guest`&&i.id===e.owner){fe(`host-left`);return}k.delete(i.id);let r=p?.by[i.id];t===`host`&&p&&r&&!Object.values(r).includes(!1)&&(p={...p,by:Object.fromEntries(Object.entries(p.by).filter(([e])=>e!==i.id))},F(L()),j({...n})),ne(e);return}}}),r===e?(t===`host`&&(c=setInterval(()=>F(L()),Zg)),t===`guest`&&(I(),S=setInterval(I,t_),T={status:{s:`away`},at:Date.now()},O=setInterval(()=>{bg(se())&&oe(!0)},e_)),l=setInterval(()=>{A&&F({t:`name`,name:A})},Qg),A&&F({t:`name`,name:A}),ne(e),e.closed.then(({reason:t})=>{r===e&&(le(),N(),j({status:`ended`,reason:t}))})):(i(),i=void 0)},de=e=>n.status===`active`&&(n.role===`host`||ag(m,n.self,e)),fe=async e=>{let t=r;le(),N(),j({status:`ended`,reason:e}),await t?.leave().catch(()=>{})},pe=(e,t)=>{N(),j(t?{status:`idle`}:{status:`failed`,code:i_(e)?e.code:`unknown`})},me=async(e,t,n=!1)=>{r&&await fe(`left`),u.clear(),j({status:`joining`,invite:e??``});try{let e=await t();await ue(e)}catch(e){pe(e,n)}};return{getState:()=>n,subscribe:e=>(o.add(e),()=>{o.delete(e)}),onMessage:e=>(s.add(e),()=>{s.delete(e)}),create:()=>me(void 0,()=>e.create()),join:t=>me(t,()=>e.join(t)),resume:async()=>{let t=ee();t&&!r&&await me(t,()=>e.join(t),!0)},leave:async()=>{r&&await fe(`left`)},send:F,setLocation:(e,t)=>{a.path=e,a.y=t},setPlayback:e=>{a.playback=e,a.playbackAt=Date.now()},issued:()=>p??ig,setGrants:e=>{n.status===`active`&&n.role===`host`&&(p=e,F(L()),j({...n}))},may:de,partyTrack:e=>_[e],setPartyTrack:(e,t)=>{n.status===`active`&&(n.role===`host`?ie(e,t):de(rg[e])&&F(e===`subtitles`?{t:`ask`,c:`subs`,sub:t}:{t:`ask`,c:`audio`,audio:t}))},mine:e=>v[e],setMine:(e,t)=>{v={...v,[e]:t},j({...n})},playerTracks:()=>y,setPlayerTracks:e=>{y=e,j({...n})},invite:()=>n.status===`active`?n.invite:void 0,hostClock:()=>b,hostPath:se,following:()=>h,setFollowing:e=>{h=e,j({...n})},replay:()=>{for(let e of[`state`,`nav`,`scroll`,`playback`]){let t=e===`state`?ce():u.get(e);t&&r&&P(t,{replayed:!0,from:r.owner,self:!1})}h||(h=!0,j({...n}))},nameOf:e=>d.get(e),roster:async()=>{if(!r)return[];let e=r;return(await e.members().catch(()=>[])).map(t=>({id:t.id,name:d.get(t.id),host:t.id===e.owner,self:t.id===e.self.id}))},chat:()=>f.slice(),setName:e=>{A=e;try{e?t?.setItem(Xg,e):t?.removeItem(Xg)}catch{}e&&F({t:`name`,name:e})},name:()=>A,kick:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.remove(e)},ban:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.block(e)},playing:()=>!(!a.playback||a.playback.paused),setStatus:e=>{n.status===`active`&&n.role===`guest`&&(T={status:e,at:Date.now()},oe(!1))},statuses:()=>k,dismiss:()=>{(n.status===`ended`||n.status===`failed`)&&j({status:`idle`})}}},o_=`/party`,s_=(e,t)=>`${e}${o_}#${l_(e,t)}`,c_=(e,t)=>{let n=e.startsWith(`#`)?e.slice(1):e,r;try{r=decodeURIComponent(n).trim()}catch{return}if(f_.test(r))return r;if(!p_.test(r))return;let i=r.indexOf(`.`),a=`${r.slice(0,i)}.${t}/${r.slice(i+1)}`;return f_.test(a)?a:void 0},l_=(e,t)=>{let n=t.indexOf(`.`),r=t.slice(n+1),i=r.lastIndexOf(`/`);return i>0&&r.slice(0,i)===e?`${t.slice(0,n)}.${r.slice(i+1)}`:t},u_=`[A-Za-z0-9_-]{43}`,d_=`[a-z0-9][a-z0-9._-]{0,63}`,f_=RegExp(`^${u_}\\.[\\x21-\\x7e]{1,256}\\/${d_}$`),p_=RegExp(`^${u_}\\.${d_}$`),Q=a_($e);G();var m_=()=>{let[e,t]=U(Q.getState);return B(()=>Q.subscribe(t),[]),e},h_=e=>{let[t]=U(()=>({current:e}));t.current=e,B(()=>Q.onMessage((e,n)=>t.current(e,n)),[])};G();var g_=O`
|
|
114
|
+
`,eg=()=>{let{info:e,ready:t,logout:n}=Kh(),[r,i]=U(!1),[a,o]=U(!1),{refs:s,floatingStyles:c,context:l}=Rm({open:r,onOpenChange:i,placement:`bottom-end`,middleware:[hp(8),_p(),gp({padding:8})],whileElementsMounted:Ve}),{getReferenceProps:u,getFloatingProps:d}=Hm([Mm(l),Im(l),Wm(l,{role:`menu`})]);B(()=>{e||(i(!1),o(!1))},[e]);let f=async()=>{o(!0);try{await n()}finally{o(!1),i(!1)}};return t?e?W(R,{children:[W(`button`,{ref:s.setReference,css:Zh,type:`button`,"aria-label":`FKN account: ${e.name||`Account`}`,...u(),children:[W(`span`,{className:`who`,children:[H(`span`,{className:`name`,children:e.name||`Account`}),H(`span`,{className:`tier ${e.premium?`premium`:`free`}`,children:e.premium?`Premium`:`Free`})]}),H(nh,{size:16,className:`chevron`})]}),r?H(fm,{children:H(Cm,{context:l,modal:!1,children:W(`div`,{ref:s.setFloating,style:c,css:Qh,...d(),children:[W(`a`,{className:`item`,href:Jh,target:`_blank`,rel:`noreferrer`,children:[H(sh,{size:16}),`Manage account`]}),W(`button`,{className:`item`,type:`button`,disabled:a,onClick:f,children:[H(hh,{size:16}),a?`Disconnecting...`:`Disconnect`]})]})})}):void 0]}):H(Hh,{style:{flex:`none`,width:Yh,height:Xh}}):H(`div`,{css:$h})},tg=[`ready`,`loading`,`away`],ng=[`play`,`seek`,`go`,`rate`,`subs`,`audio`],rg={subtitles:`subs`,audio:`audio`},ig={all:[],by:{}},ag=(e,t,n)=>e.by[t]?.[n]??e.all.includes(n),og=new Set([`nav`,`scroll`,`cursor`,`playback`,`state`,`pong`]),sg=e=>og.has(e.t),cg=e=>e.trim().slice(0,500)||void 0,lg=e=>e.trim().replace(/\s+/g,` `).slice(0,32)||void 0,ug=e=>JSON.stringify({v:1,...e}),dg=e=>{let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;let n=t;if(n.v===1)switch(n.t){case`nav`:return yg(n.path)?{t:`nav`,path:n.path}:void 0;case`scroll`:return Cg(n.y)?{t:`scroll`,y:n.y}:void 0;case`cursor`:return Cg(n.x)&&Cg(n.y)?{t:`cursor`,x:n.x,y:n.y}:void 0;case`chat`:{let e=typeof n.text==`string`?cg(n.text):void 0;return e?{t:`chat`,text:e}:void 0}case`name`:{let e=typeof n.name==`string`?lg(n.name):void 0;return e?{t:`name`,name:e}:void 0}case`ping`:return xg(n.n)&&xg(n.at)?{t:`ping`,n:n.n,at:n.at}:void 0;case`pong`:return xg(n.n)&&xg(n.at)&&xg(n.host)?{t:`pong`,n:n.n,at:n.at,host:n.host}:void 0;case`playback`:return wg(n.s)?{t:`playback`,s:n.s}:void 0;case`state`:{if(!yg(n.path)||!Cg(n.y)||n.s!==void 0&&!wg(n.s))return;let e=pg(n.grants),t=hg(n.sub),r=hg(n.audio);return{t:`state`,path:n.path,y:n.y,...n.s?{s:n.s}:{},...e?{grants:e}:{},...t===void 0?{}:{sub:t},...r===void 0?{}:{audio:r}}}case`status`:{if(!tg.includes(n.s)||n.path!==void 0&&!bg(n.path))return;let e=Sg(n.time)&&typeof n.rate==`number`&&n.rate>=0&&n.rate<=16;return!e&&(n.time!==void 0||n.rate!==void 0)?void 0:{t:`status`,s:n.s,...n.path===void 0?{}:{path:n.path},...e?{time:n.time,rate:n.rate}:{}}}case`ask`:if(n.c===`go`)return bg(n.path)?{t:`ask`,c:`go`,path:n.path}:void 0;if(n.c===`subs`){let e=hg(n.sub);return e===void 0?void 0:{t:`ask`,c:`subs`,sub:e}}if(n.c===`audio`){let e=hg(n.audio);return e===void 0?void 0:{t:`ask`,c:`audio`,audio:e}}return fg(n.c)&&yg(n.path)&&wg(n.s)?{t:`ask`,c:n.c,path:n.path,s:n.s}:void 0;default:return}},fg=e=>ng.includes(e),pg=e=>{if(!e||typeof e!=`object`)return;let{all:t,by:n}=e;if(!Array.isArray(t)||!n||typeof n!=`object`||Array.isArray(n))return;let r=Object.entries(n);if(r.length>mg)return;let i={all:t.filter(fg),by:{}};for(let[e,t]of r){if(!e||e.length>128||!t||typeof t!=`object`)return;i.by[e]=Object.fromEntries(Object.entries(t).filter(([e,t])=>fg(e)&&typeof t==`boolean`))}return i},mg=100,hg=e=>{if(e===null)return null;if(typeof e!=`string`)return;let t=e.replace(/\s+/g,` `).trim();return t&&t.length<=64?t:void 0},gg=e=>e.c===`go`?`changed the episode`:e.c===`subs`?_g(`subtitles`,e.sub):e.c===`audio`?_g(`audio`,e.audio):e.c===`seek`?`skipped to ${vg(e.s.time)}`:e.c===`rate`?`set speed to ${Number(e.s.rate.toFixed(2))}x`:e.s.paused?`paused`:`resumed`,_g=(e,t)=>t===null?`turned ${e} off`:`set ${e} to ${t}`,vg=e=>{let t=Math.floor(e),n=e=>String(e).padStart(2,`0`),r=Math.floor(t/60)%60;return t>=3600?`${Math.floor(t/3600)}:${n(r)}:${n(t%60)}`:`${r}:${n(t%60)}`},yg=e=>typeof e==`string`&&e.length>0&&e.length<=2048&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!/[\r\n\t]/.test(e),bg=e=>yg(e)&&new URL(e,`https://stub.invalid`).pathname.startsWith(`/watch/`),xg=e=>typeof e==`number`&&Number.isFinite(e),Sg=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0,Cg=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1,wg=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.paused==`boolean`&&Sg(t.time)&&typeof t.rate==`number`&&Number.isFinite(t.rate)&&t.rate>0&&t.rate<=16&&typeof t.at==`number`&&Number.isFinite(t.at)},Tg=1.05,Eg=5e3,Dg=(e,t,n=!1)=>{if(e.paused)return e.time;let r=Math.max(t-e.at,0),i=(n?r:Math.min(r,Og))/1e3;return e.time+i*e.rate},Og=2e3,kg=(e,t,n,r=!1)=>{let i={},a=Dg(t,n,r),o=a-e.time;Math.abs(o)>.5&&(i.seek=a),t.paused&&!e.paused&&(i.pause=!0),!t.paused&&e.paused&&(i.play=!0);let s=!t.paused&&i.seek===void 0&&Math.abs(o)>=.05&&jg(e.rate,t.rate)?t.rate*(o>0?Tg:1/Tg):t.rate;return Ag(e.rate,s)||(i.rate=s),i},Ag=(e,t)=>Math.abs(e-t)<=.001,jg=(e,t)=>e<=t*1.05+.001&&e>=t/1.05-.001,Mg=(e,t,n)=>({...e,time:e.paused?e.time:e.time+Math.max(0,n-t)/1e3*e.rate,at:n}),Ng=2e3,Pg=3e3,Fg=(e,t,n)=>{let r=[];return t.paused!==e.paused&&t.paused!==n.paused&&r.push(`play`),(t.time<e.time-.05||t.time>Dg(e,t.at,!0)+.5)&&Math.abs(t.time-n.time)>.5&&r.push(`seek`),!jg(t.rate,e.rate)&&!jg(t.rate,n.rate)&&r.push(`rate`),r},Ig=(e,t,n)=>{let r=Mg(e,e.at,n);if(t.c===`play`)return e.paused===t.s.paused?void 0:{...r,paused:t.s.paused};if(t.c===`rate`)return Ag(e.rate,t.s.rate)?void 0:{...r,rate:t.s.rate};let i=Dg(t.s,n);return Math.abs(i-r.time)<=.5?void 0:{...r,time:i}},Lg=1e3,Rg=1,zg=(e,t)=>{let n=e.find(([e,n])=>e-.5<=t&&t<n);return n?n[1]-t:0},Bg=(e,t,n,r=0)=>{if(!t||t.readyState<3)return`loading`;let i=e===`ready`?2:10,a=r>0&&Number.isFinite(r)?r-n:1/0;return zg(t.ranges,n)>=Math.min(i,a)?`ready`:`loading`},Vg=(e,t)=>e.time===void 0?void 0:e.time+Math.max(0,t)/1e3*(e.rate??0),Hg=(e,t,n)=>{if(e.s!==t.s||e.path!==t.path||!e.rate!=!t.rate)return!0;let r=Vg(e,n);return r===void 0||t.time===void 0?r!==t.time:Math.abs(r-t.time)>Rg},Ug=(e,t,n)=>{if(e.path!==n)return{s:e.s===`away`?`away`:`loading`};let r=Vg(e,t);return r===void 0?{s:e.s}:{s:e.s,time:r}},Wg=(e,t,n)=>({rtt:n-e,offset:t-(e+n)/2}),Gg=e=>e.length?e.reduce((e,t)=>t.rtt<e.rtt?t:e):void 0,Kg=(e,t)=>e-t,qg=(e,t)=>e+t,Jg=4e3,Yg=`stub-party-invite`,Xg=`stub-party-name`,Zg=1e4,Qg=3e4,$g=2e3,e_=1e4,t_=6e4,n_={subtitles:`party`,audio:`party`},r_=()=>{try{return globalThis.sessionStorage}catch{return}},i_=e=>e instanceof Error&&typeof e.code==`string`,a_=(e,t=r_())=>{let n={status:`idle`},r,i,a={path:`/`,y:0},o=new Set,s=new Set,c,l,u=new Map,d=new Map,f=[],p,m=ig,h=!0,g={},_={},v=n_,y,b,x,S,C=new Map,w=1,T,E,D,O,k=new Map,A=(()=>{try{return t?.getItem(`stub-party-name`)??void 0}catch{return}})(),j=e=>{n=e;for(let e of o)e(n)},M=e=>{try{t?.setItem(Yg,e)}catch{}},N=()=>{try{t?.removeItem(Yg)}catch{}},ee=()=>{try{return t?.getItem(`stub-party-invite`)??void 0}catch{return}},te=e=>e.owner===e.self.id?`host`:`guest`,P=(e,t)=>{for(let n of s)n(e,t)},ne=async e=>{let t=await e.members().catch(()=>void 0);r===e&&n.status===`active`&&t&&j({...n,members:t.length})},re=e=>{r&&n.status===`active`&&(sg(e)&&n.role!==`host`||r.send(ug(e)).catch(()=>{}))},F=()=>{if(!r||n.status!==`active`||n.role!==`guest`)return;let e=r,t=[];x=t;for(let n=0;n<5;n++)setTimeout(()=>{if(x!==t||r!==e)return;let n=Date.now(),i=w++;C.set(i,n),setTimeout(()=>C.delete(i),Jg),re({t:`ping`,n:i,at:n})},n*400);setTimeout(()=>{if(x!==t||r!==e)return;x=void 0;let n=Gg(t);n&&(b=n)},2e3+Jg)},I=()=>({t:`state`,path:a.path,y:a.y,...a.playback?{s:Mg(a.playback,a.playbackAt??Date.now(),Date.now())}:{},...p?{grants:p}:{},...g.subtitles===void 0?{}:{sub:g.subtitles},...g.audio===void 0?{}:{audio:g.audio}}),ie=({grants:e=ig,sub:t,audio:r})=>{let i={subtitles:t,audio:r};JSON.stringify([e,i])!==JSON.stringify([m,_])&&(m=e,_=i,n.status===`active`&&j({...n}))},L=(e,t)=>{g={...g,[e]:t},re(I())},ae=()=>{if(D=void 0,!T)return;let e=Date.now(),t=Vg(T.status,e-T.at);E={status:t===void 0?T.status:{...T.status,time:t},at:e},re({t:`status`,...E.status})},oe=e=>{if(!T||D||!e&&E&&!Hg(E.status,T.status,T.at-E.at))return;let t=(E?.at??-1/0)+$g-Date.now();t<=0?ae():D=setTimeout(ae,t)},se=()=>[...u.values()].filter(e=>`path`in e).at(-1)?.path,ce=()=>{let e=u.get(`state`),t=u.get(`scroll`);if(e?.t!==`state`||t?.t!==`scroll`)return e;let n=[...u.keys()];return n.indexOf(`scroll`)>n.indexOf(`state`)?{...e,y:t.y}:e},le=()=>{i?.(),i=void 0,r=void 0,c&&clearInterval(c),c=void 0,l&&clearInterval(l),l=void 0,S&&clearInterval(S),S=void 0,clearTimeout(D),D=void 0,clearInterval(O),O=void 0,T=void 0,E=void 0,k.clear(),x=void 0,b=void 0,C.clear(),v=n_},ue=async e=>{r=e;let t=te(e);d.clear(),f.length=0,p=void 0,m=ig,h=!0,g={},_={},j({status:`active`,role:t,invite:e.invite,members:1,self:e.self.id,owner:e.owner}),M(e.invite),i=await e.on(i=>{if(r===e)switch(i.type){case`message`:{let n=dg(i.message.text);if(!n)return;let r=i.message.from,a=r===e.self.id;if(n.t===`ping`){t===`host`&&!a&&re({t:`pong`,n:n.n,at:n.at,host:Date.now()});return}if(n.t===`pong`){if(t!==`guest`||r!==e.owner)return;let i=C.get(n.n);if(i===void 0||i!==n.at)return;C.delete(n.n);let a=Wg(i,n.host,Date.now());if(a.rtt>4e3)return;x?.push(a),b||=a;return}if(sg(n)){if(r!==e.owner||(n.t===`state`&&ie(n),t===`host`))return;u.delete(n.t),u.set(n.t,n),P(n,{replayed:!1,from:r,self:a});return}if(n.t===`ask`){if(!ag(m,r,n.c))return;let e=f.at(-1);e?.from===r&&e.action===n.c&&f.pop(),t===`host`&&n.c===`subs`&&L(`subtitles`,n.sub),t===`host`&&n.c===`audio`&&L(`audio`,n.audio)}if(n.t===`name`&&d.set(r,n.name),n.t===`status`&&t===`host`&&!a){let{t:e,...t}=n;k.set(r,{status:t,at:Date.now()})}if(n.t===`chat`||n.t===`ask`){let e=n.t===`chat`?{text:n.text}:{text:gg(n),action:n.c};f.push({seq:i.message.seq,from:r,name:d.get(r),at:i.message.at,self:a,...e}),f.length>200&&f.splice(0,f.length-200)}P(n,{replayed:!1,from:r,self:a});return}case`joined`:t===`host`&&re(I()),A&&re({t:`name`,name:A}),ne(e);return;case`left`:{if(t===`guest`&&i.id===e.owner){fe(`host-left`);return}k.delete(i.id);let r=p?.by[i.id];t===`host`&&p&&r&&!Object.values(r).includes(!1)&&(p={...p,by:Object.fromEntries(Object.entries(p.by).filter(([e])=>e!==i.id))},re(I()),j({...n})),ne(e);return}}}),r===e?(t===`host`&&(c=setInterval(()=>re(I()),Zg)),t===`guest`&&(F(),S=setInterval(F,t_),T={status:{s:`away`},at:Date.now()},O=setInterval(()=>{bg(se())&&oe(!0)},e_)),l=setInterval(()=>{A&&re({t:`name`,name:A})},Qg),A&&re({t:`name`,name:A}),ne(e),e.closed.then(({reason:t})=>{r===e&&(le(),N(),j({status:`ended`,reason:t}))})):(i(),i=void 0)},de=e=>n.status===`active`&&(n.role===`host`||ag(m,n.self,e)),fe=async e=>{let t=r;le(),N(),j({status:`ended`,reason:e}),await t?.leave().catch(()=>{})},pe=(e,t)=>{N(),j(t?{status:`idle`}:{status:`failed`,code:i_(e)?e.code:`unknown`})},me=async(e,t,n=!1)=>{r&&await fe(`left`),u.clear(),j({status:`joining`,invite:e??``});try{let e=await t();await ue(e)}catch(e){pe(e,n)}};return{getState:()=>n,subscribe:e=>(o.add(e),()=>{o.delete(e)}),onMessage:e=>(s.add(e),()=>{s.delete(e)}),create:()=>me(void 0,()=>e.create()),join:t=>me(t,()=>e.join(t)),resume:async()=>{let t=ee();t&&!r&&await me(t,()=>e.join(t),!0)},leave:async()=>{r&&await fe(`left`)},send:re,setLocation:(e,t)=>{a.path=e,a.y=t},setPlayback:e=>{a.playback=e,a.playbackAt=Date.now()},issued:()=>p??ig,setGrants:e=>{n.status===`active`&&n.role===`host`&&(p=e,re(I()),j({...n}))},may:de,partyTrack:e=>_[e],setPartyTrack:(e,t)=>{n.status===`active`&&(n.role===`host`?L(e,t):de(rg[e])&&re(e===`subtitles`?{t:`ask`,c:`subs`,sub:t}:{t:`ask`,c:`audio`,audio:t}))},mine:e=>v[e],setMine:(e,t)=>{v={...v,[e]:t},j({...n})},playerTracks:()=>y,setPlayerTracks:e=>{y=e,j({...n})},invite:()=>n.status===`active`?n.invite:void 0,hostClock:()=>b,hostPath:se,following:()=>h,setFollowing:e=>{h=e,j({...n})},replay:()=>{for(let e of[`state`,`nav`,`scroll`,`playback`]){let t=e===`state`?ce():u.get(e);t&&r&&P(t,{replayed:!0,from:r.owner,self:!1})}h||(h=!0,j({...n}))},nameOf:e=>d.get(e),roster:async()=>{if(!r)return[];let e=r;return(await e.members().catch(()=>[])).map(t=>({id:t.id,name:d.get(t.id),host:t.id===e.owner,self:t.id===e.self.id}))},chat:()=>f.slice(),setName:e=>{A=e;try{e?t?.setItem(Xg,e):t?.removeItem(Xg)}catch{}e&&re({t:`name`,name:e})},name:()=>A,kick:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.remove(e)},ban:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.block(e)},playing:()=>!(!a.playback||a.playback.paused),setStatus:e=>{n.status===`active`&&n.role===`guest`&&(T={status:e,at:Date.now()},oe(!1))},statuses:()=>k,dismiss:()=>{(n.status===`ended`||n.status===`failed`)&&j({status:`idle`})}}},o_=`/party`,s_=(e,t)=>`${e}${o_}#${l_(e,t)}`,c_=(e,t)=>{let n=e.startsWith(`#`)?e.slice(1):e,r;try{r=decodeURIComponent(n).trim()}catch{return}if(f_.test(r))return r;if(!p_.test(r))return;let i=r.indexOf(`.`),a=`${r.slice(0,i)}.${t}/${r.slice(i+1)}`;return f_.test(a)?a:void 0},l_=(e,t)=>{let n=t.indexOf(`.`),r=t.slice(n+1),i=r.lastIndexOf(`/`);return i>0&&r.slice(0,i)===e?`${t.slice(0,n)}.${r.slice(i+1)}`:t},u_=`[A-Za-z0-9_-]{43}`,d_=`[a-z0-9][a-z0-9._-]{0,63}`,f_=RegExp(`^${u_}\\.[\\x21-\\x7e]{1,256}\\/${d_}$`),p_=RegExp(`^${u_}\\.${d_}$`),Q=a_($e);G();var m_=()=>{let[e,t]=U(Q.getState);return B(()=>Q.subscribe(t),[]),e},h_=e=>{let[t]=U(()=>({current:e}));t.current=e,B(()=>Q.onMessage((e,n)=>t.current(e,n)),[])};G();var g_=O`
|
|
115
115
|
position: fixed;
|
|
116
116
|
right: 2rem;
|
|
117
117
|
bottom: 2rem;
|
|
@@ -798,7 +798,7 @@ https://bit.ly/2XbVrpR#`;function cc(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
|
|
|
798
798
|
gap: 1.2rem;
|
|
799
799
|
padding: 2rem 1.5rem;
|
|
800
800
|
}
|
|
801
|
-
`,ev=()=>{let[e]=Fu(Ku(Z.WATCH)),[t]=Fu(Ku(Z.LOGIN_CALLBACK));return e||t?null:W(`footer`,{css:$_,children:[H(Bu,{to:qu(Z.HOME),className:`wordmark`,onClick:Bh,children:`stub`}),H(Bu,{to:qu(Z.LEGAL),className:`nav-link`,children:`Legal`}),H(Bu,{to:qu(Z.PRIVACY),className:`nav-link`,children:`Privacy`}),W(`span`,{className:`version`,title:`stub v0.0.
|
|
801
|
+
`,ev=()=>{let[e]=Fu(Ku(Z.WATCH)),[t]=Fu(Ku(Z.LOGIN_CALLBACK));return e||t?null:W(`footer`,{css:$_,children:[H(Bu,{to:qu(Z.HOME),className:`wordmark`,onClick:Bh,children:`stub`}),H(Bu,{to:qu(Z.LEGAL),className:`nav-link`,children:`Legal`}),H(Bu,{to:qu(Z.PRIVACY),className:`nav-link`,children:`Privacy`}),W(`span`,{className:`version`,title:`stub v0.0.60, commit 0c4b2a6`,children:[`v`,`0.0.60`,` `,H(`span`,{className:`commit`,children:`0c4b2a6`})]})]})};G();var tv=O`
|
|
802
802
|
position: fixed;
|
|
803
803
|
inset: 0;
|
|
804
804
|
/* a sibling of the modal's portal rather than a child of it, so it competes at the root and 200
|
|
@@ -2314,7 +2314,7 @@ transition: max-height 0.3s ease-in-out;
|
|
|
2314
2314
|
width: 100%;
|
|
2315
2315
|
background-color: rgb(35, 35, 35);
|
|
2316
2316
|
}
|
|
2317
|
-
`,gx=({children:e,collapsedHeight:t=200,...n})=>{let[r,i]=U(!1),[a,o]=U(!1),s=K(null),[c,l]=U(0);B(()=>{if(!s.current)return;let e=new ResizeObserver(()=>{if(s.current){let e=s.current.scrollHeight;l(e),o(e>t)}});return e.observe(s.current),()=>e.disconnect()},[t]);let u=()=>i(!r);return W(`div`,{...n,ref:s,css:hx,className:`${n.className||``} ${r?`expanded`:`collapsed`}`,children:[H(`div`,{className:`content`,children:e}),a&&!r?H(`div`,{className:`fade-overlay`}):void 0,a?H(`button`,{className:`toggle-button`,onClick:u,children:r?`Collapse`:`Expand`}):void 0]})},_x=`this build of the worker exposes no traceGraph, so there is nothing to read a trace from`,vx=async()=>await Ee(()=>import(`./worker-
|
|
2317
|
+
`,gx=({children:e,collapsedHeight:t=200,...n})=>{let[r,i]=U(!1),[a,o]=U(!1),s=K(null),[c,l]=U(0);B(()=>{if(!s.current)return;let e=new ResizeObserver(()=>{if(s.current){let e=s.current.scrollHeight;l(e),o(e>t)}});return e.observe(s.current),()=>e.disconnect()},[t]);let u=()=>i(!r);return W(`div`,{...n,ref:s,css:hx,className:`${n.className||``} ${r?`expanded`:`collapsed`}`,children:[H(`div`,{className:`content`,children:e}),a&&!r?H(`div`,{className:`fade-overlay`}):void 0,a?H(`button`,{className:`toggle-button`,onClick:u,children:r?`Collapse`:`Expand`}):void 0]})},_x=`this build of the worker exposes no traceGraph, so there is nothing to read a trace from`,vx=async()=>await Ee(()=>import(`./worker-6zDaiXIC.js`),__vite__mapDeps([0,1,2,3,4]),import.meta.url),yx=async e=>{let t=await vx();if(typeof t.traceGraph!=`function`)throw Error(_x);return t.traceGraph(e)},bx=async e=>{let t=await vx();if(typeof t.traceAnswer!=`function`)throw Error(_x);return t.traceAnswer(e)},xx=[`graph`,`store`],Sx=({uri:e,search:t}={})=>{let n=qu(Z.DEBUG_TRACE),r=new URLSearchParams;e&&r.set(`uri`,e);let i=Ex(t??``);for(let e of xx)for(let t of i.getAll(e))r.append(e,t);let a=r.toString();return a?`${n}?${a}`:n},Cx=e=>{let t=Ex(Ox(e)),n=new URLSearchParams;for(let e of xx)for(let r of t.getAll(e))n.append(e,r);let r=n.toString();return r?`?${r}`:``},wx=(e,t=`graph`)=>{let n=Ex(e);return n.set(t,`1`),`${qu(Z.DEBUG_TRACE)}?${n.toString()}`},Tx=e=>{let t=Ex(e);t.delete(`store`);let n=t.toString();return`${qu(Z.DEBUG_TRACE)}${n?`?${n}`:``}`},Ex=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),Dx=typeof location>`u`?``:location.search,Ox=(e=``)=>{let t=Ex(Dx);for(let[n,r]of Ex(e))t.set(n,r);return t.toString()},kx=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e).get(`uri`)??``,Ax={PREQUEL:`SEQUEL`,ADAPTATION:`SOURCE`,COMPILATION:`CONTAINS`,SIDE_STORY:`PARENT`},jx=e=>{let t=new Set,n=[];for(let r of e){if(!r?.from||!r?.to||r.from===r.to)continue;let e=Ax[r.relation],i=e?{from:r.to,to:r.from,relation:e}:r,a=`${i.from}\u0000${i.to}\u0000${i.relation}`;t.has(a)||(t.add(a),n.push(i))}return n},Mx=new Set([`TV`,`TV_SHORT`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`,`MUSIC`]),Nx=e=>!e||Mx.has(e),Px=e=>[...new Set((e.nodes??[]).map(e=>e.format??``).filter(Boolean))].sort(),Fx=(e,t)=>{let n=(e.nodes??[]).filter(t),r=new Set(n.map(e=>e.uri));return{nodes:n,edges:(e.edges??[]).filter(e=>r.has(e.from)&&r.has(e.to))}},Ix=e=>`${e.from}\u0000${e.to}\u0000${e.relation}`,Lx=(e,t)=>{if(!e)return{nodes:new Set,edges:new Set};if(e.kind===`node`){let n=t.filter(t=>t.from===e.uri||t.to===e.uri);return{nodes:new Set([e.uri]),edges:new Set(n.map(Ix))}}let n=t.find(t=>Ix(t)===e.key);return n?{nodes:new Set([n.from,n.to]),edges:new Set([e.key])}:{nodes:new Set,edges:new Set}},Rx=e=>e.titles?.[0]?.title||e.uri,zx=e=>[...e].sort((e,t)=>(e.startDate??`9999`).localeCompare(t.startDate??`9999`)||Rx(e).localeCompare(Rx(t))),Bx=(e,t)=>{let n=new Map(e.map(e=>[e.uri,0]));for(let r=0;r<e.length;r++){let e=!1;for(let r of t){let t=n.get(r.from),i=n.get(r.to);t!==void 0&&i!==void 0&&i<t+1&&(n.set(r.to,t+1),e=!0)}if(!e)break}let r=[...new Set(n.values())].sort((e,t)=>e-t),i=new Map(r.map((e,t)=>[e,t]));for(let[e,t]of n)n.set(e,i.get(t)??0);return n},Vx=(e,t=`story`)=>{let n=jx(e.edges??[]),r=new Set((e.nodes??[]).map(e=>e.uri)),i=n.filter(e=>r.has(e.from)&&r.has(e.to)),a=zx(e.nodes??[]),o=t===`graph`?Bx(a,i):void 0,s=[...new Set(a.map(e=>e.startDate??``))],c=new Map(s.map((e,t)=>[e,t])),l=new Map,u=a.map(e=>{let t=o?o.get(e.uri)??0:c.get(e.startDate??``)??0,n=l.get(t)??0;return l.set(t,n+1),{...e,column:t,row:n}}),d=[];if(t===`story`)for(let e=0;e<u.length-1;e++){let t=u[e],n=u[e+1];n.column>t.column&&d.push({from:t.uri,to:n.uri})}return{nodes:u,edges:i,chain:d,columns:Math.max(0,...u.map(e=>e.column+1)),rows:Math.max(0,...l.values())}},Hx={ADAPTATION:`Adaptation`,PREQUEL:`Prequel`,SEQUEL:`Sequel`,PARENT:`Parent story`,SIDE_STORY:`Side story`,CHARACTER:`Character`,SUMMARY:`Summary`,ALTERNATIVE:`Alternative`,SPIN_OFF:`Spin off`,SOURCE:`Source`,COMPILATION:`Compilation`,CONTAINS:`Contains`,OTHER:`Related`},Ux=[`SOURCE`,`PREQUEL`,`SEQUEL`,`PARENT`,`SIDE_STORY`,`SPIN_OFF`,`ALTERNATIVE`,`ADAPTATION`,`SUMMARY`,`COMPILATION`,`CONTAINS`,`CHARACTER`,`OTHER`],Wx=e=>{let t=Ux.indexOf(e);return t===-1?Ux.length:t},Gx=e=>e&&Hx[e]||Hx.OTHER,Kx={TV:`TV`,TV_SHORT:`TV Short`,MOVIE:`Movie`,SPECIAL:`Special`,OVA:`OVA`,ONA:`ONA`,MUSIC:`Music`,MANGA:`Manga`,NOVEL:`Light Novel`,ONE_SHOT:`One Shot`},qx=e=>e?Kx[e]||e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):void 0,Jx=e=>[...e].sort((e,t)=>Wx(e.relation)-Wx(t.relation)),Yx=e=>e.filter(e=>Nx(e.format)),Xx=3,Zx=O`
|
|
2318
2318
|
& > h2 {
|
|
2319
2319
|
display: flex;
|
|
2320
2320
|
align-items: center;
|
|
@@ -2448,12 +2448,12 @@ transition: max-height 0.3s ease-in-out;
|
|
|
2448
2448
|
background: #fff;
|
|
2449
2449
|
color: #000;
|
|
2450
2450
|
}
|
|
2451
|
-
`,nS=({seasons:e,currentUris:t,href:n})=>!e||e.length<2?null:e.some(e=>t.includes(e.uri))?W(`section`,{className:`seasons`,css:tS,"data-seasons":!0,children:[H(`h2`,{children:`Seasons`}),H(`nav`,{children:e.map(e=>W(Bu,{href:n(d(e.uri)),"aria-current":t.includes(e.uri)?`page`:void 0,children:[`Season `,e.number]},e.uri))})]}):H(Uu,{to:n(d(e[0].uri)),replace:!0});function rS(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=rS(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var iS={value:()=>{}};function aS(){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 oS(n)}function oS(e){this._=e}function sS(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}})}oS.prototype=aS.prototype={constructor:oS,on:function(e,t){var n=this._,r=sS(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=cS(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=lS(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lS(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 oS(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 cS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lS(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=iS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uS={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 dS(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),uS.hasOwnProperty(t)?{space:uS[t],local:e}:e}function fS(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 pS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mS(e){var t=dS(e);return(t.local?pS:fS)(t)}function hS(){}function gS(e){return e==null?hS:function(){return this.querySelector(e)}}function _S(e){typeof e!=`function`&&(e=gS(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 aw(r,this._parents)}function vS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yS(){return[]}function bS(e){return e==null?yS:function(){return this.querySelectorAll(e)}}function xS(e){return function(){return vS(e.apply(this,arguments))}}function SS(e){e=typeof e==`function`?xS(e):bS(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 aw(r,i)}function CS(e){return function(){return this.matches(e)}}function wS(e){return function(t){return t.matches(e)}}var TS=Array.prototype.find;function ES(e){return function(){return TS.call(this.children,e)}}function DS(){return this.firstElementChild}function OS(e){return this.select(e==null?DS:ES(typeof e==`function`?e:wS(e)))}var kS=Array.prototype.filter;function AS(){return Array.from(this.children)}function jS(e){return function(){return kS.call(this.children,e)}}function MS(e){return this.selectAll(e==null?AS:jS(typeof e==`function`?e:wS(e)))}function NS(e){typeof e!=`function`&&(e=CS(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 aw(r,this._parents)}function PS(e){return Array(e.length)}function FS(){return new aw(this._enter||this._groups.map(PS),this._parents)}function IS(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}IS.prototype={constructor:IS,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 LS(e){return function(){return e}}function RS(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 IS(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function zS(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 IS(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function BS(e){return e.__data__}function VS(e,t){if(!arguments.length)return Array.from(this,BS);var n=t?zS:RS,r=this._parents,i=this._groups;typeof e!=`function`&&(e=LS(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=HS(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 aw(o,r),o._enter=s,o._exit=c,o}function HS(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function US(){return new aw(this._exit||this._groups.map(PS),this._parents)}function WS(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 GS(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 aw(s,this._parents)}function KS(){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 qS(e){e||=JS;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 aw(i,this._parents).order()}function JS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function YS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XS(){return Array.from(this)}function ZS(){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 QS(){let e=0;for(let t of this)++e;return e}function $S(){return!this.node()}function eC(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 tC(e){return function(){this.removeAttribute(e)}}function nC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rC(e,t){return function(){this.setAttribute(e,t)}}function iC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function aC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oC(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 sC(e,t){var n=dS(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?nC:tC:typeof t==`function`?n.local?oC:aC:n.local?iC:rC)(n,t))}function cC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lC(e){return function(){this.style.removeProperty(e)}}function uC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function fC(e,t,n){return arguments.length>1?this.each((t==null?lC:typeof t==`function`?dC:uC)(e,t,n??``)):pC(this.node(),e)}function pC(e,t){return e.style.getPropertyValue(t)||cC(e).getComputedStyle(e,null).getPropertyValue(t)}function mC(e){return function(){delete this[e]}}function hC(e,t){return function(){this[e]=t}}function gC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _C(e,t){return arguments.length>1?this.each((t==null?mC:typeof t==`function`?gC:hC)(e,t)):this.node()[e]}function vC(e){return e.trim().split(/^|\s+/)}function yC(e){return e.classList||new bC(e)}function bC(e){this._node=e,this._names=vC(e.getAttribute(`class`)||``)}bC.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 xC(e,t){for(var n=yC(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function SC(e,t){for(var n=yC(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function CC(e){return function(){xC(this,e)}}function wC(e){return function(){SC(this,e)}}function TC(e,t){return function(){(t.apply(this,arguments)?xC:SC)(this,e)}}function EC(e,t){var n=vC(e+``);if(arguments.length<2){for(var r=yC(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?TC:t?CC:wC)(n,t))}function DC(){this.textContent=``}function OC(e){return function(){this.textContent=e}}function kC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function AC(e){return arguments.length?this.each(e==null?DC:(typeof e==`function`?kC:OC)(e)):this.node().textContent}function jC(){this.innerHTML=``}function MC(e){return function(){this.innerHTML=e}}function NC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function PC(e){return arguments.length?this.each(e==null?jC:(typeof e==`function`?NC:MC)(e)):this.node().innerHTML}function FC(){this.nextSibling&&this.parentNode.appendChild(this)}function IC(){return this.each(FC)}function LC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function RC(){return this.each(LC)}function zC(e){var t=typeof e==`function`?e:mS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function BC(){return null}function VC(e,t){var n=typeof e==`function`?e:mS(e),r=t==null?BC:typeof t==`function`?t:gS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function HC(){var e=this.parentNode;e&&e.removeChild(this)}function UC(){return this.each(HC)}function WC(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GC(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KC(e){return this.select(e?GC:WC)}function qC(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function JC(e){return function(t){e.call(this,t,this.__data__)}}function YC(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 XC(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 ZC(e,t,n){return function(){var r=this.__on,i,a=JC(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 QC(e,t,n){var r=YC(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}}else{for(s=t?ZC:XC,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function $C(e,t,n){var r=cC(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 ew(e,t){return function(){return $C(this,e,t)}}function tw(e,t){return function(){return $C(this,e,t.apply(this,arguments))}}function nw(e,t){return this.each((typeof t==`function`?tw:ew)(e,t))}function*rw(){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 iw=[null];function aw(e,t){this._groups=e,this._parents=t}function ow(){return new aw([[document.documentElement]],iw)}function sw(){return this}aw.prototype=ow.prototype={constructor:aw,select:_S,selectAll:SS,selectChild:OS,selectChildren:MS,filter:NS,data:VS,enter:FS,exit:US,join:WS,merge:GS,selection:sw,order:KS,sort:qS,call:YS,nodes:XS,node:ZS,size:QS,empty:$S,each:eC,attr:sC,style:fC,property:_C,classed:EC,text:AC,html:PC,raise:IC,lower:RC,append:zC,insert:VC,remove:UC,clone:KC,datum:qC,on:QC,dispatch:nw,[Symbol.iterator]:rw};function cw(e){return typeof e==`string`?new aw([[document.querySelector(e)]],[document.documentElement]):new aw([[e]],iw)}function lw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function uw(e,t){if(e=lw(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 dw={passive:!1},fw={capture:!0,passive:!1};function pw(e){e.stopImmediatePropagation()}function mw(e){e.preventDefault(),e.stopImmediatePropagation()}function hw(e){var t=e.document.documentElement,n=cw(e).on(`dragstart.drag`,mw,fw);`onselectstart`in t?n.on(`selectstart.drag`,mw,fw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function gw(e,t){var n=e.document.documentElement,r=cw(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,mw,fw),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 _w=e=>()=>e;function vw(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}})}vw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yw(e){return!e.ctrlKey&&!e.button}function bw(){return this.parentNode}function xw(e,t){return t??{x:e.x,y:e.y}}function Sw(){return navigator.maxTouchPoints||`ontouchstart`in this}function Cw(){var e=yw,t=bw,n=xw,r=Sw,i={},a=aS(`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`,_,dw).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&&(cw(n.view).on(`mousemove.drag`,m,fw).on(`mouseup.drag`,h,fw),hw(n.view),pw(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(mw(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){cw(e.view).on(`mousemove.drag mouseup.drag`,null),gw(e.view,l),mw(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(pw(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(mw(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])&&(pw(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=uw(l||r,t),p,m,h;if((h=n.call(e,new vw(`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=uw(l||a,t),_=o}u.call(r,e,new vw(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:_w(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:_w(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:_w(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:_w(!!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 ww(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Tw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ew(){}var Dw=.7,Ow=1/Dw,kw=`\\s*([+-]?\\d+)\\s*`,Aw=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,jw=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Mw=/^#([0-9a-f]{3,8})$/,Nw=RegExp(`^rgb\\(${kw},${kw},${kw}\\)$`),Pw=RegExp(`^rgb\\(${jw},${jw},${jw}\\)$`),Fw=RegExp(`^rgba\\(${kw},${kw},${kw},${Aw}\\)$`),Iw=RegExp(`^rgba\\(${jw},${jw},${jw},${Aw}\\)$`),Lw=RegExp(`^hsl\\(${Aw},${jw},${jw}\\)$`),Rw=RegExp(`^hsla\\(${Aw},${jw},${jw},${Aw}\\)$`),zw={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};ww(Ew,Ww,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bw,formatHex:Bw,formatHex8:Vw,formatHsl:Hw,formatRgb:Uw,toString:Uw});function Bw(){return this.rgb().formatHex()}function Vw(){return this.rgb().formatHex8()}function Hw(){return rT(this).formatHsl()}function Uw(){return this.rgb().formatRgb()}function Ww(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Mw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Gw(t):n===3?new Yw(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kw(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kw(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=Nw.exec(e))?new Yw(t[1],t[2],t[3],1):(t=Pw.exec(e))?new Yw(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fw.exec(e))?Kw(t[1],t[2],t[3],t[4]):(t=Iw.exec(e))?Kw(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lw.exec(e))?nT(t[1],t[2]/100,t[3]/100,1):(t=Rw.exec(e))?nT(t[1],t[2]/100,t[3]/100,t[4]):zw.hasOwnProperty(e)?Gw(zw[e]):e===`transparent`?new Yw(NaN,NaN,NaN,0):null}function Gw(e){return new Yw(e>>16&255,e>>8&255,e&255,1)}function Kw(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yw(e,t,n,r)}function qw(e){return e instanceof Ew||(e=Ww(e)),e?(e=e.rgb(),new Yw(e.r,e.g,e.b,e.opacity)):new Yw}function Jw(e,t,n,r){return arguments.length===1?qw(e):new Yw(e,t,n,r??1)}function Yw(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ww(Yw,Jw,Tw(Ew,{brighter(e){return e=e==null?Ow:Ow**+e,new Yw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dw:Dw**+e,new Yw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yw(eT(this.r),eT(this.g),eT(this.b),$w(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:Xw,formatHex:Xw,formatHex8:Zw,formatRgb:Qw,toString:Qw}));function Xw(){return`#${tT(this.r)}${tT(this.g)}${tT(this.b)}`}function Zw(){return`#${tT(this.r)}${tT(this.g)}${tT(this.b)}${tT((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qw(){let e=$w(this.opacity);return`${e===1?`rgb(`:`rgba(`}${eT(this.r)}, ${eT(this.g)}, ${eT(this.b)}${e===1?`)`:`, ${e})`}`}function $w(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eT(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tT(e){return e=eT(e),(e<16?`0`:``)+e.toString(16)}function nT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new aT(e,t,n,r)}function rT(e){if(e instanceof aT)return new aT(e.h,e.s,e.l,e.opacity);if(e instanceof Ew||(e=Ww(e)),!e)return new aT;if(e instanceof aT)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 aT(o,s,c,e.opacity)}function iT(e,t,n,r){return arguments.length===1?rT(e):new aT(e,t,n,r??1)}function aT(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ww(aT,iT,Tw(Ew,{brighter(e){return e=e==null?Ow:Ow**+e,new aT(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dw:Dw**+e,new aT(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 Yw(cT(e>=240?e-240:e+120,i,r),cT(e,i,r),cT(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new aT(oT(this.h),sT(this.s),sT(this.l),$w(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=$w(this.opacity);return`${e===1?`hsl(`:`hsla(`}${oT(this.h)}, ${sT(this.s)*100}%, ${sT(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function oT(e){return e=(e||0)%360,e<0?e+360:e}function sT(e){return Math.max(0,Math.min(1,e||0))}function cT(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 lT=e=>()=>e;function uT(e,t){return function(n){return e+n*t}}function dT(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function fT(e){return(e=+e)==1?pT:function(t,n){return n-t?dT(t,n,e):lT(isNaN(t)?n:t)}}function pT(e,t){var n=t-e;return n?uT(e,n):lT(isNaN(e)?t:e)}var mT=(function e(t){var n=fT(t);function r(e,t){var r=n((e=Jw(e)).r,(t=Jw(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=pT(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 hT(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 gT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _T(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ET(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 vT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function yT(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bT(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]=ET(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var xT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ST=new RegExp(xT.source,`g`);function CT(e){return function(){return e}}function wT(e){return function(t){return e(t)+``}}function TT(e,t){var n=xT.lastIndex=ST.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=xT.exec(e))&&(i=ST.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:yT(r,i)})),n=ST.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?wT(c[0].x):CT(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 ET(e,t){var n=typeof t,r;return t==null||n===`boolean`?lT(t):(n===`number`?yT:n===`string`?(r=Ww(t))?(t=r,mT):TT:t instanceof Ww?mT:t instanceof Date?vT:gT(t)?hT:Array.isArray(t)?_T:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?bT:yT)(e,t)}var DT=180/Math.PI,OT={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kT(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)*DT,skewX:Math.atan(c)*DT,scaleX:o,scaleY:s}}var AT;function jT(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?OT:kT(t.a,t.b,t.c,t.d,t.e,t.f)}function MT(e){return e==null||(AT||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),AT.setAttribute(`transform`,e),!(e=AT.transform.baseVal.consolidate()))?OT:(e=e.matrix,kT(e.a,e.b,e.c,e.d,e.e,e.f))}function NT(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:yT(e,i)},{i:c-2,x:yT(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:yT(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:yT(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:yT(e,n)},{i:s-2,x:yT(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 PT=NT(jT,`px, `,`px)`,`deg)`),FT=NT(MT,`, `,`)`,`)`),IT=1e-12;function LT(e){return((e=Math.exp(e))+1/e)/2}function RT(e){return((e=Math.exp(e))-1/e)/2}function zT(e){return((e=Math.exp(2*e))-1)/(e+1)}var BT=(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<IT)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=LT(y),c=s/(n*g)*(i*zT(t*r+y)-RT(y));return[a+c*d,o+c*f,s*i/LT(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),VT=0,HT=0,UT=0,WT=1e3,GT,KT,qT=0,JT=0,YT=0,XT=typeof performance==`object`&&performance.now?performance:Date,ZT=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function QT(){return JT||=(ZT($T),XT.now()+YT)}function $T(){JT=0}function eE(){this._call=this._time=this._next=null}eE.prototype=tE.prototype={constructor:eE,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?QT():+n)+(t==null?0:+t),!this._next&&KT!==this&&(KT?KT._next=this:GT=this,KT=this),this._call=e,this._time=n,oE()},stop:function(){this._call&&(this._call=null,this._time=1/0,oE())}};function tE(e,t,n){var r=new eE;return r.restart(e,t,n),r}function nE(){QT(),++VT;for(var e=GT,t;e;)(t=JT-e._time)>=0&&e._call.call(void 0,t),e=e._next;--VT}function rE(){JT=(qT=XT.now())+YT,VT=HT=0;try{nE()}finally{VT=0,aE(),JT=0}}function iE(){var e=XT.now(),t=e-qT;t>WT&&(YT-=t,qT=e)}function aE(){for(var e,t=GT,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:GT=n);KT=e,oE(r)}function oE(e){VT||(HT&&=clearTimeout(HT),e-JT>24?(e<1/0&&(HT=setTimeout(rE,e-XT.now()-YT)),UT&&=clearInterval(UT)):(UT||=(qT=XT.now(),setInterval(iE,WT)),VT=1,ZT(rE)))}function sE(e,t,n){var r=new eE;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var cE=aS(`start`,`end`,`cancel`,`interrupt`),lE=[];function uE(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;mE(e,n,{name:t,index:r,group:i,on:cE,tween:lE,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function dE(e,t){var n=pE(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function fE(e,t){var n=pE(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function pE(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function mE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=tE(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 sE(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(sE(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 hE(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(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=!1;a&&delete e.__transition}}function gE(e){return this.each(function(){hE(this,e)})}function _E(e,t){var n,r;return function(){var i=fE(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 vE(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=fE(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 yE(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=pE(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?_E:vE)(n,e,t))}function bE(e,t,n){var r=e._id;return e.each(function(){var e=fE(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return pE(e,r).value[t]}}function xE(e,t){var n;return(typeof t==`number`?yT:t instanceof Ww?mT:(n=Ww(t))?(t=n,mT):TT)(e,t)}function SE(e){return function(){this.removeAttribute(e)}}function CE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wE(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 TE(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 EE(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 DE(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 OE(e,t){var n=dS(e),r=n===`transform`?FT:xE;return this.attrTween(e,typeof t==`function`?(n.local?DE:EE)(n,r,bE(this,`attr.`+e,t)):t==null?(n.local?CE:SE)(n):(n.local?TE:wE)(n,r,t))}function kE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function AE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function jE(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&AE(e,i)),n}return i._value=t,i}function ME(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kE(e,i)),n}return i._value=t,i}function NE(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=dS(e);return this.tween(n,(r.local?jE:ME)(r,t))}function PE(e,t){return function(){dE(this,e).delay=+t.apply(this,arguments)}}function FE(e,t){return t=+t,function(){dE(this,e).delay=t}}function IE(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?PE:FE)(t,e)):pE(this.node(),t).delay}function LE(e,t){return function(){fE(this,e).duration=+t.apply(this,arguments)}}function RE(e,t){return t=+t,function(){fE(this,e).duration=t}}function zE(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?LE:RE)(t,e)):pE(this.node(),t).duration}function BE(e,t){if(typeof t!=`function`)throw Error();return function(){fE(this,e).ease=t}}function VE(e){var t=this._id;return arguments.length?this.each(BE(t,e)):pE(this.node(),t).ease}function HE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();fE(this,e).ease=n}}function UE(e){if(typeof e!=`function`)throw Error();return this.each(HE(this._id,e))}function WE(e){typeof e!=`function`&&(e=CS(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 yD(r,this._parents,this._name,this._id)}function GE(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 yD(o,this._parents,this._name,this._id)}function KE(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 qE(e,t,n){var r,i,a=KE(t)?dE:fE;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function JE(e,t){var n=this._id;return arguments.length<2?pE(this.node(),n).on.on(e):this.each(qE(n,e,t))}function YE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function XE(){return this.on(`end.remove`,YE(this._id))}function ZE(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=gS(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,uE(l[f],t,n,f,l,pE(u,n)));return new yD(a,this._parents,t,n)}function QE(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=bS(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=pE(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&uE(p,t,n,h,f,m);a.push(f),o.push(u)}return new yD(a,o,t,n)}var $E=ow.prototype.constructor;function eD(){return new $E(this._groups,this._parents)}function tD(e,t){var n,r,i;return function(){var a=pC(this,e),o=(this.style.removeProperty(e),pC(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function nD(e){return function(){this.style.removeProperty(e)}}function rD(e,t,n){var r,i=n+``,a;return function(){var o=pC(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function iD(e,t,n){var r,i,a;return function(){var o=pC(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),pC(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function aD(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=fE(this,e),l=c.on,u=c.value[a]==null?s||=nD(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function oD(e,t,n){var r=(e+=``)==`transform`?PT:xE;return t==null?this.styleTween(e,tD(e,r)).on(`end.style.`+e,nD(e)):typeof t==`function`?this.styleTween(e,iD(e,r,bE(this,`style.`+e,t))).each(aD(this._id,e)):this.styleTween(e,rD(e,r,t),n).on(`end.style.`+e,null)}function sD(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function cD(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&sD(e,a,n)),r}return a._value=t,a}function lD(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,cD(e,t,n??``))}function uD(e){return function(){this.textContent=e}}function dD(e){return function(){var t=e(this);this.textContent=t??``}}function fD(e){return this.tween(`text`,typeof e==`function`?dD(bE(this,`text`,e)):uD(e==null?``:e+``))}function pD(e){return function(t){this.textContent=e.call(this,t)}}function mD(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&pD(r)),t}return r._value=e,r}function hD(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,mD(e))}function gD(){for(var e=this._name,t=this._id,n=bD(),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=pE(c,t);uE(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yD(r,this._parents,e,n)}function _D(){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=fE(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 vD=0;function yD(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function bD(){return++vD}var xD=ow.prototype;yD.prototype={constructor:yD,select:ZE,selectAll:QE,selectChild:xD.selectChild,selectChildren:xD.selectChildren,filter:WE,merge:GE,selection:eD,transition:gD,call:xD.call,nodes:xD.nodes,node:xD.node,size:xD.size,empty:xD.empty,each:xD.each,on:JE,attr:OE,attrTween:NE,style:oD,styleTween:lD,text:fD,textTween:hD,remove:XE,tween:yE,delay:IE,duration:zE,ease:VE,easeVarying:UE,end:_D,[Symbol.iterator]:xD[Symbol.iterator]};function SD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CD={time:null,delay:0,duration:250,ease:SD};function wD(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function TD(e){var t,n;e instanceof yD?(t=e._id,e=e._name):(t=bD(),(n=CD).time=QT(),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])&&uE(c,e,t,l,o,n||wD(c,t));return new yD(r,this._parents,e,t)}ow.prototype.interrupt=gE,ow.prototype.transition=TD;var ED=e=>()=>e;function DD(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 OD(e,t,n){this.k=e,this.x=t,this.y=n}OD.prototype={constructor:OD,scale:function(e){return e===1?this:new OD(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new OD(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 kD=new OD(1,0,0);AD.prototype=OD.prototype;function AD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kD;return e.__zoom}function jD(e){e.stopImmediatePropagation()}function MD(e){e.preventDefault(),e.stopImmediatePropagation()}function ND(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function PD(){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 FD(){return this.__zoom||kD}function ID(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function LD(){return navigator.maxTouchPoints||`ontouchstart`in this}function RD(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 zD(){var e=ND,t=PD,n=RD,r=ID,i=LD,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=BT,l=aS(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,FD).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`,FD),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(kD.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 OD(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 OD(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 OD(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=cw(this.that).datum();l.call(e,this.that,new DD(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=uw(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)],hE(this),s.start();MD(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=cw(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=uw(t,i),l=t.clientX,u=t.clientY;hw(t.view),jD(t),a.mouse=[c,this.__zoom.invert(c)],hE(this),a.start();function d(e){if(MD(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]=uw(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),gw(e.view,a.moved),MD(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=uw(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);MD(r),s>0?cw(this).transition().duration(s).call(x,d,c,r):cw(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(jD(t),s=0;s<i;++s)c=r[s],l=uw(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)),hE(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(MD(e),s=0;s<a;++s)c=i[s],l=uw(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(jD(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=uw(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=cw(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ED(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ED(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ED(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ED([[+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 BD={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.`},VD=[[-1/0,-1/0],[1/0,1/0]],HD=[`Enter`,` `,`Escape`],UD={"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`},WD;(function(e){e.Strict=`strict`,e.Loose=`loose`})(WD||={});var GD;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(GD||={});var KD;(function(e){e.Partial=`partial`,e.Full=`full`})(KD||={});var qD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},JD;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(JD||={});var YD;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(YD||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var XD={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},ZD=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,QD=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),$D=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),eO=(e,t=[0,0])=>{let{width:n,height:r}=PO(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},tO=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):$D(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,mO(e,vO(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?gO(r):{x:0,y:0,width:0,height:0}},nO=(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=mO(n,vO(e)),r=!0)}),r?gO(n):{x:0,y:0,width:0,height:0}},rO=(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=bO(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},iO=(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 aO(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}=PO(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 oO({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=jO(nO(aO(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 sO({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`,BD.error005());else{let{width:e,height:t}=PO(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&NO(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=NO(d)?uO(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,BD.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 cO({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=iO(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 lO=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),uO=(e={x:0,y:0},t,n)=>({x:lO(e.x,t[0][0],t[1][0]-(n?.width??0)),y:lO(e.y,t[0][1],t[1][1]-(n?.height??0))});function dO(e,t,n){let{width:r,height:i}=PO(n),{x:a,y:o}=n.internals.positionAbsolute;return uO(e,[[a,o],[a+r,o+i]],t)}var fO=(e,t,n)=>e<t?lO(Math.abs(e-t),1,t)/t:e>n?-lO(Math.abs(e-n),1,t)/t:0,pO=(e,t,n=15,r=40)=>[fO(e.x,r,t.width-r)*n,fO(e.y,r,t.height-r)*n],mO=(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)}),hO=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),gO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),_O=(e,t=[0,0])=>{let{x:n,y:r}=$D(e)?e.internals.positionAbsolute:eO(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}},vO=(e,t=[0,0])=>{let{x:n,y:r}=$D(e)?e.internals.positionAbsolute:eO(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)}},yO=(e,t)=>gO(mO(hO(e),hO(t))),bO=(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)},xO=(e,t)=>bO(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),SO=e=>CO(e.width)&&CO(e.height)&&CO(e.x)&&CO(e.y),CO=e=>!isNaN(e)&&isFinite(e),wO=(e,t)=>(e,t)=>{},TO=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),EO=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?TO(s,o):s},DO=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function OO(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 kO(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=OO(e,n),i=OO(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=OO(e.top??e.y??0,n),i=OO(e.bottom??e.y??0,n),a=OO(e.left??e.x??0,t),o=OO(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 AO(e,t,n,r,i,a){let{x:o,y:s}=DO(e,[t,n,r]),{x:c,y:l}=DO({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 jO=(e,t,n,r,i,a)=>{let o=kO(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=lO(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=AO(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}},MO=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function NO(e){return e!=null&&e!==`parent`}function PO(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function FO(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function IO(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 LO(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function RO(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function zO(e){return{...UD,...e||{}}}function BO(e){return e===null?null:e?`valid`:`invalid`}function VO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=qO(e),s=EO({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?TO(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var HO=e=>({width:e.offsetWidth,height:e.offsetHeight}),UO=e=>e?.getRootNode?.()||window?.document,WO=[`INPUT`,`SELECT`,`TEXTAREA`];function GO(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?WO.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var KO=e=>`clientX`in e,qO=(e,t)=>{let n=KO(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)}},JO=(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,...HO(t)}})};function YO({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 XO(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ZO({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-XO(t-r,a),n];case $.Right:return[t+XO(r-t,a),n];case $.Top:return[t,n-XO(n-i,a)];case $.Bottom:return[t,n+XO(i-n,a)]}}function QO({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=ZO({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=ZO({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=YO({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 $O({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 ek({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 tk({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=mO(vO(e),vO(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),xO({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},gO(a))>0}var nk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,rk=(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)),ik=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,BD.error006()),t;let r=n.getEdgeId||nk,i;return i=ZD(e)?{...e}:{...e,id:r(e)},rk(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ak({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=$O({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var ok={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},sk=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.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},ck=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function lk({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=ok[t],c=ok[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=sk({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]=$O({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 uk(e,t,n,r){let i=Math.min(ck(e,t)/2,ck(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 dk({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=lk({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+=uk(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 fk(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function pk(e){let{sourceNode:t,targetNode:n}=e;if(!fk(t)||!fk(n))return null;let r=t.internals.handleBounds||mk(t.handles),i=n.internals.handleBounds||mk(n.handles),a=gk(r?.source??[],e.sourceHandle),o=gk(e.connectionMode===WD.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,BD.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=hk(t,a,s),u=hk(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function mk(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 hk(e,t,n=$.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??PO(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function gk(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function _k(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function vk(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=_k(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 yk=1e3,bk=10,xk={nodeOrigin:[0,0],nodeExtent:VD,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Sk={...xk,checkEquality:!0};function Ck(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function wk(e,t,n){let r=Ck(xk,n);for(let n of e.values())if(n.parentId)kk(n,e,t,r);else{let e=uO(eO(n,r.nodeOrigin),NO(n.extent)?n.extent:r.nodeExtent,PO(n));n.internals.positionAbsolute=e}}function Tk(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 Ek(e){return e===`manual`}function Dk(e,t,n,r={}){let i=Ck(Sk,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Ek(i.zIndexMode)?yk: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=uO(eO(u,i.nodeOrigin),NO(u.extent)?u.extent:i.nodeExtent,PO(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Tk(u,e),z:Ak(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&&kk(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Ok(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 kk(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Ck(xk,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}Ok(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*bk),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=jk(e,u,o,s,a&&!Ek(c)?yk: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 Ak(e,t,n){let r=CO(e.zIndex)?e.zIndex:0;return Ek(n)?r:r+(e.selected?t:0)}function jk(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=PO(e),l=eO(e,n),u=NO(e.extent)?uO(l,e.extent,c):l,d=uO({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=dO(d,c,t));let f=Ak(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Mk(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=yO(a.get(n.parentId)?.expandedRect??_O(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=PO(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 Nk(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=HO(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=NO(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=dO(h,s,n))}else m&&(h=uO(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:JO(`source`,r.nodeElement,p,d,e.id),target:JO(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&kk(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:_O(g,i)}))}}if(f.length>0){let e=Mk(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Pk({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 Fk(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 Ik(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}`;Fk(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Fk(`target`,s,c,e,i,o),t.set(r.id,r)}}function Lk(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Lk(n,t):!1}function Rk(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 zk(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Lk(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 Bk({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 Vk({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=TO(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Hk({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=cw(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?hO(nO(s)):null,x=v&&l?Vk({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)}:TO(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}=sO({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]=Bk({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]=pO(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=VO(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=zk(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Bk({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Cw().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=VO(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=qO(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=VO(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=qO(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=qO(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else 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]=Bk({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||!Rk(t,`.${g}`,v))&&(!_||Rk(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Uk(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())xO(i,_O(e))>0&&r.push(e);return r}var Wk=250;function Gk(e,t,n,r){let i=[],a=1/0,o=Uk(e,n,t+Wk);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}=hk(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 Kk(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,...hk(o,c,c.position,!0)}:c}function qk(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Jk(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Yk=()=>!0;function Xk(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:_=Yk,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=UO(e.target),E=0,D,{x:O,y:k}=qO(e),A=qk(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=Kk(i,A,r,c,t);if(!N)return;let ee=qO(e,j),te=!1,P=null,ne=!1,F=null;function I(){if(!u||!j)return;let[e,t]=pO(ee,j,S);f({x:e,y:t}),E=requestAnimationFrame(I)}let L={...N,nodeId:i,type:A,position:N.position},re=c.get(i),ie={inProgress:!0,isValid:null,from:hk(re,L,$.Left,!0),fromHandle:L,fromPosition:L.position,fromNode:re,to:ee,toHandle:null,toPosition:XD[L.position],toNode:null,pointer:ee};function ae(){M=!0,y(ie),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ae();function oe(e){if(!M){let{x:t,y:n}=qO(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ae()}if(!x()||!L){se(e);return}let a=b();ee=qO(e,j),D=Gk(EO(ee,a,!1,[1,1]),n,c,L),te||=(I(),!0);let s=Zk(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});F=s.handleDomNode,P=s.connection,ne=Jk(!!D,s.isValid);let u=c.get(i),f=u?hk(u,L,$.Left,!0):ie.from,p={...ie,from:f,isValid:ne,to:s.toHandle&&ne?DO({x:s.toHandle.x,y:s.toHandle.y},a):ee,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:XD[L.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ee};y(p),ie=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||F)&&P&&ne&&h?.(P);let{inProgress:t,...n}=ie,r={...n,toPosition:ie.toHandle?ie.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,ne=!1,P=null,F=null,T.removeEventListener(`mousemove`,oe),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,oe),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,oe),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,oe),T.addEventListener(`touchend`,se)}function Zk(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Yk,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}=qO(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=qk(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===WD.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Kk(t,e,a,u,n,!0)}return _}var Qk={onPointerDown:Xk,isValid:Zk};function $k({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=cw(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&&MO()?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=zD().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:uw}}var eA=e=>({x:e.x,y:e.y,zoom:e.k}),tA=({x:e,y:t,zoom:n})=>kD.translate(e,t).scale(n),nA=(e,t)=>e.target.closest(`.${t}`),rA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),iA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,aA=(e,t=0,n=iA,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},oA=e=>{let t=e.ctrlKey&&MO()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function sA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(nA(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=uw(u),t=d*2**oA(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===GD.Vertical?0:u.deltaX*f,m=i===GD.Horizontal?0:u.deltaY*f;!MO()&&u.shiftKey&&i!==GD.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=eA(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 cA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=nA(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function lA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=eA(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 uA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&rA(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,eA(a.transform))}}function dA({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&rA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=eA(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function fA({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(nA(f,`${u}-flow__node`)||nA(f,`${u}-flow__edge`)||nA(f,`${u}-flow__selection`)||nA(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||nA(f,c)&&h||nA(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function pA({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=zD().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=cw(e).call(f);y({x:i.x,y:i.y,zoom:lO(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(oA);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ET:BT).transform(aA(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,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!CO(D)||D<0?0:D);let A=k?sA({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):cA({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=lA({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=uA({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=dA({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let ee=fA({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(ee),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=tA(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=tA(e);return await g(n,t),n}function x(e){if(p){let t=tA(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?AD(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`?ET:BT).scaleTo(aA(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ET:BT).scaleBy(aA(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=!CO(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 mA;(function(e){e.Line=`line`,e.Handle=`handle`})(mA||={});function hA({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 gA(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 _A(e,t){return Math.max(0,t-e)}function vA(e,t){return Math.max(0,e-t)}function yA(e,t,n){return Math.max(0,t-e,e-n)}function bA(e,t){return e?!t:t}function xA(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=yA(E,h,g),j=yA(D,_,v);if(o){let e=0,t=0;c&&w<0?e=_A(y+w+O,o[0][0]):!c&&w>0&&(e=vA(y+E+O,o[1][0])),l&&T<0?t=_A(b+T+k,o[0][1]):!l&&T>0&&(t=vA(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=vA(y+w,s[0][0]):!c&&w<0&&(e=_A(y+E,s[1][0])),l&&T>0?t=vA(b+T,s[0][1]):!l&&T<0&&(t=_A(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=yA(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?vA(b+k+E/C,o[1][1])*C:_A(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?_A(b+E/C,s[1][1])*C:vA(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=yA(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?vA(y+D*C+O,o[1][0])/C:_A(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?_A(y+D*C,s[1][0])/C:vA(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=(bA(c,l)?-w:w)/C:w=(bA(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 SA={width:0,height:0,x:0,y:0},CA={...SA,pointerX:0,pointerY:0,aspectRatio:1};function wA(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 TA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=cw(e),o={controlDirection:gA(`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={...SA},h={...CA};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:gA(e)};let g,_=null,v=[],y,b,x,S=!1,C=Cw().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}=VO(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=NO(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=wA(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=VO(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}=xA(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,ee=A!==f&&M;if(!N&&!ee&&!j&&!M)return;if((N||ee||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=ee?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 te=hA({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),P={...m,direction:te};p?.(e,P)!==!1&&(S=!0,d?.(e,P),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 EA=t((t=>{var n=(pe(),e(fe)),r=$l();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),DA=n(t(((e,t)=>{t.exports=EA()}))(),1),OA=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},kA=e=>e?OA(e):OA;pe();var{useDebugValue:AA}=ue,{useSyncExternalStoreWithSelector:jA}=DA.default,MA=e=>e;function NA(e,t=MA,n){let r=jA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return AA(r),r}var PA=(e,t)=>{let n=kA(e),r=(e,r=t)=>NA(n,e,r);return Object.assign(r,n),r},FA=(e,t)=>e?PA(e,t):PA;function IA(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}je(),pe();var LA=xe(null),RA=LA.Provider,zA=BD.error001(`react`);function BA(e,t){let n=ge(LA);if(n===null)throw Error(zA);return NA(n,e,t)}function VA(){let e=ge(LA);if(e===null)throw Error(zA);return V(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var HA={display:`none`},UA={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},WA=`react-flow__node-desc`,GA=`react-flow__edge-desc`,KA=`react-flow__aria-live`,qA=e=>e.ariaLiveMessage,JA=e=>e.ariaLabelConfig;function YA({rfId:e}){let t=BA(qA);return A(`div`,{id:`${KA}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:UA,children:t})}function XA({rfId:e,disableKeyboardA11y:t}){let n=BA(JA);return A(Te,{children:[A(`div`,{id:`${WA}-${e}`,style:HA,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),A(`div`,{id:`${GA}-${e}`,style:HA,children:n[`edge.a11yDescription.default`]}),!t&&A(YA,{rfId:e})]})}var ZA=Fe(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return A(`div`,{className:rS([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});ZA.displayName=`Panel`;var QA=`https://reactflow.dev?utm_source=attribution`;function $A({proOptions:e,position:t=`bottom-right`}){return B(()=>{},[]),e?.hideAttribution?null:A(ZA,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${QA}`,children:A(`a`,{href:QA,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ej=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}},tj=e=>e.id;function nj(e,t){return IA(e.selectedNodes.map(tj),t.selectedNodes.map(tj))&&IA(e.selectedEdges.map(tj),t.selectedEdges.map(tj))}function rj({onSelectionChange:e}){let t=VA(),{selectedNodes:n,selectedEdges:r}=BA(ej,nj);return B(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var ij=e=>!!e.onSelectionChangeHandlers;function aj({onSelectionChange:e}){let t=BA(ij);return e||t?A(rj,{onSelectionChange:e}):null}var oj=[0,0],sj={x:0,y:0,zoom:1},cj=[...`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`],lj=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}),uj={translateExtent:VD,nodeOrigin:oj,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function dj(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=BA(lj,IA),l=VA();B(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=uj,s()}),[]);let u=K(uj);return B(()=>{for(let s of cj){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:zO(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},cj.map(t=>e[t])),null}function fj(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function pj(e){let[t,n]=U(e===`system`?null:e);return B(()=>{if(e!==`system`){n(e);return}let t=fj(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?fj()?.matches?`dark`:`light`:t}var mj=typeof document<`u`?document:null;function hj(e=null,t={target:mj,actInsideInputWithModifier:!0}){let[n,r]=U(!1),i=K(!1),a=K(new Set([])),[o,s]=V(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
2451
|
+
`,nS=({seasons:e,currentUris:t,href:n})=>!e||e.length<2?null:e.some(e=>t.includes(e.uri))?W(`section`,{className:`seasons`,css:tS,"data-seasons":!0,children:[H(`h2`,{children:`Seasons`}),H(`nav`,{children:e.map(e=>W(Bu,{href:n(d(e.uri)),"aria-current":t.includes(e.uri)?`page`:void 0,children:[`Season `,e.number]},e.uri))})]}):H(Uu,{to:n(d(e[0].uri)),replace:!0});function rS(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=rS(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var iS={value:()=>{}};function aS(){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 oS(n)}function oS(e){this._=e}function sS(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}})}oS.prototype=aS.prototype={constructor:oS,on:function(e,t){var n=this._,r=sS(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=cS(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=lS(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lS(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 oS(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 cS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lS(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=iS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uS={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 dS(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),uS.hasOwnProperty(t)?{space:uS[t],local:e}:e}function fS(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 pS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mS(e){var t=dS(e);return(t.local?pS:fS)(t)}function hS(){}function gS(e){return e==null?hS:function(){return this.querySelector(e)}}function _S(e){typeof e!=`function`&&(e=gS(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 aw(r,this._parents)}function vS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yS(){return[]}function bS(e){return e==null?yS:function(){return this.querySelectorAll(e)}}function xS(e){return function(){return vS(e.apply(this,arguments))}}function SS(e){e=typeof e==`function`?xS(e):bS(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 aw(r,i)}function CS(e){return function(){return this.matches(e)}}function wS(e){return function(t){return t.matches(e)}}var TS=Array.prototype.find;function ES(e){return function(){return TS.call(this.children,e)}}function DS(){return this.firstElementChild}function OS(e){return this.select(e==null?DS:ES(typeof e==`function`?e:wS(e)))}var kS=Array.prototype.filter;function AS(){return Array.from(this.children)}function jS(e){return function(){return kS.call(this.children,e)}}function MS(e){return this.selectAll(e==null?AS:jS(typeof e==`function`?e:wS(e)))}function NS(e){typeof e!=`function`&&(e=CS(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 aw(r,this._parents)}function PS(e){return Array(e.length)}function FS(){return new aw(this._enter||this._groups.map(PS),this._parents)}function IS(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}IS.prototype={constructor:IS,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 LS(e){return function(){return e}}function RS(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 IS(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function zS(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 IS(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function BS(e){return e.__data__}function VS(e,t){if(!arguments.length)return Array.from(this,BS);var n=t?zS:RS,r=this._parents,i=this._groups;typeof e!=`function`&&(e=LS(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=HS(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 aw(o,r),o._enter=s,o._exit=c,o}function HS(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function US(){return new aw(this._exit||this._groups.map(PS),this._parents)}function WS(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 GS(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 aw(s,this._parents)}function KS(){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 qS(e){e||=JS;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 aw(i,this._parents).order()}function JS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function YS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XS(){return Array.from(this)}function ZS(){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 QS(){let e=0;for(let t of this)++e;return e}function $S(){return!this.node()}function eC(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 tC(e){return function(){this.removeAttribute(e)}}function nC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rC(e,t){return function(){this.setAttribute(e,t)}}function iC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function aC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function oC(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 sC(e,t){var n=dS(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?nC:tC:typeof t==`function`?n.local?oC:aC:n.local?iC:rC)(n,t))}function cC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function lC(e){return function(){this.style.removeProperty(e)}}function uC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function fC(e,t,n){return arguments.length>1?this.each((t==null?lC:typeof t==`function`?dC:uC)(e,t,n??``)):pC(this.node(),e)}function pC(e,t){return e.style.getPropertyValue(t)||cC(e).getComputedStyle(e,null).getPropertyValue(t)}function mC(e){return function(){delete this[e]}}function hC(e,t){return function(){this[e]=t}}function gC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _C(e,t){return arguments.length>1?this.each((t==null?mC:typeof t==`function`?gC:hC)(e,t)):this.node()[e]}function vC(e){return e.trim().split(/^|\s+/)}function yC(e){return e.classList||new bC(e)}function bC(e){this._node=e,this._names=vC(e.getAttribute(`class`)||``)}bC.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 xC(e,t){for(var n=yC(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function SC(e,t){for(var n=yC(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function CC(e){return function(){xC(this,e)}}function wC(e){return function(){SC(this,e)}}function TC(e,t){return function(){(t.apply(this,arguments)?xC:SC)(this,e)}}function EC(e,t){var n=vC(e+``);if(arguments.length<2){for(var r=yC(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?TC:t?CC:wC)(n,t))}function DC(){this.textContent=``}function OC(e){return function(){this.textContent=e}}function kC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function AC(e){return arguments.length?this.each(e==null?DC:(typeof e==`function`?kC:OC)(e)):this.node().textContent}function jC(){this.innerHTML=``}function MC(e){return function(){this.innerHTML=e}}function NC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function PC(e){return arguments.length?this.each(e==null?jC:(typeof e==`function`?NC:MC)(e)):this.node().innerHTML}function FC(){this.nextSibling&&this.parentNode.appendChild(this)}function IC(){return this.each(FC)}function LC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function RC(){return this.each(LC)}function zC(e){var t=typeof e==`function`?e:mS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function BC(){return null}function VC(e,t){var n=typeof e==`function`?e:mS(e),r=t==null?BC:typeof t==`function`?t:gS(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function HC(){var e=this.parentNode;e&&e.removeChild(this)}function UC(){return this.each(HC)}function WC(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GC(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KC(e){return this.select(e?GC:WC)}function qC(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function JC(e){return function(t){e.call(this,t,this.__data__)}}function YC(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 XC(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 ZC(e,t,n){return function(){var r=this.__on,i,a=JC(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 QC(e,t,n){var r=YC(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}}else{for(s=t?ZC:XC,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function $C(e,t,n){var r=cC(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 ew(e,t){return function(){return $C(this,e,t)}}function tw(e,t){return function(){return $C(this,e,t.apply(this,arguments))}}function nw(e,t){return this.each((typeof t==`function`?tw:ew)(e,t))}function*rw(){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 iw=[null];function aw(e,t){this._groups=e,this._parents=t}function ow(){return new aw([[document.documentElement]],iw)}function sw(){return this}aw.prototype=ow.prototype={constructor:aw,select:_S,selectAll:SS,selectChild:OS,selectChildren:MS,filter:NS,data:VS,enter:FS,exit:US,join:WS,merge:GS,selection:sw,order:KS,sort:qS,call:YS,nodes:XS,node:ZS,size:QS,empty:$S,each:eC,attr:sC,style:fC,property:_C,classed:EC,text:AC,html:PC,raise:IC,lower:RC,append:zC,insert:VC,remove:UC,clone:KC,datum:qC,on:QC,dispatch:nw,[Symbol.iterator]:rw};function cw(e){return typeof e==`string`?new aw([[document.querySelector(e)]],[document.documentElement]):new aw([[e]],iw)}function lw(e){let t;for(;t=e.sourceEvent;)e=t;return e}function uw(e,t){if(e=lw(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 dw={passive:!1},fw={capture:!0,passive:!1};function pw(e){e.stopImmediatePropagation()}function mw(e){e.preventDefault(),e.stopImmediatePropagation()}function hw(e){var t=e.document.documentElement,n=cw(e).on(`dragstart.drag`,mw,fw);`onselectstart`in t?n.on(`selectstart.drag`,mw,fw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function gw(e,t){var n=e.document.documentElement,r=cw(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,mw,fw),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 _w=e=>()=>e;function vw(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}})}vw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yw(e){return!e.ctrlKey&&!e.button}function bw(){return this.parentNode}function xw(e,t){return t??{x:e.x,y:e.y}}function Sw(){return navigator.maxTouchPoints||`ontouchstart`in this}function Cw(){var e=yw,t=bw,n=xw,r=Sw,i={},a=aS(`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`,_,dw).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&&(cw(n.view).on(`mousemove.drag`,m,fw).on(`mouseup.drag`,h,fw),hw(n.view),pw(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(mw(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){cw(e.view).on(`mousemove.drag mouseup.drag`,null),gw(e.view,l),mw(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(pw(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(mw(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])&&(pw(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=uw(l||r,t),p,m,h;if((h=n.call(e,new vw(`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=uw(l||a,t),_=o}u.call(r,e,new vw(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:_w(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:_w(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:_w(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:_w(!!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 ww(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Tw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ew(){}var Dw=.7,Ow=1/Dw,kw=`\\s*([+-]?\\d+)\\s*`,Aw=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,jw=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Mw=/^#([0-9a-f]{3,8})$/,Nw=RegExp(`^rgb\\(${kw},${kw},${kw}\\)$`),Pw=RegExp(`^rgb\\(${jw},${jw},${jw}\\)$`),Fw=RegExp(`^rgba\\(${kw},${kw},${kw},${Aw}\\)$`),Iw=RegExp(`^rgba\\(${jw},${jw},${jw},${Aw}\\)$`),Lw=RegExp(`^hsl\\(${Aw},${jw},${jw}\\)$`),Rw=RegExp(`^hsla\\(${Aw},${jw},${jw},${Aw}\\)$`),zw={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};ww(Ew,Ww,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bw,formatHex:Bw,formatHex8:Vw,formatHsl:Hw,formatRgb:Uw,toString:Uw});function Bw(){return this.rgb().formatHex()}function Vw(){return this.rgb().formatHex8()}function Hw(){return rT(this).formatHsl()}function Uw(){return this.rgb().formatRgb()}function Ww(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Mw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Gw(t):n===3?new Yw(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kw(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kw(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=Nw.exec(e))?new Yw(t[1],t[2],t[3],1):(t=Pw.exec(e))?new Yw(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fw.exec(e))?Kw(t[1],t[2],t[3],t[4]):(t=Iw.exec(e))?Kw(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lw.exec(e))?nT(t[1],t[2]/100,t[3]/100,1):(t=Rw.exec(e))?nT(t[1],t[2]/100,t[3]/100,t[4]):zw.hasOwnProperty(e)?Gw(zw[e]):e===`transparent`?new Yw(NaN,NaN,NaN,0):null}function Gw(e){return new Yw(e>>16&255,e>>8&255,e&255,1)}function Kw(e,t,n,r){return r<=0&&(e=t=n=NaN),new Yw(e,t,n,r)}function qw(e){return e instanceof Ew||(e=Ww(e)),e?(e=e.rgb(),new Yw(e.r,e.g,e.b,e.opacity)):new Yw}function Jw(e,t,n,r){return arguments.length===1?qw(e):new Yw(e,t,n,r??1)}function Yw(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ww(Yw,Jw,Tw(Ew,{brighter(e){return e=e==null?Ow:Ow**+e,new Yw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dw:Dw**+e,new Yw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Yw(eT(this.r),eT(this.g),eT(this.b),$w(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:Xw,formatHex:Xw,formatHex8:Zw,formatRgb:Qw,toString:Qw}));function Xw(){return`#${tT(this.r)}${tT(this.g)}${tT(this.b)}`}function Zw(){return`#${tT(this.r)}${tT(this.g)}${tT(this.b)}${tT((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qw(){let e=$w(this.opacity);return`${e===1?`rgb(`:`rgba(`}${eT(this.r)}, ${eT(this.g)}, ${eT(this.b)}${e===1?`)`:`, ${e})`}`}function $w(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eT(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tT(e){return e=eT(e),(e<16?`0`:``)+e.toString(16)}function nT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new aT(e,t,n,r)}function rT(e){if(e instanceof aT)return new aT(e.h,e.s,e.l,e.opacity);if(e instanceof Ew||(e=Ww(e)),!e)return new aT;if(e instanceof aT)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 aT(o,s,c,e.opacity)}function iT(e,t,n,r){return arguments.length===1?rT(e):new aT(e,t,n,r??1)}function aT(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ww(aT,iT,Tw(Ew,{brighter(e){return e=e==null?Ow:Ow**+e,new aT(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dw:Dw**+e,new aT(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 Yw(cT(e>=240?e-240:e+120,i,r),cT(e,i,r),cT(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new aT(oT(this.h),sT(this.s),sT(this.l),$w(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=$w(this.opacity);return`${e===1?`hsl(`:`hsla(`}${oT(this.h)}, ${sT(this.s)*100}%, ${sT(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function oT(e){return e=(e||0)%360,e<0?e+360:e}function sT(e){return Math.max(0,Math.min(1,e||0))}function cT(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 lT=e=>()=>e;function uT(e,t){return function(n){return e+n*t}}function dT(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function fT(e){return(e=+e)==1?pT:function(t,n){return n-t?dT(t,n,e):lT(isNaN(t)?n:t)}}function pT(e,t){var n=t-e;return n?uT(e,n):lT(isNaN(e)?t:e)}var mT=(function e(t){var n=fT(t);function r(e,t){var r=n((e=Jw(e)).r,(t=Jw(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=pT(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 hT(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 gT(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _T(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ET(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 vT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function yT(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bT(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]=ET(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var xT=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ST=new RegExp(xT.source,`g`);function CT(e){return function(){return e}}function wT(e){return function(t){return e(t)+``}}function TT(e,t){var n=xT.lastIndex=ST.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=xT.exec(e))&&(i=ST.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:yT(r,i)})),n=ST.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?wT(c[0].x):CT(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 ET(e,t){var n=typeof t,r;return t==null||n===`boolean`?lT(t):(n===`number`?yT:n===`string`?(r=Ww(t))?(t=r,mT):TT:t instanceof Ww?mT:t instanceof Date?vT:gT(t)?hT:Array.isArray(t)?_T:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?bT:yT)(e,t)}var DT=180/Math.PI,OT={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kT(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)*DT,skewX:Math.atan(c)*DT,scaleX:o,scaleY:s}}var AT;function jT(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?OT:kT(t.a,t.b,t.c,t.d,t.e,t.f)}function MT(e){return e==null||(AT||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),AT.setAttribute(`transform`,e),!(e=AT.transform.baseVal.consolidate()))?OT:(e=e.matrix,kT(e.a,e.b,e.c,e.d,e.e,e.f))}function NT(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:yT(e,i)},{i:c-2,x:yT(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:yT(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:yT(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:yT(e,n)},{i:s-2,x:yT(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 PT=NT(jT,`px, `,`px)`,`deg)`),FT=NT(MT,`, `,`)`,`)`),IT=1e-12;function LT(e){return((e=Math.exp(e))+1/e)/2}function RT(e){return((e=Math.exp(e))-1/e)/2}function zT(e){return((e=Math.exp(2*e))-1)/(e+1)}var BT=(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<IT)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=LT(y),c=s/(n*g)*(i*zT(t*r+y)-RT(y));return[a+c*d,o+c*f,s*i/LT(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),VT=0,HT=0,UT=0,WT=1e3,GT,KT,qT=0,JT=0,YT=0,XT=typeof performance==`object`&&performance.now?performance:Date,ZT=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function QT(){return JT||=(ZT($T),XT.now()+YT)}function $T(){JT=0}function eE(){this._call=this._time=this._next=null}eE.prototype=tE.prototype={constructor:eE,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?QT():+n)+(t==null?0:+t),!this._next&&KT!==this&&(KT?KT._next=this:GT=this,KT=this),this._call=e,this._time=n,oE()},stop:function(){this._call&&(this._call=null,this._time=1/0,oE())}};function tE(e,t,n){var r=new eE;return r.restart(e,t,n),r}function nE(){QT(),++VT;for(var e=GT,t;e;)(t=JT-e._time)>=0&&e._call.call(void 0,t),e=e._next;--VT}function rE(){JT=(qT=XT.now())+YT,VT=HT=0;try{nE()}finally{VT=0,aE(),JT=0}}function iE(){var e=XT.now(),t=e-qT;t>WT&&(YT-=t,qT=e)}function aE(){for(var e,t=GT,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:GT=n);KT=e,oE(r)}function oE(e){VT||(HT&&=clearTimeout(HT),e-JT>24?(e<1/0&&(HT=setTimeout(rE,e-XT.now()-YT)),UT&&=clearInterval(UT)):(UT||=(qT=XT.now(),setInterval(iE,WT)),VT=1,ZT(rE)))}function sE(e,t,n){var r=new eE;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var cE=aS(`start`,`end`,`cancel`,`interrupt`),lE=[];function uE(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;mE(e,n,{name:t,index:r,group:i,on:cE,tween:lE,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function dE(e,t){var n=pE(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function fE(e,t){var n=pE(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function pE(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function mE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=tE(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 sE(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(sE(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 hE(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(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=!1;a&&delete e.__transition}}function gE(e){return this.each(function(){hE(this,e)})}function _E(e,t){var n,r;return function(){var i=fE(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 vE(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=fE(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 yE(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=pE(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?_E:vE)(n,e,t))}function bE(e,t,n){var r=e._id;return e.each(function(){var e=fE(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return pE(e,r).value[t]}}function xE(e,t){var n;return(typeof t==`number`?yT:t instanceof Ww?mT:(n=Ww(t))?(t=n,mT):TT)(e,t)}function SE(e){return function(){this.removeAttribute(e)}}function CE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wE(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 TE(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 EE(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 DE(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 OE(e,t){var n=dS(e),r=n===`transform`?FT:xE;return this.attrTween(e,typeof t==`function`?(n.local?DE:EE)(n,r,bE(this,`attr.`+e,t)):t==null?(n.local?CE:SE)(n):(n.local?TE:wE)(n,r,t))}function kE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function AE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function jE(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&AE(e,i)),n}return i._value=t,i}function ME(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&kE(e,i)),n}return i._value=t,i}function NE(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=dS(e);return this.tween(n,(r.local?jE:ME)(r,t))}function PE(e,t){return function(){dE(this,e).delay=+t.apply(this,arguments)}}function FE(e,t){return t=+t,function(){dE(this,e).delay=t}}function IE(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?PE:FE)(t,e)):pE(this.node(),t).delay}function LE(e,t){return function(){fE(this,e).duration=+t.apply(this,arguments)}}function RE(e,t){return t=+t,function(){fE(this,e).duration=t}}function zE(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?LE:RE)(t,e)):pE(this.node(),t).duration}function BE(e,t){if(typeof t!=`function`)throw Error();return function(){fE(this,e).ease=t}}function VE(e){var t=this._id;return arguments.length?this.each(BE(t,e)):pE(this.node(),t).ease}function HE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();fE(this,e).ease=n}}function UE(e){if(typeof e!=`function`)throw Error();return this.each(HE(this._id,e))}function WE(e){typeof e!=`function`&&(e=CS(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 yD(r,this._parents,this._name,this._id)}function GE(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 yD(o,this._parents,this._name,this._id)}function KE(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 qE(e,t,n){var r,i,a=KE(t)?dE:fE;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function JE(e,t){var n=this._id;return arguments.length<2?pE(this.node(),n).on.on(e):this.each(qE(n,e,t))}function YE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function XE(){return this.on(`end.remove`,YE(this._id))}function ZE(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=gS(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,uE(l[f],t,n,f,l,pE(u,n)));return new yD(a,this._parents,t,n)}function QE(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=bS(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=pE(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&uE(p,t,n,h,f,m);a.push(f),o.push(u)}return new yD(a,o,t,n)}var $E=ow.prototype.constructor;function eD(){return new $E(this._groups,this._parents)}function tD(e,t){var n,r,i;return function(){var a=pC(this,e),o=(this.style.removeProperty(e),pC(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function nD(e){return function(){this.style.removeProperty(e)}}function rD(e,t,n){var r,i=n+``,a;return function(){var o=pC(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function iD(e,t,n){var r,i,a;return function(){var o=pC(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),pC(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function aD(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=fE(this,e),l=c.on,u=c.value[a]==null?s||=nD(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function oD(e,t,n){var r=(e+=``)==`transform`?PT:xE;return t==null?this.styleTween(e,tD(e,r)).on(`end.style.`+e,nD(e)):typeof t==`function`?this.styleTween(e,iD(e,r,bE(this,`style.`+e,t))).each(aD(this._id,e)):this.styleTween(e,rD(e,r,t),n).on(`end.style.`+e,null)}function sD(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function cD(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&sD(e,a,n)),r}return a._value=t,a}function lD(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,cD(e,t,n??``))}function uD(e){return function(){this.textContent=e}}function dD(e){return function(){var t=e(this);this.textContent=t??``}}function fD(e){return this.tween(`text`,typeof e==`function`?dD(bE(this,`text`,e)):uD(e==null?``:e+``))}function pD(e){return function(t){this.textContent=e.call(this,t)}}function mD(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&pD(r)),t}return r._value=e,r}function hD(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,mD(e))}function gD(){for(var e=this._name,t=this._id,n=bD(),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=pE(c,t);uE(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new yD(r,this._parents,e,n)}function _D(){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=fE(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 vD=0;function yD(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function bD(){return++vD}var xD=ow.prototype;yD.prototype={constructor:yD,select:ZE,selectAll:QE,selectChild:xD.selectChild,selectChildren:xD.selectChildren,filter:WE,merge:GE,selection:eD,transition:gD,call:xD.call,nodes:xD.nodes,node:xD.node,size:xD.size,empty:xD.empty,each:xD.each,on:JE,attr:OE,attrTween:NE,style:oD,styleTween:lD,text:fD,textTween:hD,remove:XE,tween:yE,delay:IE,duration:zE,ease:VE,easeVarying:UE,end:_D,[Symbol.iterator]:xD[Symbol.iterator]};function SD(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CD={time:null,delay:0,duration:250,ease:SD};function wD(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function TD(e){var t,n;e instanceof yD?(t=e._id,e=e._name):(t=bD(),(n=CD).time=QT(),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])&&uE(c,e,t,l,o,n||wD(c,t));return new yD(r,this._parents,e,t)}ow.prototype.interrupt=gE,ow.prototype.transition=TD;var ED=e=>()=>e;function DD(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 OD(e,t,n){this.k=e,this.x=t,this.y=n}OD.prototype={constructor:OD,scale:function(e){return e===1?this:new OD(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new OD(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 kD=new OD(1,0,0);AD.prototype=OD.prototype;function AD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kD;return e.__zoom}function jD(e){e.stopImmediatePropagation()}function MD(e){e.preventDefault(),e.stopImmediatePropagation()}function ND(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function PD(){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 FD(){return this.__zoom||kD}function ID(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function LD(){return navigator.maxTouchPoints||`ontouchstart`in this}function RD(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 zD(){var e=ND,t=PD,n=RD,r=ID,i=LD,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=BT,l=aS(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,FD).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`,FD),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(kD.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 OD(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 OD(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 OD(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=cw(this.that).datum();l.call(e,this.that,new DD(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=uw(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)],hE(this),s.start();MD(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=cw(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=uw(t,i),l=t.clientX,u=t.clientY;hw(t.view),jD(t),a.mouse=[c,this.__zoom.invert(c)],hE(this),a.start();function d(e){if(MD(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]=uw(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),gw(e.view,a.moved),MD(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=uw(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);MD(r),s>0?cw(this).transition().duration(s).call(x,d,c,r):cw(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(jD(t),s=0;s<i;++s)c=r[s],l=uw(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)),hE(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(MD(e),s=0;s<a;++s)c=i[s],l=uw(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(jD(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=uw(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=cw(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ED(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ED(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ED(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ED([[+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 BD={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.`},VD=[[-1/0,-1/0],[1/0,1/0]],HD=[`Enter`,` `,`Escape`],UD={"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`},WD;(function(e){e.Strict=`strict`,e.Loose=`loose`})(WD||={});var GD;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(GD||={});var KD;(function(e){e.Partial=`partial`,e.Full=`full`})(KD||={});var qD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},JD;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(JD||={});var YD;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(YD||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var XD={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top},ZD=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,QD=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),$D=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),eO=(e,t=[0,0])=>{let{width:n,height:r}=PO(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},tO=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):$D(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,mO(e,vO(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?gO(r):{x:0,y:0,width:0,height:0}},nO=(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=mO(n,vO(e)),r=!0)}),r?gO(n):{x:0,y:0,width:0,height:0}},rO=(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=bO(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},iO=(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 aO(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}=PO(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 oO({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=jO(nO(aO(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 sO({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`,BD.error005());else{let{width:e,height:t}=PO(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&NO(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=NO(d)?uO(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,BD.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 cO({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=iO(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 lO=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),uO=(e={x:0,y:0},t,n)=>({x:lO(e.x,t[0][0],t[1][0]-(n?.width??0)),y:lO(e.y,t[0][1],t[1][1]-(n?.height??0))});function dO(e,t,n){let{width:r,height:i}=PO(n),{x:a,y:o}=n.internals.positionAbsolute;return uO(e,[[a,o],[a+r,o+i]],t)}var fO=(e,t,n)=>e<t?lO(Math.abs(e-t),1,t)/t:e>n?-lO(Math.abs(e-n),1,t)/t:0,pO=(e,t,n=15,r=40)=>[fO(e.x,r,t.width-r)*n,fO(e.y,r,t.height-r)*n],mO=(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)}),hO=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),gO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),_O=(e,t=[0,0])=>{let{x:n,y:r}=$D(e)?e.internals.positionAbsolute:eO(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}},vO=(e,t=[0,0])=>{let{x:n,y:r}=$D(e)?e.internals.positionAbsolute:eO(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)}},yO=(e,t)=>gO(mO(hO(e),hO(t))),bO=(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)},xO=(e,t)=>bO(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),SO=e=>CO(e.width)&&CO(e.height)&&CO(e.x)&&CO(e.y),CO=e=>!isNaN(e)&&isFinite(e),wO=(e,t)=>(e,t)=>{},TO=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),EO=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?TO(s,o):s},DO=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function OO(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 kO(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=OO(e,n),i=OO(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=OO(e.top??e.y??0,n),i=OO(e.bottom??e.y??0,n),a=OO(e.left??e.x??0,t),o=OO(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 AO(e,t,n,r,i,a){let{x:o,y:s}=DO(e,[t,n,r]),{x:c,y:l}=DO({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 jO=(e,t,n,r,i,a)=>{let o=kO(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=lO(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=AO(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}},MO=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function NO(e){return e!=null&&e!==`parent`}function PO(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function FO(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function IO(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 LO(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function RO(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function zO(e){return{...UD,...e||{}}}function BO(e){return e===null?null:e?`valid`:`invalid`}function VO(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=qO(e),s=EO({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?TO(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var HO=e=>({width:e.offsetWidth,height:e.offsetHeight}),UO=e=>e?.getRootNode?.()||window?.document,WO=[`INPUT`,`SELECT`,`TEXTAREA`];function GO(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?WO.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var KO=e=>`clientX`in e,qO=(e,t)=>{let n=KO(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)}},JO=(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,...HO(t)}})};function YO({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 XO(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ZO({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-XO(t-r,a),n];case $.Right:return[t+XO(r-t,a),n];case $.Top:return[t,n-XO(n-i,a)];case $.Bottom:return[t,n+XO(i-n,a)]}}function QO({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=ZO({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=ZO({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=YO({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 $O({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 ek({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 tk({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=mO(vO(e),vO(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),xO({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},gO(a))>0}var nk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,rk=(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)),ik=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,BD.error006()),t;let r=n.getEdgeId||nk,i;return i=ZD(e)?{...e}:{...e,id:r(e)},rk(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ak({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=$O({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var ok={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},sk=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.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},ck=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function lk({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=ok[t],c=ok[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=sk({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]=$O({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 uk(e,t,n,r){let i=Math.min(ck(e,t)/2,ck(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 dk({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=lk({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+=uk(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 fk(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function pk(e){let{sourceNode:t,targetNode:n}=e;if(!fk(t)||!fk(n))return null;let r=t.internals.handleBounds||mk(t.handles),i=n.internals.handleBounds||mk(n.handles),a=gk(r?.source??[],e.sourceHandle),o=gk(e.connectionMode===WD.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,BD.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=hk(t,a,s),u=hk(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function mk(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 hk(e,t,n=$.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??PO(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function gk(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function _k(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function vk(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=_k(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 yk=1e3,bk=10,xk={nodeOrigin:[0,0],nodeExtent:VD,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Sk={...xk,checkEquality:!0};function Ck(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function wk(e,t,n){let r=Ck(xk,n);for(let n of e.values())if(n.parentId)kk(n,e,t,r);else{let e=uO(eO(n,r.nodeOrigin),NO(n.extent)?n.extent:r.nodeExtent,PO(n));n.internals.positionAbsolute=e}}function Tk(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 Ek(e){return e===`manual`}function Dk(e,t,n,r={}){let i=Ck(Sk,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Ek(i.zIndexMode)?yk: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=uO(eO(u,i.nodeOrigin),NO(u.extent)?u.extent:i.nodeExtent,PO(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Tk(u,e),z:Ak(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&&kk(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Ok(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 kk(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Ck(xk,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}Ok(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*bk),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=jk(e,u,o,s,a&&!Ek(c)?yk: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 Ak(e,t,n){let r=CO(e.zIndex)?e.zIndex:0;return Ek(n)?r:r+(e.selected?t:0)}function jk(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=PO(e),l=eO(e,n),u=NO(e.extent)?uO(l,e.extent,c):l,d=uO({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=dO(d,c,t));let f=Ak(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Mk(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=yO(a.get(n.parentId)?.expandedRect??_O(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=PO(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 Nk(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=HO(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=NO(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=dO(h,s,n))}else m&&(h=uO(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:JO(`source`,r.nodeElement,p,d,e.id),target:JO(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&kk(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:_O(g,i)}))}}if(f.length>0){let e=Mk(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Pk({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 Fk(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 Ik(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}`;Fk(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Fk(`target`,s,c,e,i,o),t.set(r.id,r)}}function Lk(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Lk(n,t):!1}function Rk(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 zk(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Lk(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 Bk({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 Vk({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=TO(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Hk({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=cw(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?hO(nO(s)):null,x=v&&l?Vk({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)}:TO(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}=sO({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]=Bk({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]=pO(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=VO(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=zk(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Bk({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Cw().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=VO(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=qO(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=VO(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=qO(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=qO(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else 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]=Bk({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||!Rk(t,`.${g}`,v))&&(!_||Rk(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Uk(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())xO(i,_O(e))>0&&r.push(e);return r}var Wk=250;function Gk(e,t,n,r){let i=[],a=1/0,o=Uk(e,n,t+Wk);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}=hk(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 Kk(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,...hk(o,c,c.position,!0)}:c}function qk(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Jk(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Yk=()=>!0;function Xk(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:_=Yk,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=UO(e.target),E=0,D,{x:O,y:k}=qO(e),A=qk(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=Kk(i,A,r,c,t);if(!N)return;let ee=qO(e,j),te=!1,P=null,ne=!1,re=null;function F(){if(!u||!j)return;let[e,t]=pO(ee,j,S);f({x:e,y:t}),E=requestAnimationFrame(F)}let I={...N,nodeId:i,type:A,position:N.position},ie=c.get(i),L={inProgress:!0,isValid:null,from:hk(ie,I,$.Left,!0),fromHandle:I,fromPosition:I.position,fromNode:ie,to:ee,toHandle:null,toPosition:XD[I.position],toNode:null,pointer:ee};function ae(){M=!0,y(L),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ae();function oe(e){if(!M){let{x:t,y:n}=qO(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ae()}if(!x()||!I){se(e);return}let a=b();ee=qO(e,j),D=Gk(EO(ee,a,!1,[1,1]),n,c,I),te||=(F(),!0);let s=Zk(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,P=s.connection,ne=Jk(!!D,s.isValid);let u=c.get(i),f=u?hk(u,I,$.Left,!0):L.from,p={...L,from:f,isValid:ne,to:s.toHandle&&ne?DO({x:s.toHandle.x,y:s.toHandle.y},a):ee,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:XD[I.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ee};y(p),L=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||re)&&P&&ne&&h?.(P);let{inProgress:t,...n}=L,r={...n,toPosition:L.toHandle?L.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,ne=!1,P=null,re=null,T.removeEventListener(`mousemove`,oe),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,oe),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,oe),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,oe),T.addEventListener(`touchend`,se)}function Zk(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Yk,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}=qO(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=qk(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===WD.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Kk(t,e,a,u,n,!0)}return _}var Qk={onPointerDown:Xk,isValid:Zk};function $k({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=cw(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&&MO()?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=zD().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:uw}}var eA=e=>({x:e.x,y:e.y,zoom:e.k}),tA=({x:e,y:t,zoom:n})=>kD.translate(e,t).scale(n),nA=(e,t)=>e.target.closest(`.${t}`),rA=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),iA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,aA=(e,t=0,n=iA,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},oA=e=>{let t=e.ctrlKey&&MO()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function sA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(nA(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=uw(u),t=d*2**oA(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===GD.Vertical?0:u.deltaX*f,m=i===GD.Horizontal?0:u.deltaY*f;!MO()&&u.shiftKey&&i!==GD.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=eA(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 cA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=nA(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function lA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=eA(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 uA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&rA(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,eA(a.transform))}}function dA({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&rA(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=eA(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function fA({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(nA(f,`${u}-flow__node`)||nA(f,`${u}-flow__edge`)||nA(f,`${u}-flow__selection`)||nA(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||nA(f,c)&&h||nA(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function pA({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=zD().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=cw(e).call(f);y({x:i.x,y:i.y,zoom:lO(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(oA);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ET:BT).transform(aA(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,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!CO(D)||D<0?0:D);let A=k?sA({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):cA({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=lA({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=uA({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=dA({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let ee=fA({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(ee),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=tA(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=tA(e);return await g(n,t),n}function x(e){if(p){let t=tA(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?AD(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`?ET:BT).scaleTo(aA(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ET:BT).scaleBy(aA(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=!CO(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 mA;(function(e){e.Line=`line`,e.Handle=`handle`})(mA||={});function hA({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 gA(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 _A(e,t){return Math.max(0,t-e)}function vA(e,t){return Math.max(0,e-t)}function yA(e,t,n){return Math.max(0,t-e,e-n)}function bA(e,t){return e?!t:t}function xA(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=yA(E,h,g),j=yA(D,_,v);if(o){let e=0,t=0;c&&w<0?e=_A(y+w+O,o[0][0]):!c&&w>0&&(e=vA(y+E+O,o[1][0])),l&&T<0?t=_A(b+T+k,o[0][1]):!l&&T>0&&(t=vA(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=vA(y+w,s[0][0]):!c&&w<0&&(e=_A(y+E,s[1][0])),l&&T>0?t=vA(b+T,s[0][1]):!l&&T<0&&(t=_A(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=yA(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?vA(b+k+E/C,o[1][1])*C:_A(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?_A(b+E/C,s[1][1])*C:vA(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=yA(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?vA(y+D*C+O,o[1][0])/C:_A(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?_A(y+D*C,s[1][0])/C:vA(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=(bA(c,l)?-w:w)/C:w=(bA(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 SA={width:0,height:0,x:0,y:0},CA={...SA,pointerX:0,pointerY:0,aspectRatio:1};function wA(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 TA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=cw(e),o={controlDirection:gA(`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={...SA},h={...CA};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:gA(e)};let g,_=null,v=[],y,b,x,S=!1,C=Cw().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}=VO(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=NO(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=wA(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=VO(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}=xA(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,ee=A!==f&&M;if(!N&&!ee&&!j&&!M)return;if((N||ee||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=ee?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 te=hA({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),P={...m,direction:te};p?.(e,P)!==!1&&(S=!0,d?.(e,P),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 EA=t((t=>{var n=(pe(),e(fe)),r=$l();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),DA=n(t(((e,t)=>{t.exports=EA()}))(),1),OA=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},kA=e=>e?OA(e):OA;pe();var{useDebugValue:AA}=ue,{useSyncExternalStoreWithSelector:jA}=DA.default,MA=e=>e;function NA(e,t=MA,n){let r=jA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return AA(r),r}var PA=(e,t)=>{let n=kA(e),r=(e,r=t)=>NA(n,e,r);return Object.assign(r,n),r},FA=(e,t)=>e?PA(e,t):PA;function IA(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}je(),pe();var LA=xe(null),RA=LA.Provider,zA=BD.error001(`react`);function BA(e,t){let n=ge(LA);if(n===null)throw Error(zA);return NA(n,e,t)}function VA(){let e=ge(LA);if(e===null)throw Error(zA);return V(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var HA={display:`none`},UA={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},WA=`react-flow__node-desc`,GA=`react-flow__edge-desc`,KA=`react-flow__aria-live`,qA=e=>e.ariaLiveMessage,JA=e=>e.ariaLabelConfig;function YA({rfId:e}){let t=BA(qA);return A(`div`,{id:`${KA}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:UA,children:t})}function XA({rfId:e,disableKeyboardA11y:t}){let n=BA(JA);return A(Te,{children:[A(`div`,{id:`${WA}-${e}`,style:HA,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),A(`div`,{id:`${GA}-${e}`,style:HA,children:n[`edge.a11yDescription.default`]}),!t&&A(YA,{rfId:e})]})}var ZA=Fe(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return A(`div`,{className:rS([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});ZA.displayName=`Panel`;var QA=`https://reactflow.dev?utm_source=attribution`;function $A({proOptions:e,position:t=`bottom-right`}){return B(()=>{},[]),e?.hideAttribution?null:A(ZA,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${QA}`,children:A(`a`,{href:QA,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var ej=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}},tj=e=>e.id;function nj(e,t){return IA(e.selectedNodes.map(tj),t.selectedNodes.map(tj))&&IA(e.selectedEdges.map(tj),t.selectedEdges.map(tj))}function rj({onSelectionChange:e}){let t=VA(),{selectedNodes:n,selectedEdges:r}=BA(ej,nj);return B(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var ij=e=>!!e.onSelectionChangeHandlers;function aj({onSelectionChange:e}){let t=BA(ij);return e||t?A(rj,{onSelectionChange:e}):null}var oj=[0,0],sj={x:0,y:0,zoom:1},cj=[...`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`],lj=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}),uj={translateExtent:VD,nodeOrigin:oj,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function dj(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=BA(lj,IA),l=VA();B(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=uj,s()}),[]);let u=K(uj);return B(()=>{for(let s of cj){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:zO(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},cj.map(t=>e[t])),null}function fj(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function pj(e){let[t,n]=U(e===`system`?null:e);return B(()=>{if(e!==`system`){n(e);return}let t=fj(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?fj()?.matches?`dark`:`light`:t}var mj=typeof document<`u`?document:null;function hj(e=null,t={target:mj,actInsideInputWithModifier:!0}){let[n,r]=U(!1),i=K(!1),a=K(new Set([])),[o,s]=V(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
2452
2452
|
`).replace(`
|
|
2453
2453
|
|
|
2454
2454
|
`,`
|
|
2455
2455
|
+`).split(`
|
|
2456
|
-
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return B(()=>{let n=t?.target??mj,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)&&GO(e))return!1;let n=_j(e.code,s);if(a.current.add(e[n]),gj(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=_j(e.code,s);gj(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 gj(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function _j(e,t){return t.includes(e)?`code`:`key`}var vj=()=>{let e=VA();return V(()=>({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=jO(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 EO(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=DO(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function yj(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)bj(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 bj(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 xj(e,t){return yj(e,t)}function Sj(e,t){return yj(e,t)}function Cj(e,t){return{id:e,type:`select`,selected:t}}function wj(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(Cj(a.id,e)))}return r}function Tj({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 Ej(e){return{id:e.id,type:`remove`}}var Dj=wO(`React Flow`,`https://reactflow.dev/`);function Oj(e,t,n={}){return ik(e,t,{...n,onError:n.onError??Dj})}var kj=e=>QD(e),Aj=e=>ZD(e);function jj(e){return Fe(e)}var Mj=typeof window<`u`?ye:B;function Nj(e){let[t,n]=U(BigInt(0)),[r]=U(()=>Pj(()=>n(e=>e+BigInt(1))));return Mj(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Pj(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Fj=xe(null);function Ij({children:e}){let t=VA(),n=Nj(z(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=Tj({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=Nj(z(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(Tj({items:s,lookup:o}))},[])),i=V(()=>({nodeQueue:n,edgeQueue:r}),[]);return A(Fj.Provider,{value:i,children:e})}function Lj(){let e=ge(Fj);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Rj=e=>!!e.panZoom;function zj(){let e=vj(),t=VA(),n=Lj(),r=BA(Rj),i=V(()=>{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=kj(e)?e:n.get(e.id),a=i.parentId?IO(i.position,i.measured,i.parentId,n,r):i.position;return _O({...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&&kj(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&&Aj(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 cO({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Ej);o?.(f),c(e)}if(m){let e=d.map(Ej);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=SO(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=_O(s?r:a),l=xO(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=SO(e)?e:a(e);if(!r)return!1;let i=xO(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 tO(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??RO();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return V(()=>({...i,...e,viewportInitialized:r}),[r])}var Bj=e=>e.selected,Vj=typeof window<`u`?window:void 0;function Hj({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=VA(),{deleteElements:r}=zj(),i=hj(e,{actInsideInputWithModifier:!1}),a=hj(t,{target:Vj});B(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Bj),edges:e.filter(Bj)}),n.setState({nodesSelectionActive:!1})}},[i]),B(()=>{n.setState({multiSelectionActive:a})},[a])}function Uj(e){let t=VA();B(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=HO(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,BD.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 Wj={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Gj=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Kj({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=GD.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){let S=VA(),C=K(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=BA(Gj,IA),D=hj(p),O=K();Uj(C);let k=z(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),y||S.setState({transform:e})},[v,y]);return B(()=>{if(C.current){O.current=pA({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return S.setState({panZoom:O.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),B(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:_,userSelectionActive:w,noWheelClassName:g,lib:T,onTransformChange:k,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,i,a,o,s,c,D,m,_,w,g,T,k,E,x,b]),A(`div`,{className:`react-flow__renderer`,ref:C,style:Wj,children:h})}var qj=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Jj(){let{userSelectionActive:e,userSelectionRect:t}=BA(qj,IA);return e&&t?A(`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 Yj=(e,t)=>n=>{n.target===t.current&&e?.(n)},Xj=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Zj({isSelecting:e,selectionKeyPressed:t,selectionMode:n=KD.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=K(0),_=VA(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=BA(Xj,IA),C=y&&(e||v),w=K(null),T=K(),E=K(new Set),D=K(new Set),O=K(!1),k=K(!1),j=K({x:0,y:0}),M=K(!1),N=e=>{k.current||O.current||_.getState().connection.inProgress?(k.current=!1,O.current=!1):(l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1}))},ee=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},te=d?e=>d(e):void 0,P=e=>{k.current&&=(e.stopPropagation(),!1)},ne=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(T.current=i?.getBoundingClientRect(),!T.current)return;let s=n.target===w.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=qO(n.nativeEvent,T.current),u=EO({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function F(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}=DO(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(rO(a,m,i,n===KD.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)}}LO(h,E.current)||c(wj(a,E.current,!0)),LO(g,D.current)||l(wj(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function I(){if(!i||!T.current)return;let[e,t]=pO(j.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(I);return}let{x:t,y:n}=j.current;F(t,n),g.current=requestAnimationFrame(I)})}let L=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};B(()=>()=>L(),[]);let re=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=qO(e.nativeEvent,T.current);j.current={x:o,y:c};let l=DO({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,M.current||=(I(),!0),F(o,c)},ie=e=>{C?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&N?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),L()):e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0)},ae=e=>{e.target?.releasePointerCapture?.(e.pointerId),L()},oe=r===!0||Array.isArray(r)&&r.includes(0);return A(`div`,{className:rS([`react-flow__pane`,{draggable:oe,dragging:b,selection:e}]),onClick:C?void 0:Yj(N,w),onContextMenu:Yj(ee,w),onWheel:Yj(te,w),onPointerEnter:C?void 0:f,onPointerMove:C?re:p,onPointerUp:ie,onPointerCancel:C?ae:void 0,onPointerDownCapture:C?ne:void 0,onClickCapture:C?P:void 0,onPointerLeave:m,ref:w,style:Wj,children:[h,A(Jj,{})]})}function Qj({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);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,BD.error012(e))}function $j({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=VA(),[c,l]=U(!1),u=K();return B(()=>{if(!t)return u.current=Hk({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Qj({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),B(()=>{!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 eM=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function tM(){let e=VA();return z(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=eM(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=TO(t,i));let{position:a,positionAbsolute:s}=sO({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 nM=xe(null),rM=nM.Provider;nM.Consumer;var iM=()=>ge(nM),aM=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),oM=xe(null);function sM({children:e}){let t=BA(aM,IA);return A(oM.Provider,{value:t,children:e})}function cM(){let e=ge(oM);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var lM={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uM=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return lM;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===WD.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function dM({type:e=`source`,position:t=$.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=VA(),_=iM(),{connectOnClick:v,noPanClassName:y,rfId:b}=cM(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=BA(uM(_,m,e),IA);_||g.getState().onError?.(`010`,BD.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(Oj(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=KO(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();Qk.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 A(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:rS([`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=UO(t.target),h=n||c,{connection:v,isValid:y}=Qk.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 fM=N(jj(dM));function pM({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return A(Te,{children:[e?.label,A(fM,{type:`source`,position:n,isConnectable:t})]})}function mM({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return A(Te,{children:[A(fM,{type:`target`,position:n,isConnectable:t}),e?.label,A(fM,{type:`source`,position:r,isConnectable:t})]})}function hM(){return null}function gM({data:e,isConnectable:t,targetPosition:n=$.Top}){return A(Te,{children:[A(fM,{type:`target`,position:n,isConnectable:t}),e?.label]})}var _M={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vM={input:pM,default:mM,output:gM,group:hM};function yM(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 bM=e=>{let{width:t,height:n,x:r,y:i}=nO(e.nodeLookup,{filter:e=>!!e.selected});return{width:CO(t)?t:null,height:CO(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 xM({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=VA(),{width:i,height:a,transformString:o,userSelectionActive:s}=BA(bM,IA),c=tM(),l=K(null);B(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if($j({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return A(`div`,{className:rS([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:A(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(_M,e.key)&&(e.preventDefault(),c({direction:_M[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var SM=typeof window<`u`?window:void 0,CM=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function wM({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:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:ee,disableKeyboardA11y:te,onViewportChange:P,isControlledViewport:ne}){let{nodesSelectionActive:F,userSelectionActive:I}=BA(CM,IA),L=hj(l,{target:SM}),re=hj(h,{target:SM}),ie=re||w,ae=re||b,oe=u&&ie!==!0,se=L||I||oe;return Hj({deleteKeyCode:c,multiSelectionKeyCode:m}),A(Kj,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panActivationKeyPressed:re,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!L&&ie,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:j,noWheelClassName:N,noPanClassName:ee,onViewportChange:P,isControlledViewport:ne,paneClickDistance:s,selectionOnDrag:oe,children:A(Zj,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ie,autoPanOnSelection:T,isSelecting:!!se,selectionMode:d,selectionKeyPressed:L,paneClickDistance:s,selectionOnDrag:oe,children:[e,F&&A(xM,{onSelectionContextMenu:M,noPanClassName:ee,disableKeyboardA11y:te})]})})}wM.displayName=`FlowRenderer`;var TM=N(wM),EM=e=>t=>e?rO(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 DM(e){return BA(z(EM(e),[e]),IA)}var OM=e=>e.updateNodeInternals;function kM(){let e=BA(OM),[t]=U(()=>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 B(()=>()=>{t?.disconnect()},[t]),t}function AM({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=VA(),a=K(null),o=K(null),s=K(e.sourcePosition),c=K(e.targetPosition),l=K(t),u=n&&!!e.internals.handleBounds;return B(()=>{!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]),B(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),B(()=>{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 jM({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}=BA(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},IA),S=y.type||`default`,C=g?.[S]||vM[S];C===void 0&&(v?.(`003`,BD.error003(S)),S=`default`,C=g?.default||vM.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=VA(),k=FO(y),j=AM({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),M=$j({nodeRef:j,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),N=tM();if(y.hidden)return null;let ee=PO(y),te=yM(y),P=T||w||t||n||r||i,ne=n?e=>n(e,{...b.userNode}):void 0,F=r?e=>r(e,{...b.userNode}):void 0,I=i?e=>i(e,{...b.userNode}):void 0,L=a?e=>a(e,{...b.userNode}):void 0,re=o?e=>o(e,{...b.userNode}):void 0,ie=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Qj({id:e,store:O,nodeRef:j}),t&&t(n,{...b.userNode})},ae=t=>{if(!(GO(t.nativeEvent)||m)){if(HD.includes(t.key)&&T){let n=t.key===`Escape`;Qj({id:e,store:O,unselect:n,nodeRef:j})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(_M,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})}),N({direction:_M[t.key],factor:t.shiftKey?4:1})}}},oe=()=>{if(m||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(rO(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ee.width/2,y.position.y+ee.height/2,{zoom:t[2]}))};return A(`div`,{className:rS([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:M}]),ref:j,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:P?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ne,onMouseMove:F,onMouseLeave:I,onContextMenu:L,onClick:ie,onDoubleClick:re,onKeyDown:D?ae:void 0,tabIndex:D?0:void 0,onFocus:D?oe:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${WA}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:A(rM,{value:e,children:A(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:M,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ee})})})}var MM=N(jM),NM=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function PM(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=BA(NM,IA),a=DM(e.onlyRenderVisibleElements),o=kM();return A(`div`,{className:`react-flow__nodes`,style:Wj,children:a.map(a=>A(MM,{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))})}PM.displayName=`NodeRenderer`;var FM=N(PM);function IM(e){return BA(z(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&&tk({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),IA)}var LM=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return A(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},RM=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return A(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},zM={[YD.Arrow]:LM,[YD.ArrowClosed]:RM};function BM(e){let t=VA();return V(()=>Object.prototype.hasOwnProperty.call(zM,e)?zM[e]:(t.getState().onError?.(`009`,BD.error009(e)),null),[e])}var VM=({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=BM(t);return c?A(`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:A(c,{color:n,strokeWidth:o})}):null},HM=({defaultColor:e,rfId:t})=>{let n=BA(e=>e.edges),r=BA(e=>e.defaultEdgeOptions),i=V(()=>vk(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?A(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:A(`defs`,{children:i.map(e=>A(VM,{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};HM.displayName=`MarkerDefinitions`;var UM=N(HM);function WM({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]=U({x:1,y:0,width:0,height:0}),p=rS([`react-flow__edge-textwrapper`,l]),m=K(null);return B(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?A(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&A(`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}),A(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}WM.displayName=`EdgeText`;var GM=N(WM);function KM({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return A(Te,{children:[A(`path`,{...u,d:e,fill:`none`,className:rS([`react-flow__edge-path`,u.className])}),l?A(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&CO(t)&&CO(n)?A(GM,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function qM({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function JM({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=qM({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=qM({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=YO({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 YM(e){return N(({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]=JM({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return A(KM,{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 XM=YM({isInternal:!1}),ZM=YM({isInternal:!0});XM.displayName=`SimpleBezierEdge`,ZM.displayName=`SimpleBezierEdgeInternal`;function QM(e){return N(({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=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=dk({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 A(KM,{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 $M=QM({isInternal:!1}),eN=QM({isInternal:!0});$M.displayName=`SmoothStepEdge`,eN.displayName=`SmoothStepEdgeInternal`;function tN(e){return N(({id:t,...n})=>{let r=e.isInternal?void 0:t;return A($M,{...n,id:r,pathOptions:V(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var nN=tN({isInternal:!1}),rN=tN({isInternal:!0});nN.displayName=`StepEdge`,rN.displayName=`StepEdgeInternal`;function iN(e){return N(({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]=ak({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return A(KM,{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 aN=iN({isInternal:!1}),oN=iN({isInternal:!0});aN.displayName=`StraightEdge`,oN.displayName=`StraightEdgeInternal`;function sN(e){return N(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.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]=QO({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return A(KM,{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 cN=sN({isInternal:!1}),lN=sN({isInternal:!0});cN.displayName=`BezierEdge`,lN.displayName=`BezierEdgeInternal`;var uN={default:lN,straight:oN,step:rN,smoothstep:eN,simplebezier:ZM},dN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},fN=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,pN=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,mN=`react-flow__edgeupdater`;function hN({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return A(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:rS([mN,`${mN}-${s}`]),cx:fN(t,r,e),cy:pN(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function gN({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=VA(),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`;Qk.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 A(Te,{children:[(e===!0||e===`source`)&&A(hN,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&A(hN,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function _N({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=BA(t=>t.edgeLookup.get(e)),b=BA(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||uN[x];S===void 0&&(_?.(`011`,BD.error011(x)),x=`default`,S=h?.default||uN.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=K(null),[D,O]=U(!1),[k,j]=U(!1),M=VA(),{zIndex:N=y.zIndex,sourceX:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:F,targetPosition:I}=BA(z(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return dN;let i=pk({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=ek({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||dN,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex,_]),IA),L=V(()=>y.markerStart?`url('#${_k(y.markerStart,m)}')`:void 0,[y.markerStart,m]),re=V(()=>y.markerEnd?`url('#${_k(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||ee===null||te===null||P===null||ne===null)return null;let ie=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();T&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},ae=a?e=>{a(e,{...y})}:void 0,oe=o?e=>{o(e,{...y})}:void 0,se=s?e=>{s(e,{...y})}:void 0,ce=c?e=>{c(e,{...y})}:void 0,le=l?e=>{l(e,{...y})}:void 0;return A(`svg`,{style:{zIndex:N},children:A(`g`,{className:rS([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:ie,onDoubleClick:ae,onContextMenu:oe,onMouseEnter:se,onMouseMove:ce,onMouseLeave:le,onKeyDown:C?t=>{if(!v&&HD.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.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?`${GA}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&A(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:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:F,targetPosition:I,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:L,markerEnd:re,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&A(gN,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:F,targetPosition:I,setUpdateHover:O,setReconnecting:j})]})})}var vN=N(_N),yN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function bN({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}=BA(yN,IA),b=IM(t);return A(`div`,{className:`react-flow__edges`,children:[A(UM,{defaultColor:e,rfId:n}),b.map(e=>A(vN,{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))]})}bN.displayName=`EdgeRenderer`;var xN=N(bN),SN=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function CN({children:e}){let t=VA(),n=K(null),[r]=U(()=>t.getState().transform);return Mj(()=>{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=SN(r)))};return r(),t.subscribe(r)},[t]),A(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:SN(r)},children:e})}function wN(e){let t=zj(),n=K(!1);B(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var TN=e=>e.panZoom?.syncViewport;function EN(e){let t=BA(TN),n=VA();return B(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function DN(e){return e.connection.inProgress?{...e.connection,to:EO(e.connection.to,e.transform)}:{...e.connection}}function ON(e){return e?t=>e(DN(t)):DN}function kN(e){return BA(ON(e),IA)}var AN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function jN({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=BA(AN,IA);return a&&i&&c?A(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:A(`g`,{className:rS([`react-flow__connection`,BO(s)]),children:A(MN,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var MN=({style:e,type:t=JD.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}=kN();if(!i)return;if(n)return A(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:BO(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 JD.Bezier:[m]=QO(h);break;case JD.SimpleBezier:[m]=JM(h);break;case JD.Step:[m]=dk({...h,borderRadius:0});break;case JD.SmoothStep:[m]=dk(h);break;default:[m]=ak(h)}return A(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};MN.displayName=`ConnectionLine`;var NN={};function PN(e=NN){K(e),VA(),B(()=>{},[e])}function FN(){VA(),K(!1),B(()=>{},[])}function IN({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:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:ee,zoomOnPinch:te,panOnScroll:P,panOnScrollSpeed:ne,panOnScrollMode:F,zoomOnDoubleClick:I,panOnDrag:L,autoPanOnSelection:re,onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:ue,nodeClickDistance:de,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:R,reconnectRadius:z,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,viewport:we,onViewportChange:Te,nodesDraggable:Ee}){return PN(e),PN(t),FN(),wN(n),EN(we),A(TM,{onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:ue,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ee,zoomOnPinch:te,zoomOnDoubleClick:I,panOnScroll:P,panOnScrollSpeed:ne,panOnScrollMode:F,panOnDrag:L,autoPanOnSelection:re,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,onViewportChange:Te,isControlledViewport:!!we,children:A(CN,{children:[A(xN,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,onlyRenderVisibleElements:T,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:R,reconnectRadius:z,defaultMarkerColor:N,noPanClassName:be,disableKeyboardA11y:xe,rfId:Ce}),A(jN,{style:h,type:m,component:g,containerStyle:_}),A(`div`,{className:`react-flow__edgelabel-renderer`}),A(FM,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:de,onlyRenderVisibleElements:T,noPanClassName:be,noDragClassName:ve,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,nodesDraggable:Ee}),A(`div`,{className:`react-flow__viewport-portal`})]})})}IN.displayName=`GraphView`;var LN=N(IN),RN=wO(`React Flow`,`https://reactflow.dev/`),zN=({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??VD;Ik(h,g,_);let{nodesInitialized:x}=Dk(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=jO(nO(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:VD,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:WD.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:{...qD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:RN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:UD,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},BN=({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})=>FA((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 oO({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...zN({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,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Dk(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();Ik(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}=Nk(e,n,r,i,a,o,l);d&&(wk(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=hk(e,o.fromHandle,$.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=Mk(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(xj(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(Sj(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();t?i(e.map(e=>Cj(e,!0))):(i(wj(r,new Set([...e]),!0)),a(wj(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>Cj(e,!0))):(a(wj(n,new Set([...e]))),i(wj(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(Cj(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(Cj(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,Cj(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,Cj(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])&&(Dk(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 Pk({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:{...qD}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...zN()})}},Object.is);function VN({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]=U(()=>BN({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 A(RA,{value:m,children:A(Ij,{children:A(sM,{children:p})})})}function HN({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 ge(LA)?A(Te,{children:e}):A(VN,{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 UN={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function WN({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:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:ee,onSelectionStart:te,onSelectionEnd:P,onBeforeDelete:ne,connectionMode:F,connectionLineType:I=JD.Bezier,connectionLineStyle:L,connectionLineComponent:re,connectionLineContainerStyle:ie,deleteKeyCode:ae=`Backspace`,selectionKeyCode:oe=`Shift`,selectionOnDrag:se=!1,selectionMode:ce=KD.Full,panActivationKeyCode:le=`Space`,multiSelectionKeyCode:ue=MO()?`Meta`:`Control`,zoomActivationKeyCode:de=MO()?`Meta`:`Control`,snapToGrid:fe,snapGrid:pe,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:R,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,nodeOrigin:ye=oj,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se=!0,defaultViewport:Ce=sj,minZoom:we=.5,maxZoom:Te=2,translateExtent:Ee=VD,preventScrolling:B=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:V=!0,panOnScroll:Ae=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Me=GD.Free,zoomOnDoubleClick:H=!0,panOnDrag:U=!0,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le=1,nodeClickDistance:K=0,children:Re,onReconnect:ze,onReconnectStart:Be,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe=10,onNodesChange:Je,onEdgesChange:Ye,noDragClassName:Xe=`nodrag`,noWheelClassName:Ze=`nowheel`,noPanClassName:Qe=`nopan`,fitView:$e,fitViewOptions:et,connectOnClick:tt,attributionPosition:nt,proOptions:rt,defaultEdgeOptions:it,elevateNodesOnSelect:at=!0,elevateEdgesOnSelect:ot=!1,disableKeyboardA11y:st=!1,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanOnSelection:ut=!0,autoPanSpeed:dt,connectionRadius:ft,isValidConnection:pt,onError:mt,style:ht,id:gt,nodeDragThreshold:_t,connectionDragThreshold:vt,viewport:yt,onViewportChange:bt,width:xt,height:St,colorMode:Ct=`light`,debug:wt,onScroll:Tt,ariaLabelConfig:Et,zIndexMode:Dt=`basic`,...Ot},kt){let At=gt||`1`,jt=pj(Ct),Mt=z(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Tt?.(e)},[Tt]);return A(`div`,{"data-testid":`rf__wrapper`,...Ot,onScroll:Mt,style:{...ht,...UN},ref:kt,className:rS([`react-flow`,i,jt]),id:gt,role:`application`,children:A(HN,{nodes:e,edges:t,width:xt,height:St,fitView:$e,fitViewOptions:et,minZoom:we,maxZoom:Te,nodeOrigin:ye,nodeExtent:De,zIndexMode:Dt,children:[A(dj,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se,elevateNodesOnSelect:at,elevateEdgesOnSelect:ot,minZoom:we,maxZoom:Te,nodeExtent:De,onNodesChange:Je,onEdgesChange:Ye,snapToGrid:fe,snapGrid:pe,connectionMode:F,translateExtent:Ee,connectOnClick:tt,defaultEdgeOptions:it,fitView:$e,fitViewOptions:et,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Qe,nodeOrigin:ye,rfId:At,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanSpeed:dt,onError:mt,connectionRadius:ft,isValidConnection:pt,selectNodesOnDrag:R,nodeDragThreshold:_t,connectionDragThreshold:vt,onBeforeDelete:ne,debug:wt,ariaLabelConfig:Et,zIndexMode:Dt}),A(LN,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:I,connectionLineStyle:L,connectionLineComponent:re,connectionLineContainerStyle:ie,selectionKeyCode:oe,selectionOnDrag:se,selectionMode:ce,deleteKeyCode:ae,multiSelectionKeyCode:ue,panActivationKeyCode:le,zoomActivationKeyCode:de,onlyRenderVisibleElements:me,defaultViewport:Ce,translateExtent:Ee,minZoom:we,maxZoom:Te,preventScrolling:B,zoomOnScroll:ke,zoomOnPinch:V,zoomOnDoubleClick:H,panOnScroll:Ae,panOnScrollSpeed:je,panOnScrollMode:Me,panOnDrag:U,autoPanOnSelection:ut,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le,nodeClickDistance:K,onSelectionContextMenu:ee,onSelectionStart:te,onSelectionEnd:P,onReconnect:ze,onReconnectStart:Be,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe,defaultMarkerColor:Oe,noDragClassName:Xe,noWheelClassName:Ze,noPanClassName:Qe,rfId:At,disableKeyboardA11y:st,nodeExtent:De,viewport:yt,onViewportChange:bt,nodesDraggable:he}),A(aj,{onSelectionChange:k}),Re,A($A,{proOptions:rt,position:nt}),A(XA,{rfId:At,disableKeyboardA11y:st})]})})}var GN=jj(WN);BD.error014();function KN({dimensions:e,lineWidth:t,variant:n,className:r}){return A(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rS([`react-flow__background-pattern`,n,r])})}function qN({radius:e,className:t}){return A(`circle`,{cx:e,cy:e,r:e,className:rS([`react-flow__background-pattern`,`dots`,t])})}var JN;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(JN||={});var YN={[JN.Dots]:1,[JN.Lines]:1,[JN.Cross]:6},XN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ZN({id:e,variant:t=JN.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=K(null),{transform:f,patternId:p}=BA(XN,IA),m=r||YN[t],h=t===JN.Dots,g=t===JN.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]+x[0]/2,b[1]*f[2]+x[1]/2],C=`${p}${e||``}`;return A(`svg`,{className:rS([`react-flow__background`,l]),style:{...c,...Wj,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[A(`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?A(qN,{radius:y/2,className:u}):A(KN,{dimensions:x,lineWidth:i,variant:t,className:u})}),A(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}ZN.displayName=`Background`;var QN=N(ZN);function $N(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:A(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function eP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:A(`path`,{d:`M0 0h32v4.2H0z`})})}function tP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:A(`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 nP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:A(`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 rP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:A(`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 iP({children:e,className:t,...n}){return A(`button`,{type:`button`,className:rS([`react-flow__controls-button`,t]),...n,children:e})}var aP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function oP({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=VA(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=BA(aP,IA),{zoomIn:y,zoomOut:b,fitView:x}=zj();return A(ZA,{className:rS([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&A(Te,{children:[A(iP,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:A($N,{})}),A(iP,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:A(eP,{})})]}),n&&A(iP,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:A(tP,{})}),r&&A(iP,{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:A(h?rP:nP,{})}),u]})}oP.displayName=`Controls`,N(oP);function sP({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 A(`rect`,{className:rS([`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 cP=N(sP),lP=e=>e.nodes.map(e=>e.id),uP=e=>e instanceof Function?e:()=>e;function dP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=cP,onClick:o}){let s=BA(lP,IA),c=uP(t),l=uP(e),u=uP(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return A(Te,{children:s.map(e=>A(pP,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function fP({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}=BA(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}=PO(r);return{node:r,x:i,y:a,width:o,height:s}},IA);return!l||l.hidden||!FO(l)?null:A(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 pP=N(fP),mP=N(dP),hP=200,gP=150,_P=e=>!e.hidden,vP=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]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?yO(nO(e.nodeLookup,{filter:_P}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yP=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bP=(e,t)=>yP(e.viewBB,t.viewBB)&&yP(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,xP=`react-flow__minimap-desc`;function SP({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=VA(),S=K(null),{boundingRect:C,panZoom:w,viewBB:T,rfId:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:j}=BA(vP,bP),M=e?.width??hP,N=e?.height??gP,ee=C.width/M,te=C.height/N,P=Math.max(ee,te),ne=P*M,F=P*N,I=b*P,L=C.x-(ne-C.width)/2-I,re=C.y-(F-C.height)/2-I,ie=ne+I*2,ae=F+I*2,oe=`${xP}-${E}`,se=K(0),ce=K();se.current=P,B(()=>{let e=x.getState().panZoom;if(S.current&&e)return ce.current=$k({domNode:S.current,panZoom:e,getTransform:()=>x.getState().transform,getViewScale:()=>se.current}),()=>{ce.current?.destroy()}},[w]),B(()=>{ce.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let le=p?e=>{let[t,n]=ce.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ue=z((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),de=m?ue:void 0,fe=_??j[`minimap.ariaLabel`];return A(ZA,{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*P: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:rS([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:A(`svg`,{width:M,height:N,viewBox:`${L} ${re} ${ie} ${ae}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":oe,ref:S,onClick:le,children:[fe&&A(`title`,{id:oe,children:fe}),A(mP,{onClick:de,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),A(`path`,{className:`react-flow__minimap-mask`,d:`M${L-I},${re-I}h${ie+I*2}v${ae+I*2}h${-ie-I*2}z
|
|
2456
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return B(()=>{let n=t?.target??mj,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)&&GO(e))return!1;let n=_j(e.code,s);if(a.current.add(e[n]),gj(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=_j(e.code,s);gj(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 gj(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function _j(e,t){return t.includes(e)?`code`:`key`}var vj=()=>{let e=VA();return V(()=>({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=jO(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 EO(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=DO(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function yj(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)bj(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 bj(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 xj(e,t){return yj(e,t)}function Sj(e,t){return yj(e,t)}function Cj(e,t){return{id:e,type:`select`,selected:t}}function wj(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(Cj(a.id,e)))}return r}function Tj({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 Ej(e){return{id:e.id,type:`remove`}}var Dj=wO(`React Flow`,`https://reactflow.dev/`);function Oj(e,t,n={}){return ik(e,t,{...n,onError:n.onError??Dj})}var kj=e=>QD(e),Aj=e=>ZD(e);function jj(e){return Fe(e)}var Mj=typeof window<`u`?ye:B;function Nj(e){let[t,n]=U(BigInt(0)),[r]=U(()=>Pj(()=>n(e=>e+BigInt(1))));return Mj(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function Pj(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Fj=xe(null);function Ij({children:e}){let t=VA(),n=Nj(z(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=Tj({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=Nj(z(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(Tj({items:s,lookup:o}))},[])),i=V(()=>({nodeQueue:n,edgeQueue:r}),[]);return A(Fj.Provider,{value:i,children:e})}function Lj(){let e=ge(Fj);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Rj=e=>!!e.panZoom;function zj(){let e=vj(),t=VA(),n=Lj(),r=BA(Rj),i=V(()=>{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=kj(e)?e:n.get(e.id),a=i.parentId?IO(i.position,i.measured,i.parentId,n,r):i.position;return _O({...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&&kj(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&&Aj(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 cO({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Ej);o?.(f),c(e)}if(m){let e=d.map(Ej);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=SO(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=_O(s?r:a),l=xO(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=SO(e)?e:a(e);if(!r)return!1;let i=xO(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 tO(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??RO();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return V(()=>({...i,...e,viewportInitialized:r}),[r])}var Bj=e=>e.selected,Vj=typeof window<`u`?window:void 0;function Hj({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=VA(),{deleteElements:r}=zj(),i=hj(e,{actInsideInputWithModifier:!1}),a=hj(t,{target:Vj});B(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Bj),edges:e.filter(Bj)}),n.setState({nodesSelectionActive:!1})}},[i]),B(()=>{n.setState({multiSelectionActive:a})},[a])}function Uj(e){let t=VA();B(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=HO(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,BD.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 Wj={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Gj=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Kj({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=GD.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){let S=VA(),C=K(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=BA(Gj,IA),D=hj(p),O=K();Uj(C);let k=z(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),y||S.setState({transform:e})},[v,y]);return B(()=>{if(C.current){O.current=pA({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=O.current.getViewport();return S.setState({panZoom:O.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{O.current?.destroy()}}},[]),B(()=>{O.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:_,userSelectionActive:w,noWheelClassName:g,lib:T,onTransformChange:k,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,i,a,o,s,c,D,m,_,w,g,T,k,E,x,b]),A(`div`,{className:`react-flow__renderer`,ref:C,style:Wj,children:h})}var qj=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Jj(){let{userSelectionActive:e,userSelectionRect:t}=BA(qj,IA);return e&&t?A(`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 Yj=(e,t)=>n=>{n.target===t.current&&e?.(n)},Xj=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Zj({isSelecting:e,selectionKeyPressed:t,selectionMode:n=KD.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=K(0),_=VA(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=BA(Xj,IA),C=y&&(e||v),w=K(null),T=K(),E=K(new Set),D=K(new Set),O=K(!1),k=K(!1),j=K({x:0,y:0}),M=K(!1),N=e=>{k.current||O.current||_.getState().connection.inProgress?(k.current=!1,O.current=!1):(l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1}))},ee=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},te=d?e=>d(e):void 0,P=e=>{k.current&&=(e.stopPropagation(),!1)},ne=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(T.current=i?.getBoundingClientRect(),!T.current)return;let s=n.target===w.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:c,y:l}=qO(n.nativeEvent,T.current),u=EO({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function re(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}=DO(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(rO(a,m,i,n===KD.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)}}LO(h,E.current)||c(wj(a,E.current,!0)),LO(g,D.current)||l(wj(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!i||!T.current)return;let[e,t]=pO(j.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(F);return}let{x:t,y:n}=j.current;re(t,n),g.current=requestAnimationFrame(F)})}let I=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};B(()=>()=>I(),[]);let ie=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=qO(e.nativeEvent,T.current);j.current={x:o,y:c};let l=DO({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,M.current||=(F(),!0),re(o,c)},L=e=>{C?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&N?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),I()):e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0)},ae=e=>{e.target?.releasePointerCapture?.(e.pointerId),I()},oe=r===!0||Array.isArray(r)&&r.includes(0);return A(`div`,{className:rS([`react-flow__pane`,{draggable:oe,dragging:b,selection:e}]),onClick:C?void 0:Yj(N,w),onContextMenu:Yj(ee,w),onWheel:Yj(te,w),onPointerEnter:C?void 0:f,onPointerMove:C?ie:p,onPointerUp:L,onPointerCancel:C?ae:void 0,onPointerDownCapture:C?ne:void 0,onClickCapture:C?P:void 0,onPointerLeave:m,ref:w,style:Wj,children:[h,A(Jj,{})]})}function Qj({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);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,BD.error012(e))}function $j({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=VA(),[c,l]=U(!1),u=K();return B(()=>{if(!t)return u.current=Hk({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Qj({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),B(()=>{!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 eM=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function tM(){let e=VA();return z(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=eM(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=TO(t,i));let{position:a,positionAbsolute:s}=sO({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 nM=xe(null),rM=nM.Provider;nM.Consumer;var iM=()=>ge(nM),aM=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),oM=xe(null);function sM({children:e}){let t=BA(aM,IA);return A(oM.Provider,{value:t,children:e})}function cM(){let e=ge(oM);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var lM={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},uM=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return lM;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===WD.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function dM({type:e=`source`,position:t=$.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=VA(),_=iM(),{connectOnClick:v,noPanClassName:y,rfId:b}=cM(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=BA(uM(_,m,e),IA);_||g.getState().onError?.(`010`,BD.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(Oj(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=KO(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();Qk.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 A(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:rS([`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=UO(t.target),h=n||c,{connection:v,isValid:y}=Qk.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 fM=N(jj(dM));function pM({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return A(Te,{children:[e?.label,A(fM,{type:`source`,position:n,isConnectable:t})]})}function mM({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return A(Te,{children:[A(fM,{type:`target`,position:n,isConnectable:t}),e?.label,A(fM,{type:`source`,position:r,isConnectable:t})]})}function hM(){return null}function gM({data:e,isConnectable:t,targetPosition:n=$.Top}){return A(Te,{children:[A(fM,{type:`target`,position:n,isConnectable:t}),e?.label]})}var _M={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vM={input:pM,default:mM,output:gM,group:hM};function yM(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 bM=e=>{let{width:t,height:n,x:r,y:i}=nO(e.nodeLookup,{filter:e=>!!e.selected});return{width:CO(t)?t:null,height:CO(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 xM({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=VA(),{width:i,height:a,transformString:o,userSelectionActive:s}=BA(bM,IA),c=tM(),l=K(null);B(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if($j({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return A(`div`,{className:rS([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:A(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(_M,e.key)&&(e.preventDefault(),c({direction:_M[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var SM=typeof window<`u`?window:void 0,CM=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function wM({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:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:ee,disableKeyboardA11y:te,onViewportChange:P,isControlledViewport:ne}){let{nodesSelectionActive:re,userSelectionActive:F}=BA(CM,IA),I=hj(l,{target:SM}),ie=hj(h,{target:SM}),L=ie||w,ae=ie||b,oe=u&&L!==!0,se=I||F||oe;return Hj({deleteKeyCode:c,multiSelectionKeyCode:m}),A(Kj,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panActivationKeyPressed:ie,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!I&&L,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:j,noWheelClassName:N,noPanClassName:ee,onViewportChange:P,isControlledViewport:ne,paneClickDistance:s,selectionOnDrag:oe,children:A(Zj,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:L,autoPanOnSelection:T,isSelecting:!!se,selectionMode:d,selectionKeyPressed:I,paneClickDistance:s,selectionOnDrag:oe,children:[e,re&&A(xM,{onSelectionContextMenu:M,noPanClassName:ee,disableKeyboardA11y:te})]})})}wM.displayName=`FlowRenderer`;var TM=N(wM),EM=e=>t=>e?rO(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 DM(e){return BA(z(EM(e),[e]),IA)}var OM=e=>e.updateNodeInternals;function kM(){let e=BA(OM),[t]=U(()=>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 B(()=>()=>{t?.disconnect()},[t]),t}function AM({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=VA(),a=K(null),o=K(null),s=K(e.sourcePosition),c=K(e.targetPosition),l=K(t),u=n&&!!e.internals.handleBounds;return B(()=>{!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]),B(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),B(()=>{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 jM({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}=BA(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},IA),S=y.type||`default`,C=g?.[S]||vM[S];C===void 0&&(v?.(`003`,BD.error003(S)),S=`default`,C=g?.default||vM.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=VA(),k=FO(y),j=AM({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),M=$j({nodeRef:j,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),N=tM();if(y.hidden)return null;let ee=PO(y),te=yM(y),P=T||w||t||n||r||i,ne=n?e=>n(e,{...b.userNode}):void 0,re=r?e=>r(e,{...b.userNode}):void 0,F=i?e=>i(e,{...b.userNode}):void 0,I=a?e=>a(e,{...b.userNode}):void 0,ie=o?e=>o(e,{...b.userNode}):void 0,L=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Qj({id:e,store:O,nodeRef:j}),t&&t(n,{...b.userNode})},ae=t=>{if(!(GO(t.nativeEvent)||m)){if(HD.includes(t.key)&&T){let n=t.key===`Escape`;Qj({id:e,store:O,unselect:n,nodeRef:j})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(_M,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})}),N({direction:_M[t.key],factor:t.shiftKey?4:1})}}},oe=()=>{if(m||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(rO(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ee.width/2,y.position.y+ee.height/2,{zoom:t[2]}))};return A(`div`,{className:rS([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:M}]),ref:j,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:P?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ne,onMouseMove:re,onMouseLeave:F,onContextMenu:I,onClick:L,onDoubleClick:ie,onKeyDown:D?ae:void 0,tabIndex:D?0:void 0,onFocus:D?oe:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${WA}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:A(rM,{value:e,children:A(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:M,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ee})})})}var MM=N(jM),NM=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function PM(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=BA(NM,IA),a=DM(e.onlyRenderVisibleElements),o=kM();return A(`div`,{className:`react-flow__nodes`,style:Wj,children:a.map(a=>A(MM,{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))})}PM.displayName=`NodeRenderer`;var FM=N(PM);function IM(e){return BA(z(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&&tk({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),IA)}var LM=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return A(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},RM=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return A(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},zM={[YD.Arrow]:LM,[YD.ArrowClosed]:RM};function BM(e){let t=VA();return V(()=>Object.prototype.hasOwnProperty.call(zM,e)?zM[e]:(t.getState().onError?.(`009`,BD.error009(e)),null),[e])}var VM=({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=BM(t);return c?A(`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:A(c,{color:n,strokeWidth:o})}):null},HM=({defaultColor:e,rfId:t})=>{let n=BA(e=>e.edges),r=BA(e=>e.defaultEdgeOptions),i=V(()=>vk(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?A(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:A(`defs`,{children:i.map(e=>A(VM,{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};HM.displayName=`MarkerDefinitions`;var UM=N(HM);function WM({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]=U({x:1,y:0,width:0,height:0}),p=rS([`react-flow__edge-textwrapper`,l]),m=K(null);return B(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?A(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&A(`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}),A(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}WM.displayName=`EdgeText`;var GM=N(WM);function KM({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return A(Te,{children:[A(`path`,{...u,d:e,fill:`none`,className:rS([`react-flow__edge-path`,u.className])}),l?A(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&CO(t)&&CO(n)?A(GM,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function qM({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function JM({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=qM({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=qM({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=YO({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 YM(e){return N(({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]=JM({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return A(KM,{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 XM=YM({isInternal:!1}),ZM=YM({isInternal:!0});XM.displayName=`SimpleBezierEdge`,ZM.displayName=`SimpleBezierEdgeInternal`;function QM(e){return N(({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=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=dk({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 A(KM,{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 $M=QM({isInternal:!1}),eN=QM({isInternal:!0});$M.displayName=`SmoothStepEdge`,eN.displayName=`SmoothStepEdgeInternal`;function tN(e){return N(({id:t,...n})=>{let r=e.isInternal?void 0:t;return A($M,{...n,id:r,pathOptions:V(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var nN=tN({isInternal:!1}),rN=tN({isInternal:!0});nN.displayName=`StepEdge`,rN.displayName=`StepEdgeInternal`;function iN(e){return N(({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]=ak({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return A(KM,{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 aN=iN({isInternal:!1}),oN=iN({isInternal:!0});aN.displayName=`StraightEdge`,oN.displayName=`StraightEdgeInternal`;function sN(e){return N(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.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]=QO({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return A(KM,{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 cN=sN({isInternal:!1}),lN=sN({isInternal:!0});cN.displayName=`BezierEdge`,lN.displayName=`BezierEdgeInternal`;var uN={default:lN,straight:oN,step:rN,smoothstep:eN,simplebezier:ZM},dN={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},fN=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,pN=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,mN=`react-flow__edgeupdater`;function hN({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return A(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:rS([mN,`${mN}-${s}`]),cx:fN(t,r,e),cy:pN(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function gN({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=VA(),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`;Qk.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 A(Te,{children:[(e===!0||e===`source`)&&A(hN,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&A(hN,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function _N({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=BA(t=>t.edgeLookup.get(e)),b=BA(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||uN[x];S===void 0&&(_?.(`011`,BD.error011(x)),x=`default`,S=h?.default||uN.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=K(null),[D,O]=U(!1),[k,j]=U(!1),M=VA(),{zIndex:N=y.zIndex,sourceX:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:re,targetPosition:F}=BA(z(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return dN;let i=pk({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=ek({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||dN,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex,_]),IA),I=V(()=>y.markerStart?`url('#${_k(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ie=V(()=>y.markerEnd?`url('#${_k(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||ee===null||te===null||P===null||ne===null)return null;let L=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();T&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},ae=a?e=>{a(e,{...y})}:void 0,oe=o?e=>{o(e,{...y})}:void 0,se=s?e=>{s(e,{...y})}:void 0,ce=c?e=>{c(e,{...y})}:void 0,le=l?e=>{l(e,{...y})}:void 0;return A(`svg`,{style:{zIndex:N},children:A(`g`,{className:rS([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:L,onDoubleClick:ae,onContextMenu:oe,onMouseEnter:se,onMouseMove:ce,onMouseLeave:le,onKeyDown:C?t=>{if(!v&&HD.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.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?`${GA}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&A(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:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:re,targetPosition:F,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:I,markerEnd:ie,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&A(gN,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:ee,sourceY:te,targetX:P,targetY:ne,sourcePosition:re,targetPosition:F,setUpdateHover:O,setReconnecting:j})]})})}var vN=N(_N),yN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function bN({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}=BA(yN,IA),b=IM(t);return A(`div`,{className:`react-flow__edges`,children:[A(UM,{defaultColor:e,rfId:n}),b.map(e=>A(vN,{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))]})}bN.displayName=`EdgeRenderer`;var xN=N(bN),SN=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function CN({children:e}){let t=VA(),n=K(null),[r]=U(()=>t.getState().transform);return Mj(()=>{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=SN(r)))};return r(),t.subscribe(r)},[t]),A(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:SN(r)},children:e})}function wN(e){let t=zj(),n=K(!1);B(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var TN=e=>e.panZoom?.syncViewport;function EN(e){let t=BA(TN),n=VA();return B(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function DN(e){return e.connection.inProgress?{...e.connection,to:EO(e.connection.to,e.transform)}:{...e.connection}}function ON(e){return e?t=>e(DN(t)):DN}function kN(e){return BA(ON(e),IA)}var AN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function jN({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=BA(AN,IA);return a&&i&&c?A(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:A(`g`,{className:rS([`react-flow__connection`,BO(s)]),children:A(MN,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var MN=({style:e,type:t=JD.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}=kN();if(!i)return;if(n)return A(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:BO(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 JD.Bezier:[m]=QO(h);break;case JD.SimpleBezier:[m]=JM(h);break;case JD.Step:[m]=dk({...h,borderRadius:0});break;case JD.SmoothStep:[m]=dk(h);break;default:[m]=ak(h)}return A(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};MN.displayName=`ConnectionLine`;var NN={};function PN(e=NN){K(e),VA(),B(()=>{},[e])}function FN(){VA(),K(!1),B(()=>{},[])}function IN({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:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:ee,zoomOnPinch:te,panOnScroll:P,panOnScrollSpeed:ne,panOnScrollMode:re,zoomOnDoubleClick:F,panOnDrag:I,autoPanOnSelection:ie,onPaneClick:L,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:ue,nodeClickDistance:de,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:R,reconnectRadius:z,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,viewport:we,onViewportChange:Te,nodesDraggable:Ee}){return PN(e),PN(t),FN(),wN(n),EN(we),A(TM,{onPaneClick:L,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:ue,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ee,zoomOnPinch:te,zoomOnDoubleClick:F,panOnScroll:P,panOnScrollSpeed:ne,panOnScrollMode:re,panOnDrag:I,autoPanOnSelection:ie,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,onViewportChange:Te,isControlledViewport:!!we,children:A(CN,{children:[A(xN,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,onlyRenderVisibleElements:T,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:me,onEdgeMouseLeave:R,reconnectRadius:z,defaultMarkerColor:N,noPanClassName:be,disableKeyboardA11y:xe,rfId:Ce}),A(jN,{style:h,type:m,component:g,containerStyle:_}),A(`div`,{className:`react-flow__edgelabel-renderer`}),A(FM,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:de,onlyRenderVisibleElements:T,noPanClassName:be,noDragClassName:ve,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,nodesDraggable:Ee}),A(`div`,{className:`react-flow__viewport-portal`})]})})}IN.displayName=`GraphView`;var LN=N(IN),RN=wO(`React Flow`,`https://reactflow.dev/`),zN=({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??VD;Ik(h,g,_);let{nodesInitialized:x}=Dk(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=jO(nO(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:VD,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:WD.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:{...qD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:RN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:UD,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},BN=({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})=>FA((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 oO({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...zN({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,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Dk(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();Ik(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}=Nk(e,n,r,i,a,o,l);d&&(wk(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=hk(e,o.fromHandle,$.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=Mk(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(xj(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(Sj(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();t?i(e.map(e=>Cj(e,!0))):(i(wj(r,new Set([...e]),!0)),a(wj(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>Cj(e,!0))):(a(wj(n,new Set([...e]))),i(wj(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(Cj(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(Cj(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,Cj(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,Cj(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])&&(Dk(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 Pk({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:{...qD}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...zN()})}},Object.is);function VN({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]=U(()=>BN({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 A(RA,{value:m,children:A(Ij,{children:A(sM,{children:p})})})}function HN({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 ge(LA)?A(Te,{children:e}):A(VN,{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 UN={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function WN({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:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:ee,onSelectionStart:te,onSelectionEnd:P,onBeforeDelete:ne,connectionMode:re,connectionLineType:F=JD.Bezier,connectionLineStyle:I,connectionLineComponent:ie,connectionLineContainerStyle:L,deleteKeyCode:ae=`Backspace`,selectionKeyCode:oe=`Shift`,selectionOnDrag:se=!1,selectionMode:ce=KD.Full,panActivationKeyCode:le=`Space`,multiSelectionKeyCode:ue=MO()?`Meta`:`Control`,zoomActivationKeyCode:de=MO()?`Meta`:`Control`,snapToGrid:fe,snapGrid:pe,onlyRenderVisibleElements:me=!1,selectNodesOnDrag:R,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,nodeOrigin:ye=oj,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se=!0,defaultViewport:Ce=sj,minZoom:we=.5,maxZoom:Te=2,translateExtent:Ee=VD,preventScrolling:B=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:V=!0,panOnScroll:Ae=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Me=GD.Free,zoomOnDoubleClick:H=!0,panOnDrag:U=!0,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le=1,nodeClickDistance:K=0,children:Re,onReconnect:ze,onReconnectStart:Be,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe=10,onNodesChange:Je,onEdgesChange:Ye,noDragClassName:Xe=`nodrag`,noWheelClassName:Ze=`nowheel`,noPanClassName:Qe=`nopan`,fitView:$e,fitViewOptions:et,connectOnClick:tt,attributionPosition:nt,proOptions:rt,defaultEdgeOptions:it,elevateNodesOnSelect:at=!0,elevateEdgesOnSelect:ot=!1,disableKeyboardA11y:st=!1,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanOnSelection:ut=!0,autoPanSpeed:dt,connectionRadius:ft,isValidConnection:pt,onError:mt,style:ht,id:gt,nodeDragThreshold:_t,connectionDragThreshold:vt,viewport:yt,onViewportChange:bt,width:xt,height:St,colorMode:Ct=`light`,debug:wt,onScroll:Tt,ariaLabelConfig:Et,zIndexMode:Dt=`basic`,...Ot},kt){let At=gt||`1`,jt=pj(Ct),Mt=z(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Tt?.(e)},[Tt]);return A(`div`,{"data-testid":`rf__wrapper`,...Ot,onScroll:Mt,style:{...ht,...UN},ref:kt,className:rS([`react-flow`,i,jt]),id:gt,role:`application`,children:A(HN,{nodes:e,edges:t,width:xt,height:St,fitView:$e,fitViewOptions:et,minZoom:we,maxZoom:Te,nodeOrigin:ye,nodeExtent:De,zIndexMode:Dt,children:[A(dj,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se,elevateNodesOnSelect:at,elevateEdgesOnSelect:ot,minZoom:we,maxZoom:Te,nodeExtent:De,onNodesChange:Je,onEdgesChange:Ye,snapToGrid:fe,snapGrid:pe,connectionMode:re,translateExtent:Ee,connectOnClick:tt,defaultEdgeOptions:it,fitView:$e,fitViewOptions:et,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Qe,nodeOrigin:ye,rfId:At,autoPanOnConnect:ct,autoPanOnNodeDrag:lt,autoPanSpeed:dt,onError:mt,connectionRadius:ft,isValidConnection:pt,selectNodesOnDrag:R,nodeDragThreshold:_t,connectionDragThreshold:vt,onBeforeDelete:ne,debug:wt,ariaLabelConfig:Et,zIndexMode:Dt}),A(LN,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:F,connectionLineStyle:I,connectionLineComponent:ie,connectionLineContainerStyle:L,selectionKeyCode:oe,selectionOnDrag:se,selectionMode:ce,deleteKeyCode:ae,multiSelectionKeyCode:ue,panActivationKeyCode:le,zoomActivationKeyCode:de,onlyRenderVisibleElements:me,defaultViewport:Ce,translateExtent:Ee,minZoom:we,maxZoom:Te,preventScrolling:B,zoomOnScroll:ke,zoomOnPinch:V,zoomOnDoubleClick:H,panOnScroll:Ae,panOnScrollSpeed:je,panOnScrollMode:Me,panOnDrag:U,autoPanOnSelection:ut,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Le,nodeClickDistance:K,onSelectionContextMenu:ee,onSelectionStart:te,onSelectionEnd:P,onReconnect:ze,onReconnectStart:Be,onReconnectEnd:Ve,onEdgeContextMenu:He,onEdgeDoubleClick:Ue,onEdgeMouseEnter:We,onEdgeMouseMove:Ge,onEdgeMouseLeave:Ke,reconnectRadius:qe,defaultMarkerColor:Oe,noDragClassName:Xe,noWheelClassName:Ze,noPanClassName:Qe,rfId:At,disableKeyboardA11y:st,nodeExtent:De,viewport:yt,onViewportChange:bt,nodesDraggable:he}),A(aj,{onSelectionChange:k}),Re,A($A,{proOptions:rt,position:nt}),A(XA,{rfId:At,disableKeyboardA11y:st})]})})}var GN=jj(WN);BD.error014();function KN({dimensions:e,lineWidth:t,variant:n,className:r}){return A(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rS([`react-flow__background-pattern`,n,r])})}function qN({radius:e,className:t}){return A(`circle`,{cx:e,cy:e,r:e,className:rS([`react-flow__background-pattern`,`dots`,t])})}var JN;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(JN||={});var YN={[JN.Dots]:1,[JN.Lines]:1,[JN.Cross]:6},XN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ZN({id:e,variant:t=JN.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=K(null),{transform:f,patternId:p}=BA(XN,IA),m=r||YN[t],h=t===JN.Dots,g=t===JN.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]+x[0]/2,b[1]*f[2]+x[1]/2],C=`${p}${e||``}`;return A(`svg`,{className:rS([`react-flow__background`,l]),style:{...c,...Wj,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[A(`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?A(qN,{radius:y/2,className:u}):A(KN,{dimensions:x,lineWidth:i,variant:t,className:u})}),A(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}ZN.displayName=`Background`;var QN=N(ZN);function $N(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:A(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function eP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:A(`path`,{d:`M0 0h32v4.2H0z`})})}function tP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:A(`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 nP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:A(`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 rP(){return A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:A(`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 iP({children:e,className:t,...n}){return A(`button`,{type:`button`,className:rS([`react-flow__controls-button`,t]),...n,children:e})}var aP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function oP({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=VA(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=BA(aP,IA),{zoomIn:y,zoomOut:b,fitView:x}=zj();return A(ZA,{className:rS([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&A(Te,{children:[A(iP,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:A($N,{})}),A(iP,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:A(eP,{})})]}),n&&A(iP,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:A(tP,{})}),r&&A(iP,{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:A(h?rP:nP,{})}),u]})}oP.displayName=`Controls`,N(oP);function sP({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 A(`rect`,{className:rS([`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 cP=N(sP),lP=e=>e.nodes.map(e=>e.id),uP=e=>e instanceof Function?e:()=>e;function dP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=cP,onClick:o}){let s=BA(lP,IA),c=uP(t),l=uP(e),u=uP(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return A(Te,{children:s.map(e=>A(pP,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function fP({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}=BA(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}=PO(r);return{node:r,x:i,y:a,width:o,height:s}},IA);return!l||l.hidden||!FO(l)?null:A(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 pP=N(fP),mP=N(dP),hP=200,gP=150,_P=e=>!e.hidden,vP=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]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?yO(nO(e.nodeLookup,{filter:_P}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yP=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,bP=(e,t)=>yP(e.viewBB,t.viewBB)&&yP(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,xP=`react-flow__minimap-desc`;function SP({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=VA(),S=K(null),{boundingRect:C,panZoom:w,viewBB:T,rfId:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:j}=BA(vP,bP),M=e?.width??hP,N=e?.height??gP,ee=C.width/M,te=C.height/N,P=Math.max(ee,te),ne=P*M,re=P*N,F=b*P,I=C.x-(ne-C.width)/2-F,ie=C.y-(re-C.height)/2-F,L=ne+F*2,ae=re+F*2,oe=`${xP}-${E}`,se=K(0),ce=K();se.current=P,B(()=>{let e=x.getState().panZoom;if(S.current&&e)return ce.current=$k({domNode:S.current,panZoom:e,getTransform:()=>x.getState().transform,getViewScale:()=>se.current}),()=>{ce.current?.destroy()}},[w]),B(()=>{ce.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let le=p?e=>{let[t,n]=ce.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ue=z((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),de=m?ue:void 0,fe=_??j[`minimap.ariaLabel`];return A(ZA,{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*P: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:rS([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:A(`svg`,{width:M,height:N,viewBox:`${I} ${ie} ${L} ${ae}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":oe,ref:S,onClick:le,children:[fe&&A(`title`,{id:oe,children:fe}),A(mP,{onClick:de,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),A(`path`,{className:`react-flow__minimap-mask`,d:`M${I-F},${ie-F}h${L+F*2}v${ae+F*2}h${-L-F*2}z
|
|
2457
2457
|
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}SP.displayName=`MiniMap`,N(SP);var CP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,wP={[mA.Line]:`right`,[mA.Handle]:`bottom-right`};function TP({nodeId:e,position:t,variant:n=mA.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=iM(),y=typeof e==`string`?e:v,b=VA(),x=K(null),S=n===mA.Handle,C=BA(z(CP(S&&p),[S,p]),IA),w=K(null),T=t??wP[n];B(()=>{if(x.current&&y)return w.current||=TA({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=Mk([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...IO({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 A(`div`,{className:rS([`react-flow__resize-control`,`nodrag`,...E,n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}N(TP);var EP=40,DP=280,OP=98,kP=24,AP=e=>{let t=e.split(/\s+/).filter(Boolean),n=[],r=``;for(let e of t){let t=r?`${r} ${e}`:e;if(t.length<=kP)r=t;else{if(n.length===1)break;r&&n.push(r),r=e}}r&&n.length<2&&n.push(r);let i=n.slice(0,2);return i.join(` `).length<e.length&&i.length&&(i[i.length-1]=`${i[i.length-1].slice(0,23)}…`),i.length?i:[e.slice(0,kP)]},jP=(e,t)=>{let n=Lx(t.hover,e.edges),r=new Set(e.nodes.map(e=>e.uri)),i=e.nodes.map(e=>{let r=Rx(e);return{id:e.uri,type:`work`,position:{x:EP+e.column*DP,y:EP+e.row*OP},width:190,height:74,draggable:!1,selectable:!1,data:{uri:e.uri,title:r,lines:AP(r),meta:[qx(e.format),e.episodeCount?`${e.episodeCount} ep`:void 0].filter(Boolean).join(` · `),current:t.current.has(e.uri),lit:n.nodes.has(e.uri)}}}),a=e=>t.hover?.kind===`node`&&(e.from===t.hover.uri||e.to===t.hover.uri),o=e.chain.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>({id:`chain\u0000${e.from}\u0000${e.to}`,type:`chain`,source:e.from,target:e.to,data:{kind:`chain`,label:``,lit:a(e)}})),s=e.edges.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>{let t=Ix(e);return{id:t,type:`relation`,source:e.from,target:e.to,data:{kind:`relation`,label:Gx(e.relation).toUpperCase(),lit:n.edges.has(t)}}});return{nodes:i,edges:[...o,...s]}};G();var MP=O`
|
|
2458
2458
|
display: inline-flex;
|
|
2459
2459
|
align-items: center;
|
|
@@ -2878,7 +2878,7 @@ transition: max-height 0.3s ease-in-out;
|
|
|
2878
2878
|
.chip > label { margin: 0 -0.4rem; padding: 0 0.4rem; }
|
|
2879
2879
|
.chip .login-button { padding: 0 0.6rem; }
|
|
2880
2880
|
}
|
|
2881
|
-
`,oF={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10},sF=(e,t)=>{let n=t??`POINT_100`;return`${No(e,n)} / ${oF[n]??100}`},cF=`REMOVE`,lF=``,uF=({answer:e})=>H(`span`,{className:`logo`,style:e.tracker.color?{color:e.tracker.color}:void 0,children:e.tracker.icon?H(`img`,{src:e.tracker.icon,alt:``}):e.tracker.name.slice(0,1)}),dF=e=>e.state===`PAUSED`||e.state===`ERROR`?zo(e):void 0,fF=({answer:e,failed:t})=>t||e.state===`ERROR`?H(`span`,{className:`badge red`,"data-badge":`red`}):e.state===`PAUSED`?H(`span`,{className:`badge amber`,"data-badge":`amber`}):null,pF=({name:e,shown:t,scale:n,mixed:r,disabled:i,listed:a,removable:o,onChange:s,dots:c={},movie:l=!1,statuses:u,clearable:d})=>{let[f,p]=U(),m=K(void 0),h=K(()=>{}),g=t.total,_=()=>{if(clearTimeout(m.current),f===void 0)return;let e=Number(f);if(p(void 0),f.trim()===``||!Number.isFinite(e))return;let n=Math.max(0,Math.min(g??1/0,Math.floor(e)));n!==t.progress&&s({progress:n},!0)};h.current=_;let v=t.status===`COMPLETED`||t.progress>=(g??1);return W(`div`,{className:`group edit`,children:[H(rF,{score:t.score,scale:n,mixed:r,disabled:i||!a&&!t.status&&!t.progress,clearable:d,onPick:e=>s({score:e},!0)}),c.SCORE,W(`select`,{name:`${e}-status`,"aria-label":`Status`,value:t.status??``,disabled:i,onChange:e=>{let t=e.currentTarget.value;s(t===cF?{remove:!0}:{status:t},!0)},children:[t.status?void 0:H(`option`,{value:``,disabled:!0,children:`Add to list`}),Object.entries(Io).filter(([e])=>!u||u.includes(e)).map(([e,t])=>H(`option`,{value:e,children:t},e)),o?H(`option`,{value:cF,children:`Remove from list`}):void 0]}),c.STATUS,l?W(R,{children:[W(`button`,{type:`button`,className:`watched${v?` on`:``}`,"aria-pressed":v,disabled:i,onClick:()=>s(v?{progress:0,...t.status===`COMPLETED`?{status:`PLANNING`}:{}}:{progress:g??1,status:`COMPLETED`},!0),children:[H(me,{size:14,"aria-hidden":`true`}),`Watched`]}),c.PROGRESS]}):W(`span`,{className:`progress-field`,children:[H(`label`,{for:`${e}-progress`,className:`word`,children:`Episodes`}),H(`input`,{id:`${e}-progress`,type:`number`,inputMode:`numeric`,name:`${e}-progress`,min:0,max:g??void 0,disabled:i,value:f??t.progress,onInput:e=>{p(e.currentTarget.value),clearTimeout(m.current),m.current=setTimeout(()=>h.current(),1e3)},onBlur:_,onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&(clearTimeout(m.current),p(void 0),e.stopPropagation())}}),g?W(`span`,{className:`of`,children:[`/ `,g]}):void 0,c.PROGRESS,H(`button`,{type:`button`,className:`more`,"aria-label":`One episode more`,disabled:i||g!=null&&t.progress>=g,onClick:()=>s({progress:t.progress+1},!1),children:H(bh,{size:14,"aria-hidden":`true`})})]}),!l&&!i&&g&&t.progress===g&&t.status!==`COMPLETED`&&(!u||u.includes(`COMPLETED`))?H(`button`,{type:`button`,onClick:()=>s({status:`COMPLETED`},!0),children:`Mark completed`}):void 0,!l&&!i&&g&&t.status===`COMPLETED`&&t.progress<g?W(`button`,{type:`button`,onClick:()=>s({progress:g},!0),children:[`Set `,g,` / `,g]}):void 0]})},mF=({answer:e,className:t,busy:n,open:r,onOpen:i,card:a,children:o})=>{let s=K(null),{refs:c,floatingStyles:l,context:u}=Rm({open:r,onOpenChange:(e,t,n)=>{let r=c.floating.current?.contains(document.activeElement)??!1;(e||!r||n!==`hover`&&n!==`safe-polygon`)&&(e&&n===`hover`&&document.activeElement?.closest(`[data-card]`)||(!e&&r&&n===`escape-key`&&s.current?.focus(),i(e)))},placement:`bottom-end`,strategy:`fixed`,whileElementsMounted:Ve,middleware:[hp(8),_p({padding:8}),gp({padding:8})]}),{getReferenceProps:d}=Hm([Mm(u)]),{getReferenceProps:f,getFloatingProps:p}=Hm([Gp(u,{mouseOnly:!0,delay:{open:100},handleClose:$m()}),Bm(u),Im(u)]),m=e.tracker.name;return W(`span`,{ref:c.setReference,className:t,"data-chip":e.tracker.id,"aria-busy":n?`true`:void 0,...f(),children:[H(`button`,{ref:s,type:`button`,className:`logo-button`,"aria-label":`${m} entry`,"aria-haspopup":`dialog`,"aria-expanded":r,...d(),children:H(uF,{answer:e})}),o,r?H(`div`,{ref:c.setFloating,style:l,className:`card`,role:`dialog`,"aria-label":`${m} entry`,"data-card":e.tracker.id,...p(),children:a()}):void 0]})},hF=({tracking:e,episodeCount:t,movie:n=!1,watched:r,counted:i,onSaveFields:a,onRemove:o,signIns:s={},prefs:c,onPrefs:l})=>{let[,u]=U(0),[d,f]=U({}),[p,m]=U(``),[h,g]=U(new Set),[_,v]=U({}),[y,b]=U(),x=K({onSaveFields:a,onRemove:o,tracking:e,episodeCount:t});x.current={onSaveFields:a,onRemove:o,tracking:e,episodeCount:t};let S=V(()=>es({send:async(e,t)=>{let n=await(t.remove?x.current.onRemove([e]):x.current.onSaveFields([e],t));return n.find(t=>t.tracker===e)??n[0]??{outcome:`FAILED`,error:`The write did not reach the trackers`}},shape:(e,t)=>{let{tracking:n,episodeCount:r}=x.current,i=n?.answers.find(t=>t.tracker.id===e);return i&&Jo(i,t,{...Bo(n,r),...t})},steps:e=>Yo(x.current.tracking,e),onChange:e=>{if(u(e=>e+1),!e)return;let t=x.current.tracking?.answers.find(t=>t.tracker.id===e.tracker)?.tracker.name??e.tracker,n=e.outcome===`SAVED`||e.outcome===`QUEUED`;m(n?`${e.fields.remove?`Removed from`:`Saved to`} ${t}`:`${t} did not save: ${e.error??e.outcome.toLowerCase()}`),!n&&S.idle()&&f({})}}),[]),C=K(new Map),w=K(new Map),T=i??w.current,E=(e,t,n)=>{for(let[t,{progress:n}]of Object.entries(e))n!==void 0&&C.current.set(t,n);S.stage(e,t,n)};B(()=>{let e=()=>{document.visibilityState===`hidden`&&S.flush()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),S.flush()}},[]);let D=Bo(e,t),O=t=>{let n=e?.answers.find(e=>e.tracker.id===t);return n&&Ho(n,D.total)};B(()=>{f(e=>S.idle()?{}:Object.fromEntries(Object.entries(e).flatMap(([e,t])=>{let n=e===lF?D:O(e);return n?[[e,Wo(t,n)]]:[]})))},[e]);let k=Uo(D,d[lF]),A=r&&e&&k.status!==`COMPLETED`?ns({...r,movie:n},e,c.targets,t):{},j=e=>T.has(e)&&T.get(e)===r?.episode,M=e?.answers.filter(({tracker:{id:e}})=>A[e]&&!j(e)&&A[e].progress>(C.current.get(e)??0))??[];B(()=>{let t=M.filter(Ro);if(r&&e&&r.played>=.85)for(let t of e.answers){let e=Go(t,c.targets[t.tracker.id]);e.kind===`check`&&e.sendable&&T.set(t.tracker.id,r.episode)}t.length&&E(Object.fromEntries(t.map(({tracker:{id:e}})=>[e,A[e]])),!0)},[r,e,c]);let N=e?.answers.filter(e=>e.state!==`NO_ID`)??[];if(e!==void 0&&!N.length)return null;let ee=N.map(e=>({answer:e,target:Go(e,c.targets[e.tracker.id])})),te=ee.filter(({target:e})=>e.kind===`check`&&e.sendable).map(({answer:e})=>e),P=!te.length,ne=Zo(te.map(e=>e.tracker.scoreScale)),F=(e,t)=>{t.remove||f(n=>({...n,[e]:{...n[e],...t}}))},I=(e,t)=>{F(lF,e);let n={...k,...e},r={};for(let{answer:t,target:i}of ee){if(i.kind!==`check`||!i.checked)continue;let a=t.tracker.id;if(!Ro(t)){S.fail(a,e,zo(t));continue}let o=Jo(t,e,n);o&&(r[a]=o)}E(r,t)},L=(e,t,n)=>{let r=e.tracker.id,i=Uo(Ho(e,D.total),d[r]);F(r,t);let a=Jo(e,t,{...i,...t});a&&E({[r]:a},n,!0)},re=e=>{let t=S.state(e.tracker.id);return t.failed?.fields.remove&&e.state===`NOT_LISTED`?{...t,failed:void 0}:!t.failed&&M.includes(e)&&!Ro(e)?{...t,failed:{fields:A[e.tracker.id],error:zo(e)}}:t},ie=(e,t)=>{t||S.drop(e),!t&&!S.state(e).busy&&C.current.delete(e),l({...c,targets:{...c.targets,[e]:t}})},ae=e=>{let t=s[e.tracker.id],n=e.tracker.id;if(!t||h.has(n))return;let r=t();g(e=>new Set(e).add(n)),v(({[n]:e,...t})=>t),r.then(t=>iF[t]?.(e.tracker.name),e=>e instanceof Error?e.message:String(e)).then(e=>{e&&v(t=>({...t,[n]:e})),g(e=>{let t=new Set(e);return t.delete(n),t})})},oe=(e,t)=>H(`button`,{type:`button`,className:t,"aria-label":`Log in to ${e.tracker.name}`,disabled:!s[e.tracker.id]||h.has(e.tracker.id),onClick:()=>ae(e),children:h.has(e.tracker.id)?`Logging in`:`Log in`}),se=(e,t)=>{let r=e.tracker.id,i=e.tracker.name,a=W(`div`,{className:`head`,children:[H(uF,{answer:e}),i,e.tracker.account?H(`span`,{className:`account`,children:e.tracker.account}):void 0]});if(t.kind===`loading`)return a;if(t.kind===`login`)return W(R,{children:[a,H(`span`,{className:`why`,children:`Signed out`}),oe(e)]});if(t.kind===`cannot`)return W(R,{children:[a,W(`span`,{className:`why`,children:[i,` cannot track this media: `,t.reason]})]});let o=Ro(e),s=Ho(e,D.total),c=Zo([e.tracker.scoreScale]);return W(R,{children:[a,H(pF,{name:`card-${r}`,movie:n,statuses:e.tracker.statuses,clearable:e.tracker.canClearScore!==!1,shown:Uo(s,d[r]),scale:c.scale,mixed:!1,disabled:!o,listed:e.state===`LISTED`,removable:o&&qo(e),onChange:(t,n)=>L(e,t,n)}),o?void 0:H(`span`,{className:`why`,children:zo(e)})]})},ce=e=>N.filter(e=>e.state===`LISTED`).map(t=>`${t.tracker.name} ${e(t)??`none`}`).join(`, `),le=(e,t)=>D.differs.includes(e)?H(`span`,{className:`differs`,"data-differs":e,title:ce(t)}):void 0;return W(`section`,{css:aF,className:`tracking-compact`,"aria-label":`Quick tracking`,children:[W(`div`,{className:`row`,children:[H(pF,{name:`compact`,movie:n,shown:k,scale:ne?.scale??`POINT_100`,mixed:ne?.mixed??!1,disabled:P,listed:N.some(e=>e.state===`LISTED`),removable:te.some(qo),onChange:I,dots:{SCORE:le(`SCORE`,e=>Mo(e.entry?.score)?sF(e.entry.score,e.tracker.scoreScale):void 0),STATUS:le(`STATUS`,e=>e.entry?.status?Io[e.entry.status]:void 0),PROGRESS:le(`PROGRESS`,e=>e.entry?.progress==null?void 0:String(e.entry.progress))}}),W(`div`,{className:`group platforms`,children:[e===void 0?H(`span`,{className:`chip loading`,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`Trackers loading`,children:H(mh,{size:14,className:`spin`,"aria-hidden":`true`})})}):void 0,ee.map(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,i={answer:e,open:y===n,onOpen:e=>b(t=>e?n:t===n?void 0:t),card:()=>se(e,t)};if(t.kind===`loading`)return H(mF,{...i,className:`chip loading`,busy:!0,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`${r} loading`,children:H(mh,{size:14,className:`spin`,"aria-hidden":`true`})})},n);if(t.kind===`login`)return H(mF,{...i,className:`chip login`,children:oe(e,`login-button`)},n);if(t.kind===`cannot`)return H(mF,{...i,className:`chip cannot`,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`${r} cannot track this media: ${t.reason}`,children:H(vh,{size:14,"aria-hidden":`true`})})},n);let{busy:a,failed:o}=re(e),s=dF(e);return W(mF,{...i,className:`chip${t.checked?``:` off`}`,busy:a,children:[W(`label`,{children:[H(`input`,{type:`checkbox`,className:`sr-only`,name:`compact-target-${n}`,"aria-label":`Save to ${r}`,"aria-describedby":s?`compact-hint-${n}`:void 0,checked:t.checked,onChange:e=>ie(n,e.currentTarget.checked)}),H(`span`,{className:`slot`,children:a?H(mh,{size:14,className:`spin`,"aria-hidden":`true`}):t.checked?H(`span`,{className:`check`,children:H(me,{size:11,"aria-hidden":`true`})}):H(`span`,{className:`ring`})})]}),H(fF,{answer:e,failed:o}),s?H(`span`,{id:`compact-hint-${n}`,className:`sr-only`,children:s}):void 0]},n)})]})]}),H(`div`,{className:`notes`,children:ee.flatMap(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name;return[_[n]&&e.state===`SIGNED_OUT`?H(`div`,{className:`note`,"data-note":n,children:_[n]},`${n}-sign-in`):void 0,H(XP,{answer:e,state:re(e),queue:S},`${n}-problems`),t.kind===`check`&&t.sendable&&Ko(e,D.total)?W(`div`,{className:`note`,"data-note":n,children:[r,`: set progress on its card`]},`${n}-count`):void 0].filter(Boolean)})}),H(`div`,{className:`sr-only`,role:`status`,children:p})]})};G();var gF=iv(`
|
|
2881
|
+
`,oF={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10},sF=(e,t)=>{let n=t??`POINT_100`;return`${No(e,n)} / ${oF[n]??100}`},cF=`REMOVE`,lF=``,uF=({answer:e})=>H(`span`,{className:`logo`,style:e.tracker.color?{color:e.tracker.color}:void 0,children:e.tracker.icon?H(`img`,{src:e.tracker.icon,alt:``}):e.tracker.name.slice(0,1)}),dF=e=>e.state===`PAUSED`||e.state===`ERROR`?zo(e):void 0,fF=({answer:e,failed:t})=>t||e.state===`ERROR`?H(`span`,{className:`badge red`,"data-badge":`red`}):e.state===`PAUSED`?H(`span`,{className:`badge amber`,"data-badge":`amber`}):null,pF=({name:e,shown:t,scale:n,mixed:r,disabled:i,listed:a,removable:o,onChange:s,dots:c={},movie:l=!1,statuses:u,clearable:d})=>{let[f,p]=U(),m=K(void 0),h=K(()=>{}),g=t.total,_=()=>{if(clearTimeout(m.current),f===void 0)return;let e=Number(f);if(p(void 0),f.trim()===``||!Number.isFinite(e))return;let n=Math.max(0,Math.min(g??1/0,Math.floor(e)));n!==t.progress&&s({progress:n},!0)};h.current=_;let v=t.status===`COMPLETED`||t.progress>=(g??1);return W(`div`,{className:`group edit`,children:[H(rF,{score:t.score,scale:n,mixed:r,disabled:i||!a&&!t.status&&!t.progress,clearable:d,onPick:e=>s({score:e},!0)}),c.SCORE,W(`select`,{name:`${e}-status`,"aria-label":`Status`,value:t.status??``,disabled:i,onChange:e=>{let t=e.currentTarget.value;s(t===cF?{remove:!0}:{status:t},!0)},children:[t.status?void 0:H(`option`,{value:``,disabled:!0,children:`Add to list`}),Object.entries(Io).filter(([e])=>!u||u.includes(e)).map(([e,t])=>H(`option`,{value:e,children:t},e)),o?H(`option`,{value:cF,children:`Remove from list`}):void 0]}),c.STATUS,l?W(R,{children:[W(`button`,{type:`button`,className:`watched${v?` on`:``}`,"aria-pressed":v,disabled:i,onClick:()=>s(v?{progress:0,...t.status===`COMPLETED`?{status:`PLANNING`}:{}}:{progress:g??1,status:`COMPLETED`},!0),children:[H(me,{size:14,"aria-hidden":`true`}),`Watched`]}),c.PROGRESS]}):W(`span`,{className:`progress-field`,children:[H(`label`,{for:`${e}-progress`,className:`word`,children:`Episodes`}),H(`input`,{id:`${e}-progress`,type:`number`,inputMode:`numeric`,name:`${e}-progress`,min:0,max:g??void 0,disabled:i,value:f??t.progress,onInput:e=>{p(e.currentTarget.value),clearTimeout(m.current),m.current=setTimeout(()=>h.current(),1e3)},onBlur:_,onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&(clearTimeout(m.current),p(void 0),e.stopPropagation())}}),g?W(`span`,{className:`of`,children:[`/ `,g]}):void 0,c.PROGRESS,H(`button`,{type:`button`,className:`more`,"aria-label":`One episode more`,disabled:i||g!=null&&t.progress>=g,onClick:()=>s({progress:t.progress+1},!1),children:H(bh,{size:14,"aria-hidden":`true`})})]}),!l&&!i&&g&&t.progress===g&&t.status!==`COMPLETED`&&(!u||u.includes(`COMPLETED`))?H(`button`,{type:`button`,onClick:()=>s({status:`COMPLETED`},!0),children:`Mark completed`}):void 0,!l&&!i&&g&&t.status===`COMPLETED`&&t.progress<g?W(`button`,{type:`button`,onClick:()=>s({progress:g},!0),children:[`Set `,g,` / `,g]}):void 0]})},mF=({answer:e,className:t,busy:n,open:r,onOpen:i,card:a,children:o})=>{let s=K(null),{refs:c,floatingStyles:l,context:u}=Rm({open:r,onOpenChange:(e,t,n)=>{let r=c.floating.current?.contains(document.activeElement)??!1;(e||!r||n!==`hover`&&n!==`safe-polygon`)&&(e&&n===`hover`&&document.activeElement?.closest(`[data-card]`)||(!e&&r&&n===`escape-key`&&s.current?.focus(),i(e)))},placement:`bottom-end`,strategy:`fixed`,whileElementsMounted:Ve,middleware:[hp(8),_p({padding:8}),gp({padding:8})]}),{getReferenceProps:d}=Hm([Mm(u)]),{getReferenceProps:f,getFloatingProps:p}=Hm([Gp(u,{mouseOnly:!0,delay:{open:100},handleClose:$m()}),Bm(u),Im(u)]),m=e.tracker.name;return W(`span`,{ref:c.setReference,className:t,"data-chip":e.tracker.id,"aria-busy":n?`true`:void 0,...f(),children:[H(`button`,{ref:s,type:`button`,className:`logo-button`,"aria-label":`${m} entry`,"aria-haspopup":`dialog`,"aria-expanded":r,...d(),children:H(uF,{answer:e})}),o,r?H(`div`,{ref:c.setFloating,style:l,className:`card`,role:`dialog`,"aria-label":`${m} entry`,"data-card":e.tracker.id,...p(),children:a()}):void 0]})},hF=({tracking:e,episodeCount:t,movie:n=!1,watched:r,counted:i,onSaveFields:a,onRemove:o,signIns:s={},prefs:c,onPrefs:l})=>{let[,u]=U(0),[d,f]=U({}),[p,m]=U(``),[h,g]=U(new Set),[_,v]=U({}),[y,b]=U(),x=K({onSaveFields:a,onRemove:o,tracking:e,episodeCount:t});x.current={onSaveFields:a,onRemove:o,tracking:e,episodeCount:t};let S=V(()=>es({send:async(e,t)=>{let n=await(t.remove?x.current.onRemove([e]):x.current.onSaveFields([e],t));return n.find(t=>t.tracker===e)??n[0]??{outcome:`FAILED`,error:`The write did not reach the trackers`}},shape:(e,t)=>{let{tracking:n,episodeCount:r}=x.current,i=n?.answers.find(t=>t.tracker.id===e);return i&&Jo(i,t,{...Bo(n,r),...t})},steps:e=>Yo(x.current.tracking,e),onChange:e=>{if(u(e=>e+1),!e)return;let t=x.current.tracking?.answers.find(t=>t.tracker.id===e.tracker)?.tracker.name??e.tracker,n=e.outcome===`SAVED`||e.outcome===`QUEUED`;m(n?`${e.fields.remove?`Removed from`:`Saved to`} ${t}`:`${t} did not save: ${e.error??e.outcome.toLowerCase()}`),!n&&S.idle()&&f({})}}),[]),C=K(new Map),w=K(new Map),T=i??w.current,E=(e,t,n)=>{for(let[t,{progress:n}]of Object.entries(e))n!==void 0&&C.current.set(t,n);S.stage(e,t,n)};B(()=>{let e=()=>{document.visibilityState===`hidden`&&S.flush()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),S.flush()}},[]);let D=Bo(e,t),O=t=>{let n=e?.answers.find(e=>e.tracker.id===t);return n&&Ho(n,D.total)};B(()=>{f(e=>S.idle()?{}:Object.fromEntries(Object.entries(e).flatMap(([e,t])=>{let n=e===lF?D:O(e);return n?[[e,Wo(t,n)]]:[]})))},[e]);let k=Uo(D,d[lF]),A=r&&e&&k.status!==`COMPLETED`?ns({...r,movie:n},e,c.targets,t):{},j=e=>T.has(e)&&T.get(e)===r?.episode,M=e?.answers.filter(({tracker:{id:e}})=>A[e]&&!j(e)&&A[e].progress>(C.current.get(e)??0))??[];B(()=>{let t=M.filter(Ro);if(r&&e&&r.played>=.85)for(let t of e.answers){let e=Go(t,c.targets[t.tracker.id]);e.kind===`check`&&e.sendable&&T.set(t.tracker.id,r.episode)}t.length&&E(Object.fromEntries(t.map(({tracker:{id:e}})=>[e,A[e]])),!0)},[r,e,c]);let N=e?.answers.filter(e=>e.state!==`NO_ID`)??[];if(e!==void 0&&!N.length)return null;let ee=N.map(e=>({answer:e,target:Go(e,c.targets[e.tracker.id])})),te=ee.filter(({target:e})=>e.kind===`check`&&e.sendable).map(({answer:e})=>e),P=!te.length,ne=Zo(te.map(e=>e.tracker.scoreScale)),re=(e,t)=>{t.remove||f(n=>({...n,[e]:{...n[e],...t}}))},F=(e,t)=>{re(lF,e);let n={...k,...e},r={};for(let{answer:t,target:i}of ee){if(i.kind!==`check`||!i.checked)continue;let a=t.tracker.id;if(!Ro(t)){S.fail(a,e,zo(t));continue}let o=Jo(t,e,n);o&&(r[a]=o)}E(r,t)},I=(e,t,n)=>{let r=e.tracker.id,i=Uo(Ho(e,D.total),d[r]);re(r,t);let a=Jo(e,t,{...i,...t});a&&E({[r]:a},n,!0)},ie=e=>{let t=S.state(e.tracker.id);return t.failed?.fields.remove&&e.state===`NOT_LISTED`?{...t,failed:void 0}:!t.failed&&M.includes(e)&&!Ro(e)?{...t,failed:{fields:A[e.tracker.id],error:zo(e)}}:t},L=(e,t)=>{t||S.drop(e),!t&&!S.state(e).busy&&C.current.delete(e),l({...c,targets:{...c.targets,[e]:t}})},ae=e=>{let t=s[e.tracker.id],n=e.tracker.id;if(!t||h.has(n))return;let r=t();g(e=>new Set(e).add(n)),v(({[n]:e,...t})=>t),r.then(t=>iF[t]?.(e.tracker.name),e=>e instanceof Error?e.message:String(e)).then(e=>{e&&v(t=>({...t,[n]:e})),g(e=>{let t=new Set(e);return t.delete(n),t})})},oe=(e,t)=>H(`button`,{type:`button`,className:t,"aria-label":`Log in to ${e.tracker.name}`,disabled:!s[e.tracker.id]||h.has(e.tracker.id),onClick:()=>ae(e),children:h.has(e.tracker.id)?`Logging in`:`Log in`}),se=(e,t)=>{let r=e.tracker.id,i=e.tracker.name,a=W(`div`,{className:`head`,children:[H(uF,{answer:e}),i,e.tracker.account?H(`span`,{className:`account`,children:e.tracker.account}):void 0]});if(t.kind===`loading`)return a;if(t.kind===`login`)return W(R,{children:[a,H(`span`,{className:`why`,children:`Signed out`}),oe(e)]});if(t.kind===`cannot`)return W(R,{children:[a,W(`span`,{className:`why`,children:[i,` cannot track this media: `,t.reason]})]});let o=Ro(e),s=Ho(e,D.total),c=Zo([e.tracker.scoreScale]);return W(R,{children:[a,H(pF,{name:`card-${r}`,movie:n,statuses:e.tracker.statuses,clearable:e.tracker.canClearScore!==!1,shown:Uo(s,d[r]),scale:c.scale,mixed:!1,disabled:!o,listed:e.state===`LISTED`,removable:o&&qo(e),onChange:(t,n)=>I(e,t,n)}),o?void 0:H(`span`,{className:`why`,children:zo(e)})]})},ce=e=>N.filter(e=>e.state===`LISTED`).map(t=>`${t.tracker.name} ${e(t)??`none`}`).join(`, `),le=(e,t)=>D.differs.includes(e)?H(`span`,{className:`differs`,"data-differs":e,title:ce(t)}):void 0;return W(`section`,{css:aF,className:`tracking-compact`,"aria-label":`Quick tracking`,children:[W(`div`,{className:`row`,children:[H(pF,{name:`compact`,movie:n,shown:k,scale:ne?.scale??`POINT_100`,mixed:ne?.mixed??!1,disabled:P,listed:N.some(e=>e.state===`LISTED`),removable:te.some(qo),onChange:F,dots:{SCORE:le(`SCORE`,e=>Mo(e.entry?.score)?sF(e.entry.score,e.tracker.scoreScale):void 0),STATUS:le(`STATUS`,e=>e.entry?.status?Io[e.entry.status]:void 0),PROGRESS:le(`PROGRESS`,e=>e.entry?.progress==null?void 0:String(e.entry.progress))}}),W(`div`,{className:`group platforms`,children:[e===void 0?H(`span`,{className:`chip loading`,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`Trackers loading`,children:H(mh,{size:14,className:`spin`,"aria-hidden":`true`})})}):void 0,ee.map(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,i={answer:e,open:y===n,onOpen:e=>b(t=>e?n:t===n?void 0:t),card:()=>se(e,t)};if(t.kind===`loading`)return H(mF,{...i,className:`chip loading`,busy:!0,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`${r} loading`,children:H(mh,{size:14,className:`spin`,"aria-hidden":`true`})})},n);if(t.kind===`login`)return H(mF,{...i,className:`chip login`,children:oe(e,`login-button`)},n);if(t.kind===`cannot`)return H(mF,{...i,className:`chip cannot`,children:H(`span`,{className:`slot`,role:`img`,"aria-label":`${r} cannot track this media: ${t.reason}`,children:H(vh,{size:14,"aria-hidden":`true`})})},n);let{busy:a,failed:o}=ie(e),s=dF(e);return W(mF,{...i,className:`chip${t.checked?``:` off`}`,busy:a,children:[W(`label`,{children:[H(`input`,{type:`checkbox`,className:`sr-only`,name:`compact-target-${n}`,"aria-label":`Save to ${r}`,"aria-describedby":s?`compact-hint-${n}`:void 0,checked:t.checked,onChange:e=>L(n,e.currentTarget.checked)}),H(`span`,{className:`slot`,children:a?H(mh,{size:14,className:`spin`,"aria-hidden":`true`}):t.checked?H(`span`,{className:`check`,children:H(me,{size:11,"aria-hidden":`true`})}):H(`span`,{className:`ring`})})]}),H(fF,{answer:e,failed:o}),s?H(`span`,{id:`compact-hint-${n}`,className:`sr-only`,children:s}):void 0]},n)})]})]}),H(`div`,{className:`notes`,children:ee.flatMap(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name;return[_[n]&&e.state===`SIGNED_OUT`?H(`div`,{className:`note`,"data-note":n,children:_[n]},`${n}-sign-in`):void 0,H(XP,{answer:e,state:ie(e),queue:S},`${n}-problems`),t.kind===`check`&&t.sendable&&Ko(e,D.total)?W(`div`,{className:`note`,"data-note":n,children:[r,`: set progress on its card`]},`${n}-count`):void 0].filter(Boolean)})}),H(`div`,{className:`sr-only`,role:`status`,children:p})]})};G();var gF=iv(`
|
|
2882
2882
|
mutation DeleteListEntry($input: DeleteListEntryInput!) {
|
|
2883
2883
|
deleteListEntry(input: $input) {
|
|
2884
2884
|
tracker
|
|
@@ -2916,7 +2916,9 @@ transition: max-height 0.3s ease-in-out;
|
|
|
2916
2916
|
white-space: nowrap;
|
|
2917
2917
|
|
|
2918
2918
|
&:hover { border-color: rgba(255, 255, 255, 0.5); }
|
|
2919
|
-
`,jF=({uri:e})=>{let t=Ox(Nu());return!e||!Bt(`?${t}`,`http://d/`)?null:H(Bu,{css:AF,"data-trace-link":e,href:Sx({uri:e,search:t}),title:`what the graph holds for this uri`,children:`graph trace`})}
|
|
2919
|
+
`,jF=({uri:e})=>{let t=Ox(Nu());return!e||!Bt(`?${t}`,`http://d/`)?null:H(Bu,{css:AF,"data-trace-link":e,href:Sx({uri:e,search:t}),title:`what the graph holds for this uri`,children:`graph trace`})};function MF(e,t){this.v=e,this.k=t}function NF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function PF(e){if(Array.isArray(e))return e}function FF(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function IF(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2920
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LF(e,t){return PF(e)||FF(e,t)||RF(e,t)||IF()}function RF(e,t){if(e){if(typeof e==`string`)return NF(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?NF(e,t):void 0}}function zF(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof MF;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}zF.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},zF.prototype.next=function(e){return this._invoke(`next`,e)},zF.prototype.throw=function(e){return this._invoke(`throw`,e)},zF.prototype.return=function(e){return this._invoke(`return`,e)};var BF=Object.entries,VF=Object.setPrototypeOf,HF=Object.isFrozen,UF=Object.getPrototypeOf,WF=Object.getOwnPropertyDescriptor,GF=Object.freeze,KF=Object.seal,qF=Object.create,JF=typeof Reflect<`u`&&Reflect,YF=JF.apply,XF=JF.construct;GF||=function(e){return e},KF||=function(e){return e},YF||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},XF||=function(e){return new e(...[...arguments].slice(1))};var ZF=xI(Array.prototype.forEach);Array.prototype.indexOf;var QF=xI(Array.prototype.lastIndexOf),$F=xI(Array.prototype.pop),eI=xI(Array.prototype.push),tI=xI(Array.prototype.slice),nI=xI(Array.prototype.splice),rI=Array.isArray,iI=SI(Set),aI=xI(Set.prototype.add),oI=xI(Set.prototype.has),sI=xI(String.prototype.toLowerCase),cI=xI(String.prototype.toString),lI=xI(String.prototype.match),uI=xI(String.prototype.replace),dI=xI(String.prototype.indexOf),fI=xI(String.prototype.trim),pI=xI(Number.prototype.toString),mI=xI(Boolean.prototype.toString),hI=typeof BigInt>`u`?null:xI(BigInt.prototype.toString),gI=typeof Symbol>`u`?null:xI(Symbol.prototype.toString),_I=xI(Object.prototype.hasOwnProperty),vI=xI(Object.prototype.toString),yI=xI(RegExp.prototype.test),bI=SI(TypeError);function xI(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return YF(e,t,n)}}function SI(e){return function(){return XF(e,[...arguments])}}function CI(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sI;if(VF&&VF(e,null),!rI(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(HF(t)||(t[r]=e),i=e)}e[i]=!0}return e}function wI(e){for(let t=0;t<e.length;t++)_I(e,t)||(e[t]=null);return e}function TI(e){let t=qF(null);for(let r of BF(e)){var n=LF(r,2);let i=n[0],a=n[1];_I(e,i)&&(t[i]=rI(a)?wI(a):a&&typeof a==`object`&&a.constructor===Object?TI(a):a)}return t}function EI(e){switch(typeof e){case`string`:return e;case`number`:return pI(e);case`boolean`:return mI(e);case`bigint`:return hI?hI(e):`0`;case`symbol`:return gI?gI(e):`Symbol()`;case`undefined`:return vI(e);case`function`:case`object`:{if(e===null)return vI(e);let t=e,n=DI(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:vI(e)}return vI(e)}default:return vI(e)}}function DI(e,t){for(;e!==null;){let n=WF(e,t);if(n){if(n.get)return xI(n.get);if(typeof n.value==`function`)return xI(n.value)}e=UF(e)}function n(){return null}return n}function OI(e,t){for(;e!==null;){let n=WF(e,t);if(n)return n.get?xI(n.get):null;e=UF(e)}return null}function kI(e){try{return yI(e,``),!0}catch{return!1}}var AI=GF(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),jI=GF(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),MI=GF([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),NI=GF([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),PI=GF(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),FI=GF([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),II=GF([`#text`]),LI=GF(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),RI=GF(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),zI=GF(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),BI=GF([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),VI=KF(/{{[\w\W]*|^[\w\W]*}}/g),HI=KF(/<%[\w\W]*|^[\w\W]*%>/g),UI=KF(/\${[\w\W]*/g),WI=KF(/^data-[\-\w.\u00B7-\uFFFF]+$/),GI=KF(/^aria-[\-\w]+$/),KI=KF(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qI=KF(/^(?:\w+script|data):/i),JI=KF(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),YI=KF(/^html$/i),XI=KF(/^[a-z][.\w]*(-[.\w]+)+$/i),ZI=KF(/<[/\w!]/g),QI=KF(/<[/\w]/g),$I=KF(/<\/no(script|embed|frames)/i),eL=KF(/\/>/i),tL={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nL=GF(CI({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),rL=function(){return typeof window>`u`?null:window},iL=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},aL=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},oL=function(e,t,n,r){return _I(e,t)&&rI(e[t])?CI(r.base?TI(r.base):{},e[t],r.transform):n},sL=function(e,t,n){let r=_I(e,t)?e[t]:void 0;return r&&typeof r==`object`?TI(r):n()};function cL(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rL(),t=e=>cL(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==tL.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=DI(d,`cloneNode`),p=DI(d,`remove`),m=DI(d,`removeAttributeNode`),h=DI(d,`nextSibling`),g=DI(d,`childNodes`),_=DI(d,`parentNode`),v=DI(d,`shadowRoot`),y=DI(d,`attributes`),b=o&&o.prototype?DI(o.prototype,`nodeType`):null,x=o&&o.prototype?DI(o.prototype,`nodeName`):null,S=o&&o.prototype?DI(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName},T=OI(d,`namespaceURI`),E=function(e){return T?T(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let D,O=``,k,A=!1,j=0,M=function(){if(j>0)throw bI(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},N=function(e){M(),j++;try{return D.createHTML(e)}finally{j--}},ee=function(e){M(),j++;try{return D.createScriptURL(e)}finally{j--}},te=function(){return A||=(k=iL(u,i),!0),k},P=n,ne=P.implementation,re=P.createNodeIterator,F=P.createDocumentFragment,I=P.getElementsByTagName,ie=r.importNode,L=aL();t.isSupported=typeof BF==`function`&&typeof _==`function`&&ne&&ne.createHTMLDocument!==void 0;let ae=VI,oe=HI,se=UI,ce=WI,le=GI,ue=qI,de=JI,fe=XI,pe=KI,me=null,R=CI({},[...AI,...jI,...MI,...PI,...II]),z=null,he=CI({},[...LI,...RI,...zI,...BI]),ge=Object.seal(qF(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,ve=null,ye=Object.seal(qF(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),be=!0,xe=!0,Se=!1,Ce=!0,we=!1,Te=!0,Ee=!1,B=!1,De=null,Oe=null,ke=!1,V=!1,Ae=!1,je=!1,Me=!0,H=!1,U=`user-content-`,Ne=!0,Pe=!1,Fe=null,Ie={},W=null,G=CI({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Le=null,K=CI({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Re=null,ze=CI({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Be=`http://www.w3.org/1998/Math/MathML`,Ve=`http://www.w3.org/2000/svg`,He=`http://www.w3.org/1999/xhtml`,Ue=He,We=!1,Ge=null,Ke=CI({},[Be,Ve,He],cI),qe=GF([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=CI({},qe),Ye=GF([`annotation-xml`]),Xe=CI({},Ye),Ze=CI({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],et=null,tt=null,nt=n.createElement(`form`),rt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===e)return;e&&typeof e==`object`||(e={}),e=TI(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,et=Qe===`application/xhtml+xml`?cI:sI,me=oL(e,`ALLOWED_TAGS`,R,{transform:et}),z=oL(e,`ALLOWED_ATTR`,he,{transform:et}),Ge=oL(e,`ALLOWED_NAMESPACES`,Ke,{transform:cI}),Re=oL(e,`ADD_URI_SAFE_ATTR`,ze,{transform:et,base:ze}),Le=oL(e,`ADD_DATA_URI_TAGS`,K,{transform:et,base:K}),W=oL(e,`FORBID_CONTENTS`,G,{transform:et}),_e=oL(e,`FORBID_TAGS`,TI({}),{transform:et}),ve=oL(e,`FORBID_ATTR`,TI({}),{transform:et}),Ie=_I(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?TI(e.USE_PROFILES):e.USE_PROFILES:!1,be=e.ALLOW_ARIA_ATTR!==!1,xe=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=e.SAFE_FOR_TEMPLATES||!1,Te=e.SAFE_FOR_XML!==!1,Ee=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,je=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Me=e.SANITIZE_DOM!==!1,H=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,Pe=e.IN_PLACE||!1,pe=kI(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:KI,Ue=typeof e.NAMESPACE==`string`?e.NAMESPACE:He,Je=sL(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>CI({},qe)),Xe=sL(e,`HTML_INTEGRATION_POINTS`,()=>CI({},Ye));let t=sL(e,`CUSTOM_ELEMENT_HANDLING`,()=>qF(null));if(ge=qF(null),_I(t,`tagNameCheck`)&&rt(t.tagNameCheck)&&(ge.tagNameCheck=t.tagNameCheck),_I(t,`attributeNameCheck`)&&rt(t.attributeNameCheck)&&(ge.attributeNameCheck=t.attributeNameCheck),_I(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ge.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),KF(ge),we&&(xe=!1),Ae&&(V=!0),Ie&&(me=CI({},II),z=qF(null),Ie.html===!0&&(CI(me,AI),CI(z,LI)),Ie.svg===!0&&(CI(me,jI),CI(z,RI),CI(z,BI)),Ie.svgFilters===!0&&(CI(me,MI),CI(z,RI),CI(z,BI)),Ie.mathMl===!0&&(CI(me,PI),CI(z,zI),CI(z,BI))),ye.tagCheck=null,ye.attributeCheck=null,_I(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ye.tagCheck=e.ADD_TAGS:rI(e.ADD_TAGS)&&(me===R&&(me=TI(me)),CI(me,e.ADD_TAGS,et))),_I(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ye.attributeCheck=e.ADD_ATTR:rI(e.ADD_ATTR)&&(z===he&&(z=TI(z)),CI(z,e.ADD_ATTR,et))),_I(e,`ADD_FORBID_CONTENTS`)&&rI(e.ADD_FORBID_CONTENTS)&&(W===G&&(W=TI(W)),CI(W,e.ADD_FORBID_CONTENTS,et)),Ne&&(me[`#text`]=!0),Ee&&CI(me,[`html`,`head`,`body`]),me.table&&(CI(me,[`tbody`]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw bI(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw bI(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=D;D=e.TRUSTED_TYPES_POLICY;try{O=N(``)}catch(e){throw D=t,e}}else e.TRUSTED_TYPES_POLICY===null?(D=void 0,O=``):(D===void 0&&(D=te()),D&&typeof O==`string`&&(O=N(``)));GF&&GF(e),tt=e},at=CI({},[...jI,...MI,...NI]),ot=CI({},[...PI,...FI]),st=function(e,t,n){return t.namespaceURI===He?e===`svg`:t.namespaceURI===Be?e===`svg`&&(n===`annotation-xml`||Je[n]):!!at[e]},ct=function(e,t,n){return t.namespaceURI===He?e===`math`:t.namespaceURI===Ve?e===`math`&&Xe[n]:!!ot[e]},lt=function(e,t,n){return t.namespaceURI===Ve&&!Xe[n]||t.namespaceURI===Be&&!Je[n]?!1:!ot[e]&&(Ze[e]||!at[e])},ut=function(e){let t=E(e),n=sI(w(e)),r=_(e),i,a;return r&&C(r)===tL.element?(i={namespaceURI:E(r)},a=sI(w(r))):(i={namespaceURI:Ue},a=`template`),Ge[t]?t===Ve?st(n,i,a):t===Be?ct(n,i,a):t===He?lt(n,i,a):!!(Qe===`application/xhtml+xml`&&Ge[t]):!1},dt=function(e){eI(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw bI(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ft=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},pt=function(e){_t(e);let t=g(e);t&&ZF(tI(t),e=>{try{p(e)}catch{}});let n=C(e)===tL.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&ft(e,r,i)}},mt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}eI(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(V||Ae)try{dt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},ht=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||z[et(i)]||ft(e,r,i)}},gt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===tL.element){let t=v(e);Mt(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},_t=function(e){gt(e,e=>{C(e)===tL.element&&ht(e)})},vt=function(e){let t=[];return gt(e,e=>{t.push(e)},!0),t},yt=function(e,t){let n=iI();ZF(vt(e),e=>{C(e)===tL.element&&aI(n,e)}),ZF(t,e=>{C(e)===tL.element&&!oI(n,e)&&ht(e)})},bt=function(e,n){let r=!1;return ZF(t.removed,t=>{t.element&&(r||=t.element===e,_t(t.element))}),yt(e,n),r},xt=function(e,t){let n=Fe,r=null,i=()=>(r||(r=iI(),ZF(t,e=>{aI(r,e)})),r);for(let t=0;;t++){let r=vt(e),a=[e],o=!1;if(ZF(r,e=>{C(e)===tL.documentFragment?eI(a,e):!o&&!oI(n,e)&&(o=oI(i(),e))}),!o)return;if(t>=8)throw bI(`the tree kept changing during in-place sanitization; refusing to return it`);ZF(a,(t,n)=>{St(t,n>0,e,i())})}},St=function(e,t,n,r){let i=Dt(e),a;for(;a=i.nextNode();)oI(r,a)&&!oI(Fe,a)&&(t&&Pt(L.uponSanitizeShadowNode,a,null),Bt(a,n),qt(a,n),Mt(a.content)&&Jt(a.content))},Ct=function(e){Fe&&aI(Fe,e)},wt=function(e,t){return Te?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Tt=function(e){Te&>(e,e=>{let t=C(e);if(t===tL.processingInstruction||t===tL.comment&&yI(QI,e.data)){try{p(e)}catch{}return!1}if(t===tL.element){let t=e,n=et(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&wt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Et=function(e){let t=null,r=null;if(ke)e=`<remove></remove>`+e;else{let t=lI(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&Ue===He&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=D?N(e):e;if(Ue===He)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=ne.createDocument(Ue,`template`,null);try{t.documentElement.innerHTML=We?O:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ue===He?I.call(t,Ee?`html`:`body`)[0]:Ee?t.documentElement:a},Dt=function(e){let t=S?S(e):e.ownerDocument;return re.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ot=function(e){return e=uI(e,ae,` `),e=uI(e,oe,` `),e=uI(e,se,` `),e},kt=function(e){At(e);let t=e.querySelectorAll?.call(e,`template`);t&&ZF(t,e=>{Mt(e.content)&&kt(e.content)})},At=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=re.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ot(r.data),r=n.nextNode()},jt=function(e){let t=x?x(e):null;return typeof t!=`string`||et(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===tL.documentFragment}catch{return!1}},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Pt(e,n,r){e.length!==0&&ZF(e,e=>{e.call(t,n,r,tt)})}let Ft=function(e,t){return!!(Te&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&yI(ZI,e.textContent)&&yI(ZI,e.innerHTML)||Te&&nL[t]&&C(e)===tL.element&&E(e)===He&&(Nt(e.firstElementChild)||typeof e.textContent==`string`&&yI(ZI,e.textContent))||e.nodeType===tL.processingInstruction||Te&&e.nodeType===tL.comment&&yI(QI,e.data))},It=function(e,t){return e instanceof RegExp?yI(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Lt=function(e,t,n){if(!_e[t]&&Ut(t)&&It(ge.tagNameCheck,t))return!1;if(Ne&&!W[t]&&!W[sI(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return dt(e),!0},Rt=function(e,t,n,r){return e.length===0?t:t===n||t===r?TI(t):t},zt=function(e,t){return e===t||_(e)!==null?!1:(Pe&&_t(e),!0)},Bt=function(e,n){if(Ct(e),Pt(L.beforeSanitizeElements,e,null),zt(e,n))return!0;if(jt(e))return dt(e),!0;let r=et(w(e));if(me=Rt(L.uponSanitizeElement,me,R,De),Pt(L.uponSanitizeElement,e,{tagName:r,allowedTags:me}),zt(e,n))return!0;if(Ft(e,r))return dt(e),!0;if(_e[r]||!(ye.tagCheck instanceof Function&&ye.tagCheck(r))&&!me[r]){let t=Lt(e,r,n);return t===!1&&(Pt(L.afterSanitizeElements,e,null),zt(e,n))?!0:t}if(C(e)===tL.element&&!ut(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&yI($I,e.innerHTML))return dt(e),!0;if(we&&e.nodeType===tL.text){let n=Ot(e.textContent);e.textContent!==n&&(eI(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Pt(L.afterSanitizeElements,e,null),zt(e,n)},Vt=function(e,t,r){if(ve[t]||wt(t,e)||Me&&(t===`id`||t===`name`)&&(r in n||r in nt))return!1;let i=z[t]||ye.attributeCheck instanceof Function&&ye.attributeCheck(t,e);return xe&&yI(ce,t)||be&&yI(le,t)?!0:i?Re[t]||yI(pe,uI(r,de,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&dI(r,`data:`)===0&&Le[e]||Se&&!yI(ue,uI(r,de,``))?!0:!r:Ut(e)&&It(ge.tagNameCheck,e)&&It(ge.attributeNameCheck,t,e)||t===`is`&&ge.allowCustomizedBuiltInElements&&It(ge.tagNameCheck,r)},Ht=CI({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ut=function(e){return!Ht[sI(e)]&&yI(fe,e)},Wt=function(e,t,n,r){if(D&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return N(r);case`TrustedScriptURL`:return ee(r)}return r},Gt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!jt(e)||(dt(e),!1)}catch{return mt(t,e),!1}},Kt=function(e,t){return Te&&yI(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:sI(e)===`attributename`&&lI(t,`href`)!==null},qt=function(e,n){if(Pt(L.beforeSanitizeAttributes,e,null),zt(e,n))return;let r=e.attributes;if(!r||jt(e))return;z=Rt(L.uponSanitizeAttribute,z,he,Oe);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},a=r.length,o=et(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=et(s),d=l,f=s===`value`?d:fI(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Pt(L.uponSanitizeAttribute,e,i),f=i.attrValue,H&&(u===`id`||u===`name`)&&dI(f,U)!==0&&(mt(s,e,n),f=U+f,p=!0),Kt(s,f)?mt(s,e,n):i.forceKeepAttr||(i.keepAttr?!Ce&&yI(eL,f)?mt(s,e,n):(we&&(f=Ot(f)),Vt(o,u,f)?(f=Wt(o,u,c,f),f!==d&&Gt(e,s,c,f)&&p&&$F(t.removed)):mt(s,e,n)):mt(s,e,n))}Pt(L.afterSanitizeAttributes,e,null),zt(e,n)},Jt=function(e){let t=null,n=Dt(e);for(Pt(L.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Pt(L.uponSanitizeShadowNode,t,null),Bt(t,e),qt(t,e),Mt(t.content)&&Jt(t.content),C(t)===tL.element){let e=v(t);Mt(e)&&(Yt(e),Jt(e))}we&&At(e),Pt(L.afterSanitizeShadowDOM,e,null)},Yt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Jt(e.shadow);continue}let n=e.node,r=C(n)===tL.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&et(e)===`template`){let e=n.content;Mt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Mt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(We=!e,We&&(e=`<!-->`),typeof e!=`string`&&!Nt(e)&&(e=EI(e),typeof e!=`string`))throw bI(`dirty is not a string, aborting`);if(!t.isSupported)return e;B?(me=De,z=Oe):it(n),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(me=TI(me)),L.uponSanitizeAttribute.length>0&&(z=TI(z)),t.removed=[];let c=Pe&&typeof e!=`string`&&Nt(e),l=[],u=Fe;if(c){Tt(e);let t=w(e);if(typeof t==`string`){let n=et(t);if(!me[n]||_e[n])throw pt(e),bI(`root node is forbidden and cannot be sanitized in-place`)}if(jt(e))throw pt(e),bI(`root node is clobbered and cannot be sanitized in-place`);l=vt(e),Fe=iI()}else if(Nt(e))i=Et(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===tL.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Yt(i);else{if(!V&&!we&&!Ee&&e.indexOf(`<`)===-1)return D&&je?N(e):e;if(i=Et(e),!i)return V?null:je?O:``}i&&ke&&dt(i.firstChild);let d=c?e:i;try{c&&Yt(e);let t=Dt(d);for(;o=t.nextNode();)Bt(o,d),qt(o,d),Mt(o.content)&&Jt(o.content);c&&xt(e,l)}catch(t){throw c&&(pt(e),bt(e,l)),t}finally{Fe=u}if(c){if(bt(e,l))throw bI(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return we&&kt(e),e}if(V){if(we&&kt(i),Ae)for(s=F.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(z.shadowroot||z.shadowrootmode)&&(s=ie.call(r,s,!0)),s}let f=Ee?i.outerHTML:i.innerHTML;return Ee&&me[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&yI(YI,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
2921
|
+
`+f),we&&(f=Ot(f)),D&&je?N(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(e),B=!0,De=me,Oe=z},t.clearConfig=function(){tt=null,B=!1,De=null,Oe=null,D=k,O=``},t.isValidAttribute=function(e,t,n){tt||it({});let r=et(e),i=et(t);return typeof n==`string`&&(Kt(t,n)||!Ce&&yI(eL,n))?!1:Vt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&_I(L,e)&&eI(L[e],t)},t.removeHook=function(e,t){if(_I(L,e)){if(t!==void 0){let n=QF(L[e],t);return n===-1?void 0:nI(L[e],n,1)[0]}return $F(L[e])}},t.removeHooks=function(e){_I(L,e)&&(L[e]=[])},t.removeAllHooks=function(){L=aL()},t}var lL=cL(),uL=e=>lL.sanitize(e,{FORBID_TAGS:[`style`,`form`],FORBID_ATTR:[`style`]}),dL=({episode:e,mediaUri:t,sources:n,settled:r,startDate:i,status:a,genres:o})=>{let s=Yy(),{released:c,upcoming:l}=Hy({startDate:i,status:a,episode:e},new Date(s)),u=!l&&e?.uri&&n.some(t=>!t.external||!!e?.handles?.some(({relation:e,node:n})=>e===`SAME_AS`&&n.origin===t.id&&$y(n.origin,n.url,`extension`)))?qu(Z.WATCH,{mediaUri:t,episodeUri:e.uri}):void 0,d=by(c),f=!l&&!n.length,p=l?d&&`Releases ${d}`:f&&r?`No sources yet`:void 0,m=!u&&!l&&!r&&(f||n.some(e=>e.external&&$y(e.id,e.href,`extension`)));return W(`div`,{className:`movie`,children:[H(`div`,{className:`facts`,children:Ty({released:c,runtime:e?.runtime,genres:o}).join(` · `)}),u||p||m?W(`div`,{className:m?`play-bar held`:`play-bar`,children:[u?W(Bu,{className:`play`,href:u,children:[H(be,{size:20,fill:`currentColor`,"aria-hidden":`true`}),`Play`]}):void 0,p?H(`span`,{className:`when`,children:p}):void 0]}):void 0]})};G();var fL=O`
|
|
2920
2922
|
z-index: ${qh.mediaModal};
|
|
2921
2923
|
padding: 5rem 1rem;
|
|
2922
2924
|
background-color: hsla(0, 0%, 0%, 0.439);
|
|
@@ -3189,7 +3191,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3189
3191
|
}
|
|
3190
3192
|
}
|
|
3191
3193
|
}
|
|
3192
|
-
`,
|
|
3194
|
+
`,pL=({mediaNodes:e})=>{let t=Au(),n={...t,uri:o(t.uri)},[,r]=Mu(),i=sy(n.uri,e),[s,c]=U(n.uri);B(()=>{c(e=>e&&a(e,n.uri??``)?e:n.uri)},[n.uri]);let[{data:l,operation:u}]=ui({query:pb,variables:{input:{uri:s},descriptionInput:{type:Ti.Html}},pause:!s}),d=l?.media??i,f=cy({data:l,operation:u},s),p=V(()=>d?.titles?.at(0)?.title,[d]),m=!!(l?.media&&Ey(l.media)),h=m?l?.media?.episodes.at(0):void 0,{sources:g,answered:v}=Sb(h,d?.uri??``,d?.handles),y=Cb(s,f?.settled&&v),b=hb(l?.media?.uri),x=V(()=>d&&`descriptions`in d&&d.descriptions.sort((e,t)=>t.description.length-e.description.length)?.at(0)?.description,[d]),S=Uv(d?.covers,d),[C,w]=U([]),[T,E]=U(),D=V(()=>{let e=(d?.trailers??[]).filter(e=>!C.includes(e.uri));return e.find(e=>e.uri===T)??e.at(0)},[d?.trailers,C,T]),O=Uv(D?.url?void 0:Hv(d),d);B(()=>{D?.uri&&D.uri!==T&&E(D.uri)},[D?.uri,T]);let k=z(()=>{D&&w([...C,D.uri])},[D,C]),[A,j]=U(!0),M=Cx(Nu()),[N,ee]=U(!1),[te,P]=U(!0),[ne,re]=U(.25),F=K(void 0);return B(()=>{_(d?.uri,n.uri,F.current)&&(F.current=d.uri,r(`${qu(Z.MEDIA,{uri:d.uri})}${location.search}`,{replace:!0}))},[d?.uri,n.uri]),A?W(kF,{"data-party-scroll":!0,css:fL,onClose:()=>j(!1),children:[W(`div`,{className:`trailer`,style:!D?.url&&O?{backgroundImage:`url(${O})`}:{},children:[D?.url?H(mv,{url:D.url,className:`player`,onError:k,paused:N,volume:te?0:ne},D.url):void 0,W(`div`,{className:`player-controls ${D?.url?``:`hidden`}`,children:[W(`span`,{className:`playback`,children:[N?H(be,{className:`icon-outline`,size:30,strokeWidth:3,stroke:`black`,onClick:()=>ee(!1)}):H(Ne,{className:`icon-outline`,size:30,strokeWidth:3,stroke:`black`,onClick:()=>ee(!0)}),N?H(be,{className:`icon-body`,size:30,onClick:()=>ee(!1)}):H(Ne,{className:`icon-body`,size:30,onClick:()=>ee(!0)})]}),H(_v,{defaultMuted:te,onMutedUpdate:P,defaultVolume:ne,onVolumeUpdate:e=>re(e)})]})]}),W(`div`,{className:`content`,children:[W(`div`,{className:`header`,children:[p||y?H(`span`,{className:`title`,children:p}):H(Cv,{className:`title-pending`}),H(jF,{uri:d?.uri}),H(Tb,{uri:l?.media?.uri,handles:d?.handles,except:xb(h,d?.handles)}),H(Bu,{className:`more`,href:`${qu(Z.TITLE,{uri:d?.uri??n.uri})}${M}`,children:`More details`})]}),m&&d?H(dL,{episode:h,mediaUri:d.uri,sources:g,settled:y,startDate:`startDate`in d?d.startDate:void 0,status:`status`in d?d.status:void 0,genres:`genres`in d?d.genres:void 0}):void 0,H(OF,{work:s,address:n.uri,uri:f?.uri,title:p,cover:S,episodeCount:f?.episodeCount,movie:m}),x?H(gx,{collapsedHeight:200,className:`description`,children:H(`div`,{dangerouslySetInnerHTML:{__html:uL(x)}})}):y?void 0:H(wv,{count:5,className:`description pending`}),m?H(ry,{film:!0,sources:g,pending:!y}):void 0,H(eS,{relations:d&&`relations`in d?d.relations??[]:[],action:H(UP,{franchise:d&&`franchise`in d?d.franchise:void 0,currentUris:d?.handles?.map(e=>e.node.uri)??[]})},s),H(nS,{seasons:l?.media?.seasons,currentUris:l?.media?.handles.map(e=>e.node.uri)??[],href:e=>`${qu(Z.MEDIA,{uri:e})}${M}`}),m||!l?.media?void 0:H(`div`,{className:`episode-list`,children:f?H(jb,{media:f,tracked:b},s):H(Ab,{})})]})]}):H(Uu,{to:`/`})},mL=[{label:`All`,value:null},{label:`Anime`,value:wi.Anime},{label:`Series`,value:wi.Series},{label:`Movies`,value:wi.Movie}],hL=O`
|
|
3193
3195
|
display: flex;
|
|
3194
3196
|
gap: 0.6rem;
|
|
3195
3197
|
|
|
@@ -3211,7 +3213,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3211
3213
|
color: #000;
|
|
3212
3214
|
border-color: #fff;
|
|
3213
3215
|
}
|
|
3214
|
-
`,
|
|
3216
|
+
`,gL=({value:e,onChange:t})=>H(`div`,{css:hL,children:mL.map(n=>H(`button`,{className:e===n.value?`tab active`:`tab`,onClick:()=>t(n.value),children:n.label},n.label))}),_L=e=>{let t=e.uri??``;return[e._id??``,...t.match(/^ag:\((.*)\)$/)?.[1]?.split(`,`)??[t]].filter(Boolean)},vL=(e,t)=>{let n=new Map;t.forEach((e,t)=>{for(let r of e)n.has(r)||n.set(r,t)});let r=e=>Math.min(..._L(e).map(e=>n.get(e)??1/0)),i=[],a=[];for(let t of e)(r(t)<1/0?i:a).push(t);return i.sort((e,t)=>r(e)-r(t)),[...i,...a]},yL=e=>e.filter(e=>e.popularity!=null).map(_L).filter(e=>e.length);G();var bL=iv(`
|
|
3215
3217
|
subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
|
|
3216
3218
|
mediaPage(input: $input) {
|
|
3217
3219
|
nodes {
|
|
@@ -3246,13 +3248,13 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3246
3248
|
}
|
|
3247
3249
|
}
|
|
3248
3250
|
}
|
|
3249
|
-
`),
|
|
3251
|
+
`),xL=O`
|
|
3250
3252
|
.category-bar {
|
|
3251
3253
|
position: relative;
|
|
3252
3254
|
z-index: ${qh.categoryBar};
|
|
3253
3255
|
padding: 1.5rem 3rem 0.5rem;
|
|
3254
3256
|
}
|
|
3255
|
-
`,
|
|
3257
|
+
`,SL=ga(),CL={season:id(SL.season),year:SL.year},wL=gd(CL),TL={categories:[wi.Movie]},EL={categories:[wi.Series]},DL={anime:[`season`],movie:[`movies`],series:[`shows`],stub:[`season`,`movies`,`shows`]}[V_],OL=(e,t)=>{let[{data:n}]=ui({query:bL,variables:{input:e,shortDescriptionInput:{count:1}},pause:!DL.includes(t)}),r=n?.mediaPage?.nodes,i=K([]);return V(()=>{if(!r?.length||t!==`season`)return r||[];let e=vL(r,i.current);return i.current=yL(e),e},[r])},kL=()=>{let[e]=Fu(Ku(Z.MEDIA)),[t,n]=U(null),r={season:OL({season:CL.season,seasonYear:CL.year,sorts:[Di.PopularityDesc],...t?{categories:[t]}:{}},`season`),movies:OL(TL,`movies`),shows:OL(EL,`shows`)};return W(`div`,{css:xL,children:[H(Ib,{mediaNodes:r[DL[0]]}),V_===`stub`?H(`div`,{className:`category-bar`,children:H(gL,{value:t,onChange:n})}):void 0,DL.includes(`season`)&&H(mx,{title:`Current season`,titleTo:wL,mediaNodes:r.season}),DL.includes(`movies`)&&(!t||t===wi.Movie)&&H(mx,{title:`Popular movies`,mediaNodes:r.movies}),DL.includes(`shows`)&&(!t||t===wi.Series)&&H(mx,{title:`Popular shows`,mediaNodes:r.shows}),e&&H(pL,{mediaNodes:[...r.season,...r.movies,...r.shows]})]})},AL=e=>e>=75?`good`:e>=60?`mixed`:`poor`,jL={good:Th,mixed:gh,poor:lh},ML={good:`#4ade80`,mixed:`#fb923c`,poor:`#f87171`},NL=O`
|
|
3256
3258
|
display: inline-flex;
|
|
3257
3259
|
align-items: center;
|
|
3258
3260
|
gap: 0.6rem;
|
|
@@ -3261,7 +3263,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3261
3263
|
.face {
|
|
3262
3264
|
display: flex;
|
|
3263
3265
|
}
|
|
3264
|
-
`,
|
|
3266
|
+
`,PL=({percent:e,size:t=18})=>{let n=jL[AL(e)];return W(`span`,{css:NL,"aria-label":`Rated ${e} percent`,children:[H(`span`,{className:`face`,style:{color:ML[AL(e)]},children:H(n,{size:t})}),W(`span`,{className:`value`,children:[e,`%`]})]})},FL=e=>{let t=new Map;for(let n of e)for(let e of new Set(n.voiceActors.map(e=>e.language).filter(e=>!!e)))t.set(e,(t.get(e)??0)+1);let n=[...t.keys()].sort((e,n)=>Number(n===`ja`)-Number(e===`ja`)||t.get(n)-t.get(e)||e.localeCompare(n));return{options:n.length<2?[]:n,selected:n[0]}},IL=(e,t)=>e.map(e=>({...e,actors:e.voiceActors.filter(e=>(e.language??void 0)===t)})),LL={MAIN:`Main`,SUPPORTING:`Supporting`,BACKGROUND:`Background`},RL=e=>e?LL[e]??e:void 0,zL=new Intl.DisplayNames([`en`],{type:`language`}),BL=e=>/^[a-z]{2,3}$/.test(e)?zL.of(e)??e:e;G();var VL=12,HL=O`
|
|
3265
3267
|
/* the footer under it stays below the fold while the page fills, rather than being pushed off it */
|
|
3266
3268
|
min-height: 100vh;
|
|
3267
3269
|
padding-bottom: 6rem;
|
|
@@ -3751,7 +3753,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3751
3753
|
}
|
|
3752
3754
|
}
|
|
3753
3755
|
}
|
|
3754
|
-
`,
|
|
3756
|
+
`,UL=({person:e,detail:t,actor:n})=>W(`div`,{className:n?`person actor`:`person`,children:[e.image?H(`img`,{className:`face`,src:e.image,alt:``,loading:`lazy`}):H(`div`,{className:`face`}),W(`div`,{children:[e.url?H(`a`,{className:`name`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.name}):H(`div`,{className:`name`,children:e.name}),t?H(`div`,{className:`detail`,children:t}):void 0]})]}),WL=({characters:e})=>{let t=FL(e),[n,r]=U(),i=IL(e,n??t.selected);return W(`section`,{"data-characters":!0,children:[W(`h2`,{children:[H(`span`,{children:`Characters`}),t.options.length?H(`select`,{"aria-label":`Language`,value:n??t.selected,onChange:e=>r(e.currentTarget.value),children:t.options.map(e=>H(`option`,{value:e,children:BL(e)},e))}):void 0]}),H(Kv,{items:i,size:VL,label:`Characters`,children:(e,t)=>H(`ul`,{className:`credits`,children:e.map((e,n)=>W(`li`,{children:[H(UL,{person:e,detail:RL(e.role)}),e.actors.length?H(`div`,{className:`actors`,children:e.actors.map(e=>H(UL,{person:e,actor:!0},e.name))}):void 0]},`${e.name}:${t+n}`))})})]})},GL=({staff:e})=>W(`section`,{"data-staff":!0,children:[H(`h2`,{children:`Staff`}),H(Kv,{items:e,size:VL,label:`Staff`,children:(e,t)=>H(`ul`,{className:`credits`,children:e.map((e,n)=>H(`li`,{children:H(UL,{person:e,detail:e.roles?.join(`, `)})},`${e.name}:${t+n}`))})})]}),KL=({url:e})=>{let[t,n]=U();return B(()=>{Ee(()=>import(`./theme-player-BsVznGeU.js`).then(e=>n(()=>e.default)),__vite__mapDeps([5,6,4,7]),import.meta.url).catch(()=>n(()=>({url:e})=>H(`video`,{src:e,controls:!0,autoPlay:!0,playsInline:!0})))},[]),H(`div`,{className:`player`,children:t?H(t,{url:e}):void 0})},qL=({themes:e})=>{let[t,n]=U();return H(`ul`,{className:`themes`,children:e.map((e,r)=>{let i=e.video;return W(`li`,{children:[W(`div`,{className:`theme`,children:[i?H(`button`,{type:`button`,className:`toggle`,"aria-label":t===r?`Stop`:`Play`,onClick:()=>n(t===r?void 0:r),children:H(t===r?Eh:be,{size:14,fill:`currentColor`})}):H(`span`,{className:`toggle`}),W(`span`,{className:`kind`,children:[e.kind,e.sequence??``]}),H(`span`,{className:`song`,children:e.title}),H(`span`,{className:`artists`,children:e.artists.join(`, `)})]}),t===r&&i?H(KL,{url:i}):void 0]},r)})})},JL=({themes:e})=>W(`section`,{"data-themes":!0,children:[H(`h2`,{children:`Themes`}),H(Kv,{items:e,size:VL,label:`Themes`,children:(e,t)=>H(qL,{themes:e},t)})]}),YL=()=>{let e=Au(),t=o(e.uri),[,n]=Mu(),r=Cx(Nu()),[s,c]=U(t);B(()=>{c(e=>e&&a(e,t??``)?e:t)},[t]);let[{data:l,operation:u}]=ui({query:pb,variables:{input:{uri:s,details:!0},descriptionInput:{type:Ti.Html},details:!0},pause:!s}),d=l?.media,f=cy({data:l,operation:u},s),p=hb(d?.uri),m=K(void 0);ye(()=>{_(d?.uri,t,m.current)&&(m.current=d.uri,n(`${qu(Z.TITLE,{uri:d.uri})}${location.search}`,{replace:!0}))},[d?.uri,t]);let h=Uv(d?.banners,d),g=Uv(d?.covers,d),v=d?.titles.at(0)?.title,y=ab(d?.titles),b=d?.descriptions.map(({description:e})=>e).sort((e,t)=>t.length-e.length).at(0),x=!!(d&&Ey(d)),S=x?d.episodes.at(0):void 0,{sources:C,answered:w}=Sb(S,d?.uri??``,d?.handles),T=Cb(s,f?.settled&&w),E=i(s??``).some(e=>W_.includes(e)),D=x&&Hy({startDate:d.startDate,status:d.status,episode:d.episodes.at(0)}).upcoming,O=cb(d??{},{},E&&!T,D),k=d?ob(d):[],A=sb(d??{}),j=d?bd(d.season,d.seasonYear):void 0,[M,N]=U(!1),[ee,te]=U(!1),P=K(null);ye(()=>{let e=P.current;e&&!M&&te(e.scrollHeight>e.clientHeight+1)},[b,M]),B(()=>{N(!1)},[s]);let[ne,re]=U(!1),F=async()=>{if(!d)return;let e=`${location.origin}${qu(Z.TITLE,{uri:d.uri})}`;if(navigator.share)return navigator.share({title:v,url:e}).catch(()=>{});try{await navigator.clipboard.writeText(e),re(!0),setTimeout(()=>re(!1),1500)}catch{}},I=d?.trailers.at(0)?.url;return W(`div`,{css:HL,children:[H(`div`,{className:`banner`,children:h??g?H(`div`,{className:h?`image`:`image blurred`,style:{backgroundImage:`url(${h??g})`}}):void 0}),W(`div`,{className:`body`,children:[g?H(`img`,{className:`cover`,src:g,alt:``}):H(`div`,{className:`cover`}),W(`div`,{className:`heading`,children:[j?H(`div`,{className:`season`,children:j}):T?void 0:H(`div`,{className:`season`,children:H(Cv,{className:`pending`})}),H(`h1`,{children:v??(T?void 0:H(wv,{count:2,className:`pending`}))}),y?H(`div`,{className:`second`,children:y}):E&&!T?H(`div`,{className:`second`,children:H(Cv,{className:`pending`})}):void 0,k.length||d?.averageScore!=null||A.length?W(`div`,{className:`chips`,children:[k.map(e=>H(`span`,{className:`chip`,children:e},e)),d?.averageScore==null?void 0:H(`span`,{className:`chip`,children:H(PL,{percent:d.averageScore,size:16})}),A.map(e=>H(`span`,{className:`chip`,children:e},e))]}):T?void 0:H(`div`,{className:`chips`,children:H(Cv,{className:`pending`})}),b?H(`div`,{ref:P,className:M?`description`:`description clamped`,dangerouslySetInnerHTML:{__html:uL(b)}}):T?void 0:H(wv,{count:5,className:`description`}),b&&(ee||M)?H(`button`,{type:`button`,className:`expand`,onClick:()=>N(!M),children:M?`Collapse`:`Expand`}):void 0,x?H(ry,{film:!0,sources:C,pending:!T}):void 0]}),W(`div`,{className:`actions`,children:[d?W(`div`,{className:`buttons`,children:[H(gb,{media:d}),H(`button`,{type:`button`,className:`icon`,onClick:F,"aria-label":ne?`Copied`:`Share`,title:ne?`Copied`:`Share`,children:H(ne?me:wh,{size:20})}),I?H(`a`,{className:`icon`,href:I,target:`_blank`,rel:`noreferrer`,"aria-label":`Trailer`,title:`Trailer`,children:H(oh,{size:20})}):void 0,H(Tb,{uri:d.uri,handles:d.handles,except:xb(S,d.handles)})]}):H(`div`,{className:`buttons`,children:H(Cv,{className:`play-pending`})}),H(`div`,{className:`tracking`,children:H(OF,{work:s,address:t,uri:f?.uri,title:v,cover:g,episodeCount:f?.episodeCount,movie:x})})]}),O.length?H(`dl`,{className:`facts`,children:O.map(({label:e,value:t})=>t?W(`div`,{children:[H(`dt`,{children:e}),H(`dd`,{children:t})]},e):W(`div`,{className:`fact placeholder`,"aria-hidden":`true`,children:[H(`dt`,{children:e}),H(`dd`,{children:H(Cv,{className:`pending`})})]},e))}):void 0,W(`div`,{className:`main`,children:[H(eS,{relations:d?.relations??[],action:H(UP,{franchise:d?.franchise,currentUris:d?.handles.map(e=>e.node.uri)??[],route:Z.TITLE}),route:Z.TITLE,pending:E&&!T}),H(nS,{seasons:d?.seasons,currentUris:d?.handles.map(e=>e.node.uri)??[],href:e=>`${qu(Z.TITLE,{uri:e})}${r}`}),d&&!x?W(`section`,{"data-episodes":!0,children:[H(`h2`,{children:`Episodes`}),f?H(jb,{media:f,tracked:p}):H(Ab,{})]}):void 0,d?.characters?.length?H(WL,{characters:d.characters}):void 0,d?.staff?.length?H(GL,{staff:d.staff}):void 0,d?.themes?.length?H(JL,{themes:d.themes}):void 0]},s)]})]})},XL=(e,t)=>{let n=e.nextAiringEpisode?.airingAt;if(!n)return;let r=new Date(n).getTime();return Number.isFinite(r)?r-t:void 0},ZL=e=>e==null?void 0:`${e} episode${e===1?``:`s`}`,QL=(e,t)=>{if(!e)return;let n=e.trim().replace(/^#/,``),r=n.length===3?n.split(``).map(e=>e+e).join(``):n.length===6?n:void 0;if(!r||!/^[0-9a-f]{6}$/i.test(r))return;let i=parseInt(r,16);return`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, ${t})`},$L=e=>({"--accent":QL(e,1)??`rgba(255, 255, 255, 0.75)`,"--accent-soft":QL(e,.18)??`rgba(255, 255, 255, 0.08)`,"--accent-wash":QL(e,.07)??`rgba(255, 255, 255, 0.03)`}),eR=O`
|
|
3755
3757
|
display: grid;
|
|
3756
3758
|
grid-template-columns: 15rem minmax(0, 1fr);
|
|
3757
3759
|
height: 23rem;
|
|
@@ -3871,7 +3873,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3871
3873
|
.description { -webkit-line-clamp: 3; }
|
|
3872
3874
|
.chips { display: none; }
|
|
3873
3875
|
}
|
|
3874
|
-
`,
|
|
3876
|
+
`,tR=({media:e,to:t})=>{let n=Yy(),r=Uv(e.covers,e,{box:ax}),i=e.covers?.find(e=>e.color)?.color,a=Wy(XL(e,n)??0),o=e.nextAiringEpisode?.episodeNumber,s=vd(e.type),c=bd(e.season,e.seasonYear),l=[s,ZL(e.episodeCount)].filter(Boolean).join(` • `);return W(Bu,{to:t,css:eR,style:$L(i),children:[H(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0,children:W(`div`,{className:`cover-text`,children:[H(`div`,{className:`title`,children:e.titles?.at(0)?.title}),c&&H(`div`,{className:`season`,children:c})]})}),W(`div`,{className:`detail`,children:[W(`div`,{className:`detail-top`,children:[H(`div`,{children:a&&o!=null?W(R,{children:[W(`div`,{className:`airing-label`,children:[`Ep `,o,` airing in`]}),H(`div`,{className:`airing-value airing`,children:a})]}):H(`div`,{className:`airing-value`,children:yd(e.status)??`Unknown status`})}),e.averageScore!=null&&H(PL,{percent:e.averageScore})]}),l&&H(`div`,{className:`meta`,children:l}),H(`div`,{className:`description`,children:e.shortDescriptions?.at(0)?.shortDescription}),H(`div`,{className:`chips`,children:e.genres?.slice(0,2).map(e=>H(`span`,{className:`chip`,children:e.toLowerCase()},e))})]})]})},nR=O`
|
|
3875
3877
|
display: grid;
|
|
3876
3878
|
grid-template-columns: 5rem minmax(0, 1fr) 11rem 11rem 17rem;
|
|
3877
3879
|
align-items: center;
|
|
@@ -3950,7 +3952,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3950
3952
|
.score { display: none; }
|
|
3951
3953
|
.chips { display: none; }
|
|
3952
3954
|
}
|
|
3953
|
-
`,
|
|
3955
|
+
`,rR=({media:e,to:t})=>{let n=Yy(),r=Uv(e.covers,e,{box:ax}),i=e.covers?.find(e=>e.color)?.color,a=Wy(XL(e,n)??0,1),o=e.nextAiringEpisode?.episodeNumber;return W(Bu,{to:t,css:nR,style:$L(i),children:[H(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0}),W(`div`,{className:`heading`,children:[H(`div`,{className:`title`,children:e.titles?.at(0)?.title}),H(`div`,{className:`chips`,children:e.genres?.slice(0,5).map(e=>H(`span`,{className:`chip`,children:e.toLowerCase()},e))})]}),W(`div`,{className:`column score`,children:[e.averageScore!=null&&H(PL,{percent:e.averageScore,size:17}),e.popularity!=null&&W(`span`,{className:`secondary`,children:[e.popularity.toLocaleString(),` users`]})]}),W(`div`,{className:`column format`,children:[H(`span`,{children:vd(e.type)}),e.episodeCount!=null&&H(`span`,{className:`secondary`,children:ZL(e.episodeCount)})]}),W(`div`,{className:`column`,children:[H(`span`,{children:yd(e.status)}),a&&o!=null&&W(`span`,{className:`secondary airing`,children:[`Ep `,o,` airing in `,a]})]})]})},iR={grid:fh,card:dh,list:ph},aR=O`
|
|
3954
3956
|
display: inline-flex;
|
|
3955
3957
|
gap: 0.4rem;
|
|
3956
3958
|
padding: 0.4rem;
|
|
@@ -3977,7 +3979,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
3977
3979
|
background: rgba(255, 255, 255, 0.12);
|
|
3978
3980
|
color: #fff;
|
|
3979
3981
|
}
|
|
3980
|
-
`,
|
|
3982
|
+
`,oR=({mode:e,onChange:t})=>H(`div`,{css:aR,role:`group`,"aria-label":`Result layout`,children:ms.map(n=>{let r=iR[n.value];return H(`button`,{type:`button`,title:n.label,"aria-label":n.label,"aria-pressed":e===n.value,onClick:()=>t(n.value),children:H(r,{size:18})},n.value)})});G();var sR=O`
|
|
3981
3983
|
display: flex;
|
|
3982
3984
|
flex-direction: column;
|
|
3983
3985
|
gap: 0.7rem;
|
|
@@ -4026,7 +4028,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4026
4028
|
}
|
|
4027
4029
|
|
|
4028
4030
|
.control.open .chevron { transform: rotate(180deg); }
|
|
4029
|
-
`,
|
|
4031
|
+
`,cR=O`
|
|
4030
4032
|
z-index: ${qh.filterMenu};
|
|
4031
4033
|
width: max-content;
|
|
4032
4034
|
min-width: 22rem;
|
|
@@ -4100,7 +4102,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4100
4102
|
font-size: 1.4rem;
|
|
4101
4103
|
color: rgba(255, 255, 255, 0.4);
|
|
4102
4104
|
}
|
|
4103
|
-
`,
|
|
4105
|
+
`,lR=({label:e,placeholder:t=`Any`,options:n,selected:r,onChange:i,multiple:a=!1,searchable:o=!1,allowCustom:s=!1})=>{let[c,l]=U(!1),[u,d]=U(``),f=`filter-${e.toLowerCase().replace(/[^a-z]+/g,`-`)}`,{refs:p,floatingStyles:m,context:h}=Rm({open:c,onOpenChange:e=>{l(e),e||d(``)},placement:`bottom-start`,whileElementsMounted:Ve,middleware:[hp(6),_p({padding:8}),gp({padding:8}),vp({padding:8,apply:({availableHeight:e,elements:t})=>{t.floating.style.maxHeight=`${Math.max(160,e)}px`}})]}),{getReferenceProps:g,getFloatingProps:_}=Hm([Mm(h),Im(h),Wm(h,{role:`listbox`})]),v=r.map(e=>n.find(t=>t.value===e)?.label??e).join(`, `),y=V(()=>{let e=u.trim().toLowerCase(),t=e?n.filter(t=>t.label.toLowerCase().includes(e)):n;return!s||!e||t.some(t=>t.label.toLowerCase()===e)?t:[{value:u.trim(),label:u.trim()},...t]},[n,u,s]),b=e=>{a?i(r.includes(e)?r.filter(t=>t!==e):[...r,e]):(i(r.includes(e)?[]:[e]),l(!1),d(``))};return W(`div`,{css:sR,children:[H(`span`,{className:`label`,id:f,children:e}),W(`button`,{ref:p.setReference,type:`button`,className:c?`control open`:`control`,"aria-labelledby":f,...g(),children:[H(`span`,{className:r.length?`value`:`value any`,children:r.length?v:t}),H(nh,{size:16,className:`chevron`})]}),c&&H(fm,{children:H(Cm,{context:h,modal:!1,initialFocus:o?0:-1,children:W(`div`,{ref:p.setFloating,css:cR,style:m,..._(),children:[o&&W(`div`,{className:`filter`,children:[H(Sh,{size:15}),H(`input`,{type:`text`,value:u,placeholder:`Filter ${e.toLowerCase()}`,"aria-label":`Filter ${e.toLowerCase()}`,onInput:e=>d(e.currentTarget.value)})]}),H(`div`,{className:`options`,children:y.length?y.map(e=>W(`button`,{type:`button`,role:`option`,"aria-selected":r.includes(e.value),className:r.includes(e.value)?`option selected`:`option`,onClick:()=>b(e.value),children:[H(me,{size:16,className:r.includes(e.value)?`tick`:`tick hidden`}),H(`span`,{children:e.label})]},e.value)):W(`div`,{className:`empty`,children:[`Nothing matches “`,u,`”.`]})})]})})})]})},uR=({label:e,children:t})=>W(`div`,{css:sR,children:[H(`span`,{className:`label`,children:e}),t]});G();var dR=V_===`movie`||V_===`series`,fR=iv(`
|
|
4104
4106
|
subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
|
|
4105
4107
|
mediaPage(input: $input) {
|
|
4106
4108
|
nodes {
|
|
@@ -4147,7 +4149,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4147
4149
|
}
|
|
4148
4150
|
}
|
|
4149
4151
|
}
|
|
4150
|
-
`),
|
|
4152
|
+
`),pR=O`
|
|
4151
4153
|
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
4152
4154
|
min-height: 100vh;
|
|
4153
4155
|
|
|
@@ -4292,7 +4294,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4292
4294
|
.grid > .pending { width: 100%; height: auto; aspect-ratio: 5 / 7; }
|
|
4293
4295
|
.cards > .pending { height: 17rem; }
|
|
4294
4296
|
}
|
|
4295
|
-
`,
|
|
4297
|
+
`,mR=(()=>{let e=[];for(let t=ud();t>=ld;t--)e.push({value:String(t),label:String(t)});return e})(),hR=e=>({...e.query?{search:e.query}:{sorts:[Di.PopularityDesc]},...e.category?{categories:[e.category]}:{},...e.status?{status:e.status}:{},...e.season?{season:e.season}:{},...e.year?{seasonYear:e.year}:{},...e.formats.length?{formats:e.formats}:{},...e.genres.length?{genres:e.genres}:{},...e.tags.length?{tags:e.tags}:{}}),gR=()=>{let e=Nu(),[,t]=Mu(),n=V(()=>fd(e),[e]),r=Sd(n),i=e=>t(gd({...n,...e}),{replace:!0}),[a,o]=U(n.query),s=K(null);B(()=>{document.activeElement!==s.current&&o(e=>e.trim()===n.query?e:n.query)},[n.query]);let[c,l]=U(()=>document.activeElement?.matches(`header input`)?``:n.query);B(()=>{let e=setTimeout(()=>l(n.query),350);return()=>clearTimeout(e)},[n.query]);let u=c!==n.query,d={...n,query:c},f=V(()=>hR(d),[md(d)]),[{data:p}]=ui({query:fR,variables:{input:f,shortDescriptionInput:{count:1}},pause:!Sd(d)}),[m,h]=U(ys),g=e=>{h(e),bs(e)},[_,v]=U(!1);B(()=>{v(!1);let e=setTimeout(()=>v(!0),5e3);return()=>clearTimeout(e)},[e,f]);let y=K(p),b=K(f);p!==y.current&&(y.current=p,b.current=f);let x=r&&!u&&b.current===f?p?.mediaPage?.nodes??[]:[],S=!!(n.season&&n.year),{genreOptions:C,tagOptions:w,genreKeys:T}=V(()=>{let e=new Map(td[V_].map(e=>[e.toLowerCase(),e])),t=new Map;for(let t of n.genres)e.set(t.toLowerCase(),t);for(let e of n.tags)t.set(e.toLowerCase(),e);let r=(n,r)=>{!e.has(r.toLowerCase())&&!t.has(r.toLowerCase())&&n.set(r.toLowerCase(),r)};if(S)for(let t of x)for(let n of t.genres??[])r(e,n);for(let e of x)for(let n of e.tags??[])r(t,n);let i=(e,t)=>e.localeCompare(t);return{genreKeys:new Set(e.keys()),genreOptions:[...e.values()].sort(i).map(e=>({value:e,label:e})),tagOptions:[...t.values()].sort(i).map(e=>({value:e,label:e}))}},[x,n.genres,n.tags,S]),E=[...n.genres,...n.tags],D=e=>T.has(e.toLowerCase()),O=e=>i({genres:e.filter(D),tags:e.filter(e=>!D(e))}),k={grid:{className:`grid`,item:e=>H(sx,{media:e,to:qu(Z.MEDIA,{uri:e.uri}),ellipsis:!1})},card:{className:`cards`,item:e=>H(tR,{media:e,to:qu(Z.MEDIA,{uri:e.uri})})},list:{className:`rows`,item:e=>H(rR,{media:e,to:qu(Z.MEDIA,{uri:e.uri})})}}[m],A=[...n.year?[{key:`year`,label:String(n.year),clear:{year:null}}]:[],...n.season?[{key:`season`,label:Qu.find(e=>e.value===n.season).label,clear:{season:null}}]:[],...n.status?[{key:`status`,label:Zu.find(e=>e.value===n.status).label,clear:{status:null}}]:[],...n.category?[{key:`category`,label:$u.find(e=>e.value===n.category).label,clear:{category:null}}]:[],...n.formats.map(e=>({key:`format:${e}`,label:Xu.find(t=>t.value===e).label,clear:{formats:n.formats.filter(t=>t!==e)}})),...n.genres.map(e=>({key:`genre:${e}`,label:e,clear:{genres:n.genres.filter(t=>t!==e)}})),...n.tags.map(e=>({key:`tag:${e}`,label:e,clear:{tags:n.tags.filter(t=>t!==e)}}))];return W(`div`,{css:pR,children:[W(`div`,{className:`heading-row`,children:[H(`div`,{className:`heading`,children:_d(n)}),H(oR,{mode:m,onChange:g})]}),W(`div`,{className:`filters`,children:[H(uR,{label:`Search`,children:W(`div`,{className:`text-field`,children:[H(Sh,{size:17}),H(`input`,{ref:s,type:`text`,value:a,placeholder:`Any title`,"aria-label":`Search by title`,onInput:e=>{let t=e.currentTarget.value;o(t),i({query:t})}})]})}),H(lR,{label:dR?`Genres`:`Genres & Tags`,options:[...C,...w],selected:E,onChange:O,multiple:!0,searchable:!0,allowCustom:!dR}),H(lR,{label:`Year`,options:mR,selected:n.year?[String(n.year)]:[],onChange:e=>i({year:e.length?Number(e[0]):null}),searchable:!0}),dR?void 0:W(R,{children:[H(lR,{label:`Season`,options:Qu,selected:n.season?[n.season]:[],onChange:e=>i({season:e[0]??null})}),H(lR,{label:`Format`,options:Xu,selected:n.formats,onChange:e=>i({formats:e}),multiple:!0}),H(lR,{label:`Airing Status`,options:Zu,selected:n.status?[n.status]:[],onChange:e=>i({status:e[0]??null})})]}),V_===`stub`?H(lR,{label:`Category`,options:$u,selected:n.category?[n.category]:[],onChange:e=>i({category:e[0]??null})}):void 0]}),W(`div`,{className:`chips`,children:[A.map(e=>W(`button`,{type:`button`,className:`chip`,"aria-label":`Remove ${e.label}`,onClick:()=>i(e.clear),children:[e.label,H(jh,{size:14})]},e.key)),A.length>1&&H(`button`,{type:`button`,className:`chip-clear`,onClick:()=>i({category:null,status:null,season:null,year:null,formats:[],genres:[],tags:[]}),children:`Clear filters`})]}),x.length?H(`div`,{className:k.className,children:x.map(k.item)}):r?_?H(`div`,{className:`status`,children:`No results found.`}):H(`div`,{className:k.className,children:Array.from({length:12},(e,t)=>H(Cv,{className:`pending`},t))}):H(`div`,{className:`status`,children:xd(n)?`Add a title or another filter.`:`Search by title, or pick a filter.`})]})},_R=O`
|
|
4296
4298
|
max-width: 72rem;
|
|
4297
4299
|
margin: 0 auto;
|
|
4298
4300
|
padding: calc(var(--stub-header-height) + 3rem) 3rem 6rem;
|
|
@@ -4331,7 +4333,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4331
4333
|
color: #ff8a3d;
|
|
4332
4334
|
}
|
|
4333
4335
|
}
|
|
4334
|
-
`,
|
|
4336
|
+
`,vR=({children:e})=>H(`div`,{css:_R,children:e}),yR=()=>W(vR,{children:[H(`h1`,{children:`Legal & Terms`}),H(`div`,{className:`updated`,children:`Last updated 1 June 2026`}),H(`p`,{children:`stub is an independent, non-commercial personal project, provided “as is” without warranties of any kind.`}),H(`h2`,{children:`No hosted content`}),H(`p`,{children:`stub hosts, stores, and distributes no media of its own. All titles, descriptions, artwork, ratings, and playback streams are retrieved on demand from third-party services (including AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix) and remain the property of their respective owners. You access those services with your own accounts and are responsible for complying with their terms.`}),H(`h2`,{children:`Personal use`}),H(`p`,{children:`stub is a technical showcase of in-browser media aggregation, intended for personal, non-commercial use. It is not a content provider.`}),H(`h2`,{children:`Privacy`}),W(`p`,{children:[`stub keeps no accounts and stores no personal data. See the`,` `,H(Bu,{href:qu(Z.PRIVACY),children:`Privacy page`}),` for what is and isn’t handled when you use it.`]}),H(`h2`,{children:`Rights holders`}),W(`p`,{children:[`stub stores no content itself; anything you see lives on the third-party service it came from. If you are a rights holder with a concern, you can reach the maintainer through the project repository at`,` `,H(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]}),H(`h2`,{children:`Liability`}),H(`p`,{children:`stub is provided without warranty of any kind. The maintainer is not liable for any damages arising from its use, or for the availability, accuracy, or legality of any third-party service it connects to.`})]}),bR=`This browser, in its storage for stub at this address`,xR=`This tab, in its storage for stub`,SR=[{id:`added-sources`,title:`Added sources`,what:`The source packages you added from npm, installed for stub through FKN. Signed in to FKN, the list is your account's, so every stub site you sign in on gets it. Sources added while signed out join the list of the next FKN account signed in on this browser.`,where:`${bR}, and your FKN account's storage while you are signed in, encrypted in this browser before it is stored`,lasts:`Until you remove them. The account's copy is deleted with your FKN account, and this browser's copy of it when you sign out`,keys:{store:`local`,names:[pi,mi]}},{id:`settings`,title:`Settings`,what:`Your choices in Settings and around stub: sources turned off, hidden icons, the country you picked, autoplay, the search layout, the trackers you chose not to save to and the play order. Signed in to FKN, they are your account's, so every stub site and device you sign in on gets them. What you set while signed out joins the next FKN account signed in on this browser, unless that account already set it.`,where:`${bR}, and your FKN account's storage while you are signed in, encrypted in this browser before it is stored`,lasts:`Until you change them. The account's copy is deleted with your FKN account, and this browser's copy of it when you sign out`,keys:{store:`local`,names:[...Ts,at]}},{id:`connected-sites`,title:`Connected tracking sites`,what:`Which of AniList, MyAnimeList and Crunchyroll you signed in to through stub on this device, so stub reaches only those.`,where:bR,lasts:`Until you sign out of them, or clear this site's data in your browser`,keys:{store:`local`,names:[St]}},{id:`site-status`,title:`Site sign-in states`,what:`Whether you were signed in to Crunchyroll, Prime Video, AniList and MyAnimeList when stub last learned it, and when. Never your name there.`,where:bR,lasts:`Until stub learns it again, or you clear this site's data in your browser`,keys:{store:`local`,names:[st]}},{id:`party-name`,title:`Party name`,what:`The name you gave yourself in a watch party.`,where:xR,lasts:`Until you close the tab`,keys:{store:`session`,names:[Xg]}},{id:`party-invite`,title:`Party you are in`,what:`The watch party this tab is in, so a reload rejoins it.`,where:xR,lasts:`Until you leave the party or close the tab`,keys:{store:`session`,names:[Yg]}},{id:`stub-list`,title:`Stub's list`,what:`What you track with stub's own tracker: status, progress, score and dates, with each title's name and cover. Signed in to FKN, stub uses your account's list instead, encrypted in this browser before it is stored.`,where:`The browser's private files for stub at this address, on this device only, and your FKN account's storage once you use its list`,lasts:`As long as the list: a removed entry stays in it, with its title and last values, as a record that it was removed`},{id:`site-sign-ins`,title:`Site sign-ins`,what:`Your Crunchyroll, Prime Video, AniList and MyAnimeList sessions, which stub plays and tracks with.`,where:`Without the FKN extension, FKN keeps them for every fkn.app app. With it, your browser does.`,lasts:`Until you sign out, or the site ends the session`},{id:`fkn-account`,title:`FKN account`,what:`Which FKN account you are signed in with.`,where:`FKN, not stub`,lasts:`Until you disconnect`},{id:`player`,title:`Player volume`,what:`The volume you last left a player at, and whether it was muted, so the next episode or theme starts the same. Speed and captions are not kept.`,where:bR,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[Le]}},{id:`positions`,title:`Where you stopped`,what:`The point you stopped at in each episode you have not finished, with the source it played on, its length and when you stopped, for your 200 most recent, and the source and time of the 200 you finished last. Signed in to FKN, they are your account's, so every stub site and device you sign in on resumes there. Those kept while signed out join the next FKN account signed in on this browser.`,where:`${bR}, and your FKN account's storage while you are signed in, encrypted in this browser before it is stored`,lasts:`Until 200 newer ones replace them. The account's copy is deleted with your FKN account, and this browser's copy of it when you sign out`,keys:{store:`local`,names:[rs,is]}},{id:`fetched`,title:`Titles, artwork and streams`,what:`What stub fetched to show you.`,where:`Memory, in this tab`,lasts:`Until you refresh or close the tab`}],CR=O`
|
|
4335
4337
|
display: flex;
|
|
4336
4338
|
flex-direction: column;
|
|
4337
4339
|
gap: 1rem;
|
|
@@ -4346,7 +4348,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4346
4348
|
|
|
4347
4349
|
strong { color: #fff; }
|
|
4348
4350
|
.facts { color: rgba(255, 255, 255, 0.55); }
|
|
4349
|
-
`,GI=e=>e.endsWith(`.`)?e:`${e}.`,KI=()=>W(zI,{children:[H(`h1`,{children:`Privacy`}),H(`div`,{className:`updated`,children:`Last updated 13 October 2026`}),H(`p`,{children:`stub is an independent, non-commercial personal project. In short: it has no accounts and no server of its own, runs no analytics, and keeps your settings and your watch list in your browser, or in your own FKN account when you choose to.`}),H(`h2`,{children:`What stub keeps`}),W(`p`,{children:[`stub sets no advertising or tracking cookies and runs no analytics or telemetry. This is everything it keeps, where, and for how long. You sign out of a site in`,` `,H(Bu,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, and remove a source you added in`,` `,H(Bu,{to:`/settings#sources`,children:`Settings, under Sources`}),`. Clearing this site's data in your browser removes everything stub keeps in this browser.`]}),H(`ul`,{css:WI,children:UI.map(e=>W(`li`,{children:[W(`strong`,{children:[e.title,`.`]}),` `,e.what,` `,W(`span`,{className:`facts`,children:[`Where: `,GI(e.where),` How long: `,GI(e.lasts)]})]},e.id))}),H(`p`,{children:`About stub's list: signed out, it is saved in your browser's storage for stub, on this device only. Signed in to an FKN account, stub uses that account's list instead: your changes are saved on the device and in the account's storage, encrypted in your browser before they leave the device, so every device signed in to the same account shows them. A list you kept before signing in is added to the account only if you choose to. When you sign out, the account's list is removed from the device. Removing an entry keeps a record that it was removed, with the entry's title and last values, so that every device using the list removes it too. There is no way to clear these records yet.`}),H(`h2`,{children:`Sign-ins to other sites`}),W(`p`,{children:[`stub plays Crunchyroll and Prime Video and tracks your AniList and MyAnimeList lists with your own accounts on those sites. Without the FKN browser extension, you sign in on each site's own page, in an FKN window, and the cookies that sign-in sets are kept by FKN, in a cookie jar every fkn.app app shares, and not by stub. Signing out in `,H(Bu,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, removes that site's cookies from FKN. The site itself is not told, so its session stays valid there until it expires, held by nobody.`]}),H(`p`,{children:`With the extension, stub uses your browser's own sessions for these sites and for Netflix. Those stay in your browser, and you sign in and out of them on the sites themselves.`}),H(`h2`,{children:`Network requests & third parties`}),W(`p`,{children:[`To fetch titles, artwork, and streams, stub sends requests through the FKN platform proxy, which then reaches third-party services such as AniList, MyAnimeList, Crunchyroll, Prime Video, JustWatch, and Netflix. The proxy requires no account. It uses your IP address to rate-limit requests, and it keeps a copy of each answer for a while, under a key made from the whole request (its address, headers and body), so only an identical request is answered from that copy. How the FKN platform handles that data is described in the`,` `,H(`a`,{href:`https://fkn.app/privacy`,target:`_blank`,rel:`noreferrer noopener`,children:`FKN platform privacy policy`}),`. Each third-party service receives the requests made to it and applies its own privacy policy, especially when you sign in to one (for example Crunchyroll) to watch.`]}),W(`p`,{children:[`JustWatch is asked for the streaming links of your country: the one you picked in`,` `,H(Bu,{to:`/settings#accounts`,children:`Settings`}),`, or else the one your device's time zone is in. Only the country is sent, never the time zone.`]}),H(`h2`,{children:`The optional browser extension`}),H(`p`,{children:`If you install the FKN browser extension, it works with your own already-logged-in sessions locally on your device so you can play content you have access to. Those credentials stay in your browser; stub never receives them.`}),H(`h2`,{children:`Your control`}),H(`p`,{children:`Disconnecting from FKN, in the account menu at the top right, takes your account's list off the device. Your party name and the party you are in go when you close the tab. If you use the browser extension, you can review and revoke its access at any time from the extension itself.`}),H(`h2`,{children:`Contact`}),W(`p`,{children:[`Questions about privacy can be raised through the project repository at`,` `,H(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]})]});G();var qI=({label:e,name:t=e,confirmLabel:n,busyLabel:r,question:i,onConfirm:a,home:o})=>{let[s,c]=U(!1),[l,u]=U(!1),d=K(null),f=K(null),p=K(null),m=K(!1),h=K(!0),g=Me(),_=()=>{let e=document.activeElement;return!e||e===document.body||!!p.current?.contains(e)};return B(()=>()=>{h.current=!1,p.current&&_()&&o?.current?.focus()},[]),ye(()=>{s?f.current?.focus():m.current&&d.current?.focus(),m.current=!1},[s]),s?W(`div`,{ref:p,className:`confirm`,role:`group`,"aria-label":t,children:[H(`p`,{id:g,children:i}),W(`div`,{className:`actions`,children:[H(`button`,{type:`button`,className:`danger`,"aria-describedby":g,disabled:l,onClick:()=>{u(!0),Promise.resolve().then(a).catch(()=>{}).finally(()=>{if(!h.current)return;let e=_();u(!1),c(!1),e&&(o?.current?o.current.focus():m.current=!0)})},children:l?r:n}),H(`button`,{ref:f,type:`button`,className:`secondary`,"aria-describedby":g,disabled:l,onClick:()=>{m.current=!0,c(!1)},children:`Cancel`})]})]}):H(`button`,{ref:d,type:`button`,className:`secondary`,"aria-label":t===e?void 0:t,onClick:()=>c(!0),children:e})};G();var JI=new Intl.DisplayNames([`en`],{type:`region`}),YI=e=>JI.of(e)??e,XI=[...bt].sort((e,t)=>YI(e).localeCompare(YI(t))),ZI=()=>{let[e,t]=U(ut);return B(()=>(t(ut()),ht(()=>t(ut()))),[]),e},QI=()=>(ZI(),it()),$I=()=>{let e=ZI(),t=Me();return W(`div`,{className:`row`,"data-setting":`country`,children:[H(`div`,{className:`head`,children:H(`h3`,{id:t,children:`Country`})}),W(`select`,{"aria-labelledby":t,value:e??``,onChange:e=>vt(e.currentTarget.value||void 0),children:[W(`option`,{value:``,children:[`Automatic (`,YI(yt()),`)`]}),XI.map(e=>H(`option`,{value:e,children:YI(e)},e))]})]})};G();var eL=e=>e instanceof Error?e.message:String(e),tL=(e,t)=>{switch(t){case`authed`:return{text:`Signed in to ${e}.`};case`closed`:return{text:`The sign-in window closed.`};case`blocked`:return{text:`The browser blocked the sign-in window. Allow pop-ups for this page and try again.`,error:!0};case`unsupported`:return{text:`Connected to ${e}.`}}},nL={"signed-in":`Signed in`,"signed-out":`Signed out`},rL=(e,t)=>{let[,n]=U(0);return B(()=>e.watch(t,()=>n(e=>e+1)),[e,t]),e.read(t)},iL=(e,t,n)=>{B(()=>{if(!t||!n)return;let r=()=>{document.visibilityState!==`hidden`&&e.refresh(`crunchyroll`,t)};return r(),document.addEventListener(`visibilitychange`,r),()=>document.removeEventListener(`visibilitychange`,r)},[e,t,n])},aL=({id:e,title:t,state:n,on:r,heading:i,children:a})=>W(`div`,{className:`row account`,"data-account":e,children:[W(`div`,{className:`head`,children:[H(`h3`,{ref:i,tabIndex:-1,children:t}),n?H(`span`,{className:`state${r?` on`:``}`,children:n}):void 0]}),a]}),oL=({note:e})=>H(`p`,{className:`note${e?.error?` error`:``}`,role:`status`,children:e?.text}),sL=()=>{let e=K(!0);return B(()=>()=>{e.current=!1},[]),e},cL=[{site:`crunchyroll`,origin:`cr`,name:`Crunchyroll`,hostFor:()=>`crunchyroll.com`,signsInOnCloud:()=>!0,checked:!0},{site:`prime`,origin:`amazon`,name:`Prime Video`,hostFor:g,signsInOnCloud:m,checked:!1}].filter(e=>G_(e.origin)),lL=({site:e,name:t,hostFor:n,signsInOnCloud:r,checked:i,account:a,backend:o,status:s})=>{let c=n(QI()),[l,u]=U(!1),[d,f]=U(),p=sL(),m=K(null),h=rL(s,e);iL(s,o,i&&o===`cloud`&&h!==void 0);let g=()=>{let e=a.signIn();u(!0),f(void 0),e.then(e=>{p.current&&f(tL(t,e))}).catch(e=>{p.current&&f({text:eL(e),error:!0})}).finally(()=>{p.current&&u(!1)})},_=()=>a.signOut().then(()=>{p.current&&f({text:`Signed out.`})},e=>{p.current&&f({text:`Could not sign out of ${t}: ${eL(e)}. Try again.`,error:!0})}),v=o===`cloud`&&r(c),y=h?.state??(v?`signed-out`:void 0);return W(aL,{id:e,title:t,state:y&&nL[y],on:y===`signed-in`,heading:m,children:[v?H(`div`,{className:`actions`,children:y===`signed-in`?H(qI,{label:`Sign out`,name:`Sign out of ${t}`,home:m,confirmLabel:`Yes, sign out`,busyLabel:`Signing out...`,question:`Sign out of ${t} in every fkn.app app?`,onConfirm:_}):H(`button`,{type:`button`,disabled:l,onClick:g,children:l?`Signing in...`:`Sign in`})}):o?H(`div`,{className:`actions`,children:W(`a`,{className:`link`,href:`https://www.${c}`,target:`_blank`,rel:`noreferrer`,children:[`Open `,c]})}):H(`p`,{children:`Loading...`}),H(oL,{note:d})]})},uL=[{site:`anilist`,name:`AniList`,host:`anilist.co`},{site:`mal`,name:`MyAnimeList`,host:`myanimelist.net`}].filter(e=>G_(e.site)),dL=({site:e,name:t,host:n,backend:r,sites:i,status:a})=>{let[o,s]=U(()=>i.isConnected(e)),[c,l]=U(!1),[u,d]=U(),f=sL(),p=K(null),m=rL(a,e),h=o&&m?.state!==`signed-out`;B(()=>(s(i.isConnected(e)),i.watch(e,()=>{f.current&&s(i.isConnected(e))})),[i,e]);let g=()=>{f.current&&s(i.isConnected(e))},_=()=>{let n=i.signIn(e);l(!0),d(void 0),n.then(e=>{f.current&&d(tL(t,e))}).catch(e=>{f.current&&d({text:eL(e),error:!0})}).finally(()=>{f.current&&l(!1),g()})},v=n=>i.signOut(e,n).then(()=>{f.current&&d({text:n===`cloud`?`Signed out.`:`Disconnected.`}),g()},e=>{f.current&&d({text:`Could not finish signing out of ${t}: ${eL(e)}. Sign in and out again to retry.`,error:!0}),g()});return W(aL,{id:e,title:t,state:o?m&&nL[m.state]:`Not connected`,on:h,heading:p,children:[r?H(`div`,{className:`actions`,children:h?H(qI,{label:r===`cloud`?`Sign out`:`Disconnect`,name:r===`cloud`?`Sign out of ${t}`:`Disconnect ${t}`,home:p,confirmLabel:r===`cloud`?`Yes, sign out`:`Yes, disconnect`,busyLabel:r===`cloud`?`Signing out...`:`Disconnecting...`,question:r===`cloud`?`Sign out of ${t} in every fkn.app app?`:`Disconnect ${t} on this device?`,onConfirm:()=>v(r)}):r===`extension`&&o?W(`a`,{className:`link`,href:`https://${n}`,target:`_blank`,rel:`noreferrer`,children:[`Open `,n]}):H(`button`,{type:`button`,disabled:c,onClick:_,children:c?`Signing in...`:r===`cloud`?`Sign in`:`Connect`})}):void 0,H(oL,{note:u})]})},fL=({backend:e})=>H(aL,{id:`netflix`,title:`Netflix`,children:e===`extension`?H(`div`,{className:`actions`,children:H(`a`,{className:`link`,href:`https://www.netflix.com`,target:`_blank`,rel:`noreferrer`,children:`Open netflix.com`})}):H(`p`,{children:`Needs the FKN browser extension.`})}),pL=({backend:e,sites:t,status:n,...r})=>W(`div`,{className:`rows`,children:[H($I,{}),cL.map(t=>H(lL,{...t,account:r[t.site],backend:e,status:n},t.site)),uL.map(r=>H(dL,{...r,backend:e,sites:t,status:n},r.site)),H(fL,{backend:e})]}),mL=[{origin:`mal`,name:`MyAnimeList`,url:`https://myanimelist.net`},{origin:`anilist`,name:`AniList`,url:`https://anilist.co`},{origin:`anizip`,name:`AniZip`,url:`https://api.ani.zip/`},{origin:`cr`,name:`Crunchyroll`,url:`https://www.crunchyroll.com`},{origin:`nf`,name:`Netflix`,url:`https://www.netflix.com`},{origin:`jw`,name:`JustWatch`,url:`https://www.justwatch.com`},{origin:`appletv`,name:`Apple TV+`,url:`https://tv.apple.com`},{origin:`paramount`,name:`Paramount+`,url:`https://www.paramountplus.com`},{origin:`disney`,name:`Disney+`,url:`https://www.disneyplus.com`},{origin:`amazon`,name:`Prime Video`,url:`https://www.primevideo.com`},{origin:`hulu`,name:`Hulu`,url:`https://www.hulu.com`},{origin:`peacock`,name:`Peacock`,url:`https://www.peacocktv.com`},{origin:`hbo`,name:`Max`,url:`https://www.max.com`},{origin:`fubo`,name:`Fubo`,url:`https://www.fubo.tv`},{origin:`hidive`,name:`HIDIVE`,url:`https://www.hidive.com`},{origin:`tubi`,name:`Tubi`,url:`https://tubitv.com`},{origin:`roku`,name:`The Roku Channel`,url:`https://therokuchannel.roku.com`},{origin:`pluto`,name:`Pluto TV`,url:`https://pluto.tv`},{origin:`plex`,name:`Plex`,url:`https://watch.plex.tv`},{origin:`hoopla`,name:`Hoopla`,url:`https://www.hoopladigital.com`},{origin:`starz`,name:`Starz`,url:`https://www.starz.com`},{origin:`amcplus`,name:`AMC+`,url:`https://www.amcplus.com`},{origin:`philo`,name:`Philo`,url:`https://www.philo.com`},{origin:`tmdb`,name:`TMDB`,url:`https://www.themoviedb.org`},{origin:`tvmaze`,name:`TVmaze`,url:`https://www.tvmaze.com`},{origin:`kitsu`,name:`Kitsu`,url:`https://kitsu.io`},{origin:`livechart`,name:`LiveChart`,url:`https://www.livechart.me`},{origin:`omdb`,name:`IMDb`,url:`https://www.imdb.com`},{origin:`trakt`,name:`Trakt`,url:`https://trakt.tv`},{origin:`simkl`,name:`Simkl`,url:`https://simkl.com`},{origin:`tvdb`,name:`TheTVDB`,url:`https://www.thetvdb.com`},{origin:`offline`,name:`Offline database`,url:`https://github.com/manami-project/anime-offline-database`},{origin:`animethemes`,name:`AnimeThemes`,url:`https://animethemes.moe`},{origin:`ann`,name:`Anime News Network`,url:`https://www.animenewsnetwork.com`},{origin:`watchmode`,name:`Watchmode`,url:`https://www.watchmode.com`}],hL=new Set([`anizip`,`jw`,`kitsu`,`livechart`,`offline`,`simkl`,`trakt`,`tvmaze`,`watchmode`]),gL=mL.filter(e=>!hL.has(e.origin)).map(e=>e.origin===`omdb`?{...e,origin:`imdb`}:e);G();var _L=()=>{let[e,t]=U(Ha);return B(()=>{let e=()=>t(Ha());return e(),Va(e)},[]),e};G();var vL=`
|
|
4351
|
+
`,wR=e=>e.endsWith(`.`)?e:`${e}.`,TR=()=>W(vR,{children:[H(`h1`,{children:`Privacy`}),H(`div`,{className:`updated`,children:`Last updated 13 October 2026`}),H(`p`,{children:`stub is an independent, non-commercial personal project. In short: it has no accounts and no server of its own, runs no analytics, and keeps your settings and your watch list in your browser, or in your own FKN account when you choose to.`}),H(`h2`,{children:`What stub keeps`}),W(`p`,{children:[`stub sets no advertising or tracking cookies and runs no analytics or telemetry. This is everything it keeps, where, and for how long. You sign out of a site in`,` `,H(Bu,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, and remove a source you added in`,` `,H(Bu,{to:`/settings#sources`,children:`Settings, under Sources`}),`. Clearing this site's data in your browser removes everything stub keeps in this browser.`]}),H(`ul`,{css:CR,children:SR.map(e=>W(`li`,{children:[W(`strong`,{children:[e.title,`.`]}),` `,e.what,` `,W(`span`,{className:`facts`,children:[`Where: `,wR(e.where),` How long: `,wR(e.lasts)]})]},e.id))}),H(`p`,{children:`About stub's list: signed out, it is saved in your browser's storage for stub, on this device only. Signed in to an FKN account, stub uses that account's list instead: your changes are saved on the device and in the account's storage, encrypted in your browser before they leave the device, so every device signed in to the same account shows them. A list you kept before signing in is added to the account only if you choose to. When you sign out, the account's list is removed from the device. Removing an entry keeps a record that it was removed, with the entry's title and last values, so that every device using the list removes it too. There is no way to clear these records yet.`}),H(`h2`,{children:`Sign-ins to other sites`}),W(`p`,{children:[`stub plays Crunchyroll and Prime Video and tracks your AniList and MyAnimeList lists with your own accounts on those sites. Without the FKN browser extension, you sign in on each site's own page, in an FKN window, and the cookies that sign-in sets are kept by FKN, in a cookie jar every fkn.app app shares, and not by stub. Signing out in `,H(Bu,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, removes that site's cookies from FKN. The site itself is not told, so its session stays valid there until it expires, held by nobody.`]}),H(`p`,{children:`With the extension, stub uses your browser's own sessions for these sites and for Netflix. Those stay in your browser, and you sign in and out of them on the sites themselves.`}),H(`h2`,{children:`Network requests & third parties`}),W(`p`,{children:[`To fetch titles, artwork, and streams, stub sends requests through the FKN platform proxy, which then reaches third-party services such as AniList, MyAnimeList, Crunchyroll, Prime Video and JustWatch. The proxy requires no account. It uses your IP address to rate-limit requests, and it keeps a copy of each answer for a while, under a key made from the whole request (its address, headers and body), so only an identical request is answered from that copy. How the FKN platform handles that data is described in the`,` `,H(`a`,{href:`https://fkn.app/privacy`,target:`_blank`,rel:`noreferrer noopener`,children:`FKN platform privacy policy`}),`. Each third-party service receives the requests made to it and applies its own privacy policy, especially when you sign in to one (for example Crunchyroll) to watch.`]}),H(`p`,{children:`Netflix's catalogue is the exception: stub asks www.netflix.com from your browser, not through the proxy, because its answer depends on your country, so Netflix sees your IP address.`}),W(`p`,{children:[`JustWatch is asked for the streaming links of your country: the one you picked in`,` `,H(Bu,{to:`/settings#accounts`,children:`Settings`}),`, or else the one your device's time zone is in. Only the country is sent, never the time zone.`]}),H(`h2`,{children:`The optional browser extension`}),H(`p`,{children:`If you install the FKN browser extension, it works with your own already-logged-in sessions locally on your device so you can play content you have access to. Those credentials stay in your browser; stub never receives them.`}),H(`h2`,{children:`Your control`}),H(`p`,{children:`Disconnecting from FKN, in the account menu at the top right, takes your account's list off the device. Your party name and the party you are in go when you close the tab. If you use the browser extension, you can review and revoke its access at any time from the extension itself.`}),H(`h2`,{children:`Contact`}),W(`p`,{children:[`Questions about privacy can be raised through the project repository at`,` `,H(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]})]});G();var ER=({label:e,name:t=e,confirmLabel:n,busyLabel:r,question:i,onConfirm:a,home:o})=>{let[s,c]=U(!1),[l,u]=U(!1),d=K(null),f=K(null),p=K(null),m=K(!1),h=K(!0),g=Me(),_=()=>{let e=document.activeElement;return!e||e===document.body||!!p.current?.contains(e)};return B(()=>()=>{h.current=!1,p.current&&_()&&o?.current?.focus()},[]),ye(()=>{s?f.current?.focus():m.current&&d.current?.focus(),m.current=!1},[s]),s?W(`div`,{ref:p,className:`confirm`,role:`group`,"aria-label":t,children:[H(`p`,{id:g,children:i}),W(`div`,{className:`actions`,children:[H(`button`,{type:`button`,className:`danger`,"aria-describedby":g,disabled:l,onClick:()=>{u(!0),Promise.resolve().then(a).catch(()=>{}).finally(()=>{if(!h.current)return;let e=_();u(!1),c(!1),e&&(o?.current?o.current.focus():m.current=!0)})},children:l?r:n}),H(`button`,{ref:f,type:`button`,className:`secondary`,"aria-describedby":g,disabled:l,onClick:()=>{m.current=!0,c(!1)},children:`Cancel`})]})]}):H(`button`,{ref:d,type:`button`,className:`secondary`,"aria-label":t===e?void 0:t,onClick:()=>c(!0),children:e})};G();var DR=new Intl.DisplayNames([`en`],{type:`region`}),OR=e=>DR.of(e)??e,kR=[...bt].sort((e,t)=>OR(e).localeCompare(OR(t))),AR=()=>{let[e,t]=U(ut);return B(()=>(t(ut()),ht(()=>t(ut()))),[]),e},jR=()=>(AR(),it()),MR=()=>{let e=AR(),t=Me();return W(`div`,{className:`row`,"data-setting":`country`,children:[H(`div`,{className:`head`,children:H(`h3`,{id:t,children:`Country`})}),W(`select`,{"aria-labelledby":t,value:e??``,onChange:e=>vt(e.currentTarget.value||void 0),children:[W(`option`,{value:``,children:[`Automatic (`,OR(yt()),`)`]}),kR.map(e=>H(`option`,{value:e,children:OR(e)},e))]})]})};G();var NR=e=>e instanceof Error?e.message:String(e),PR=(e,t)=>{switch(t){case`authed`:return{text:`Signed in to ${e}.`};case`closed`:return{text:`The sign-in window closed.`};case`blocked`:return{text:`The browser blocked the sign-in window. Allow pop-ups for this page and try again.`,error:!0};case`unsupported`:return{text:`Connected to ${e}.`}}},FR={"signed-in":`Signed in`,"signed-out":`Signed out`},IR=(e,t)=>{let[,n]=U(0);return B(()=>e.watch(t,()=>n(e=>e+1)),[e,t]),e.read(t)},LR=(e,t,n)=>{B(()=>{if(!t||!n)return;let r=()=>{document.visibilityState!==`hidden`&&e.refresh(`crunchyroll`,t)};return r(),document.addEventListener(`visibilitychange`,r),()=>document.removeEventListener(`visibilitychange`,r)},[e,t,n])},RR=({id:e,title:t,state:n,on:r,heading:i,children:a})=>W(`div`,{className:`row account`,"data-account":e,children:[W(`div`,{className:`head`,children:[H(`h3`,{ref:i,tabIndex:-1,children:t}),n?H(`span`,{className:`state${r?` on`:``}`,children:n}):void 0]}),a]}),zR=({note:e})=>H(`p`,{className:`note${e?.error?` error`:``}`,role:`status`,children:e?.text}),BR=()=>{let e=K(!0);return B(()=>()=>{e.current=!1},[]),e},VR=[{site:`crunchyroll`,origin:`cr`,name:`Crunchyroll`,hostFor:()=>`crunchyroll.com`,signsInOnCloud:()=>!0,checked:!0},{site:`prime`,origin:`amazon`,name:`Prime Video`,hostFor:g,signsInOnCloud:m,checked:!1}].filter(e=>G_(e.origin)),HR=({site:e,name:t,hostFor:n,signsInOnCloud:r,checked:i,account:a,backend:o,status:s})=>{let c=n(jR()),[l,u]=U(!1),[d,f]=U(),p=BR(),m=K(null),h=IR(s,e);LR(s,o,i&&o===`cloud`&&h!==void 0);let g=()=>{let e=a.signIn();u(!0),f(void 0),e.then(e=>{p.current&&f(PR(t,e))}).catch(e=>{p.current&&f({text:NR(e),error:!0})}).finally(()=>{p.current&&u(!1)})},_=()=>a.signOut().then(()=>{p.current&&f({text:`Signed out.`})},e=>{p.current&&f({text:`Could not sign out of ${t}: ${NR(e)}. Try again.`,error:!0})}),v=o===`cloud`&&r(c),y=h?.state??(v?`signed-out`:void 0);return W(RR,{id:e,title:t,state:y&&FR[y],on:y===`signed-in`,heading:m,children:[v?H(`div`,{className:`actions`,children:y===`signed-in`?H(ER,{label:`Sign out`,name:`Sign out of ${t}`,home:m,confirmLabel:`Yes, sign out`,busyLabel:`Signing out...`,question:`Sign out of ${t} in every fkn.app app?`,onConfirm:_}):H(`button`,{type:`button`,disabled:l,onClick:g,children:l?`Signing in...`:`Sign in`})}):o?H(`div`,{className:`actions`,children:W(`a`,{className:`link`,href:`https://www.${c}`,target:`_blank`,rel:`noreferrer`,children:[`Open `,c]})}):H(`p`,{children:`Loading...`}),H(zR,{note:d})]})},UR=[{site:`anilist`,name:`AniList`,host:`anilist.co`},{site:`mal`,name:`MyAnimeList`,host:`myanimelist.net`}].filter(e=>G_(e.site)),WR=({site:e,name:t,host:n,backend:r,sites:i,status:a})=>{let[o,s]=U(()=>i.isConnected(e)),[c,l]=U(!1),[u,d]=U(),f=BR(),p=K(null),m=IR(a,e),h=o&&m?.state!==`signed-out`;B(()=>(s(i.isConnected(e)),i.watch(e,()=>{f.current&&s(i.isConnected(e))})),[i,e]);let g=()=>{f.current&&s(i.isConnected(e))},_=()=>{let n=i.signIn(e);l(!0),d(void 0),n.then(e=>{f.current&&d(PR(t,e))}).catch(e=>{f.current&&d({text:NR(e),error:!0})}).finally(()=>{f.current&&l(!1),g()})},v=n=>i.signOut(e,n).then(()=>{f.current&&d({text:n===`cloud`?`Signed out.`:`Disconnected.`}),g()},e=>{f.current&&d({text:`Could not finish signing out of ${t}: ${NR(e)}. Sign in and out again to retry.`,error:!0}),g()});return W(RR,{id:e,title:t,state:o?m&&FR[m.state]:`Not connected`,on:h,heading:p,children:[r?H(`div`,{className:`actions`,children:h?H(ER,{label:r===`cloud`?`Sign out`:`Disconnect`,name:r===`cloud`?`Sign out of ${t}`:`Disconnect ${t}`,home:p,confirmLabel:r===`cloud`?`Yes, sign out`:`Yes, disconnect`,busyLabel:r===`cloud`?`Signing out...`:`Disconnecting...`,question:r===`cloud`?`Sign out of ${t} in every fkn.app app?`:`Disconnect ${t} on this device?`,onConfirm:()=>v(r)}):r===`extension`&&o?W(`a`,{className:`link`,href:`https://${n}`,target:`_blank`,rel:`noreferrer`,children:[`Open `,n]}):H(`button`,{type:`button`,disabled:c,onClick:_,children:c?`Signing in...`:r===`cloud`?`Sign in`:`Connect`})}):void 0,H(zR,{note:u})]})},GR=({backend:e})=>H(RR,{id:`netflix`,title:`Netflix`,children:e===`extension`?H(`div`,{className:`actions`,children:H(`a`,{className:`link`,href:`https://www.netflix.com`,target:`_blank`,rel:`noreferrer`,children:`Open netflix.com`})}):H(`p`,{children:`Needs the FKN browser extension.`})}),KR=({backend:e,sites:t,status:n,...r})=>W(`div`,{className:`rows`,children:[H(MR,{}),VR.map(t=>H(HR,{...t,account:r[t.site],backend:e,status:n},t.site)),UR.map(r=>H(WR,{...r,backend:e,sites:t,status:n},r.site)),H(GR,{backend:e})]}),qR=[{origin:`mal`,name:`MyAnimeList`,url:`https://myanimelist.net`},{origin:`anilist`,name:`AniList`,url:`https://anilist.co`},{origin:`anizip`,name:`AniZip`,url:`https://api.ani.zip/`},{origin:`cr`,name:`Crunchyroll`,url:`https://www.crunchyroll.com`},{origin:`nf`,name:`Netflix`,url:`https://www.netflix.com`},{origin:`jw`,name:`JustWatch`,url:`https://www.justwatch.com`},{origin:`appletv`,name:`Apple TV+`,url:`https://tv.apple.com`},{origin:`paramount`,name:`Paramount+`,url:`https://www.paramountplus.com`},{origin:`disney`,name:`Disney+`,url:`https://www.disneyplus.com`},{origin:`amazon`,name:`Prime Video`,url:`https://www.primevideo.com`},{origin:`hulu`,name:`Hulu`,url:`https://www.hulu.com`},{origin:`peacock`,name:`Peacock`,url:`https://www.peacocktv.com`},{origin:`hbo`,name:`Max`,url:`https://www.max.com`},{origin:`fubo`,name:`Fubo`,url:`https://www.fubo.tv`},{origin:`hidive`,name:`HIDIVE`,url:`https://www.hidive.com`},{origin:`tubi`,name:`Tubi`,url:`https://tubitv.com`},{origin:`roku`,name:`The Roku Channel`,url:`https://therokuchannel.roku.com`},{origin:`pluto`,name:`Pluto TV`,url:`https://pluto.tv`},{origin:`plex`,name:`Plex`,url:`https://watch.plex.tv`},{origin:`hoopla`,name:`Hoopla`,url:`https://www.hoopladigital.com`},{origin:`starz`,name:`Starz`,url:`https://www.starz.com`},{origin:`amcplus`,name:`AMC+`,url:`https://www.amcplus.com`},{origin:`philo`,name:`Philo`,url:`https://www.philo.com`},{origin:`tmdb`,name:`TMDB`,url:`https://www.themoviedb.org`},{origin:`tvmaze`,name:`TVmaze`,url:`https://www.tvmaze.com`},{origin:`kitsu`,name:`Kitsu`,url:`https://kitsu.io`},{origin:`livechart`,name:`LiveChart`,url:`https://www.livechart.me`},{origin:`omdb`,name:`IMDb`,url:`https://www.imdb.com`},{origin:`trakt`,name:`Trakt`,url:`https://trakt.tv`},{origin:`simkl`,name:`Simkl`,url:`https://simkl.com`},{origin:`tvdb`,name:`TheTVDB`,url:`https://www.thetvdb.com`},{origin:`offline`,name:`Offline database`,url:`https://github.com/manami-project/anime-offline-database`},{origin:`animethemes`,name:`AnimeThemes`,url:`https://animethemes.moe`},{origin:`ann`,name:`Anime News Network`,url:`https://www.animenewsnetwork.com`},{origin:`watchmode`,name:`Watchmode`,url:`https://www.watchmode.com`}],JR=new Set([`anizip`,`jw`,`kitsu`,`livechart`,`offline`,`simkl`,`trakt`,`tvmaze`,`watchmode`]),YR=qR.filter(e=>!JR.has(e.origin)).map(e=>e.origin===`omdb`?{...e,origin:`imdb`}:e);G();var XR=()=>{let[e,t]=U(Ha);return B(()=>{let e=()=>t(Ha());return e(),Va(e)},[]),e};G();var ZR=`
|
|
4350
4352
|
max-width: 52rem;
|
|
4351
4353
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
4352
4354
|
border-radius: 0.8rem;
|
|
@@ -4354,9 +4356,9 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4354
4356
|
font-size: 1.5rem;
|
|
4355
4357
|
font-weight: 600;
|
|
4356
4358
|
color: #fff;
|
|
4357
|
-
`,
|
|
4359
|
+
`,QR=O`
|
|
4358
4360
|
label.autoplay {
|
|
4359
|
-
${
|
|
4361
|
+
${ZR}
|
|
4360
4362
|
display: flex;
|
|
4361
4363
|
align-items: center;
|
|
4362
4364
|
justify-content: space-between;
|
|
@@ -4388,7 +4390,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4388
4390
|
}
|
|
4389
4391
|
|
|
4390
4392
|
ol.play-order li {
|
|
4391
|
-
${
|
|
4393
|
+
${ZR}
|
|
4392
4394
|
display: flex;
|
|
4393
4395
|
align-items: center;
|
|
4394
4396
|
gap: 0.8rem;
|
|
@@ -4421,7 +4423,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4421
4423
|
}
|
|
4422
4424
|
|
|
4423
4425
|
ol.play-order button[aria-disabled='true'] { opacity: 0.35; cursor: default; }
|
|
4424
|
-
|
|
4426
|
+
`,$R=new Map(qR.filter(e=>mo.includes(e.origin)).map(e=>[e.origin,e.name])),ez=()=>{let[e,t]=U(ho),[n,r]=U(Lt);B(()=>_o(()=>t(ho())),[]),B(()=>$t(()=>r(Lt())),[]);let i=new Map([...$R,...XR().flatMap(e=>e.state===`connected`?e.sources?.map(e=>[e.origin,e.name])??[]:[])]),a=vo(e,[...i.keys()]),o=a.filter(e=>i.has(e)&&!n.includes(e)),s=K(void 0);ye(()=>{s.current?.focus(),s.current=void 0});let c=(e,t,n)=>{let r=t<0?n===0:n===o.length-1;return H(`button`,{type:`button`,className:`secondary`,"aria-label":`Move ${i.get(e)} ${t<0?`up`:`down`}`,"aria-disabled":r?!0:void 0,onClick:n=>{r||(s.current=n.currentTarget,go(yo(a,e,t,o)))},children:H(t<0?rh:nh,{})})};return H(`ol`,{className:`play-order`,children:o.map((e,t)=>W(`li`,{"data-play-order":e,children:[H(`span`,{className:`name`,children:i.get(e)}),c(e,-1,t),c(e,1,t)]},e))})},tz=()=>{let[e,t]=U(Eo);return B(()=>Oo(()=>t(Eo())),[]),W(`div`,{css:QR,children:[W(`label`,{className:`autoplay`,children:[`Autoplay next episode`,H(`input`,{type:`checkbox`,role:`switch`,css:P_,checked:e,onChange:e=>{let n=e.target.checked;Do(n),t(n)}})]}),H(`h3`,{className:`part`,children:`Play order`}),H(ez,{})]})},nz=[{id:`accounts`,title:`Accounts`},{id:`sources`,title:`Sources`},{id:`playback`,title:`Playback`}],rz=e=>nz.find(t=>`#${t.id}`===e)?.id??`accounts`;G();var iz=O`
|
|
4425
4427
|
h3.part {
|
|
4426
4428
|
font-size: 1.3rem;
|
|
4427
4429
|
font-weight: 700;
|
|
@@ -4619,7 +4621,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4619
4621
|
.group button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 0; }
|
|
4620
4622
|
|
|
4621
4623
|
.by-address .note { font-size: 1.35rem; overflow-wrap: anywhere; }
|
|
4622
|
-
`,
|
|
4624
|
+
`,az={connected:`Connected`,connecting:`Connecting`,error:`Error`},oz=({plugin:e,onRemove:t})=>{let n=e.sources??[],r=n.length?n.map(e=>e.name).join(`, `):e.uri.replace(/^npm:/,``);return W(`li`,{className:`row plugin`,"data-plugin":e.uri,children:[W(`div`,{className:`info`,children:[H(`span`,{className:`name`,children:r}),n.length?W(`span`,{className:`meta`,children:[H(`span`,{className:`uri`,children:e.uri}),n.length>1?` · ${n.length} sources`:``,e.rejected?.length?` · ${e.rejected.length} unavailable`:``]}):void 0]}),W(`span`,{className:`pill`,"data-state":e.state,children:[H(`span`,{className:`dot`,"aria-hidden":`true`}),az[e.state]]}),H(`button`,{type:`button`,className:`secondary small`,"aria-label":`Remove ${r}`,onClick:t,children:`Remove`}),e.state===`error`?H(`p`,{className:`failure`,children:`Could not connect to this source.`}):void 0]})},sz=e=>{let{host:t,pathname:n}=new URL(e);return t.replace(/^www\./,``)+n.replace(/\/$/,``)},cz=qR.filter(e=>G_(e.origin)),lz=()=>{let[e,t]=U(()=>new Set(Lt()));B(()=>$t(()=>t(new Set(Lt()))),[]);let n=cz.filter(t=>e.has(t.origin)).length;return W(R,{children:[W(`div`,{className:`part-head`,children:[H(`h3`,{className:`part`,children:`Built in`}),H(`span`,{className:`count`,children:n?`${cz.length-n} of ${cz.length} on`:`All ${cz.length} on`}),H(`button`,{type:`button`,className:`link-button`,"aria-disabled":!n||void 0,onClick:()=>{n&&Xt(cz.map(e=>e.origin))},children:`Turn all on`})]}),H(`ul`,{className:`built-in`,children:cz.map(t=>{let n=!e.has(t.origin);return H(`li`,{"data-source":t.origin,children:W(`label`,{className:n?void 0:`off`,children:[W(`span`,{className:`source`,children:[H(`span`,{className:`source-name`,children:t.name}),H(`span`,{className:`host`,children:sz(t.url)})]}),H(`input`,{type:`checkbox`,role:`switch`,css:P_,"aria-label":t.name,checked:n,onChange:e=>Mt(t.origin,e.target.checked)})]})},t.origin)})})]})},uz=()=>{let e=fo();return W(R,{children:[H(`h3`,{className:`part`,children:`Icons`}),H(`ul`,{className:`built-in`,children:YR.map(t=>{let n=!e.has(t.origin);return H(`li`,{"data-icon":t.origin,children:W(`label`,{className:n?void 0:`off`,children:[H(`span`,{className:`source`,children:H(`span`,{className:`source-name`,children:t.name})}),H(`input`,{type:`checkbox`,role:`switch`,css:P_,"aria-label":`${t.name} icon`,checked:n,onChange:e=>lo(t.origin,e.target.checked)})]})},t.origin)})})]})},dz=()=>{let[e,t]=U(Ha),[n,r]=U(``),[i,a]=U(!1),[o,s]=U(``),c=Me(),l=()=>t(Ha());return B(()=>(l(),Va(l)),[]),W(`div`,{css:iz,children:[H(lz,{}),H(uz,{}),H(`h3`,{className:`part`,children:`Added`}),e.length?H(`ul`,{className:`rows`,children:e.map(e=>H(oz,{plugin:e,onRemove:()=>{ao(e.uri).then(l)}},e.uri))}):H(`p`,{className:`row empty`,children:`No sources added yet.`}),W(`div`,{className:`add`,children:[H(`div`,{className:`browse`,children:H(`button`,{type:`button`,onClick:()=>{oo().finally(l)},children:`Browse sources`})}),W(`form`,{className:`by-address`,onSubmit:e=>{e.preventDefault();let t=n.trim();t&&!i&&(a(!0),s(``),ro(t).then(e=>{e&&r(``)}).catch(e=>{console.warn(`Source '${t}' could not be added:`,e),s(`Could not add this source. Check the address.`)}).finally(()=>{a(!1),l()}))},children:[H(`label`,{for:`${c}-address`,children:`Or add one by its address`}),W(`div`,{className:`group${o?` invalid`:``}`,children:[H(`input`,{id:`${c}-address`,type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`npm:@scope/package`,"aria-invalid":o?!0:void 0,"aria-describedby":`${c}-error`,value:n,onInput:e=>r(e.target.value)}),H(`button`,{type:`submit`,disabled:i,children:i?`Adding...`:`Add`})]}),H(`p`,{className:`note error`,id:`${c}-error`,role:`alert`,children:o})]})]})]})},fz=O`
|
|
4623
4625
|
min-width: 0;
|
|
4624
4626
|
|
|
4625
4627
|
& > h2 {
|
|
@@ -4756,7 +4758,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4756
4758
|
}
|
|
4757
4759
|
|
|
4758
4760
|
.confirm p { color: rgba(255, 255, 255, 0.9); }
|
|
4759
|
-
`,
|
|
4761
|
+
`,pz={url:`${dt}/auth/v1/token`,authorization:`Basic ${btoa(`${Ze}:`)}`,deviceType:`stub on FKN`},mz=async({url:e,authorization:t,deviceType:n},r=fetch,i)=>{let a=globalThis.location?.origin===new URL(e).origin?globalThis.document?.cookie??``:``,o=/(?:^|;\s*)device_id=([^;]+)/.exec(a)?.[1]??crypto.randomUUID(),s=await r(`${e}?_=${crypto.randomUUID()}`,{method:`POST`,credentials:`include`,headers:{authorization:t,"content-type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`etp_rt_cookie`,device_id:o,device_type:n}).toString()}),c=await s.json().catch(()=>null);return!s.ok||!i?{status:s.status,body:s.ok?null:c}:{status:s.status,body:null,read:await i(c)}},hz=e=>(e?.context??[]).some(e=>e.field===`etp_rt`&&e.code===`auth.obtain_access_token.missing_required_field`),gz=({status:e,body:t})=>{if(e===200)return`signed-in`;if(e===400&&hz(t))return`signed-out`;throw Error(`Crunchyroll answered ${e}`)},_z=`Check whether you are signed in to crunchyroll.com`,vz=async(e,{attach:t,mount:n,fetch:r,settle:i=()=>new Promise(e=>setTimeout(e,2e3))})=>{if(e===`extension`)return gz(await mz(pz,r));let{iframe:a,remove:o}=n();try{let e=await(await t({iframe:a,blank:{url:Xe},cookies:`persistent`,permissions:[{category:`evaluation`,reason:_z}]})).evaluate(mz,pz);return e.status===200&&await i(),gz(e)}finally{o()}},yz={signIn:Qt,signOut:At},bz={signIn:()=>Ct({url:x(g(it())),domains:v,isSignedIn:y}).then(lt(ct,`prime`)),signOut:()=>Ot(v).then(()=>ct.record(`prime`,`signed-out`))},xz={isConnected:Pt,watch:jt,signIn:e=>Zt[e](),signOut:Et},Sz={read:ct.read,watch:ct.watch,refresh:gt(ct,(e,t)=>vz(t,{attach:Ye,mount:()=>Dt(`Sign-in check`),fetch:qe}))};G();var Cz=O`
|
|
4760
4762
|
display: grid;
|
|
4761
4763
|
grid-template-columns: 17rem minmax(0, 1fr);
|
|
4762
4764
|
column-gap: 4rem;
|
|
@@ -4817,7 +4819,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4817
4819
|
|
|
4818
4820
|
.index a[aria-current='true'] { background: #fff; color: #000; border-color: #fff; }
|
|
4819
4821
|
}
|
|
4820
|
-
`,
|
|
4822
|
+
`,wz=()=>location.hash,Tz=()=>{let[e,t]=U(),n=rz(uu(wz)),r=nz.find(e=>e.id===n);return B(()=>{let e=!1;return Qe().then(n=>{e||t(n)}),()=>{e=!0}},[]),W(`div`,{css:Cz,children:[H(`h1`,{children:`Settings`}),H(`nav`,{className:`index`,"aria-label":`Settings categories`,children:nz.map(e=>H(`a`,{href:`#${e.id}`,"aria-current":r===e?`true`:void 0,onClick:Fh,children:e.title},e.id))}),W(`section`,{css:fz,"data-section":r.id,"aria-labelledby":`settings-section-title`,children:[H(`h2`,{id:`settings-section-title`,children:r.title}),r.id===`accounts`?H(KR,{backend:e,crunchyroll:yz,prime:bz,sites:xz,status:Sz}):r.id===`sources`?H(dz,{}):H(tz,{})]})]})},Ez=e=>typeof e!=`number`||e===1/0?void 0:e>0?e:0,Dz=e=>typeof e==`number`&&Number.isFinite(e),Oz=e=>{if(!e||typeof e!=`object`)return;let{time:t,readyState:n,ranges:r}=e;if(!(!Dz(t)||t<0||!Dz(n)||!Number.isInteger(n)||n<0||n>4))return Array.isArray(r)&&r.every(e=>Array.isArray(e)&&e.length===2&&Dz(e[0])&&Dz(e[1])&&e[0]<=e[1])?{time:t,readyState:n,ranges:r}:void 0},kz=1e3,Az=e=>{let{onPlayback:t,applyPlayback:n,buffer:r}=e;if(!t||!n)return;let i=new Set,a=!1,o=!1,s,c=e=>{if(a||!wg(e))return;o=e.ended===!0,s=Ez(e.duration);let{paused:t,time:n,rate:r,at:c}=e;for(let e of i)e({paused:t,time:n,rate:r,at:c})},l=()=>{t(c).catch(()=>{})};return l(),{apply:e=>{n(e).catch(()=>{})},onReport:e=>(i.add(e),l(),()=>{i.delete(e)}),ended:()=>o,duration:()=>s,...r?{buffer:()=>Promise.race([r().then(Oz,()=>void 0),new Promise(e=>setTimeout(e,kz))])}:{},dispose:()=>{a=!0,i.clear()}}};G();var jz=O`
|
|
4821
4823
|
position: relative;
|
|
4822
4824
|
width: 100%;
|
|
4823
4825
|
flex: 1;
|
|
@@ -4843,9 +4845,9 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4843
4845
|
color: rgba(255, 255, 255, 0.55);
|
|
4844
4846
|
font-size: 1.4rem;
|
|
4845
4847
|
}
|
|
4846
|
-
|
|
4848
|
+
`,Mz=({pluginUri:e,release:t,onUnplayable:n,onPlayback:i})=>{let a=K(null),[o,s]=U(!1),c=K({onUnplayable:n,onPlayback:i});return c.current={onUnplayable:n,onPlayback:i},B(()=>{let n=a.current;if(!n)return;let i=!1,o,l;return s(!1),(async()=>{try{let a=await wt.mount(e,{iframe:n,protocol:fi});if(i){a.unmount();return}o=a;let{origin:s}=r(t.uri),u=a.remote,d=u.sources?.find(e=>e.origin===s)??u,f=await d.play?.({uri:t.uri,url:t.url});if(i)return;if(!f){a.unmount(),o=void 0,c.current.onUnplayable();return}l=Az(d),l&&c.current.onPlayback?.(l)}catch(t){if(i)return;console.warn(`Source '${e}' could not start playback:`,t),s(!0)}})(),()=>{i=!0,l&&(l.dispose(),c.current.onPlayback?.(void 0)),o?.unmount()}},[e,t.uri,t.url]),W(`div`,{css:jz,children:[H(`iframe`,{ref:a,sandbox:`allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox`,allow:`fullscreen; autoplay; encrypted-media; cross-origin-isolated`}),o?H(`div`,{className:`failed`,children:`This source could not start playback.`}):null]})},Nz=(e,t,n)=>{let r=t===`party`?e:t;if(!(r===void 0||n.busy||r===n.selected)&&(r===null||n.ids.includes(r)))return r},Pz=(e,t,n,r,i)=>!n||r.selected===n.selected||r.selected===i?e:r.selected===t?`party`:r.selected;G();var Fz=()=>location.pathname+location.search,Iz=()=>navigator.userActivation?.isActive??!0,Lz=({link:e,tracks:t})=>{let n=m_(),r=n.status===`active`?n.role:void 0,i=Q.following(),a=K(void 0),o=K(void 0),s=K(0),c=K(void 0),u=K(0),d=K(void 0),f=K(new Map),p=K(void 0),m=K(void 0),h=K(new Map),g=()=>m.current?.busy??!1,_=(t,n)=>{if(!e||!Q.following()||g())return;let r=Date.now(),i=o.current&&Mg(o.current,o.current.at,r),a=i&&kg(i,t,r,n);e.ended?.()&&a?.seek===void 0||((!a||a.seek!==void 0||a.play||a.pause)&&(u.current=r+Ng),a?.seek!==void 0&&(d.current=a.seek),e.apply(t,n))},v=()=>{let e=a.current;e&&_(Mg(e.state,e.receivedAt,Date.now()),e.measured)},y=(e,t)=>{let n=Q.hostClock(),r=n?{...t,at:qg(t.at,n.offset)}:t;for(let t of e){let e=f.current.get(t)??{sentAt:0};if(f.current.set(t,e),e.next={t:`ask`,c:t,path:Fz(),s:r},e.timer)continue;let n=()=>{e.timer=void 0,e.sentAt=Date.now(),Q.send(e.next)},i=e.sentAt+250-Date.now();i<=0?n():e.timer=setTimeout(n,i)}s.current=Date.now()+Pg,clearTimeout(c.current),c.current=setTimeout(v,Pg)};B(()=>{if(a.current=void 0,o.current=void 0,p.current=void 0,d.current=void 0,!e||!r)return;let t=e.onReport(t=>{let n=o.current;if(o.current=t,r===`host`){if(g())return;p.current=t,Q.setPlayback(t),Q.send({t:`playback`,s:t});return}let i=a.current;if(!i||e.ended?.()||!Q.following()||g())return;let c=Date.now(),l=c<s.current,f=Mg(i.state,i.receivedAt,c),m=d.current!==void 0&&Math.abs(t.time-d.current)<=.5;m&&(d.current=void 0);let h=n&&Iz()&&(l||c>=u.current)?Fg(n,t,l?n:f).filter(e=>Q.may(e)&&!(m&&e===`seek`)):[];h.length?y(h,t):l||_(f,i.measured)});return()=>{t(),clearTimeout(c.current);for(let e of f.current.values())clearTimeout(e.timer);f.current.clear(),s.current=0,r===`host`&&Q.setPlayback(void 0)}},[r,e]),B(()=>{i&&v()},[i]),B(()=>{if(r!==`guest`)return;let t,n=!0,i=async()=>{let r=Fz(),i=Q.hostPath();if(i===void 0)return;if(i!==r){Q.setStatus({s:`away`});return}let s=await e?.buffer?.();if(!n)return;let c=Date.now(),l=o.current&&Mg(o.current,o.current.at,c),u=s?.time??l?.time,d=l&&!l.paused&&(s?.readyState??3)>=3,f=u===void 0?{}:{time:u,rate:d?l.rate:0};if(!Q.following()){Q.setStatus({s:`away`,path:r,...f});return}let p=a.current;t=p?Bg(t,s,Mg(p.state,p.receivedAt,c).time,e?.duration?.()):`loading`,Q.setStatus({s:t,path:r,...f})};i();let s=setInterval(()=>{i()},Lg);return()=>{n=!1,clearInterval(s)}},[r,e]),B(()=>()=>{r===`guest`&&Q.setStatus({s:`away`})},[r]);let b=()=>{let e=m.current;if(t&&e&&r)for(let n of l){let r=e[n],i=r&&Nz(Q.partyTrack(n),Q.mine(n),{...r,busy:e.busy});i===void 0&&!e.busy&&h.current.delete(n),i!==void 0&&h.current.get(n)!==i&&(h.current.set(n,i),t.select(n,i))}},x=()=>{if(r===`guest`){v();return}let t=p.current,n=o.current;if(!e||!t||!n)return;let i=Date.now(),a=Mg(t,t.at,i),s=Mg(n,n.at,i);Math.abs(a.time-s.time)>.5?e.apply({...s,time:a.time},!0):(p.current=n,Q.setPlayback(n),Q.send({t:`playback`,s:n}))};return B(()=>{if(m.current=void 0,h.current.clear(),!t||!r)return;let e=t.onTracks(e=>{let t=m.current;m.current=e;for(let n of l){let r=e[n];if(!r)continue;let i=Pz(Q.mine(n),Q.partyTrack(n),t?.[n],r,h.current.get(n));i!==Q.mine(n)&&Q.setMine(n,i)}Q.setPlayerTracks(e),t?.busy&&!e.busy&&x(),b()});return()=>{e(),m.current=void 0,Q.setPlayerTracks(void 0)}},[r,t,e]),B(b),h_(t=>{if(r===`host`){if(t.t!==`ask`||!(`s`in t)||t.path!==Fz()||!e||!o.current)return;let n=Ig(o.current,t,Date.now());if(!n)return;g()&&(p.current=n),e.apply(n,!0);return}if(r!==`guest`)return;let n=t.t===`playback`||t.t===`state`?t.s:void 0;if(!n||Q.hostPath()!==Fz())return;let i=Q.hostClock(),c=i?{...n,at:Kg(n.at,i.offset)}:n;a.current={state:c,receivedAt:Date.now(),measured:!!i},Date.now()>=s.current&&_(c,!!i)}),null},Rz=[`play`,`pause`,`seeked`,`ratechange`,`ended`],zz=e=>({paused:e.paused,time:e.currentTime,rate:e.playbackRate??1,at:Date.now()}),Bz=(e,t=()=>{})=>{let n=new Set,r=()=>{let t=zz(e);for(let e of n)e(t)};for(let t of Rz)e.addEventListener(t,r);let i=setInterval(()=>{e.paused||r()},Eg);return{apply:(t,n)=>{let r=kg(zz(e),t,Date.now(),n);r.seek!==void 0&&(e.currentTime=r.seek),r.rate!==void 0&&(e.playbackRate=r.rate),r.pause&&e.pause(),r.play&&(e.autoplay?e.autoplay():e.play()).catch(()=>{})},onReport:e=>(n.add(e),queueMicrotask(r),()=>{n.delete(e)}),ended:()=>e.ended??!1,duration:()=>e.duration??0,buffer:async()=>{let{buffered:t}=e,n=[];for(let e=0;t&&e<t.length;e++)n.push([t.start(e),t.end(e)]);return{time:e.currentTime,readyState:e.readyState??0,ranges:n}},dispose:()=>{for(let t of Rz)e.removeEventListener(t,r);clearInterval(i),n.clear(),t()}}},Vz=e=>{let t=en(e,{origin:location.origin});return Bz(t,()=>t.destroy())},Hz=(e,t)=>t?`${e==null?``:`E${e} - `}${t}`:e==null?void 0:`Episode ${e}`;G();var Uz=(e,t)=>!!(e.url&&t.builtIn(e.origin,e.url))||!!(t.selfPlaying&&(e.embedUrl||t.selfPlaying(e.origin))),Wz=(e,t)=>{let n=e=>{let n=t.order.indexOf(e);return n<0?t.order.length:n},r;for(let i of e)Uz(i,t)&&(!r||n(i.origin)<n(r.origin))&&(r=i);if(!r)return;let i=t.order.slice(0,n(r.origin)).every(e=>!t.possible(e)||t.settled(e));return{uri:r.uri,now:i}},Gz=(e,{mediaUri:t,episodeUri:n,sourceUri:r,guest:i,cannotPlay:a},o)=>{let s=K(void 0);B(()=>{r&&r!==s.current&&(s.current=void 0)},[r]);let c=(!r||a&&r===s.current)&&!i&&e?.now?e.uri:void 0;B(()=>{c&&(s.current=c,o(qu(Z.WATCH,{mediaUri:t,episodeUri:n,sourceUri:c}),{replace:!0}))},[c,t,n])},Kz=(e,t)=>{if(Ey(e))return;let{handles:n,seasons:r,relations:i,type:a}=e,o=r?.findIndex(e=>n.some(t=>t.node.uri===e.uri))??-1;if(r&&o>=0){let e=r[o+t];return e&&d(e.uri)}let s=t>0?`SEQUEL`:`PREQUEL`,c=i?.filter(e=>e.relation===s&&Nx(e.format))??[];return(c.find(e=>e.format===a)??c[0])?.node.uri},qz=([e,t,n],r,i=new Date)=>{let a=[e,t,n].filter(e=>e!==void 0),o=a.flatMap(({uri:e,episodes:t})=>t.map(t=>({episode:t,mediaUri:e}))),s=a.flatMap(e=>Vy(e,i)),c=r<0?-1:r+(e?.episodes.length??0);return{previous:c>0?o[c-1]:void 0,next:c>=0&&!s[c+1]?o[c+1]:void 0}},Jz=(e,t,n)=>t?Wz(e.filter(e=>e.origin===t),n)?.uri:void 0;G();var Yz=(e,t,n,r)=>{let i=K({uris:n,guest:r});i.current={uris:n,guest:r},B(()=>{if(!e||!t)return;let n=!1,r,a=!1,o=()=>{document.visibilityState===`hidden`&&ls.flush()};document.addEventListener(`visibilitychange`,o);let s=e.onReport(o=>{let s=e.duration?.();if(!n&&s!==0){n=!0;let[,t]=ds(i.current.uris)??[];t!==void 0&&!i.current.guest&&o.time<30&&(!s||t<s)&&e.apply({...o,time:t,at:Date.now()})}let c=e.ended?.();(o.time!==r||c)&&ps(t,{time:o.time,duration:s,ended:c}),o.paused&&!a&&ls.flush(),r=o.time,a=o.paused});return()=>{s(),document.removeEventListener(`visibilitychange`,o),ls.flush()}},[e,t])};G();var Xz=5e3,Zz=le`
|
|
4847
4849
|
to { background-size: 100% 100%; }
|
|
4848
|
-
`,
|
|
4850
|
+
`,Qz=O`
|
|
4849
4851
|
position: absolute;
|
|
4850
4852
|
right: 2.4rem;
|
|
4851
4853
|
bottom: 8rem;
|
|
@@ -4873,9 +4875,9 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4873
4875
|
}
|
|
4874
4876
|
|
|
4875
4877
|
.up-next.counting {
|
|
4876
|
-
animation: ${
|
|
4878
|
+
animation: ${Zz} ${Xz}ms linear forwards;
|
|
4877
4879
|
}
|
|
4878
|
-
|
|
4880
|
+
`,$z=({link:e,next:t})=>{let[,n]=Mu(),[r,i]=U(),a=t?.href;return B(()=>{if(i(void 0),!e||!a)return;let t=!1;return e.onReport(({paused:n})=>{e.ended?.()?t&&(t=!1,document.fullscreenElement&&document.exitFullscreen().catch(()=>{}),i(Eo()?`counting`:`offered`)):(t||=!n,i(void 0))})},[e,!!a]),B(()=>{if(r!==`counting`||!a)return;let e=setTimeout(()=>n(a),Xz);return()=>clearTimeout(e)},[r,a]),!r||!a?null:W(`div`,{css:Qz,children:[H(`button`,{type:`button`,className:`up-next ${r}`,title:t?.title,onClick:()=>n(a),children:`Next episode`}),r===`counting`?H(`button`,{type:`button`,className:`up-next-cancel`,onClick:()=>i(void 0),children:`Cancel`}):void 0]})};G();var eB=e=>(e??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node),tB={nf:e=>`https://www.netflix.com/watch/${e}`},nB=iv(`
|
|
4879
4881
|
subscription GetWatchMedia($input: MediaInput!) {
|
|
4880
4882
|
media(input: $input) {
|
|
4881
4883
|
_id
|
|
@@ -4962,7 +4964,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4962
4964
|
}
|
|
4963
4965
|
}
|
|
4964
4966
|
}
|
|
4965
|
-
`),
|
|
4967
|
+
`),rB=iv(`
|
|
4966
4968
|
subscription GetWatchOrigins($input: OriginPageInput!) {
|
|
4967
4969
|
originPage(input: $input) {
|
|
4968
4970
|
nodes {
|
|
@@ -4975,7 +4977,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
4975
4977
|
}
|
|
4976
4978
|
}
|
|
4977
4979
|
}
|
|
4978
|
-
`),
|
|
4980
|
+
`),iB=e=>{let[t]=ui({query:nB,variables:{input:{uri:e??``}},pause:!e});return cy(t,e)},aB=O`
|
|
4979
4981
|
display: flex;
|
|
4980
4982
|
flex-direction: column;
|
|
4981
4983
|
height: 100vh;
|
|
@@ -5095,13 +5097,13 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5095
5097
|
}
|
|
5096
5098
|
}
|
|
5097
5099
|
}
|
|
5098
|
-
`,
|
|
5100
|
+
`,oB=()=>{let e=Au(),t={...e,mediaUri:o(e.mediaUri),episodeUri:T(e.episodeUri),sourceUri:T(e.sourceUri)},[,n]=Mu(),i=K(null),[c,l]=U(),[p,m]=U(void 0),[h]=ui({query:nB,variables:{input:{uri:t.mediaUri}},pause:!t.mediaUri}),g=h.data?.media,_=V(()=>g?.episodes?.find(e=>e.uri&&t.episodeUri?a(d(e.uri),d(t.episodeUri)):!1),[g?.episodes,t.episodeUri]),v=t.sourceUri,y=c?.sourceUri===v?c?.link:void 0,x=V(()=>{let e=eB(_?.handles);if(!v||_?.handles?.some(e=>e.node.uri===v))return e;let{origin:t,id:n}=r(v),i=tB[t]?.(n);return i?[...e,{uri:v,origin:t,url:i}]:e},[_?.handles,v]),w=V(()=>_?.uri?s(_.uri)?.handleUrisValues:void 0,[_?.uri]),E=V(()=>w&&[...new Set([...w,...x].map(e=>e.origin))],[w,x]),[{data:D}]=ui({query:rB,variables:{input:{ids:E,filters:[Ai.IsNotApiOnly]}},pause:!E}),k=g?.titles?.at(0)?.title,A=_?.titles?.at(0)?.title,j=_?.episodeNumber,M=Hz(j,A),[N,ee]=U();B(()=>{let e=!1;return Qe().then(t=>{e||ee(t)}),()=>{e=!0}},[]);let te=V(()=>v?f(v):{},[v]),P=V(()=>{if(!v)return;let e=x.find(e=>e.uri===v);if(!e)return;if(e.embedUrl)return e.embedUrl;let{origin:n}=r(v);if(!e.url||!$y(n,e.url,N)||N!==`extension`&&Zy.has(n))return;let i=new URLSearchParams({mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:v,url:e.url,...te});return`${new URL(`../embed.html`,import.meta.url).href}?${i}`},[v,x,t.mediaUri,t.episodeUri,te,N]),ne=XR(),re=ne.flatMap(e=>e.state===`connected`?e.sources?.map(e=>e.origin)??[]:[]),F=re.join(`,`),[I,ie]=U({}),[L,ae]=U(),[oe,se]=U();B(()=>{let e=!1,t=F?F.split(`,`):[],n=async e=>Object.fromEntries((await Promise.all(t.map(async t=>[t,(await e(t))?.pluginUri]))).filter(e=>!!e[1]));return Promise.all([n(Jt),n(Ft)]).then(([t,n])=>{e||(ie(t),ae(n),se(F))}).catch(()=>{e||se(F)}),()=>{e=!0}},[F]);let ce=V(()=>{if(!v)return;let{origin:e}=r(v),t=L?.[e];if(!t)return;let n=x.find(e=>e.uri===v);if(n)return{pluginUri:t,release:{uri:v,url:n.url??void 0}}},[v,L,x]),[le,ue]=U();B(()=>{ue(void 0)},[v]);let de=!!(ce&&le!==v);B(()=>{let e=i.current;if(de||!P||!e)return;let t=Vz(e),n=C(e);return l({link:t,sourceUri:v}),m(n),()=>{t.dispose(),n.dispose(),l(void 0),m(void 0)}},[de,P]),B(()=>{let e=i.current;if(!de&&P&&e&&M)return b(e,M)},[de,P,M]),B(()=>{let e=i.current;if(!de&&P&&e&&v)return u(e,v)},[de,P,v]);let[fe,pe]=U([]);B(()=>{let e=i.current;if(!de&&P&&e&&v)return S(e,()=>pe(e=>[...e,v]))},[de,P,v]);let me=V(()=>(D?.originPage?.nodes??[]).map(e=>{let n=x.filter(t=>t.origin===e.id),i=!!L?.[e.id],a=t=>!!(t?.embedUrl||i||$y(e.id,t?.url,N)),o=e=>qu(Z.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}),s=n.map(e=>({uri:e.uri,label:e.shortDescriptions?.at(0)?.shortDescription??e.titles?.at(0)?.title??r(e.uri).id,href:a(e)?o(e.uri):e.url??void 0,external:!a(e),active:v===e.uri})),c=n.at(0);return{id:e.id,name:e.name??e.id,icon:e.icon,color:e.color,href:c?s.at(0)?.href:void 0,external:!c||!a(c),active:s.some(e=>e.active),releases:s.length>1?s:void 0,picker:I[e.id]?{pluginUri:I[e.id]}:void 0}}).filter(e=>e.href||e.releases),[D,x,t.mediaUri,t.episodeUri,v,I,L,N]),R=x.find(e=>e.uri===v),z=N===`cloud`&&!P&&R?.url&&$y(R.origin,R.url,`extension`)?qR.find(e=>e.origin===R.origin)?.name:void 0;B(()=>{z&&v&&!Ge()&&pe(e=>[...e,v])},[z,v]);let he=K(new Map);for(let e of he.current.keys())re.includes(e)||he.current.delete(e);for(let e of re)he.current.has(e)||he.current.set(e,g);let ge=!!g?.settled&&oe===F,_e=ne.some(e=>e.state===`connecting`),ve=m_(),ye=N===`extension`||Ge(),be={builtIn:(e,t)=>$y(e,t,`extension`),selfPlaying:L&&(e=>!!L[e]),order:vo(ho(),re),possible:e=>Xy.has(e)?(ye||!Zy.has(e))&&!Lt().includes(e):_e||re.includes(e),settled:e=>ge&&(Xy.has(e)||he.current.has(e)&&he.current.get(e)!==g)},xe=ve.status===`joining`||ve.status===`active`&&ve.role===`guest`,Ce=!!(v&&fe.includes(v));Gz(Wz(x.filter(e=>!fe.includes(e.uri)),be),{...t,guest:xe,cannotPlay:Ce},n),Yz(y,v,x.map(e=>e.uri),xe);let Te=g?.episodes??[],Ee=_?Te.indexOf(_):-1,De=iB(g&&Ee===0?Kz(g,-1):void 0),Oe=iB(g&&Ee>=0&&Ee===Te.length-1?Kz(g,1):void 0),ke=Yy(),{previous:Ae,next:je}=qz([De,g?{...g,uri:t.mediaUri}:void 0,Oe],Ee,new Date(ke)),Me=v?r(v).origin:void 0,Ne=e=>e?.episode.uri?{href:qu(Z.WATCH,{mediaUri:e.mediaUri,episodeUri:e.episode.uri,sourceUri:Jz(eB(e.episode.handles),Me,be)}),title:Hz(e.episode.episodeNumber,e.episode.titles?.at(0)?.title)}:void 0,Pe=Ne(Ae),Fe=Ne(je),Ie=!xe&&je&&Wz(eB(je.episode.handles),be)?Fe:void 0;return H(`div`,{css:aB,children:W(`div`,{className:`watch-container`,children:[de&&ce||P?W(`div`,{className:`player-container`,children:[de&&ce?H(Mz,{pluginUri:ce.pluginUri,release:ce.release,onUnplayable:()=>ue(v),onPlayback:e=>l(e&&{link:e,sourceUri:ce.release.uri})},ce.release.uri):H(`iframe`,{ref:i,src:P,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`,css:O`
|
|
5099
5101
|
width: 100%;
|
|
5100
5102
|
border: none;
|
|
5101
5103
|
background: #000;
|
|
5102
5104
|
flex: 1;
|
|
5103
5105
|
min-height: 0;
|
|
5104
|
-
`},P),H(
|
|
5106
|
+
`},P),H($z,{link:y,next:Ie})]}):z?H(`div`,{className:`player-container fix`,children:W(`button`,{type:`button`,onClick:()=>{et().then(e=>{e&&ee(`extension`)})},children:[`Install the FKN extension to play `,z]})}):void 0,H(Lz,{link:y,tracks:p}),W(`div`,{className:`watch-info`,children:[W(`div`,{className:`episode-row`,children:[W(`div`,{className:`episode-info`,children:[H(`div`,{className:`episode-title`,children:M??(_||g?.settled?t.episodeUri:H(Cv,{className:`pending`}))}),k?H(`div`,{className:`media-title`,children:k}):void 0]}),Pe||Fe?W(`nav`,{className:`episode-nav`,children:[Pe?W(Bu,{href:Pe.href,title:Pe.title,children:[H(Se,{}),`Previous episode`]}):void 0,Fe?W(Bu,{href:Fe.href,title:Fe.title,children:[`Next episode`,H(we,{})]}):void 0]}):void 0,H(`div`,{className:`tracking`,children:H(OF,{work:t.mediaUri,address:t.mediaUri,uri:cy(h,t.mediaUri)?.uri,title:k,cover:g?.covers?.at(0)?.url,episodeCount:g?.episodeCount,movie:g?Ey(g):!1,notice:!1,link:y,episode:j})})]}),H(ry,{sources:me,onPickRelease:e=>n(qu(Z.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}))})]})]})})};G();var sB=O`
|
|
5105
5107
|
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
5106
5108
|
min-height: 100vh;
|
|
5107
5109
|
max-width: 72rem;
|
|
@@ -5215,10 +5217,10 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5215
5217
|
}
|
|
5216
5218
|
|
|
5217
5219
|
.field input:focus { border-color: rgba(255, 255, 255, 0.4); }
|
|
5218
|
-
`,
|
|
5220
|
+
`,cB={"not-found":`That party has ended.`,"bad-key":`The invite link is not valid.`,invalid:`The invite link is broken.`,full:`The party is full.`,blocked:`You cannot join this party.`,unavailable:`Parties are not available right now. Is FKN connected?`},lB=()=>{let e=m_(),[t]=U(()=>c_(location.hash,location.origin)),[n]=U(()=>location.hash.length>1&&!c_(location.hash,location.origin)),[r,i]=U([]),[a,o]=U(()=>Q.name()??``),[s,c]=U(!1),l=e.status===`active`;B(()=>{if(!t)return;let e=Q.getState();(e.status!==`joining`&&e.status!==`active`||e.invite!==t)&&Q.join(t)},[t]);let u=l?e.members:0;B(()=>{if(!l){i([]);return}let e=!1;return Q.roster().then(t=>{e||i(t)}),()=>{e=!0}},[l,u]),h_(e=>{e.t===`name`&&Q.roster().then(i)}),B(()=>{if(!s)return;let e=setTimeout(()=>c(!1),1500);return()=>clearTimeout(e)},[s]);let d=l?s_(location.origin,e.invite):void 0,f=async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0)}catch{}};return W(`div`,{css:sB,children:[H(`div`,{className:`heading`,children:`Watch together`}),W(`div`,{className:`status`,children:[n?H(R,{children:`This invite link is broken. Ask the host for a new one.`}):!t&&!l&&e.status!==`joining`?e.status===`failed`?W(R,{children:[`Could not join. `,cB[e.code]??`Something went wrong.`]}):e.status===`ended`?H(R,{children:`The party ended.`}):H(R,{children:`You are not in a party. Start one from the header.`}):!t&&e.status===`joining`?H(R,{children:`Joining the party…`}):t&&!l?e.status===`joining`?H(R,{children:`Joining the party…`}):e.status===`failed`?W(R,{children:[`Could not join. `,cB[e.code]??`Something went wrong.`]}):e.status===`ended`?H(R,{children:`The party ended.`}):H(R,{children:`This invite link is broken. Ask the host for a new one.`}):l&&e.role===`guest`&&t?H(R,{children:`You are in. Waiting for the host…`}):l&&e.role===`guest`?W(R,{children:[`You are following the host. `,H(Bu,{to:qu(Z.HOME),children:`Go home`})]}):H(R,{children:`You are hosting.`}),!t&&!l&&e.status!==`joining`&&(e.status===`failed`||e.status===`ended`)?W(R,{children:[` `,H(`button`,{type:`button`,className:`action`,onClick:()=>Q.dismiss(),children:`OK`})]}):null]}),l&&W(R,{children:[W(`div`,{className:`section`,children:[H(`div`,{className:`label`,children:`Your name`}),W(`form`,{className:`field`,onSubmit:e=>{e.preventDefault(),Q.setName(lg(a))},children:[H(`input`,{value:a,maxLength:32,placeholder:`What the party should call you`,"aria-label":`Your name`,onInput:e=>o(e.currentTarget.value)}),W(`button`,{type:`submit`,className:`action`,children:[H(me,{size:14}),` Save`]})]})]}),W(`div`,{className:`section`,children:[H(`div`,{className:`label`,children:`Invite link`}),W(`div`,{className:`field`,children:[H(`input`,{readOnly:!0,value:d,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),W(`button`,{type:`button`,className:`action`,onClick:()=>{f()},children:[H(s?me:Ae,{size:14}),` Copy`]})]})]}),W(`div`,{className:`section`,children:[W(`div`,{className:`label`,children:[`In the party (`,r.length,`)`]}),r.map(t=>W(`div`,{className:`row`,"data-member":t.id,children:[t.name?H(`span`,{className:`name`,children:t.name}):null,H(`span`,{className:`id`,title:t.id,children:t.id}),t.host&&H(`span`,{className:`badge`,children:`host`}),t.self&&H(`span`,{className:`badge you`,children:`you`}),e.role===`host`&&!t.self&&W(R,{children:[W(`button`,{type:`button`,className:`action danger`,onClick:()=>{Q.kick(t.id)},children:[H(Oh,{size:14}),` Kick`]}),W(`button`,{type:`button`,className:`action danger`,onClick:()=>{Q.ban(t.id)},children:[H(th,{size:14}),` Ban`]})]})]},t.id))]}),H(`div`,{className:`section`,children:W(`button`,{type:`button`,className:`action`,onClick:()=>{Q.leave()},children:[H(hh,{size:14}),` `,e.role===`host`?`End party`:`Leave party`]})})]})]})},uB=e=>e.owned?`owned`:`placeholder`,dB=e=>{let t=[],n=new Set;for(let r of e.members??[])r.uri&&!n.has(r.uri)&&(n.add(r.uri),t.push({uri:r.uri,kind:uB(r),origin:r.origin,scope:r.scope,title:r.title,episodeCount:r.episodeCount,startDate:r.startDate,member:r}));let r=[...(e.links??[]).flatMap(e=>[e.fromUri,e.toUri]),...(e.claims??[]).flatMap(e=>[e.fromUri,e.toUri])];for(let e of r)e&&!n.has(e)&&(n.add(e),t.push({uri:e,kind:`named`,origin:null,scope:null,title:null,episodeCount:null,startDate:null,member:null}));return t},fB=e=>{let t=dB(e),n=Vx({nodes:t.map(e=>({uri:e.uri,titles:[{title:e.title??e.uri}],startDate:e.startDate})),edges:(e.links??[]).map(e=>({from:e.fromUri,to:e.toUri,relation:e.kind}))},`graph`),r=new Map(n.nodes.map(e=>[e.uri,e]));return{nodes:t.map(e=>({...e,column:r.get(e.uri)?.column??0,row:r.get(e.uri)?.row??0})),columns:n.columns,rows:n.rows}},pB=(e,t)=>[e,t].sort().join(` `),mB=e=>{let t=new Map;for(let n of e){let e=pB(n.fromUri,n.toUri),r=t.get(e)??[];r.push(n.key),t.set(e,r)}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,{lane:r,lanes:e.length}));return n},hB=e=>{let t=new Map;for(let n of e.links??[])t.set(n.key,{kind:`link`,row:n});for(let n of e.claims??[])t.set(n.key,{kind:`claim`,row:n});for(let n of e.episodeLinks??[])t.set(n.key,{kind:`episode-link`,row:n});for(let n of e.episodeClaims??[])t.set(n.key,{kind:`episode-claim`,row:n});for(let n of e.episodeSources??[])t.set(n.key,{kind:`episode-source`,row:n});return t},gB=/^[0-9a-f]{64}$/,_B=(e,t)=>(t??[]).map(t=>{let n=e.get(t)??null;return{key:t,ref:n,gap:n?null:gB.test(t)?`missing`:`not-an-edge-key`}}),vB=(e,t)=>(e.answers??[]).find(e=>e.seq===t)??null,yB=e=>e===null?null:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),bB=e=>{if(e==null||e===``)return{kind:`absent`};let t;try{t=JSON.parse(e)}catch{return{kind:`raw`,raw:e}}return t===null?{kind:`fields`,fields:[{field:`value`,value:null}]}:typeof t==`object`&&!Array.isArray(t)?{kind:`fields`,fields:Object.entries(t).map(([e,t])=>({field:e,value:yB(t)}))}:{kind:`fields`,fields:[{field:Array.isArray(t)?`values`:`value`,value:yB(t)}]}},xB=e=>e===`not-enabled`?`The graph engine is switched off for this page, so there is nothing to read. Reloading with ?graph=1 turns it on, and this page then asks the sources about the uri itself. The only way a page gets here now is ?store=legacy, which pins it to the old store; dropping that flag puts the whole app back on the graph, which is the default.`:e===`graph-empty`?`The engine is on and the graph is empty. A graph is built inside one tab and never outlives it, so a link opened cold always starts here: what fills it is a page asking the sources, which is what this page does with the uri it was given.`:e===`no-row`?`No media row exists for that uri, so there is nothing to cluster. Either no source has answered for it in this tab yet, or the uri is not one any source recognises.`:e===`no-cluster`?`A media row exists for that uri, but no cluster holds it yet: either a pass has not run since it arrived, or it is a placeholder no pass will ever cluster on its own.`:`That uri reached no cluster, and the bundle carries no reason for it.`,SB=e=>e===`active`,CB=async(e,t,n={},r={})=>{let i=r.settleMs??2e4,a=await e(`http://d/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json, text/event-stream`},body:JSON.stringify({query:t,variables:n})});if(!(a.headers.get(`content-type`)??``).includes(`event-stream`)){let e=await a.json();return r.onPayload?.(e,1),{payloads:1,last:e}}let o=a.body.getReader(),s=new TextDecoder,c=Date.now()+i,l=``,u=0,d,f=!1;for(;!f&&Date.now()<c;){let e=await Promise.race([o.read(),new Promise(e=>setTimeout(()=>e({done:!0,value:void 0}),Math.max(0,c-Date.now())))]);if(e.done)break;l+=s.decode(e.value,{stream:!0});let t=l.split(`
|
|
5219
5221
|
|
|
5220
5222
|
`);l=t.pop()??``;for(let e of t){let t=e.split(`
|
|
5221
|
-
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t){try{d=JSON.parse(t),u+=1}catch{continue}if(r.onPayload?.(d,u),r.done?.(d,u)){f=!0;break}}}}return o.cancel().catch(()=>{}),{payloads:u,last:d}},
|
|
5223
|
+
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t){try{d=JSON.parse(t),u+=1}catch{continue}if(r.onPayload?.(d,u),r.done?.(d,u)){f=!0;break}}}}return o.cancel().catch(()=>{}),{payloads:u,last:d}},wB=`
|
|
5222
5224
|
subscription TraceWarm($input: MediaInput!) {
|
|
5223
5225
|
media(input: $input) {
|
|
5224
5226
|
_id
|
|
@@ -5252,12 +5254,12 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5252
5254
|
}
|
|
5253
5255
|
}
|
|
5254
5256
|
}
|
|
5255
|
-
`,
|
|
5257
|
+
`,TB=(e,t)=>{let n=e?.data?.media;return{payloads:t,uri:typeof n?.uri==`string`?n.uri:null,handles:Array.isArray(n?.handles)?n.handles.length:0,episodes:Array.isArray(n?.episodes)?n.episodes.length:0}},EB=async(e,{onProgress:t,settleMs:n=25e3}={})=>{let r={payloads:0,uri:null,handles:0,episodes:0};if(!e)return r;try{let i=await Ee(()=>import(`./worker-6zDaiXIC.js`),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(typeof i.handleRequest!=`function`)return r;await CB(i.handleRequest,wB,{input:{uri:e}},{settleMs:n,onPayload:(e,n)=>{r=TB(e,n),t?.(r)}})}catch(e){console.error(Error(`graph trace: the warm could not ask the sources`,{cause:e}))}return r},DB=O`
|
|
5256
5258
|
&.nothing {
|
|
5257
5259
|
color: rgb(250, 204, 21);
|
|
5258
5260
|
font-style: italic;
|
|
5259
5261
|
}
|
|
5260
|
-
`,
|
|
5262
|
+
`,OB=({value:e})=>e===null?H(`span`,{css:DB,className:`nothing`,children:`null`}):e===void 0?H(`span`,{css:DB,className:`nothing`,children:`absent`}):e===``?H(`span`,{css:DB,className:`nothing`,children:`empty`}):H(`span`,{css:DB,children:String(e)}),kB=O`
|
|
5261
5263
|
.fields {
|
|
5262
5264
|
width: 100%;
|
|
5263
5265
|
border-collapse: collapse;
|
|
@@ -5290,7 +5292,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5290
5292
|
white-space: pre-wrap;
|
|
5291
5293
|
overflow-wrap: anywhere;
|
|
5292
5294
|
}
|
|
5293
|
-
`,
|
|
5295
|
+
`,AB=({blob:e,label:t})=>W(`div`,{css:kB,className:`blob`,"data-blob":t,children:[e.kind===`absent`&&H(`div`,{className:`absent`,children:H(OB,{value:null})}),e.kind===`raw`&&W(R,{children:[H(`div`,{className:`note`,children:`not JSON, shown as it is stored`}),H(`pre`,{className:`raw`,children:e.raw})]}),e.kind===`fields`&&H(`table`,{className:`fields`,children:H(`tbody`,{children:e.fields.map(e=>W(`tr`,{"data-field":e.field,children:[H(`th`,{scope:`row`,children:e.field}),H(`td`,{children:H(OB,{value:e.value})})]},e.field))})})]}),jB=88,MB=20,NB=36,PB=266,FB=76,IB=e=>[e.member?`${e.kind} ${e.member.via===`member`?`member`:`claimed`}`:`named by an edge`,e.origin??`no origin`,e.scope??`no scope`].join(` · `),LB=(e,t)=>{let n=e.find(e=>e.key===t);return new Set(n?[n.fromUri,n.toUri]:[])},RB=(e,t)=>{let n=fB(e),r=e.links??[],i=mB(r),a=LB(r,t),o=new Set(n.nodes.map(e=>e.uri));return{nodes:n.nodes.map(e=>({id:e.uri,type:`trace`,position:{x:NB+e.column*PB,y:NB+e.row*FB},width:178,height:56,draggable:!1,selectable:!1,data:{uri:e.uri,kind:e.kind,title:e.title,meta:IB(e),lit:a.has(e.uri)}})),edges:r.filter(e=>o.has(e.fromUri)&&o.has(e.toUri)).map(e=>{let n=i.get(e.key)??{lane:0,lanes:1};return{id:e.key,type:`trace`,source:e.fromUri,target:e.toUri,selected:e.key===t,data:{spread:(n.lane-(n.lanes-1)/2)*26,active:SB(e.status),status:e.status,label:e.kind,tooltip:`${e.kind} ${e.status} by ${e.by}: ${e.reason}`}}}),width:Math.max(1,n.columns)*PB-jB+72,height:Math.max(1,n.rows)*FB-MB+72}};G();var zB=O`
|
|
5294
5296
|
position: relative;
|
|
5295
5297
|
height: 46rem;
|
|
5296
5298
|
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
@@ -5362,7 +5364,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5362
5364
|
.edge-label.active { fill: rgb(134, 239, 172); }
|
|
5363
5365
|
.edge-label.refused { fill: rgb(252, 165, 165); }
|
|
5364
5366
|
.cross { stroke: rgb(248, 113, 113); stroke-width: 1.5; }
|
|
5365
|
-
`,
|
|
5367
|
+
`,BB=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,VB=({data:e})=>W(`div`,{className:`trace-node ${e.kind}${e.lit?` lit`:``}`,"data-node":e.uri,"data-kind":e.kind,title:`${e.uri} (${e.kind})`,children:[H(fM,{type:`target`,position:$.Left}),H(`div`,{className:`uri`,children:BB(e.uri,26)}),H(`div`,{children:e.title===null?`no title`:BB(e.title,28)}),H(`div`,{className:`meta`,children:BB(e.meta,34)}),H(fM,{type:`source`,position:$.Right})]}),HB=({data:e,selected:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=e?.spread??0,s=e?.active?`active`:`refused`,c=i>=n,l=Math.max(20,Math.abs(i-n)/2)*(c?1:-1),u=`M ${n} ${r} C ${n+l} ${r+o}, ${i-l} ${a+o}, ${i} ${a}`,d=(n+i)/2,f=(r+a)/2+o*.75;return W(R,{children:[H(`path`,{className:`edge ${s}${t?` selected`:``}`,d:u}),H(`path`,{className:`edge-hit`,d:u,children:H(`title`,{children:e?.tooltip})}),s===`refused`?W(`g`,{className:`cross-mark`,children:[H(`path`,{className:`cross`,d:`M ${d-5} ${f-5} L ${d+5} ${f+5}`}),H(`path`,{className:`cross`,d:`M ${d+5} ${f-5} L ${d-5} ${f+5}`})]}):null,H(`text`,{className:`edge-label ${s}`,x:d,y:f-9,textAnchor:`middle`,children:BB(e?.label??``,22)})]})},UB={trace:VB},WB={trace:HB},GB=({bundle:e,selected:t,onSelect:n})=>{let{nodes:r,edges:i}=V(()=>RB(e,t),[e,t]),a=z((e,t)=>n(t.id),[n]);return W(`div`,{css:zB,"data-trace-graph":!0,children:[W(`div`,{className:`legend`,children:[W(`div`,{children:[H(`b`,{children:`solid`}),` owned: its origin described it`]}),W(`div`,{children:[H(`b`,{children:`dashed yellow`}),` placeholder: no origin has`]}),W(`div`,{children:[H(`b`,{children:`dotted`}),` named by an edge only`]}),W(`div`,{children:[H(`b`,{children:`green line`}),` active link`]}),W(`div`,{children:[H(`b`,{children:`red dashed, crossed`}),` refused link`]})]}),H(GN,{nodes:r,edges:i,nodeTypes:UB,edgeTypes:WB,onEdgeClick:a,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every uri this cluster names, and every link between them`,children:H(QN,{variant:JN.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.12)`})})]})};G();var KB=O`
|
|
5366
5368
|
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
5367
5369
|
border-radius: 0.5rem;
|
|
5368
5370
|
padding: 1rem 1.2rem;
|
|
@@ -5462,7 +5464,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5462
5464
|
}
|
|
5463
5465
|
|
|
5464
5466
|
.empty { color: rgba(255, 255, 255, 0.5); }
|
|
5465
|
-
`,
|
|
5467
|
+
`,qB=e=>e.kind===`link`?`link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`episode-link`?`episode link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`claim`?`claim ${e.row.kind} from ${e.row.claimer}`:e.kind===`episode-source`?`episode list from ${e.row.claimer}`:`episode claim ${e.row.kind} from ${e.row.claimer}`,JB=e=>e===`not-an-edge-key`?`not an edge key`:`not in this bundle`,YB=e=>{if(e==null)return``;if(typeof e==`string`)return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(typeof e==`object`&&typeof e.raw==`string`)return e.raw;try{return JSON.stringify(e,null,2)}catch{return String(e)}},XB=({rows:e})=>H(`table`,{className:`facts`,children:H(`tbody`,{children:e.map(([e,t])=>W(`tr`,{"data-fact":e,children:[H(`th`,{scope:`row`,children:e}),H(`td`,{children:H(OB,{value:t})})]},e))})}),ZB=({bundle:e,seq:t,answer:n,onLoad:r})=>{let i=vB(e,t);return W(R,{children:[W(`h4`,{children:[`answer `,t]}),i?H(XB,{rows:[[`uri`,i.uri],[`origin`,i.origin],[`operation`,i.operation],[`bytes`,i.bytes]]}):H(`p`,{className:`empty`,"data-no-answer-row":!0,children:`The bundle lists no answer with that sequence.`}),H(`button`,{type:`button`,className:`load`,onClick:()=>r(t),children:`Load answer bytes`}),n?.seq===t&&W(`div`,{className:`answer`,"data-answer":!0,children:[n.state===`loading`&&H(`p`,{className:`empty`,children:`loading…`}),n.state===`failed`&&H(`p`,{className:`failed`,children:n.text}),n.state===`done`&&(n.text===``?H(`p`,{className:`empty`,children:`nothing came back for that sequence.`}):H(`pre`,{children:n.text}))]})]})},QB=({bundle:e,index:t,trail:n,onFollow:r,onTrailTo:i,loadAnswerBytes:a})=>{let[o,s]=U(void 0),c=n[n.length-1],l=c===void 0?void 0:t.get(c),u=_B(t,l&&(l.kind===`link`||l.kind===`episode-link`)?l.row.supports:[]),d=e=>{s({seq:e,state:`loading`,text:``}),a(e).then(t=>s({seq:e,state:`done`,text:YB(t)})).catch(t=>s({seq:e,state:`failed`,text:t instanceof Error?t.message:String(t)}))};return W(`div`,{css:KB,"data-inspector":!0,children:[H(`h3`,{children:`Edge inspector`}),c===void 0?H(`p`,{className:`empty`,children:`Select a link in the graph, or any row in the tables below.`}):W(R,{children:[W(`div`,{className:`trail`,children:[n.slice(0,-1).map((e,n)=>H(`button`,{type:`button`,onClick:()=>i(n),children:t.get(e)?qB(t.get(e)):e},e)),H(`span`,{className:`here`,children:l?qB(l):c})]}),l===void 0?W(`p`,{className:`empty`,"data-unknown-row":!0,children:[`The bundle carries no row with the key `,H(`code`,{children:c}),`.`]}):W(R,{children:[(l.kind===`link`||l.kind===`episode-link`)&&W(R,{children:[H(XB,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`written by`,l.row.by],[`rule`,l.row.reason]]}),W(`p`,{children:[`status`,` `,H(`span`,{className:`status ${SB(l.row.status)?`active`:`refused`}`,children:l.row.status})]}),H(XB,{rows:l.kind===`link`?[[`confidence`,l.row.confidence],[`version`,l.row.version]]:[[`from number`,l.row.fromNumber],[`to number`,l.row.toNumber]]}),H(`h4`,{children:`evidence`}),H(AB,{blob:bB(l.row.evidence),label:`evidence`}),l.kind===`link`&&W(R,{children:[H(`h4`,{children:`gates`}),H(AB,{blob:bB(l.row.gates),label:`gates`})]})]}),(l.kind===`claim`||l.kind===`episode-claim`)&&W(R,{children:[H(XB,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`claimed by`,l.row.claimer],[`provenance`,l.row.provenance],[`answer seq`,l.row.answerSeq],...l.kind===`claim`?[[`target scope`,l.row.targetScope]]:[]]}),H(ZB,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),l.kind===`episode-source`&&W(R,{children:[H(XB,{rows:[[`media`,l.row.fromUri],[`episode`,l.row.toUri],[`listed by`,l.row.claimer],[`answer seq`,l.row.answerSeq]]}),H(ZB,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),H(`h4`,{children:`supports`}),l.kind===`claim`||l.kind===`episode-claim`||l.kind===`episode-source`?H(`p`,{className:`empty`,children:`This row is source truth: it is derived from nothing.`}):u.length===0?H(`p`,{className:`empty`,children:`This row names no supports.`}):H(`div`,{className:`supports`,children:u.map(e=>W(`div`,{className:`support`,"data-gap":e.gap??void 0,children:[e.ref?H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Follow`}):H(`span`,{className:`unresolved`,children:JB(e.gap)}),H(`span`,{className:`what`,children:e.ref?qB(e.ref):`unresolved`}),H(`span`,{className:`key`,children:e.key})]},e.key))})]})]})]})},$B=O`
|
|
5466
5468
|
table {
|
|
5467
5469
|
width: 100%;
|
|
5468
5470
|
border-collapse: collapse;
|
|
@@ -5515,7 +5517,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5515
5517
|
.status.active { color: rgb(74, 222, 128); }
|
|
5516
5518
|
.status.refused { color: rgb(248, 113, 113); }
|
|
5517
5519
|
.empty { color: rgba(255, 255, 255, 0.5); font-size: 1.2rem; }
|
|
5518
|
-
`,
|
|
5520
|
+
`,eV=({fill:e,index:t,onSelect:n})=>{let r=_B(t,e.supports);return r.length===0?H(`div`,{className:`proof`,children:H(`span`,{className:`missing`,"data-no-proof":!0,children:`${e.via} names no proving pair`})}):H(R,{children:r.map(e=>{let t=e.ref?.kind===`episode-link`?e.ref.row:void 0;return W(`div`,{className:`proof`,children:[H(`button`,{type:`button`,onClick:()=>n(e.key),children:`Inspect`}),t?H(`span`,{className:`pair`,children:`${t.fromUri} #${t.fromNumber??`null`} to ${t.toUri} #${t.toNumber??`null`}`}):H(`span`,{className:`pair`,children:e.ref?`${qB(e.ref)} ${e.key}`:H(`span`,{className:`missing`,children:`${e.key}: ${JB(e.gap)}`})}),t&&H(`span`,{className:`status ${SB(t.status)?`active`:`refused`}`,children:t.status})]},e.key)})})},tV=({bundle:e,index:t,selected:n,onSelect:r})=>W(`div`,{css:$B,"data-episodes":!0,children:[(e.episodes??[]).length===0?H(`p`,{className:`empty`,children:`This cluster holds no slots.`}):W(`table`,{"data-slots":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`slot`}),H(`th`,{children:`number`}),H(`th`,{children:`title`}),H(`th`,{children:`fills`})]})}),H(`tbody`,{children:e.episodes.map(e=>W(`tr`,{"data-slot":e.slotId,children:[H(`td`,{className:`slot`,children:e.slotId}),H(`td`,{children:H(OB,{value:e.number})}),H(`td`,{children:H(OB,{value:e.title})}),H(`td`,{children:e.fills.length===0?H(`span`,{className:`empty`,children:`nothing fills this slot`}):e.fills.map(e=>W(`div`,{"data-fill":e.episodeUri,children:[W(`div`,{className:`fill`,children:[H(`span`,{className:`uri`,children:e.episodeUri}),W(`span`,{children:[`#`,H(OB,{value:e.number})]}),H(`span`,{children:e.origin}),H(`span`,{className:`via`,children:e.via}),H(`span`,{className:`by`,children:e.by})]}),H(eV,{fill:e,index:t,onSelect:r})]},`${e.episodeUri}\u0000${e.via}`))})]},e.slotId))})]}),H(`h3`,{children:`Episode edges`}),(e.episodeLinks??[]).length===0?H(`p`,{className:`empty`,children:`No episode links, refused or otherwise.`}):W(`table`,{"data-episode-links":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`status`}),H(`th`,{children:`by`}),H(`th`,{children:`rule`}),H(`th`,{})]})}),H(`tbody`,{children:e.episodeLinks.map(e=>W(`tr`,{"data-episode-link":e.key,"data-status":e.status,className:n===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:`${e.fromUri} #${e.fromNumber??`null`}`}),H(`td`,{className:`uri`,children:`${e.toUri} #${e.toNumber??`null`}`}),H(`td`,{children:e.kind}),H(`td`,{children:H(`span`,{className:`status ${SB(e.status)?`active`:`refused`}`,children:e.status})}),H(`td`,{children:e.by}),H(`td`,{children:e.reason}),H(`td`,{children:H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Episode claims`}),(e.episodeClaims??[]).length===0?H(`p`,{className:`empty`,children:`no episode level claims`}):W(`table`,{"data-episode-claims":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`claimer`}),H(`th`,{children:`provenance`}),H(`th`,{children:`answer`}),H(`th`,{})]})}),H(`tbody`,{children:e.episodeClaims.map(e=>W(`tr`,{"data-episode-claim":e.key,className:n===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:e.claimer}),H(`td`,{children:e.provenance}),H(`td`,{children:e.answerSeq}),H(`td`,{children:H(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]})]});G();var nV=O`
|
|
5519
5521
|
max-width: 150rem;
|
|
5520
5522
|
margin: calc(var(--stub-header-height) + 2rem) auto 6rem;
|
|
5521
5523
|
padding: 0 1.5rem;
|
|
@@ -5625,7 +5627,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5625
5627
|
|
|
5626
5628
|
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
|
|
5627
5629
|
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }
|
|
5628
|
-
`,wz=1500,Tz=({label:e,value:t})=>W(`div`,{children:[H(`span`,{className:`label`,children:e}),H(`code`,{children:H(YR,{value:t})})]}),Ez=({reason:e})=>e===`null`?H(`code`,{className:`token`,"data-token-reason":!0,children:`"null"`}):H(YR,{value:e}),Dz=({load:e=yx,loadAnswerBytes:t=bx,warm:n=qR})=>{let r=Nu(),[,i]=Mu(),a=kx(r),[o,s]=U(a),[c,l]=U({kind:`idle`}),[u,d]=U(0),[f,p]=U({kind:`off`}),[m,h]=U([]),g=K(``),_=K(void 0);B(()=>{s(a),h([]),p({kind:`off`}),g.current=``,_.current!==void 0&&clearTimeout(_.current),_.current=void 0},[a]),B(()=>{if(!a){l({kind:`idle`});return}let t=!0;return l(e=>e.kind===`done`?e:{kind:`loading`}),e(a).then(e=>{t&&l({kind:`done`,bundle:e})}).catch(e=>{t&&l({kind:`failed`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[a,u]);let v=c.kind===`done`?c.bundle:void 0,y=V(()=>v?IR(v):new Map,[v]),b=m[m.length-1],x=!(!v||v.resolved||v.reason===`not-enabled`);return B(()=>{if(!a||!x||g.current===a)return;g.current=a;let e=a,t=()=>g.current===e,r=()=>{_.current===void 0&&(_.current=setTimeout(()=>{_.current=void 0,t()&&d(e=>e+1)},wz))};p({kind:`asking`,progress:{payloads:0,uri:null,handles:0,episodes:0}}),n(a,{onProgress:e=>{t()&&(p({kind:`asking`,progress:e}),r())}}).then(e=>{t()&&(p({kind:`done`,progress:e}),d(e=>e+1))}).catch(()=>{t()&&p({kind:`off`})})},[a,x]),B(()=>()=>{g.current=``,_.current!==void 0&&clearTimeout(_.current)},[]),W(`div`,{css:Cz,"data-debug-trace":!0,children:[H(`h1`,{children:`Graph trace`}),H(`p`,{className:`intro`,children:`Everything the graph holds for one cluster: its members, every link between them including the refused ones, the episodes it resolved to, and the answer each edge came from. Nothing here is derived, and a value the graph does not carry shows as null. The graph is built inside this tab, so a uri nothing has asked about yet is asked about here first, which is what makes this url worth pasting into a bug report.`}),W(`form`,{className:`ask`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(d(e=>e+1),i(Sx({uri:t})))},children:[H(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`ag:(mal:39535,anilist:101280), or a member uri like mal:39535, or a cluster id like cl:...`,value:o,onInput:e=>s(e.target.value)}),H(`button`,{type:`submit`,children:`Trace`})]}),c.kind===`idle`&&H(`p`,{className:`empty`,children:`Give it a uri. It rides in the url, so this page can be linked into a bug report.`}),f.kind!==`off`&&H(`p`,{className:f.kind===`asking`?`warming`:`warming done`,"data-warming":f.kind,"data-answered":f.progress.payloads,children:f.kind===`asking`?`asking the sources about ${a}: ${f.progress.payloads} answer(s) so far, ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). Every source is asked, so a cold graph takes tens of seconds. The panel fills as they answer and stops waiting on its own.`:f.progress.payloads===0?`nothing answered about ${a}. Every source was asked and none returned a row, so the graph stayed empty: either no source recognises that uri, or every one of them refused it. Nothing is still loading.`:`the sources have stopped answering about ${a}: ${f.progress.payloads} answer(s), ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). What is below is what that produced.`}),c.kind===`loading`&&W(`p`,{className:`empty`,"data-loading":!0,children:[`tracing `,a,`…`]}),c.kind===`failed`&&H(`p`,{className:`failed`,"data-failed":!0,children:c.error}),v&&W(R,{children:[v.resolved?W(`div`,{className:`resolved`,"data-resolved":!0,children:[W(`div`,{className:`pairs`,children:[H(Tz,{label:`asked`,value:v.asked}),H(Tz,{label:`cluster`,value:v.resolved.clusterId}),H(Tz,{label:`aggregate`,value:v.resolved.aggUri}),H(Tz,{label:`scope`,value:v.resolved.scope}),H(Tz,{label:`kind`,value:v.resolved.kind})]}),(v.resolved.otherClusters??[]).length>0&&W(`div`,{className:`split`,"data-other-clusters":!0,children:[`This address also reaches`,` `,v.resolved.otherClusters.length,` other cluster(s), whose members are not below:`,` `,v.resolved.otherClusters.map(e=>H(`a`,{href:Sx({uri:e,search:r}),children:H(`code`,{children:e})},e))]})]}):W(`div`,{className:`unresolved`,"data-unresolved":!0,"data-reason":v.reason??`none`,children:[H(`div`,{className:`why`,children:HR(v.reason)}),v.reason===`not-enabled`&&W(`div`,{className:`advice`,children:[H(`a`,{"data-reload-graph":!0,href:wx(r),children:`Reload with ?graph=1`}),` or `,H(`a`,{"data-reload-store":!0,href:Tx(r),children:`drop ?store=legacy`}),`, keeping this uri.`]}),W(`div`,{className:`pairs`,children:[H(Tz,{label:`asked`,value:v.asked}),H(Tz,{label:`reason`,value:v.reason??null})]})]}),W(`div`,{className:`pairs`,"data-run-length":!0,children:[H(Tz,{label:`run length`,value:v.runLength?.value??null}),H(Tz,{label:`from`,value:v.runLength?.from??null}),H(Tz,{label:`tier`,value:v.runLength?.tier??null}),H(Tz,{label:`witnesses`,value:v.runLength?.witnesses??null})]}),W(`div`,{className:`pairs`,"data-cost":!0,children:[H(Tz,{label:`statements`,value:v.cost?.statements??null}),H(Tz,{label:`ms to build`,value:v.cost?.ms??null})]}),H(`h3`,{children:`Graph counts`}),H(`div`,{className:`chips`,"data-counts":!0,children:Object.entries(v.counts??{}).length===0?H(`span`,{className:`empty`,children:`the bundle carries no counts`}):Object.entries(v.counts).map(([e,t])=>H(`span`,{className:`chip`,children:`${e} ${t}`},e))}),W(`div`,{className:`columns`,children:[W(`div`,{children:[H(`h3`,{children:`Anomalies`}),(v.anomalies??[]).length===0?H(`p`,{className:`empty`,children:`no rule complained`}):H(`table`,{"data-anomalies":!0,children:H(`tbody`,{children:v.anomalies.map((e,t)=>W(`tr`,{children:[H(`td`,{children:e.rule}),H(`td`,{children:e.detail})]},`${e.rule} ${e.detail} ${t}`))})})]}),W(`div`,{children:[H(`h3`,{children:`Asks`}),(v.asks??[]).length===0?H(`p`,{className:`empty`,children:`nothing was asked of any origin`}):W(`table`,{"data-asks":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`seq`}),H(`th`,{children:`origin`}),H(`th`,{children:`outcome`}),H(`th`,{children:`reason`})]})}),H(`tbody`,{children:v.asks.map((e,t)=>W(`tr`,{"data-ask":e.origin,children:[H(`td`,{children:H(YR,{value:e.seq??null})}),H(`td`,{children:e.origin}),H(`td`,{children:e.outcome}),H(`td`,{children:H(Ez,{reason:e.reason})})]},`${e.origin} ${e.seq??t}`))})]})]})]}),H(`h2`,{children:`Media graph`}),H(fz,{bundle:v,selected:b,onSelect:e=>h([e])}),H(`h3`,{children:`Links`}),(v.links??[]).length===0?H(`p`,{className:`empty`,children:`no links, refused or otherwise`}):W(`table`,{"data-links":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`status`}),H(`th`,{children:`by`}),H(`th`,{children:`rule`}),H(`th`,{children:`confidence`}),H(`th`,{})]})}),H(`tbody`,{children:v.links.map(e=>W(`tr`,{"data-link":e.key,"data-status":e.status,className:b===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:H(`span`,{className:`status ${UR(e.status)?`active`:`refused`}`,children:e.status})}),H(`td`,{children:e.by}),H(`td`,{children:e.reason}),H(`td`,{children:H(YR,{value:e.confidence})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Claims`}),(v.claims??[]).length===0?H(`p`,{className:`empty`,children:`no claims between the uris this bundle names`}):W(`table`,{"data-claims":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`claimer`}),H(`th`,{children:`provenance`}),H(`th`,{children:`answer`}),H(`th`,{children:`target scope`}),H(`th`,{})]})}),H(`tbody`,{children:v.claims.map(e=>W(`tr`,{"data-claim":e.key,className:b===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:e.claimer}),H(`td`,{children:e.provenance}),H(`td`,{children:e.answerSeq}),H(`td`,{children:H(YR,{value:e.targetScope})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Attachments`}),(v.attachments??[]).length===0?H(`p`,{className:`empty`,children:`no run is attached to a container here`}):W(`table`,{"data-attachments":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`run`}),H(`th`,{children:`container`}),H(`th`,{children:`via`}),H(`th`,{children:`by`}),H(`th`,{children:`evidence`}),H(`th`,{children:`supports`})]})}),H(`tbody`,{children:v.attachments.map(e=>W(`tr`,{children:[H(`td`,{className:`uri`,children:e.runUri}),H(`td`,{className:`uri`,children:e.containerUri}),H(`td`,{children:e.via}),H(`td`,{children:e.by}),H(`td`,{className:`uri`,children:H(YR,{value:e.evidence})}),H(`td`,{children:(e.supports??[]).length===0?H(YR,{value:null}):e.supports.map(e=>H(`button`,{type:`button`,className:`inspect`,"data-attachment-support":e,onClick:()=>h([e]),children:e},e))})]},`${e.runUri} ${e.containerUri} ${e.via} ${e.by}`))})]}),H(`h2`,{children:`Episodes`}),H(Sz,{bundle:v,index:y,selected:b,onSelect:e=>h([e])}),H(`h2`,{children:`Inspector`}),H(yz,{bundle:v,index:y,trail:m,onFollow:e=>h(t=>[...t,e]),onTrailTo:e=>h(t=>t.slice(0,e+1)),loadAnswerBytes:t})]})]})},Oz=`[data-party-scroll]`,kz=()=>{let e=document.querySelectorAll(Oz);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.scrollHeight-n.clientHeight>0)return n}},Az=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):0,jz=()=>{let e=kz();return e?Math.max(0,e.scrollHeight-e.clientHeight):Math.max(0,document.documentElement.scrollHeight-window.innerHeight)},Mz=()=>{let e=kz();return e?Az(e.scrollTop,e.scrollHeight-e.clientHeight):Az(window.scrollY,document.documentElement.scrollHeight-window.innerHeight)},Nz=()=>{try{return window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0}catch{return!1}},Pz=(e,t,n)=>!e||Nz()?`instant`:t<=n*2?`smooth`:`instant`,Fz=(e,{smooth:t}={})=>{let n=kz();if(n){let r=n.scrollHeight-n.clientHeight,i=r>0?e*r:0;n.scrollTo({top:i,behavior:Pz(t,Math.abs(i-n.scrollTop),n.clientHeight)});return}let r=document.documentElement.scrollHeight-window.innerHeight,i=r>0?e*r:0;window.scrollTo({top:i,behavior:Pz(t,Math.abs(i-window.scrollY),window.innerHeight)})};G();var Iz=2,Lz=8e3,Rz=[`wheel`,`touchstart`,`keydown`,`pointerdown`],zz=60,Bz=()=>{let e=m_(),[t,n]=Mu(),r=Nu(),i=r?`${t}?${r}`:t,a=e.status===`active`?e.role:void 0,o=t===o_,s=t===qu(Z.SEARCH);B(()=>{if(a!==`host`||o)return;let e=()=>{Q.setLocation(i,Mz()),Q.send({t:`nav`,path:i})};if(!s)return e();let t=setTimeout(e,350);return()=>clearTimeout(t)},[a,i,o]),B(()=>{if(a!==`host`||o)return;let e=0,t,n=()=>{t=void 0,e=Date.now();let n=Mz();Q.setLocation(i,n),Q.send({t:`scroll`,y:n})},r=()=>{if(t)return;let r=Math.max(0,1e3/Iz-(Date.now()-e));t=setTimeout(n,r)};return document.addEventListener(`scroll`,r,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,r,{capture:!0}),t&&clearTimeout(t)}},[a,i]);let c=K(void 0),l=K(0);B(()=>{if(c.current===void 0)return;let e=c.current;c.current=void 0;let t=0,n=-1,r=0,i=!1,a=l.current,o=Date.now()+Lz,s=()=>{i=!0};for(let e of Rz)document.addEventListener(e,s,{passive:!0});let u=()=>{cancelAnimationFrame(t);for(let e of Rz)document.removeEventListener(e,s)};if(Rh(),e===0)return Fz(0),u;let d=()=>{let s=jz();s===n?r+=1:(r=0,n=s);let c=s>0&&r>=zz;if(i||l.current!==a||c||Date.now()>o)return u();Fz(e),t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),u},[i]);let u=K(!1),d=e.status===`active`?e.invite:void 0;B(()=>{u.current=!1},[d]);let f=(e,t)=>{u.current=!0,e===i?(Rh(),l.current+=1,Fz(t,{smooth:!0})):(c.current=t,n(e))};return h_((e,{replayed:t})=>{if(a===`host`)e.t===`ask`&&e.c===`go`&&e.path!==i&&n(e.path);else if(a===`guest`)switch(e.t){case`nav`:u.current=!0,e.path!==i&&n(e.path);return;case`scroll`:Q.hostPath()===i&&(Rh(),l.current+=1,Fz(e.y,{smooth:!0}));return;case`state`:(!u.current||t)&&f(e.path,e.y);return}}),null};G();var Vz=4,Hz=2500,Uz=O`
|
|
5630
|
+
`,rV=1500,iV=({label:e,value:t})=>W(`div`,{children:[H(`span`,{className:`label`,children:e}),H(`code`,{children:H(OB,{value:t})})]}),aV=({reason:e})=>e===`null`?H(`code`,{className:`token`,"data-token-reason":!0,children:`"null"`}):H(OB,{value:e}),oV=({load:e=yx,loadAnswerBytes:t=bx,warm:n=EB})=>{let r=Nu(),[,i]=Mu(),a=kx(r),[o,s]=U(a),[c,l]=U({kind:`idle`}),[u,d]=U(0),[f,p]=U({kind:`off`}),[m,h]=U([]),g=K(``),_=K(void 0);B(()=>{s(a),h([]),p({kind:`off`}),g.current=``,_.current!==void 0&&clearTimeout(_.current),_.current=void 0},[a]),B(()=>{if(!a){l({kind:`idle`});return}let t=!0;return l(e=>e.kind===`done`?e:{kind:`loading`}),e(a).then(e=>{t&&l({kind:`done`,bundle:e})}).catch(e=>{t&&l({kind:`failed`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[a,u]);let v=c.kind===`done`?c.bundle:void 0,y=V(()=>v?hB(v):new Map,[v]),b=m[m.length-1],x=!(!v||v.resolved||v.reason===`not-enabled`);return B(()=>{if(!a||!x||g.current===a)return;g.current=a;let e=a,t=()=>g.current===e,r=()=>{_.current===void 0&&(_.current=setTimeout(()=>{_.current=void 0,t()&&d(e=>e+1)},rV))};p({kind:`asking`,progress:{payloads:0,uri:null,handles:0,episodes:0}}),n(a,{onProgress:e=>{t()&&(p({kind:`asking`,progress:e}),r())}}).then(e=>{t()&&(p({kind:`done`,progress:e}),d(e=>e+1))}).catch(()=>{t()&&p({kind:`off`})})},[a,x]),B(()=>()=>{g.current=``,_.current!==void 0&&clearTimeout(_.current)},[]),W(`div`,{css:nV,"data-debug-trace":!0,children:[H(`h1`,{children:`Graph trace`}),H(`p`,{className:`intro`,children:`Everything the graph holds for one cluster: its members, every link between them including the refused ones, the episodes it resolved to, and the answer each edge came from. Nothing here is derived, and a value the graph does not carry shows as null. The graph is built inside this tab, so a uri nothing has asked about yet is asked about here first, which is what makes this url worth pasting into a bug report.`}),W(`form`,{className:`ask`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(d(e=>e+1),i(Sx({uri:t})))},children:[H(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`ag:(mal:39535,anilist:101280), or a member uri like mal:39535, or a cluster id like cl:...`,value:o,onInput:e=>s(e.target.value)}),H(`button`,{type:`submit`,children:`Trace`})]}),c.kind===`idle`&&H(`p`,{className:`empty`,children:`Give it a uri. It rides in the url, so this page can be linked into a bug report.`}),f.kind!==`off`&&H(`p`,{className:f.kind===`asking`?`warming`:`warming done`,"data-warming":f.kind,"data-answered":f.progress.payloads,children:f.kind===`asking`?`asking the sources about ${a}: ${f.progress.payloads} answer(s) so far, ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). Every source is asked, so a cold graph takes tens of seconds. The panel fills as they answer and stops waiting on its own.`:f.progress.payloads===0?`nothing answered about ${a}. Every source was asked and none returned a row, so the graph stayed empty: either no source recognises that uri, or every one of them refused it. Nothing is still loading.`:`the sources have stopped answering about ${a}: ${f.progress.payloads} answer(s), ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). What is below is what that produced.`}),c.kind===`loading`&&W(`p`,{className:`empty`,"data-loading":!0,children:[`tracing `,a,`…`]}),c.kind===`failed`&&H(`p`,{className:`failed`,"data-failed":!0,children:c.error}),v&&W(R,{children:[v.resolved?W(`div`,{className:`resolved`,"data-resolved":!0,children:[W(`div`,{className:`pairs`,children:[H(iV,{label:`asked`,value:v.asked}),H(iV,{label:`cluster`,value:v.resolved.clusterId}),H(iV,{label:`aggregate`,value:v.resolved.aggUri}),H(iV,{label:`scope`,value:v.resolved.scope}),H(iV,{label:`kind`,value:v.resolved.kind})]}),(v.resolved.otherClusters??[]).length>0&&W(`div`,{className:`split`,"data-other-clusters":!0,children:[`This address also reaches`,` `,v.resolved.otherClusters.length,` other cluster(s), whose members are not below:`,` `,v.resolved.otherClusters.map(e=>H(`a`,{href:Sx({uri:e,search:r}),children:H(`code`,{children:e})},e))]})]}):W(`div`,{className:`unresolved`,"data-unresolved":!0,"data-reason":v.reason??`none`,children:[H(`div`,{className:`why`,children:xB(v.reason)}),v.reason===`not-enabled`&&W(`div`,{className:`advice`,children:[H(`a`,{"data-reload-graph":!0,href:wx(r),children:`Reload with ?graph=1`}),` or `,H(`a`,{"data-reload-store":!0,href:Tx(r),children:`drop ?store=legacy`}),`, keeping this uri.`]}),W(`div`,{className:`pairs`,children:[H(iV,{label:`asked`,value:v.asked}),H(iV,{label:`reason`,value:v.reason??null})]})]}),W(`div`,{className:`pairs`,"data-run-length":!0,children:[H(iV,{label:`run length`,value:v.runLength?.value??null}),H(iV,{label:`from`,value:v.runLength?.from??null}),H(iV,{label:`tier`,value:v.runLength?.tier??null}),H(iV,{label:`witnesses`,value:v.runLength?.witnesses??null})]}),W(`div`,{className:`pairs`,"data-cost":!0,children:[H(iV,{label:`statements`,value:v.cost?.statements??null}),H(iV,{label:`ms to build`,value:v.cost?.ms??null})]}),H(`h3`,{children:`Graph counts`}),H(`div`,{className:`chips`,"data-counts":!0,children:Object.entries(v.counts??{}).length===0?H(`span`,{className:`empty`,children:`the bundle carries no counts`}):Object.entries(v.counts).map(([e,t])=>H(`span`,{className:`chip`,children:`${e} ${t}`},e))}),W(`div`,{className:`columns`,children:[W(`div`,{children:[H(`h3`,{children:`Anomalies`}),(v.anomalies??[]).length===0?H(`p`,{className:`empty`,children:`no rule complained`}):H(`table`,{"data-anomalies":!0,children:H(`tbody`,{children:v.anomalies.map((e,t)=>W(`tr`,{children:[H(`td`,{children:e.rule}),H(`td`,{children:e.detail})]},`${e.rule} ${e.detail} ${t}`))})})]}),W(`div`,{children:[H(`h3`,{children:`Asks`}),(v.asks??[]).length===0?H(`p`,{className:`empty`,children:`nothing was asked of any origin`}):W(`table`,{"data-asks":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`seq`}),H(`th`,{children:`origin`}),H(`th`,{children:`outcome`}),H(`th`,{children:`reason`})]})}),H(`tbody`,{children:v.asks.map((e,t)=>W(`tr`,{"data-ask":e.origin,children:[H(`td`,{children:H(OB,{value:e.seq??null})}),H(`td`,{children:e.origin}),H(`td`,{children:e.outcome}),H(`td`,{children:H(aV,{reason:e.reason})})]},`${e.origin} ${e.seq??t}`))})]})]})]}),H(`h2`,{children:`Media graph`}),H(GB,{bundle:v,selected:b,onSelect:e=>h([e])}),H(`h3`,{children:`Links`}),(v.links??[]).length===0?H(`p`,{className:`empty`,children:`no links, refused or otherwise`}):W(`table`,{"data-links":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`status`}),H(`th`,{children:`by`}),H(`th`,{children:`rule`}),H(`th`,{children:`confidence`}),H(`th`,{})]})}),H(`tbody`,{children:v.links.map(e=>W(`tr`,{"data-link":e.key,"data-status":e.status,className:b===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:H(`span`,{className:`status ${SB(e.status)?`active`:`refused`}`,children:e.status})}),H(`td`,{children:e.by}),H(`td`,{children:e.reason}),H(`td`,{children:H(OB,{value:e.confidence})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Claims`}),(v.claims??[]).length===0?H(`p`,{className:`empty`,children:`no claims between the uris this bundle names`}):W(`table`,{"data-claims":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`from`}),H(`th`,{children:`to`}),H(`th`,{children:`kind`}),H(`th`,{children:`claimer`}),H(`th`,{children:`provenance`}),H(`th`,{children:`answer`}),H(`th`,{children:`target scope`}),H(`th`,{})]})}),H(`tbody`,{children:v.claims.map(e=>W(`tr`,{"data-claim":e.key,className:b===e.key?`selected`:void 0,children:[H(`td`,{className:`uri`,children:e.fromUri}),H(`td`,{className:`uri`,children:e.toUri}),H(`td`,{children:e.kind}),H(`td`,{children:e.claimer}),H(`td`,{children:e.provenance}),H(`td`,{children:e.answerSeq}),H(`td`,{children:H(OB,{value:e.targetScope})}),H(`td`,{children:H(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),H(`h3`,{children:`Attachments`}),(v.attachments??[]).length===0?H(`p`,{className:`empty`,children:`no run is attached to a container here`}):W(`table`,{"data-attachments":!0,children:[H(`thead`,{children:W(`tr`,{children:[H(`th`,{children:`run`}),H(`th`,{children:`container`}),H(`th`,{children:`via`}),H(`th`,{children:`by`}),H(`th`,{children:`evidence`}),H(`th`,{children:`supports`})]})}),H(`tbody`,{children:v.attachments.map(e=>W(`tr`,{children:[H(`td`,{className:`uri`,children:e.runUri}),H(`td`,{className:`uri`,children:e.containerUri}),H(`td`,{children:e.via}),H(`td`,{children:e.by}),H(`td`,{className:`uri`,children:H(OB,{value:e.evidence})}),H(`td`,{children:(e.supports??[]).length===0?H(OB,{value:null}):e.supports.map(e=>H(`button`,{type:`button`,className:`inspect`,"data-attachment-support":e,onClick:()=>h([e]),children:e},e))})]},`${e.runUri} ${e.containerUri} ${e.via} ${e.by}`))})]}),H(`h2`,{children:`Episodes`}),H(tV,{bundle:v,index:y,selected:b,onSelect:e=>h([e])}),H(`h2`,{children:`Inspector`}),H(QB,{bundle:v,index:y,trail:m,onFollow:e=>h(t=>[...t,e]),onTrailTo:e=>h(t=>t.slice(0,e+1)),loadAnswerBytes:t})]})]})},sV=`[data-party-scroll]`,cV=()=>{let e=document.querySelectorAll(sV);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.scrollHeight-n.clientHeight>0)return n}},lV=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):0,uV=()=>{let e=cV();return e?Math.max(0,e.scrollHeight-e.clientHeight):Math.max(0,document.documentElement.scrollHeight-window.innerHeight)},dV=()=>{let e=cV();return e?lV(e.scrollTop,e.scrollHeight-e.clientHeight):lV(window.scrollY,document.documentElement.scrollHeight-window.innerHeight)},fV=()=>{try{return window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0}catch{return!1}},pV=(e,t,n)=>!e||fV()?`instant`:t<=n*2?`smooth`:`instant`,mV=(e,{smooth:t}={})=>{let n=cV();if(n){let r=n.scrollHeight-n.clientHeight,i=r>0?e*r:0;n.scrollTo({top:i,behavior:pV(t,Math.abs(i-n.scrollTop),n.clientHeight)});return}let r=document.documentElement.scrollHeight-window.innerHeight,i=r>0?e*r:0;window.scrollTo({top:i,behavior:pV(t,Math.abs(i-window.scrollY),window.innerHeight)})};G();var hV=2,gV=8e3,_V=[`wheel`,`touchstart`,`keydown`,`pointerdown`],vV=60,yV=()=>{let e=m_(),[t,n]=Mu(),r=Nu(),i=r?`${t}?${r}`:t,a=e.status===`active`?e.role:void 0,o=t===o_,s=t===qu(Z.SEARCH);B(()=>{if(a!==`host`||o)return;let e=()=>{Q.setLocation(i,dV()),Q.send({t:`nav`,path:i})};if(!s)return e();let t=setTimeout(e,350);return()=>clearTimeout(t)},[a,i,o]),B(()=>{if(a!==`host`||o)return;let e=0,t,n=()=>{t=void 0,e=Date.now();let n=dV();Q.setLocation(i,n),Q.send({t:`scroll`,y:n})},r=()=>{if(t)return;let r=Math.max(0,1e3/hV-(Date.now()-e));t=setTimeout(n,r)};return document.addEventListener(`scroll`,r,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,r,{capture:!0}),t&&clearTimeout(t)}},[a,i]);let c=K(void 0),l=K(0);B(()=>{if(c.current===void 0)return;let e=c.current;c.current=void 0;let t=0,n=-1,r=0,i=!1,a=l.current,o=Date.now()+gV,s=()=>{i=!0};for(let e of _V)document.addEventListener(e,s,{passive:!0});let u=()=>{cancelAnimationFrame(t);for(let e of _V)document.removeEventListener(e,s)};if(Rh(),e===0)return mV(0),u;let d=()=>{let s=uV();s===n?r+=1:(r=0,n=s);let c=s>0&&r>=vV;if(i||l.current!==a||c||Date.now()>o)return u();mV(e),t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),u},[i]);let u=K(!1),d=e.status===`active`?e.invite:void 0;B(()=>{u.current=!1},[d]);let f=(e,t)=>{u.current=!0,e===i?(Rh(),l.current+=1,mV(t,{smooth:!0})):(c.current=t,n(e))};return h_((e,{replayed:t})=>{if(a===`host`)e.t===`ask`&&e.c===`go`&&e.path!==i&&n(e.path);else if(a===`guest`)switch(e.t){case`nav`:u.current=!0,e.path!==i&&n(e.path);return;case`scroll`:Q.hostPath()===i&&(Rh(),l.current+=1,mV(e.y,{smooth:!0}));return;case`state`:(!u.current||t)&&f(e.path,e.y);return}}),null};G();var bV=4,xV=2500,SV=O`
|
|
5629
5631
|
position: fixed;
|
|
5630
5632
|
left: 0;
|
|
5631
5633
|
top: 0;
|
|
@@ -5652,7 +5654,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5652
5654
|
font-weight: 600;
|
|
5653
5655
|
white-space: nowrap;
|
|
5654
5656
|
}
|
|
5655
|
-
`,
|
|
5657
|
+
`,CV=()=>{let e=m_(),t=e.status===`active`?e.role:void 0,[n]=Mu(),r=Nu(),i=r?`${n}?${r}`:n;B(()=>{if(t!==`host`)return;let e=0,n,r,i=()=>{n=void 0,r&&!Q.playing()&&(e=Date.now(),Q.send({t:`cursor`,x:r.x,y:r.y}))},a=t=>{r={x:Math.min(1,Math.max(0,t.clientX/window.innerWidth)),y:Math.min(1,Math.max(0,t.clientY/window.innerHeight))},!n&&(n=setTimeout(i,Math.max(0,1e3/bV-(Date.now()-e))))};return window.addEventListener(`pointermove`,a,{passive:!0}),()=>{window.removeEventListener(`pointermove`,a),n&&clearTimeout(n)}},[t]);let[a,o]=U(void 0),[s,c]=U(()=>Date.now()),l=K(!1);if(h_(e=>{if(t===`guest`){if(e.t===`playback`||e.t===`state`&&e.s){let t=(e.t,e.s);l.current=!t.paused,l.current&&o(void 0)}else e.t!==`cursor`||l.current||Q.hostPath()===i&&o({x:e.x,y:e.y,at:Date.now()})}}),B(()=>{if(!a)return;let e=setInterval(()=>c(Date.now()),500);return()=>clearInterval(e)},[a]),t!==`guest`||!a||s-a.at>xV)return null;let u=e.status===`active`?Q.nameOf(e.owner):void 0;return W(`div`,{css:SV,style:{"--x":`${a.x*100}vw`,"--y":`${a.y*100}vh`},"aria-hidden":`true`,children:[H(`svg`,{width:`18`,height:`22`,viewBox:`0 0 18 22`,fill:`none`,children:H(`path`,{d:`M2 2 L2 17 L6.5 13 L9.5 20 L12 19 L9 12.5 L15 12 Z`,fill:`#4ade80`,stroke:`#06120a`,strokeWidth:`1.2`,strokeLinejoin:`round`})}),H(`span`,{className:`tag`,children:u??`host`})]})};G();var wV=()=>({pathname:location.pathname,search:location.search}),TV=[[`pushState`,`push`],[`replaceState`,`replace`],[`popstate`,`pop`]],EV=()=>{let e=K(wV());return B(()=>{let t=TV.map(([t,n])=>{let r=()=>{let t={from:e.current,to:wV(),kind:n,asked:Vh()};e.current=t.to,Ph(t)&&Lh()};return addEventListener(t,r),()=>removeEventListener(t,r)});return()=>{Rh();for(let e of t)e()}},[]),null};G();var DV=()=>{let{query:e}=Au();return H(Uu,{to:gd({query:hd(e)}),replace:!0})},OV=()=>(B(()=>{globalThis.close()},[]),H(`div`,{children:`Logging in...`})),kV=O`
|
|
5656
5658
|
display: flex;
|
|
5657
5659
|
flex-direction: column;
|
|
5658
5660
|
min-height: 100vh;
|
|
@@ -5660,9 +5662,9 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5660
5662
|
& > .content {
|
|
5661
5663
|
flex: 1;
|
|
5662
5664
|
}
|
|
5663
|
-
`,
|
|
5665
|
+
`,AV=O`
|
|
5664
5666
|
padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
|
|
5665
|
-
`,
|
|
5667
|
+
`,jV=()=>H(Iu,{hrefs:Kd,children:W(`div`,{css:kV,children:[H(Q_,{}),H(`div`,{className:`content`,children:W(Hu,{children:[H(zu,{path:Ku(Z.HOME),component:kL}),H(zu,{path:Ku(Z.MEDIA),component:kL}),H(zu,{path:Ku(Z.TITLE),component:YL}),H(zu,{path:Ku(Z.SEARCH),component:gR}),H(zu,{path:Ku(Z.SEARCH_LEGACY),component:DV}),H(zu,{path:Ku(Z.LEGAL),component:yR}),H(zu,{path:Ku(Z.PRIVACY),component:TR}),H(zu,{path:Ku(Z.SETTINGS),component:Tz}),H(zu,{path:Ku(Z.WATCH),component:oB}),H(zu,{path:Ku(Z.PARTY),component:lB}),H(zu,{path:Ku(Z.DEBUG_TRACE),children:H(oV,{})}),H(zu,{path:Ku(Z.LOGIN_CALLBACK),component:OV}),H(zu,{component:()=>H(`div`,{css:AV,children:`404 No page found`})})]})}),H(ev,{}),H(nv,{}),H(yV,{}),H(CV,{}),H(v_,{}),H(EV,{})]})});je(),G();var MV=O`
|
|
5666
5668
|
display: flex;
|
|
5667
5669
|
align-items: center;
|
|
5668
5670
|
justify-content: center;
|
|
@@ -5711,7 +5713,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5711
5713
|
background: rgba(255, 255, 255, 0.08);
|
|
5712
5714
|
}
|
|
5713
5715
|
}
|
|
5714
|
-
`,
|
|
5716
|
+
`,NV=(e,t)=>`route: ${t}\nmessage: ${e.message}\nstack: ${e.stack??`(no stack)`}`,PV=({error:e,route:t})=>{let[n,r]=U(!1);return H(`div`,{css:MV,children:W(`div`,{className:`panel`,children:[H(`h2`,{children:`This page failed to render`}),H(`p`,{className:`message`,children:e.message||`No message was given.`}),W(`div`,{className:`actions`,children:[H(`button`,{type:`button`,onClick:()=>globalThis.location?.reload(),children:`Reload`}),H(`button`,{type:`button`,onClick:()=>{let n=navigator.clipboard?.writeText(NV(e,t));n&&n.then(()=>r(!0)).catch(e=>console.error(Error(`the failure details could not be copied`,{cause:e})))},children:n?`Copied`:`Copy details`})]})]})})},FV=class extends Ce{state={error:null,route:this.props.route};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}static getDerivedStateFromProps(e,t){return e.route===t.route?null:{error:null,route:e.route}}componentDidCatch(e){console.error(Error(`the ${this.props.route} route failed to render`,{cause:e}))}render(){return this.state.error?H(PV,{error:this.state.error,route:this.props.route}):this.props.children}},IV=({children:e})=>{let[t]=Mu();return H(FV,{route:t,children:e})};Vt(location.href)&&(window.__stubExportStore=e=>qt(e??{excludeOrigins:[]}));var LV=async(e,t={},n={})=>CB(Nt,e,t,{settleMs:n.settleMs});kt(location.href)&&(window.__stubExportAnswers=()=>Yt(),window.__stubExportAsks=()=>Wt(),window.__stubGraphCounts=()=>zt()),Tt(location.href)&&(window.__stubGraphQL=(e,t,n)=>LV(e,t,n));var RV=`stub.apikeys`;je(),((e=()=>localStorage)=>{try{e().removeItem(RV)}catch{}})(),js({check:It,focused:Kt}),Fs(to);var zV=O`
|
|
5715
5717
|
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
|
|
5716
5718
|
|
|
5717
5719
|
:root {
|
|
@@ -5771,4 +5773,4 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
|
5771
5773
|
.hidden {
|
|
5772
5774
|
display: none !important;
|
|
5773
5775
|
}
|
|
5774
|
-
`;Q.resume();var
|
|
5776
|
+
`;Q.resume();var BV=document.createElement(`div`);BV.id=`stub-root`,ve(W(ti,{value:Xl,children:[H(Ue,{styles:zV}),H(IV,{children:H(jV,{})})]}),document.body.appendChild(BV));
|