@rubytech/create-maxy-code 0.1.439 → 0.1.441

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.
Files changed (107) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +41 -12
  3. package/payload/platform/plugins/cloudflare/skills/calendar-site/SKILL.md +15 -5
  4. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/functions/api/calendar/free-busy.ts +152 -0
  5. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/public/index.html +6 -3
  6. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/schema.sql +11 -0
  7. package/payload/platform/plugins/docs/references/admin-identity-gate.md +32 -17
  8. package/payload/platform/plugins/docs/references/admin-ui.md +1 -1
  9. package/payload/platform/plugins/docs/references/calendar-booking.md +1 -1
  10. package/payload/platform/plugins/docs/references/graph.md +19 -3
  11. package/payload/platform/plugins/docs/references/internals.md +2 -2
  12. package/payload/platform/plugins/docs/references/outlook-guide.md +9 -4
  13. package/payload/platform/plugins/docs/references/troubleshooting.md +8 -0
  14. package/payload/platform/plugins/graph/.claude-plugin/plugin.json +19 -0
  15. package/payload/platform/plugins/graph/PLUGIN.md +10 -4
  16. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  17. package/payload/platform/plugins/outlook/PLUGIN.md +7 -3
  18. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js +100 -10
  19. package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js.map +1 -1
  20. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.d.ts +2 -0
  21. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.d.ts.map +1 -0
  22. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.js +55 -0
  23. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-list.test.js.map +1 -0
  24. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.d.ts +2 -0
  25. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.d.ts.map +1 -0
  26. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.js +64 -0
  27. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-list.test.js.map +1 -0
  28. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.d.ts +2 -0
  29. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.d.ts.map +1 -0
  30. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.js +193 -0
  31. package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.js.map +1 -0
  32. package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.js +58 -1
  33. package/payload/platform/plugins/outlook/mcp/dist/__tests__/token-store.test.js.map +1 -1
  34. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts +81 -0
  35. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts.map +1 -0
  36. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js +171 -0
  37. package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js.map +1 -0
  38. package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.d.ts +16 -1
  39. package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.d.ts.map +1 -1
  40. package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.js +25 -3
  41. package/payload/platform/plugins/outlook/mcp/dist/auth/token-store.js.map +1 -1
  42. package/payload/platform/plugins/outlook/mcp/dist/index.js +119 -50
  43. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  44. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +1 -1
  45. package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
  46. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts +8 -4
  47. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts.map +1 -1
  48. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js +22 -3
  49. package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js.map +1 -1
  50. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts +17 -0
  51. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.d.ts.map +1 -1
  52. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js +84 -21
  53. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-list.js.map +1 -1
  54. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.d.ts +26 -0
  55. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.d.ts.map +1 -0
  56. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.js +28 -0
  57. package/payload/platform/plugins/outlook/mcp/dist/tools/mailbox-list.js.map +1 -0
  58. package/payload/platform/plugins/outlook/references/auth.md +36 -8
  59. package/payload/platform/plugins/outlook/references/graph-surfaces.md +15 -1
  60. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts +27 -0
  61. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts.map +1 -0
  62. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js +241 -0
  63. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js.map +1 -0
  64. package/payload/platform/scripts/__tests__/account-schema-owned-dirs.test.sh +100 -0
  65. package/payload/platform/scripts/lib/account-schema-owned-dirs.py +207 -0
  66. package/payload/platform/scripts/lib/account-schema-owned-dirs.sh +33 -0
  67. package/payload/platform/scripts/lib/provision-account-dir.sh +7 -0
  68. package/payload/platform/scripts/setup-account.sh +10 -0
  69. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  70. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
  71. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  72. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  73. package/payload/platform/services/claude-session-manager/dist/http-server.js +6 -4
  74. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  75. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.d.ts +7 -6
  76. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.d.ts.map +1 -1
  77. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.js +56 -7
  78. package/payload/platform/services/claude-session-manager/dist/tool-registration-drift.js.map +1 -1
  79. package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
  80. package/payload/server/{chunk-UGPQCVIW.js → chunk-WC4WJR6X.js} +0 -6
  81. package/payload/server/maxy-edge.js +1 -1
  82. package/payload/server/public/assets/{AdminLoginScreens-DeR71H29.js → AdminLoginScreens-CukwQufW.js} +1 -1
  83. package/payload/server/public/assets/AdminShell-BwEBH6tT.js +2 -0
  84. package/payload/server/public/assets/{admin-C15h-NL0.js → admin-CdFRCUUZ.js} +1 -1
  85. package/payload/server/public/assets/{browser-B7xQLIRK.js → browser-BWR59IkB.js} +1 -1
  86. package/payload/server/public/assets/{calendar-A-vGm6pL.js → calendar-kuTcxX1t.js} +1 -1
  87. package/payload/server/public/assets/chat-ejnq2rck.js +1 -0
  88. package/payload/server/public/assets/data-dZbOyLdT.js +1 -0
  89. package/payload/server/public/assets/{graph-D0orIRAh.js → graph-CboWM2_-.js} +2 -2
  90. package/payload/server/public/assets/{operator-DZzuotDB.js → operator-oSaB1mya.js} +1 -1
  91. package/payload/server/public/assets/{page-Ck_pLhAk.js → page-DEkI-Gl1.js} +1 -1
  92. package/payload/server/public/assets/{page-3g0A19Rv.js → page-DMeJHVfA.js} +5 -5
  93. package/payload/server/public/assets/{public-WFUQw9AD.js → public-C54tl6V4.js} +1 -1
  94. package/payload/server/public/assets/{useCopyFeedback-CSk9KjhY.js → useCopyFeedback-DHoYHiK9.js} +1 -1
  95. package/payload/server/public/assets/{useVoiceRecorder-DCyJQkFK.js → useVoiceRecorder-b7HzTFs0.js} +1 -1
  96. package/payload/server/public/browser.html +2 -2
  97. package/payload/server/public/calendar.html +2 -2
  98. package/payload/server/public/chat.html +5 -5
  99. package/payload/server/public/data.html +3 -3
  100. package/payload/server/public/graph.html +3 -3
  101. package/payload/server/public/index.html +5 -5
  102. package/payload/server/public/operator.html +6 -6
  103. package/payload/server/public/public.html +5 -5
  104. package/payload/server/server.js +255 -112
  105. package/payload/server/public/assets/AdminShell-DlAVQUda.js +0 -2
  106. package/payload/server/public/assets/chat-DAae6Z51.js +0 -1
  107. package/payload/server/public/assets/data-BNWpKx1d.js +0 -1
@@ -1,4 +1,4 @@
1
- import{o as e,t}from"./chunk-Ck5AOu5v.js";import{C as n,E as r,a as i,c as a,d as o,g as s,h as c,o as l,r as u,w as d,x as f}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as p,n as m,p as h,t as g}from"./AdminShell-DlAVQUda.js";import{t as _}from"./Checkbox-B629mOPp.js";import{t as v}from"./chevron-left-u4tjq7fI.js";import{n as y,t as b}from"./useCopyFeedback-CSk9KjhY.js";import{d as x,f as S}from"./file-download-4mKJxUi-.js";import{t as ee}from"./maximize-2-CxstTgoK.js";import{t as C}from"./rotate-ccw-COGQTi7n.js";import{i as te,n as w,r as ne}from"./graph-labels-B8YAdo3Z.js";var T=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),E=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),D=s(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),O=s(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),k=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},j={}.propertyIsEnumerable,oe=Object.getOwnPropertyDescriptor;ae.f=oe&&!j.call({1:2},1)?function(e){var t=oe(this,e);return!!t&&t.enumerable}:j;var se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},ce=v,le=s,ue=S,de=Object,fe=ce(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},P={},Ce=P,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,L=Object,Ke=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,L(e))},qe=String,Je=function(e){try{return qe(e)}catch{return`Object`}},Ye=D,Xe=Je,Ze=TypeError,Qe=function(e){if(Ye(e))return e;throw new Ze(Xe(e)+` is not a function`)},$e=Qe,et=me,tt=function(e,t){var n=e[t];return et(n)?void 0:$e(n)},nt=A,rt=D,it=N,at=TypeError,ot=function(e,t){var n,r;if(t===`string`&&rt(n=e.toString)&&!it(r=nt(n,e))||rt(n=e.valueOf)&&!it(r=nt(n,e))||t!==`string`&&rt(n=e.toString)&&!it(r=nt(n,e)))return r;throw new at(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=N,Ht=Ke,Ut=tt,Wt=ot,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=Ke,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=N,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=se,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=Qe,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=N,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=se,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=P,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=P.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=se,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=N,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=N,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=P,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=N,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=se,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=Ke,wc=Je,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=Ke,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=P.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=N,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=se,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=Qe,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=Ke,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=Qe,Xd=N,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=P,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=Qe,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=Qe,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=tt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=tt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=Qe,Ip=Fn,Lp=Je,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=P.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=P.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||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)&&(km(s).call(s,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}}var jm=B,Mm=hr,Nm=oi,Pm=N,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(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 th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{o as e,t}from"./chunk-Ck5AOu5v.js";import{C as n,E as r,a as i,c as a,d as o,g as s,h as c,o as l,r as u,w as d,x as f}from"./useSubAccountSwitcher-DLJFISqf.js";import{b as p,n as m,p as h,t as g}from"./AdminShell-BwEBH6tT.js";import{t as _}from"./Checkbox-B629mOPp.js";import{t as v}from"./chevron-left-u4tjq7fI.js";import{n as y,t as b}from"./useCopyFeedback-DHoYHiK9.js";import{d as x,f as S}from"./file-download-4mKJxUi-.js";import{t as ee}from"./maximize-2-CxstTgoK.js";import{t as C}from"./rotate-ccw-COGQTi7n.js";import{i as te,n as w,r as ne}from"./graph-labels-B8YAdo3Z.js";var T=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),E=s(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),D=s(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),O=s(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),k=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.vis=n.vis||{}))})(e,(function(e){function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}var n=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}},a=function(e){return e&&e.Math===Math&&e},o=a(typeof globalThis==`object`&&globalThis)||a(typeof window==`object`&&window)||a(typeof self==`object`&&self)||a(typeof n==`object`&&n)||(function(){return this})()||n||Function(`return this`)(),s=function(e){try{return!!e()}catch{return!0}},c=!s(function(){var e=(function(){}).bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}),l=c,u=Function.prototype,d=u.apply,f=u.call,p=typeof Reflect==`object`&&Reflect.apply||(l?f.bind(d):function(){return f.apply(d,arguments)}),m=c,h=Function.prototype,g=h.call,_=m&&h.bind.bind(g,g),v=m?_:function(e){return function(){return g.apply(e,arguments)}},y=v,b=y({}.toString),x=y(``.slice),S=function(e){return x(b(e),8,-1)},ee=S,C=v,te=function(e){if(ee(e)===`Function`)return C(e)},w=typeof document==`object`&&document.all,ne={all:w,IS_HTMLDDA:w===void 0&&w!==void 0},T=ne,E=T.all,D=T.IS_HTMLDDA?function(e){return typeof e==`function`||e===E}:function(e){return typeof e==`function`},O={},k=!s(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),re=c,ie=Function.prototype.call,A=re?ie.bind(ie):function(){return ie.apply(ie,arguments)},ae={},j={}.propertyIsEnumerable,oe=Object.getOwnPropertyDescriptor;ae.f=oe&&!j.call({1:2},1)?function(e){var t=oe(this,e);return!!t&&t.enumerable}:j;var se=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},ce=v,le=s,ue=S,de=Object,fe=ce(``.split),pe=le(function(){return!de(`z`).propertyIsEnumerable(0)})?function(e){return ue(e)===`String`?fe(e,``):de(e)}:de,me=function(e){return e==null},he=me,ge=TypeError,_e=function(e){if(he(e))throw new ge(`Can't call method on `+e);return e},ve=pe,ye=_e,be=function(e){return ve(ye(e))},xe=D,Se=ne,M=Se.all,N=Se.IS_HTMLDDA?function(e){return typeof e==`object`?e!==null:xe(e)||e===M}:function(e){return typeof e==`object`?e!==null:xe(e)},P={},Ce=P,we=o,Te=D,F=function(e){return Te(e)?e:void 0},I=function(e,t){return arguments.length<2?F(Ce[e])||F(we[e]):Ce[e]&&Ce[e][t]||we[e]&&we[e][t]},Ee=v({}.isPrototypeOf),De=typeof navigator<`u`&&String(navigator.userAgent)||``,Oe=o,ke=De,Ae=Oe.process,je=Oe.Deno,Me=Ae&&Ae.versions||je&&je.version,Ne=Me&&Me.v8,Pe,Fe;Ne&&(Pe=Ne.split(`.`),Fe=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1])),!Fe&&ke&&(Pe=ke.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ke.match(/Chrome\/(\d+)/),Pe&&(Fe=+Pe[1])));var Ie=Fe,Le=Ie,Re=s,ze=o.String,Be=!!Object.getOwnPropertySymbols&&!Re(function(){var e=Symbol(`symbol detection`);return!ze(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Le&&Le<41}),Ve=Be&&!Symbol.sham&&typeof Symbol.iterator==`symbol`,He=I,Ue=D,We=Ee,Ge=Ve,L=Object,Ke=Ge?function(e){return typeof e==`symbol`}:function(e){var t=He(`Symbol`);return Ue(t)&&We(t.prototype,L(e))},qe=String,Je=function(e){try{return qe(e)}catch{return`Object`}},Ye=D,Xe=Je,Ze=TypeError,Qe=function(e){if(Ye(e))return e;throw new Ze(Xe(e)+` is not a function`)},$e=Qe,et=me,tt=function(e,t){var n=e[t];return et(n)?void 0:$e(n)},nt=A,rt=D,it=N,at=TypeError,ot=function(e,t){var n,r;if(t===`string`&&rt(n=e.toString)&&!it(r=nt(n,e))||rt(n=e.valueOf)&&!it(r=nt(n,e))||t!==`string`&&rt(n=e.toString)&&!it(r=nt(n,e)))return r;throw new at(`Can't convert object to primitive value`)},st={exports:{}},ct=!0,lt=o,ut=Object.defineProperty,dt=function(e,t){try{ut(lt,e,{value:t,configurable:!0,writable:!0})}catch{lt[e]=t}return t},ft=o,pt=dt,mt=`__core-js_shared__`,ht=ft[mt]||pt(mt,{}),gt=ht;(st.exports=function(e,t){return gt[e]||(gt[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.33.2`,mode:`pure`,copyright:`© 2014-2023 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE`,source:`https://github.com/zloirock/core-js`});var _t=st.exports,vt=_e,yt=Object,bt=function(e){return yt(vt(e))},xt=v,St=bt,Ct=xt({}.hasOwnProperty),wt=Object.hasOwn||function(e,t){return Ct(St(e),t)},Tt=v,Et=0,Dt=Math.random(),Ot=Tt(1 .toString),kt=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+Ot(++Et+Dt,36)},At=o,jt=_t,Mt=wt,Nt=kt,Pt=Be,Ft=Ve,It=At.Symbol,Lt=jt(`wks`),Rt=Ft?It.for||It:It&&It.withoutSetter||Nt,zt=function(e){return Mt(Lt,e)||(Lt[e]=Pt&&Mt(It,e)?It[e]:Rt(`Symbol.`+e)),Lt[e]},Bt=A,Vt=N,Ht=Ke,Ut=tt,Wt=ot,Gt=zt,Kt=TypeError,qt=Gt(`toPrimitive`),Jt=function(e,t){if(!Vt(e)||Ht(e))return e;var n=Ut(e,qt),r;if(n){if(t===void 0&&(t=`default`),r=Bt(n,e,t),!Vt(r)||Ht(r))return r;throw new Kt(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),Wt(e,t)},Yt=Ke,Xt=function(e){var t=Jt(e,`string`);return Yt(t)?t:t+``},Zt=o,Qt=N,$t=Zt.document,en=Qt($t)&&Qt($t.createElement),tn=function(e){return en?$t.createElement(e):{}},nn=k,rn=s,an=tn,on=!nn&&!rn(function(){return Object.defineProperty(an(`div`),`a`,{get:function(){return 7}}).a!==7}),sn=k,cn=A,ln=ae,un=se,dn=be,fn=Xt,pn=wt,mn=on,hn=Object.getOwnPropertyDescriptor;O.f=sn?hn:function(e,t){if(e=dn(e),t=fn(t),mn)try{return hn(e,t)}catch{}if(pn(e,t))return un(!cn(ln.f,e,t),e[t])};var gn=s,_n=D,vn=/#|\.prototype\./,yn=function(e,t){var n=xn[bn(e)];return n===Cn?!0:n===Sn?!1:_n(t)?gn(t):!!t},bn=yn.normalize=function(e){return String(e).replace(vn,`.`).toLowerCase()},xn=yn.data={},Sn=yn.NATIVE=`N`,Cn=yn.POLYFILL=`P`,wn=yn,Tn=te,En=Qe,Dn=c,On=Tn(Tn.bind),kn=function(e,t){return En(e),t===void 0?e:Dn?On(e,t):function(){return e.apply(t,arguments)}},An={},jn=k&&s(function(){return Object.defineProperty(function(){},`prototype`,{value:42,writable:!1}).prototype!==42}),Mn=N,Nn=String,Pn=TypeError,Fn=function(e){if(Mn(e))return e;throw new Pn(Nn(e)+` is not an object`)},In=k,Ln=on,Rn=jn,zn=Fn,Bn=Xt,Vn=TypeError,Hn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Wn=`enumerable`,R=`configurable`,z=`writable`;An.f=In?Rn?function(e,t,n){if(zn(e),t=Bn(t),zn(n),typeof e==`function`&&t===`prototype`&&`value`in n&&z in n&&!n[z]){var r=Un(e,t);r&&r[z]&&(e[t]=n.value,n={configurable:R in n?n[R]:r[R],enumerable:Wn in n?n[Wn]:r[Wn],writable:!1})}return Hn(e,t,n)}:Hn:function(e,t,n){if(zn(e),t=Bn(t),zn(n),Ln)try{return Hn(e,t,n)}catch{}if(`get`in n||`set`in n)throw new Vn(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e};var Gn=k,Kn=An,qn=se,Jn=Gn?function(e,t,n){return Kn.f(e,t,qn(1,n))}:function(e,t,n){return e[t]=n,e},Yn=o,Xn=p,Zn=te,Qn=D,$n=O.f,er=wn,tr=P,nr=kn,rr=Jn,ir=wt,ar=function(e){var t=function(n,r,i){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,r)}return new e(n,r,i)}return Xn(e,this,arguments)};return t.prototype=e.prototype,t},B=function(e,t){var n=e.target,r=e.global,i=e.stat,a=e.proto,o=r?Yn:i?Yn[n]:(Yn[n]||{}).prototype,s=r?tr:tr[n]||rr(tr,n,{})[n],c=s.prototype,l,u,d,f,p,m,h,g,_;for(f in t)l=er(r?f:n+(i?`.`:`#`)+f,e.forced),u=!l&&o&&ir(o,f),m=s[f],u&&(e.dontCallGetSet?(_=$n(o,f),h=_&&_.value):h=o[f]),p=u&&h?h:t[f],!(u&&typeof m==typeof p)&&(g=e.bind&&u?nr(p,Yn):e.wrap&&u?ar(p):a&&Qn(p)?Zn(p):p,(e.sham||p&&p.sham||m&&m.sham)&&rr(g,`sham`,!0),rr(s,f,g),a&&(d=n+`Prototype`,ir(tr,d)||rr(tr,d,{}),rr(tr[d],f,p),e.real&&c&&(l||!c[f])&&rr(c,f,p)))},or=B,sr=k,cr=An.f;or({target:`Object`,stat:!0,forced:Object.defineProperty!==cr,sham:!sr},{defineProperty:cr});var lr=P.Object,ur=i.exports=function(e,t,n){return lr.defineProperty(e,t,n)};lr.defineProperty.sham&&(ur.sham=!0);var dr=i.exports,fr=dr,pr=r(fr),mr=S,hr=Array.isArray||function(e){return mr(e)===`Array`},gr=Math.ceil,_r=Math.floor,vr=Math.trunc||function(e){var t=+e;return(t>0?_r:gr)(t)},yr=function(e){var t=+e;return t!==t||t===0?0:vr(t)},br=yr,xr=Math.min,Sr=function(e){return e>0?xr(br(e),9007199254740991):0},Cr=function(e){return Sr(e.length)},wr=TypeError,Tr=9007199254740991,Er=function(e){if(e>Tr)throw wr(`Maximum allowed index exceeded`);return e},Dr=Xt,Or=An,kr=se,Ar=function(e,t,n){var r=Dr(t);r in e?Or.f(e,r,kr(0,n)):e[r]=n},jr=zt(`toStringTag`),Mr={};Mr[jr]=`z`;var Nr=String(Mr)===`[object z]`,Pr=Nr,Fr=D,Ir=S,Lr=zt(`toStringTag`),Rr=Object,zr=Ir(function(){return arguments}())===`Arguments`,Br=function(e,t){try{return e[t]}catch{}},Vr=Pr?Ir:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=Br(t=Rr(e),Lr))==`string`?n:zr?Ir(t):(r=Ir(t))===`Object`&&Fr(t.callee)?`Arguments`:r},Hr=v,Ur=D,Wr=ht,Gr=Hr(Function.toString);Ur(Wr.inspectSource)||(Wr.inspectSource=function(e){return Gr(e)});var Kr=Wr.inspectSource,qr=v,Jr=s,Yr=D,Xr=Vr,Zr=I,V=Kr,Qr=function(){},$r=[],ei=Zr(`Reflect`,`construct`),ti=/^\s*(?:class|function)\b/,ni=qr(ti.exec),ri=!ti.test(Qr),ii=function(e){if(!Yr(e))return!1;try{return ei(Qr,$r,e),!0}catch{return!1}},ai=function(e){if(!Yr(e))return!1;switch(Xr(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return ri||!!ni(ti,V(e))}catch{return!0}};ai.sham=!0;var oi=!ei||Jr(function(){var e;return ii(ii.call)||!ii(Object)||!ii(function(){e=!0})||e})?ai:ii,si=hr,ci=oi,li=N,ui=zt(`species`),di=Array,fi=function(e){var t;return si(e)&&(t=e.constructor,ci(t)&&(t===di||si(t.prototype))?t=void 0:li(t)&&(t=t[ui],t===null&&(t=void 0))),t===void 0?di:t},pi=function(e,t){return new(fi(e))(t===0?0:t)},mi=s,hi=zt,gi=Ie,_i=hi(`species`),vi=function(e){return gi>=51||!mi(function(){var t=[],n=t.constructor={};return n[_i]=function(){return{foo:1}},t[e](Boolean).foo!==1})},yi=B,bi=s,xi=hr,Si=N,Ci=bt,wi=Cr,Ti=Er,Ei=Ar,Di=pi,Oi=vi,ki=zt,Ai=Ie,ji=ki(`isConcatSpreadable`),Mi=Ai>=51||!bi(function(){var e=[];return e[ji]=!1,e.concat()[0]!==e}),Ni=function(e){if(!Si(e))return!1;var t=e[ji];return t===void 0?xi(e):!!t};yi({target:`Array`,proto:!0,arity:1,forced:!Mi||!Oi(`concat`)},{concat:function(e){var t=Ci(this),n=Di(t,0),r=0,i,a,o,s,c;for(i=-1,o=arguments.length;i<o;i++)if(c=i===-1?t:arguments[i],Ni(c))for(s=wi(c),Ti(r+s),a=0;a<s;a++,r++)a in c&&Ei(n,r,c[a]);else Ti(r+1),Ei(n,r++,c);return n.length=r,n}});var Pi=Vr,Fi=String,Ii=function(e){if(Pi(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return Fi(e)},Li={},Ri=yr,zi=Math.max,Bi=Math.min,Vi=function(e,t){var n=Ri(e);return n<0?zi(n+t,0):Bi(n,t)},Hi=be,Ui=Vi,Wi=Cr,Gi=function(e){return function(t,n,r){var i=Hi(t),a=Wi(i),o=Ui(r,a),s;if(e&&n!==n){for(;a>o;)if(s=i[o++],s!==s)return!0}else for(;a>o;o++)if((e||o in i)&&i[o]===n)return e||o||0;return!e&&-1}},Ki={includes:Gi(!0),indexOf:Gi(!1)},qi={},Ji=v,Yi=wt,Xi=be,Zi=Ki.indexOf,Qi=qi,$i=Ji([].push),ea=function(e,t){var n=Xi(e),r=0,i=[],a;for(a in n)!Yi(Qi,a)&&Yi(n,a)&&$i(i,a);for(;t.length>r;)Yi(n,a=t[r++])&&(~Zi(i,a)||$i(i,a));return i},ta=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`],na=ea,ra=ta,ia=Object.keys||function(e){return na(e,ra)},aa=k,oa=jn,sa=An,ca=Fn,la=be,ua=ia;Li.f=aa&&!oa?Object.defineProperties:function(e,t){ca(e);for(var n=la(t),r=ua(t),i=r.length,a=0,o;i>a;)sa.f(e,o=r[a++],n[o]);return e};var da=I(`document`,`documentElement`),fa=_t,pa=kt,ma=fa(`keys`),ha=function(e){return ma[e]||(ma[e]=pa(e))},ga=Fn,_a=Li,va=ta,ya=qi,ba=da,xa=tn,Sa=ha,Ca=`>`,wa=`<`,Ta=`prototype`,Ea=`script`,Da=Sa(`IE_PROTO`),Oa=function(){},ka=function(e){return wa+Ea+Ca+e+wa+`/`+Ea+Ca},Aa=function(e){e.write(ka(``)),e.close();var t=e.parentWindow.Object;return e=null,t},ja=function(){var e=xa(`iframe`),t=`java`+Ea+`:`,n;return e.style.display=`none`,ba.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(ka(`document.F=Object`)),n.close(),n.F},Ma,Na=function(){try{Ma=new ActiveXObject(`htmlfile`)}catch{}Na=typeof document<`u`?document.domain&&Ma?Aa(Ma):ja():Aa(Ma);for(var e=va.length;e--;)delete Na[Ta][va[e]];return Na()};ya[Da]=!0;var Pa=Object.create||function(e,t){var n;return e===null?n=Na():(Oa[Ta]=ga(e),n=new Oa,Oa[Ta]=null,n[Da]=e),t===void 0?n:_a.f(n,t)},Fa={},Ia=ea,La=ta.concat(`length`,`prototype`);Fa.f=Object.getOwnPropertyNames||function(e){return Ia(e,La)};var Ra={},za=Vi,Ba=Cr,Va=Ar,Ha=Array,Ua=Math.max,Wa=function(e,t,n){for(var r=Ba(e),i=za(t,r),a=za(n===void 0?r:n,r),o=Ha(Ua(a-i,0)),s=0;i<a;i++,s++)Va(o,s,e[i]);return o.length=s,o},Ga=S,Ka=be,qa=Fa.f,Ja=Wa,Ya=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Xa=function(e){try{return qa(e)}catch{return Ja(Ya)}};Ra.f=function(e){return Ya&&Ga(e)===`Window`?Xa(e):qa(Ka(e))};var Za={};Za.f=Object.getOwnPropertySymbols;var Qa=Jn,$a=function(e,t,n,r){return r&&r.enumerable?e[t]=n:Qa(e,t,n),e},eo=An,to=function(e,t,n){return eo.f(e,t,n)},no={};no.f=zt;var ro=P,io=wt,ao=no,oo=An.f,so=function(e){var t=ro.Symbol||={};io(t,e)||oo(t,e,{value:ao.f(e)})},co=A,lo=I,uo=zt,fo=$a,po=function(){var e=lo(`Symbol`),t=e&&e.prototype,n=t&&t.valueOf,r=uo(`toPrimitive`);t&&!t[r]&&fo(t,r,function(e){return co(n,this)},{arity:1})},mo=Nr,ho=Vr,go=mo?{}.toString:function(){return`[object `+ho(this)+`]`},_o=Nr,vo=An.f,yo=Jn,bo=wt,xo=go,So=zt(`toStringTag`),Co=function(e,t,n,r){if(e){var i=n?e:e.prototype;bo(i,So)||vo(i,So,{configurable:!0,value:t}),r&&!_o&&yo(i,`toString`,xo)}},wo=o,To=D,Eo=wo.WeakMap,Do=To(Eo)&&/native code/.test(String(Eo)),Oo=o,ko=N,Ao=Jn,jo=wt,Mo=ht,No=ha,Po=qi,Fo=`Object already initialized`,Io=Oo.TypeError,Lo=Oo.WeakMap,Ro,zo,Bo,Vo=function(e){return Bo(e)?zo(e):Ro(e,{})},Ho=function(e){return function(t){var n;if(!ko(t)||(n=zo(t)).type!==e)throw new Io(`Incompatible receiver, `+e+` required`);return n}};if(Do||Mo.state){var Uo=Mo.state||=new Lo;Uo.get=Uo.get,Uo.has=Uo.has,Uo.set=Uo.set,Ro=function(e,t){if(Uo.has(e))throw new Io(Fo);return t.facade=e,Uo.set(e,t),t},zo=function(e){return Uo.get(e)||{}},Bo=function(e){return Uo.has(e)}}else{var Wo=No(`state`);Po[Wo]=!0,Ro=function(e,t){if(jo(e,Wo))throw new Io(Fo);return t.facade=e,Ao(e,Wo,t),t},zo=function(e){return jo(e,Wo)?e[Wo]:{}},Bo=function(e){return jo(e,Wo)}}var Go={set:Ro,get:zo,has:Bo,enforce:Vo,getterFor:Ho},Ko=kn,qo=v,Jo=pe,Yo=bt,Xo=Cr,Zo=pi,Qo=qo([].push),$o=function(e){var t=e===1,n=e===2,r=e===3,i=e===4,a=e===6,o=e===7,s=e===5||a;return function(c,l,u,d){for(var f=Yo(c),p=Jo(f),m=Ko(l,u),h=Xo(p),g=0,_=d||Zo,v=t?_(c,h):n||o?_(c,0):void 0,y,b;h>g;g++)if((s||g in p)&&(y=p[g],b=m(y,g,f),e))if(t)v[g]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return g;case 2:Qo(v,y)}else switch(e){case 4:return!1;case 7:Qo(v,y)}return a?-1:r||i?i:v}},es={forEach:$o(0),map:$o(1),filter:$o(2),some:$o(3),every:$o(4),find:$o(5),findIndex:$o(6),filterReject:$o(7)},ts=B,ns=o,rs=A,is=v,as=k,os=Be,ss=s,cs=wt,ls=Ee,us=Fn,ds=be,fs=Xt,ps=Ii,ms=se,hs=Pa,gs=ia,_s=Fa,vs=Ra,ys=Za,bs=O,xs=An,Ss=Li,Cs=ae,ws=$a,Ts=to,Es=_t,Ds=ha,Os=qi,ks=kt,As=zt,js=no,Ms=so,Ns=po,Ps=Co,Fs=Go,Is=es.forEach,Ls=Ds(`hidden`),Rs=`Symbol`,zs=`prototype`,Bs=Fs.set,Vs=Fs.getterFor(Rs),Hs=Object[zs],Us=ns.Symbol,Ws=Us&&Us[zs],Gs=ns.RangeError,Ks=ns.TypeError,qs=ns.QObject,Js=bs.f,Ys=xs.f,Xs=vs.f,Zs=Cs.f,Qs=is([].push),$s=Es(`symbols`),ec=Es(`op-symbols`),tc=Es(`wks`),nc=!qs||!qs[zs]||!qs[zs].findChild,rc=function(e,t,n){var r=Js(Hs,t);r&&delete Hs[t],Ys(e,t,n),r&&e!==Hs&&Ys(Hs,t,r)},ic=as&&ss(function(){return hs(Ys({},`a`,{get:function(){return Ys(this,`a`,{value:7}).a}})).a!==7})?rc:Ys,ac=function(e,t){var n=$s[e]=hs(Ws);return Bs(n,{type:Rs,tag:e,description:t}),as||(n.description=t),n},oc=function(e,t,n){e===Hs&&oc(ec,t,n),us(e);var r=fs(t);return us(n),cs($s,r)?(n.enumerable?(cs(e,Ls)&&e[Ls][r]&&(e[Ls][r]=!1),n=hs(n,{enumerable:ms(0,!1)})):(cs(e,Ls)||Ys(e,Ls,ms(1,{})),e[Ls][r]=!0),ic(e,r,n)):Ys(e,r,n)},sc=function(e,t){us(e);var n=ds(t);return Is(gs(n).concat(fc(n)),function(t){(!as||rs(lc,n,t))&&oc(e,t,n[t])}),e},cc=function(e,t){return t===void 0?hs(e):sc(hs(e),t)},lc=function(e){var t=fs(e),n=rs(Zs,this,t);return this===Hs&&cs($s,t)&&!cs(ec,t)?!1:n||!cs(this,t)||!cs($s,t)||cs(this,Ls)&&this[Ls][t]?n:!0},uc=function(e,t){var n=ds(e),r=fs(t);if(!(n===Hs&&cs($s,r)&&!cs(ec,r))){var i=Js(n,r);return i&&cs($s,r)&&!(cs(n,Ls)&&n[Ls][r])&&(i.enumerable=!0),i}},dc=function(e){var t=Xs(ds(e)),n=[];return Is(t,function(e){!cs($s,e)&&!cs(Os,e)&&Qs(n,e)}),n},fc=function(e){var t=e===Hs,n=Xs(t?ec:ds(e)),r=[];return Is(n,function(e){cs($s,e)&&(!t||cs(Hs,e))&&Qs(r,$s[e])}),r};os||(Us=function(){if(ls(Ws,this))throw new Ks(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:ps(arguments[0]),t=ks(e),n=function(e){var r=this===void 0?ns:this;r===Hs&&rs(n,ec,e),cs(r,Ls)&&cs(r[Ls],t)&&(r[Ls][t]=!1);var i=ms(1,e);try{ic(r,t,i)}catch(e){if(!(e instanceof Gs))throw e;rc(r,t,i)}};return as&&nc&&ic(Hs,t,{configurable:!0,set:n}),ac(t,e)},Ws=Us[zs],ws(Ws,`toString`,function(){return Vs(this).tag}),ws(Us,`withoutSetter`,function(e){return ac(ks(e),e)}),Cs.f=lc,xs.f=oc,Ss.f=sc,bs.f=uc,_s.f=vs.f=dc,ys.f=fc,js.f=function(e){return ac(As(e),e)},as&&Ts(Ws,`description`,{configurable:!0,get:function(){return Vs(this).description}})),ts({global:!0,constructor:!0,wrap:!0,forced:!os,sham:!os},{Symbol:Us}),Is(gs(tc),function(e){Ms(e)}),ts({target:Rs,stat:!0,forced:!os},{useSetter:function(){nc=!0},useSimple:function(){nc=!1}}),ts({target:`Object`,stat:!0,forced:!os,sham:!as},{create:cc,defineProperty:oc,defineProperties:sc,getOwnPropertyDescriptor:uc}),ts({target:`Object`,stat:!0,forced:!os},{getOwnPropertyNames:dc}),Ns(),Ps(Us,Rs),Os[Ls]=!0;var pc=Be&&!!Symbol.for&&!!Symbol.keyFor,mc=B,hc=I,gc=wt,_c=Ii,vc=_t,yc=pc,bc=vc(`string-to-symbol-registry`),H=vc(`symbol-to-string-registry`);mc({target:`Symbol`,stat:!0,forced:!yc},{for:function(e){var t=_c(e);if(gc(bc,t))return bc[t];var n=hc(`Symbol`)(t);return bc[t]=n,H[n]=t,n}});var xc=B,Sc=wt,Cc=Ke,wc=Je,Tc=_t,Ec=pc,Dc=Tc(`symbol-to-string-registry`);xc({target:`Symbol`,stat:!0,forced:!Ec},{keyFor:function(e){if(!Cc(e))throw TypeError(wc(e)+` is not a symbol`);if(Sc(Dc,e))return Dc[e]}});var Oc=v([].slice),kc=v,Ac=hr,jc=D,Mc=S,Nc=Ii,Pc=kc([].push),Fc=function(e){if(jc(e))return e;if(Ac(e)){for(var t=e.length,n=[],r=0;r<t;r++){var i=e[r];typeof i==`string`?Pc(n,i):(typeof i==`number`||Mc(i)===`Number`||Mc(i)===`String`)&&Pc(n,Nc(i))}var a=n.length,o=!0;return function(e,t){if(o)return o=!1,t;if(Ac(this))return t;for(var r=0;r<a;r++)if(n[r]===e)return t}}},Ic=B,Lc=I,Rc=p,zc=A,Bc=v,Vc=s,Hc=D,Uc=Ke,Wc=Oc,Gc=Fc,Kc=Be,qc=String,Jc=Lc(`JSON`,`stringify`),Yc=Bc(/./.exec),Xc=Bc(``.charAt),Zc=Bc(``.charCodeAt),Qc=Bc(``.replace),$c=Bc(1 .toString),el=/[\uD800-\uDFFF]/g,tl=/^[\uD800-\uDBFF]$/,nl=/^[\uDC00-\uDFFF]$/,rl=!Kc||Vc(function(){var e=Lc(`Symbol`)(`stringify detection`);return Jc([e])!==`[null]`||Jc({a:e})!==`{}`||Jc(Object(e))!==`{}`}),il=Vc(function(){return Jc(`\udf06\ud834`)!==`"\\udf06\\ud834"`||Jc(`\udead`)!==`"\\udead"`}),al=function(e,t){var n=Wc(arguments),r=Gc(t);if(!(!Hc(r)&&(e===void 0||Uc(e))))return n[1]=function(e,t){if(Hc(r)&&(t=zc(r,this,qc(e),t)),!Uc(t))return t},Rc(Jc,null,n)},ol=function(e,t,n){var r=Xc(n,t-1),i=Xc(n,t+1);return Yc(tl,e)&&!Yc(nl,i)||Yc(nl,e)&&!Yc(tl,r)?`\\u`+$c(Zc(e,0),16):e};Jc&&Ic({target:`JSON`,stat:!0,arity:3,forced:rl||il},{stringify:function(e,t,n){var r=Wc(arguments),i=Rc(rl?al:Jc,null,r);return il&&typeof i==`string`?Qc(i,el,ol):i}});var sl=B,cl=Be,ll=s,ul=Za,dl=bt;sl({target:`Object`,stat:!0,forced:!cl||ll(function(){ul.f(1)})},{getOwnPropertySymbols:function(e){var t=ul.f;return t?t(dl(e)):[]}}),so(`asyncIterator`),so(`hasInstance`),so(`isConcatSpreadable`),so(`iterator`),so(`match`),so(`matchAll`),so(`replace`),so(`search`),so(`species`),so(`split`);var fl=so,pl=po;fl(`toPrimitive`),pl();var ml=I,hl=so,gl=Co;hl(`toStringTag`),gl(ml(`Symbol`),`Symbol`),so(`unscopables`),Co(o.JSON,`JSON`,!0);var _l=P.Symbol,vl={},yl=k,bl=wt,xl=Function.prototype,Sl=yl&&Object.getOwnPropertyDescriptor,Cl=bl(xl,`name`),wl={EXISTS:Cl,PROPER:Cl&&(function(){}).name===`something`,CONFIGURABLE:Cl&&(!yl||yl&&Sl(xl,`name`).configurable)},Tl=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),El=wt,Dl=D,Ol=bt,kl=ha,Al=Tl,jl=kl(`IE_PROTO`),Ml=Object,Nl=Ml.prototype,Pl=Al?Ml.getPrototypeOf:function(e){var t=Ol(e);if(El(t,jl))return t[jl];var n=t.constructor;return Dl(n)&&t instanceof n?n.prototype:t instanceof Ml?Nl:null},Fl=s,Il=D,Ll=N,Rl=Pa,zl=Pl,Bl=$a,Vl=zt(`iterator`),Hl=!1,Ul,Wl,Gl;[].keys&&(Gl=[].keys(),`next`in Gl?(Wl=zl(zl(Gl)),Wl!==Object.prototype&&(Ul=Wl)):Hl=!0),Ul=!Ll(Ul)||Fl(function(){var e={};return Ul[Vl].call(e)!==e})?{}:Rl(Ul),Il(Ul[Vl])||Bl(Ul,Vl,function(){return this});var Kl={IteratorPrototype:Ul,BUGGY_SAFARI_ITERATORS:Hl},ql=Kl.IteratorPrototype,Jl=Pa,Yl=se,Xl=Co,Zl=vl,Ql=function(){return this},$l=function(e,t,n,r){var i=t+` Iterator`;return e.prototype=Jl(ql,{next:Yl(+!r,n)}),Xl(e,i,!1,!0),Zl[i]=Ql,e},eu=v,tu=Qe,nu=function(e,t,n){try{return eu(tu(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}},ru=D,iu=String,au=TypeError,ou=function(e){if(typeof e==`object`||ru(e))return e;throw new au(`Can't set `+iu(e)+` as a prototype`)},su=nu,cu=Fn,lu=ou,uu=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=su(Object.prototype,`__proto__`,`set`),n(t,[]),e=t instanceof Array}catch{}return function(t,r){return cu(t),lu(r),e?n(t,r):t.__proto__=r,t}}():void 0),du=B,fu=A,pu=wl,mu=$l,hu=Pl,gu=Co,_u=$a,vu=zt,yu=vl,bu=Kl,xu=pu.PROPER;pu.CONFIGURABLE,bu.IteratorPrototype;var Su=bu.BUGGY_SAFARI_ITERATORS,Cu=vu(`iterator`),wu=`keys`,Tu=`values`,Eu=`entries`,Du=function(){return this},Ou=function(e,t,n,r,i,a,o){mu(n,t,r);var s=function(e){if(e===i&&f)return f;if(!Su&&e&&e in u)return u[e];switch(e){case wu:return function(){return new n(this,e)};case Tu:return function(){return new n(this,e)};case Eu:return function(){return new n(this,e)}}return function(){return new n(this)}},c=t+` Iterator`,l=!1,u=e.prototype,d=u[Cu]||u[`@@iterator`]||i&&u[i],f=!Su&&d||s(i),p=t===`Array`&&u.entries||d,m,h,g;if(p&&(m=hu(p.call(new e)),m!==Object.prototype&&m.next&&(gu(m,c,!0,!0),yu[c]=Du)),xu&&i===Tu&&d&&d.name!==Tu&&(l=!0,f=function(){return fu(d,this)}),i)if(h={values:s(Tu),keys:a?f:s(wu),entries:s(Eu)},o)for(g in h)(Su||l||!(g in u))&&_u(u,g,h[g]);else du({target:t,proto:!0,forced:Su||l},h);return o&&u[Cu]!==f&&_u(u,Cu,f,{name:i}),yu[t]=f,h},ku=function(e,t){return{value:e,done:t}},Au=be,ju=vl,Mu=Go;An.f;var Nu=Ou,Pu=ku,Fu=`Array Iterator`,Iu=Mu.set,Lu=Mu.getterFor(Fu);Nu(Array,`Array`,function(e,t){Iu(this,{type:Fu,target:Au(e),index:0,kind:t})},function(){var e=Lu(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=void 0,Pu(void 0,!0);switch(e.kind){case`keys`:return Pu(n,!1);case`values`:return Pu(t[n],!1)}return Pu([n,t[n]],!1)},`values`),ju.Arguments=ju.Array;var Ru={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zu=o,Bu=Vr,Vu=Jn,Hu=vl,Uu=zt(`toStringTag`);for(var Wu in Ru){var Gu=zu[Wu],Ku=Gu&&Gu.prototype;Ku&&Bu(Ku)!==Uu&&Vu(Ku,Uu,Wu),Hu[Wu]=Hu.Array}var qu=_l,Ju=zt,Yu=An.f,Xu=Ju(`metadata`),Zu=Function.prototype;Zu[Xu]===void 0&&Yu(Zu,Xu,{value:null}),so(`asyncDispose`),so(`dispose`),so(`metadata`);var Qu=qu,$u=I,ed=v,td=$u(`Symbol`),nd=td.keyFor,rd=ed(td.prototype.valueOf),id=td.isRegisteredSymbol||function(e){try{return nd(rd(e))!==void 0}catch{return!1}};B({target:`Symbol`,stat:!0},{isRegisteredSymbol:id});for(var ad=_t,od=I,sd=v,cd=Ke,ld=zt,ud=od(`Symbol`),dd=ud.isWellKnownSymbol,fd=od(`Object`,`getOwnPropertyNames`),pd=sd(ud.prototype.valueOf),md=ad(`wks`),hd=0,gd=fd(ud),_d=gd.length;hd<_d;hd++)try{var vd=gd[hd];cd(ud[vd])&&ld(vd)}catch{}var yd=function(e){if(dd&&dd(e))return!0;try{for(var t=pd(e),n=0,r=fd(md),i=r.length;n<i;n++)if(md[r[n]]==t)return!0}catch{}return!1};B({target:`Symbol`,stat:!0,forced:!0},{isWellKnownSymbol:yd}),so(`matcher`),so(`observable`),B({target:`Symbol`,stat:!0,name:`isRegisteredSymbol`},{isRegistered:id}),B({target:`Symbol`,stat:!0,name:`isWellKnownSymbol`,forced:!0},{isWellKnown:yd}),so(`metadataKey`),so(`patternMatch`),so(`replaceAll`);var bd=Qu,xd=r(bd),Sd=v,Cd=yr,wd=Ii,Td=_e,Ed=Sd(``.charAt),Dd=Sd(``.charCodeAt),Od=Sd(``.slice),kd=function(e){return function(t,n){var r=wd(Td(t)),i=Cd(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=Dd(r,i),o<55296||o>56319||i+1===a||(s=Dd(r,i+1))<56320||s>57343?e?Ed(r,i):o:e?Od(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},Ad={codeAt:kd(!1),charAt:kd(!0)}.charAt,jd=Ii,Md=Go,Nd=Ou,Pd=ku,Fd=`String Iterator`,Id=Md.set,Ld=Md.getterFor(Fd);Nd(String,`String`,function(e){Id(this,{type:Fd,string:jd(e),index:0})},function(){var e=Ld(this),t=e.string,n=e.index,r;return n>=t.length?Pd(void 0,!0):(r=Ad(t,n),e.index+=r.length,Pd(r,!1))});var Rd=no.f(`iterator`),zd=Rd,Bd=r(zd);function Vd(e){"@babel/helpers - typeof";return Vd=typeof xd==`function`&&typeof Bd==`symbol`?function(e){return typeof e}:function(e){return e&&typeof xd==`function`&&e.constructor===xd&&e!==xd.prototype?`symbol`:typeof e},Vd(e)}var Hd=r(no.f(`toPrimitive`));function Ud(e,t){if(Vd(e)!==`object`||e===null)return e;var n=e[Hd];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wd(e){var t=Ud(e,`string`);return Vd(t)===`symbol`?t:String(t)}function Gd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),pr(e,Wd(r.key),r)}}function Kd(e,t,n){return t&&Gd(e.prototype,t),n&&Gd(e,n),pr(e,`prototype`,{writable:!1}),e}function qd(e,t,n){return t=Wd(t),t in e?pr(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jd=v,Yd=Qe,Xd=N,Zd=wt,Qd=Oc,$d=c,ef=Function,tf=Jd([].concat),nf=Jd([].join),rf={},af=function(e,t,n){if(!Zd(rf,t)){for(var r=[],i=0;i<t;i++)r[i]=`a[`+i+`]`;rf[t]=ef(`C,a`,`return new C(`+nf(r,`,`)+`)`)}return rf[t](e,n)},of=$d?ef.bind:function(e){var t=Yd(this),n=t.prototype,r=Qd(arguments,1),i=function(){var n=tf(r,Qd(arguments));return this instanceof i?af(t,n.length,n):t.apply(e,n)};return Xd(n)&&(i.prototype=n),i},sf=B,cf=of;sf({target:`Function`,proto:!0,forced:Function.bind!==cf},{bind:cf});var lf=o,uf=P,df=function(e,t){var n=uf[e+`Prototype`],r=n&&n[t];if(r)return r;var i=lf[e],a=i&&i.prototype;return a&&a[t]},ff=df(`Function`,`bind`),pf=Ee,mf=ff,hf=Function.prototype,gf=function(e){var t=e.bind;return e===hf||pf(hf,e)&&t===hf.bind?mf:t},_f=r(gf),vf=Qe,yf=bt,bf=pe,xf=Cr,Sf=TypeError,Cf=function(e){return function(t,n,r,i){vf(n);var a=yf(t),o=bf(a),s=xf(a),c=e?s-1:0,l=e?-1:1;if(r<2)for(;;){if(c in o){i=o[c],c+=l;break}if(c+=l,e?c<0:s<=c)throw new Sf(`Reduce of empty array with no initial value`)}for(;e?c>=0:s>c;c+=l)c in o&&(i=n(i,o[c],c,a));return i}},wf={left:Cf(!1),right:Cf(!0)},U=s,Tf=function(e,t){var n=[][e];return!!n&&U(function(){n.call(null,t||function(){return 1},1)})},Ef=S(o.process)===`process`,Df=B,Of=wf.left,kf=Tf,Af=Ie;Df({target:`Array`,proto:!0,forced:!Ef&&Af>79&&Af<83||!kf(`reduce`)},{reduce:function(e){var t=arguments.length;return Of(this,e,t,t>1?arguments[1]:void 0)}});var jf=df(`Array`,`reduce`),Mf=Ee,Nf=jf,Pf=Array.prototype,Ff=r(function(e){var t=e.reduce;return e===Pf||Mf(Pf,e)&&t===Pf.reduce?Nf:t}),If=B,Lf=es.filter;If({target:`Array`,proto:!0,forced:!vi(`filter`)},{filter:function(e){return Lf(this,e,arguments.length>1?arguments[1]:void 0)}});var Rf=df(`Array`,`filter`),zf=Ee,Bf=Rf,Vf=Array.prototype,Hf=r(function(e){var t=e.filter;return e===Vf||zf(Vf,e)&&t===Vf.filter?Bf:t}),Uf=B,Wf=es.map;Uf({target:`Array`,proto:!0,forced:!vi(`map`)},{map:function(e){return Wf(this,e,arguments.length>1?arguments[1]:void 0)}});var Gf=df(`Array`,`map`),Kf=Ee,qf=Gf,Jf=Array.prototype,Yf=r(function(e){var t=e.map;return e===Jf||Kf(Jf,e)&&t===Jf.map?qf:t}),Xf=hr,Zf=Cr,Qf=Er,$f=kn,ep=function(e,t,n,r,i,a,o,s){for(var c=i,l=0,u=o?$f(o,s):!1,d,f;l<r;)l in n&&(d=u?u(n[l],l,t):n[l],a>0&&Xf(d)?(f=Zf(d),c=ep(e,t,d,f,c,a-1)-1):(Qf(c+1),e[c]=d),c++),l++;return c},tp=ep,np=B,rp=tp,ip=Qe,ap=bt,op=Cr,sp=pi;np({target:`Array`,proto:!0},{flatMap:function(e){var t=ap(this),n=op(t),r;return ip(e),r=sp(t,0),r.length=rp(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}});var cp=df(`Array`,`flatMap`),lp=Ee,up=cp,dp=Array.prototype,fp=r(function(e){var t=e.flatMap;return e===dp||lp(dp,e)&&t===dp.flatMap?up:t});function pp(e){return new hp(e)}var mp=function(){function e(n,r,i){var a,o,s;t(this,e),qd(this,`_listeners`,{add:_f(a=this._add).call(a,this),remove:_f(o=this._remove).call(o,this),update:_f(s=this._update).call(s,this)}),this._source=n,this._transformers=r,this._target=i}return Kd(e,[{key:`all`,value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:`start`,value:function(){return this._source.on(`add`,this._listeners.add),this._source.on(`remove`,this._listeners.remove),this._source.on(`update`,this._listeners.update),this}},{key:`stop`,value:function(){return this._source.off(`add`,this._listeners.add),this._source.off(`remove`,this._listeners.remove),this._source.off(`update`,this._listeners.update),this}},{key:`_transformItems`,value:function(e){var t;return Ff(t=this._transformers).call(t,function(e,t){return t(e)},e)}},{key:`_add`,value:function(e,t){t!=null&&this._target.add(this._transformItems(this._source.get(t.items)))}},{key:`_update`,value:function(e,t){t!=null&&this._target.update(this._transformItems(this._source.get(t.items)))}},{key:`_remove`,value:function(e,t){t!=null&&this._target.remove(this._transformItems(t.oldData))}}]),e}(),hp=function(){function e(n){t(this,e),qd(this,`_transformers`,[]),this._source=n}return Kd(e,[{key:`filter`,value:function(e){return this._transformers.push(function(t){return Hf(t).call(t,e)}),this}},{key:`map`,value:function(e){return this._transformers.push(function(t){return Yf(t).call(t,e)}),this}},{key:`flatMap`,value:function(e){return this._transformers.push(function(t){return fp(t).call(t,e)}),this}},{key:`to`,value:function(e){return new mp(this._source,this._transformers,e)}}]),e}(),gp=A,_p=Fn,vp=tt,yp=function(e,t,n){var r,i;_p(e);try{if(r=vp(e,`return`),!r){if(t===`throw`)throw n;return n}r=gp(r,e)}catch(e){i=!0,r=e}if(t===`throw`)throw n;if(i)throw r;return _p(r),n},bp=Fn,xp=yp,Sp=function(e,t,n,r){try{return r?t(bp(n)[0],n[1]):t(n)}catch(t){xp(e,`throw`,t)}},Cp=zt,wp=vl,Tp=Cp(`iterator`),Ep=Array.prototype,Dp=function(e){return e!==void 0&&(wp.Array===e||Ep[Tp]===e)},Op=Vr,kp=tt,Ap=me,jp=vl,Mp=zt(`iterator`),Np=function(e){if(!Ap(e))return kp(e,Mp)||kp(e,`@@iterator`)||jp[Op(e)]},Pp=A,Fp=Qe,Ip=Fn,Lp=Je,Rp=Np,zp=TypeError,Bp=function(e,t){var n=arguments.length<2?Rp(e):t;if(Fp(n))return Ip(Pp(n,e));throw new zp(Lp(e)+` is not iterable`)},Vp=kn,Hp=A,Up=bt,Wp=Sp,Gp=Dp,Kp=oi,qp=Cr,Jp=Ar,Yp=Bp,Xp=Np,Zp=Array,Qp=function(e){var t=Up(e),n=Kp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=i!==void 0;a&&(i=Vp(i,r>2?arguments[2]:void 0));var o=Xp(t),s=0,c,l,u,d,f,p;if(o&&!(this===Zp&&Gp(o)))for(d=Yp(t,o),f=d.next,l=n?new this:[];!(u=Hp(f,d)).done;s++)p=a?Wp(d,i,[u.value,s],!0):u.value,Jp(l,s,p);else for(c=qp(t),l=n?new this(c):Zp(c);c>s;s++)p=a?i(t[s],s):t[s],Jp(l,s,p);return l.length=s,l},$p=zt(`iterator`),em=!1;try{var tm=0,nm={next:function(){return{done:!!tm++}},return:function(){em=!0}};nm[$p]=function(){return this},Array.from(nm,function(){throw 2})}catch{}var rm=function(e,t){try{if(!t&&!em)return!1}catch{return!1}var n=!1;try{var r={};r[$p]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch{}return n},im=B,am=Qp;im({target:`Array`,stat:!0,forced:!rm(function(e){Array.from(e)})},{from:am});var om=P.Array.from,sm=r(om),cm=Np,lm=r(cm),um=r(cm);B({target:`Array`,stat:!0},{isArray:hr});var dm=P.Array.isArray,fm=r(dm);function pm(e){if(fm(e))return e}var mm=k,hm=hr,gm=TypeError,_m=Object.getOwnPropertyDescriptor,vm=mm&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(hm(e)&&!_m(e,`length`).writable)throw new gm(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t},ym=B,bm=bt,xm=Cr,Sm=vm,Cm=Er;ym({target:`Array`,proto:!0,arity:1,forced:s(function(){return[].push.call({length:4294967296},1)!==4294967297})||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=bm(this),n=xm(t),r=arguments.length;Cm(n+r);for(var i=0;i<r;i++)t[n]=arguments[i],n++;return Sm(t,n),n}});var wm=df(`Array`,`push`),Tm=Ee,Em=wm,Dm=Array.prototype,Om=function(e){var t=e.push;return e===Dm||Tm(Dm,e)&&t===Dm.push?Em:t},km=r(Om);function Am(e,t){var n=e==null?null:xd!==void 0&&lm(e)||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)&&(km(s).call(s,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}}var jm=B,Mm=hr,Nm=oi,Pm=N,Fm=Vi,Im=Cr,Lm=be,Rm=Ar,zm=zt,Bm=vi,Vm=Oc,Hm=Bm(`slice`),Um=zm(`species`),Wm=Array,Gm=Math.max;jm({target:`Array`,proto:!0,forced:!Hm},{slice:function(e,t){var n=Lm(this),r=Im(n),i=Fm(e,r),a=Fm(t===void 0?r:t,r),o,s,c;if(Mm(n)&&(o=n.constructor,Nm(o)&&(o===Wm||Mm(o.prototype))?o=void 0:Pm(o)&&(o=o[Um],o===null&&(o=void 0)),o===Wm||o===void 0))return Vm(n,i,a);for(s=new(o===void 0?Wm:o)(Gm(a-i,0)),c=0;i<a;i++,c++)i in n&&Rm(s,c,n[i]);return s.length=c,s}});var Km=df(`Array`,`slice`),qm=Ee,Jm=Km,Ym=Array.prototype,Xm=function(e){var t=e.slice;return e===Ym||qm(Ym,e)&&t===Ym.slice?Jm:t},Zm=Xm,Qm=r(Zm),$m=r(om);function eh(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 th(e,t){var n;if(e){if(typeof e==`string`)return eh(e,t);var r=Qm(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return $m(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(e,t)}}function nh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rh(e,t){return pm(e)||Am(e,t)||th(e,t)||nh()}function ih(e){if(fm(e))return eh(e)}function ah(e){if(xd!==void 0&&lm(e)!=null||e[`@@iterator`]!=null)return $m(e)}function oh(){throw TypeError(`Invalid attempt to spread non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sh(e){return ih(e)||ah(e)||th(e)||oh()}var ch=r(qu),lh=df(`Array`,`concat`),uh=Ee,dh=lh,fh=Array.prototype,ph=r(function(e){var t=e.concat;return e===fh||uh(fh,e)&&t===fh.concat?dh:t}),mh=r(Xm),hh=I,gh=v,_h=Fa,vh=Za,yh=Fn,bh=gh([].concat),xh=hh(`Reflect`,`ownKeys`)||function(e){var t=_h.f(yh(e)),n=vh.f;return n?bh(t,n(e)):t};B({target:`Reflect`,stat:!0},{ownKeys:xh});var Sh=P.Reflect.ownKeys,Ch=r(Sh),wh=r(dm),Th=B,Eh=bt,Dh=ia;Th({target:`Object`,stat:!0,forced:s(function(){Dh(1)})},{keys:function(e){return Dh(Eh(e))}});var Oh=P.Object.keys,kh=r(Oh),Ah=es.forEach,jh=Tf(`forEach`)?[].forEach:function(e){return Ah(this,e,arguments.length>1?arguments[1]:void 0)},Mh=B,Nh=jh;Mh({target:`Array`,proto:!0,forced:[].forEach!==Nh},{forEach:Nh});var Ph=df(`Array`,`forEach`),Fh=Vr,Ih=wt,Lh=Ee,Rh=Ph,zh=Array.prototype,Bh={DOMTokenList:!0,NodeList:!0},Vh=function(e){var t=e.forEach;return e===zh||Lh(zh,e)&&t===zh.forEach||Ih(Bh,Fh(e))?Rh:t},Hh=r(Vh),Uh=B,Wh=v,Gh=hr,Kh=Wh([].reverse),qh=[1,2];Uh({target:`Array`,proto:!0,forced:String(qh)===String(qh.reverse())},{reverse:function(){return Gh(this)&&(this.length=this.length),Kh(this)}});var Jh=df(`Array`,`reverse`),Yh=Ee,Xh=Jh,Zh=Array.prototype,Qh=function(e){var t=e.reverse;return e===Zh||Yh(Zh,e)&&t===Zh.reverse?Xh:t},$h=r(Qh),eg=Je,tg=TypeError,ng=function(e,t){if(!delete e[t])throw new tg(`Cannot delete property `+eg(t)+` of `+eg(e))},rg=B,ig=bt,ag=Vi,og=yr,sg=Cr,cg=vm,lg=Er,ug=pi,dg=Ar,fg=ng,pg=vi(`splice`),mg=Math.max,hg=Math.min;rg({target:`Array`,proto:!0,forced:!pg},{splice:function(e,t){var n=ig(this),r=sg(n),i=ag(e,r),a=arguments.length,o,s,c,l,u,d;for(a===0?o=s=0:a===1?(o=0,s=r-i):(o=a-2,s=hg(mg(og(t),0),r-i)),lg(r+o-s),c=ug(n,s),l=0;l<s;l++)u=i+l,u in n&&dg(c,l,n[u]);if(c.length=s,o<s){for(l=i;l<r-s;l++)u=l+s,d=l+o,u in n?n[d]=n[u]:fg(n,d);for(l=r;l>r-s+o;l--)fg(n,l-1)}else if(o>s)for(l=r-s;l>i;l--)u=l+s-1,d=l+o-1,u in n?n[d]=n[u]:fg(n,d);for(l=0;l<o;l++)n[l+i]=arguments[l+2];return cg(n,r-s+o),c}});var gg=df(`Array`,`splice`),_g=Ee,vg=gg,yg=Array.prototype,bg=r(function(e){var t=e.splice;return e===yg||_g(yg,e)&&t===yg.splice?vg:t}),xg=k,Sg=v,Cg=A,wg=s,Tg=ia,Eg=Za,Dg=ae,Og=bt,kg=pe,Ag=Object.assign,jg=Object.defineProperty,Mg=Sg([].concat),Ng=!Ag||wg(function(){if(xg&&Ag({b:1},Ag(jg({},`a`,{enumerable:!0,get:function(){jg(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),r=`abcdefghijklmnopqrst`;return e[n]=7,r.split(``).forEach(function(e){t[e]=e}),Ag({},e)[n]!==7||Tg(Ag({},t)).join(``)!==r})?function(e,t){for(var n=Og(e),r=arguments.length,i=1,a=Eg.f,o=Dg.f;r>i;)for(var s=kg(arguments[i++]),c=a?Mg(Tg(s),a(s)):Tg(s),l=c.length,u=0,d;l>u;)d=c[u++],(!xg||Cg(o,s,d))&&(n[d]=s[d]);return n}:Ag,Pg=B,Fg=Ng;Pg({target:`Object`,stat:!0,arity:2,forced:Object.assign!==Fg},{assign:Fg});var Ig=P.Object.assign,Lg=r(Ig),Rg=B,zg=s,Bg=bt,Vg=Pl,Hg=Tl;Rg({target:`Object`,stat:!0,forced:zg(function(){Vg(1)}),sham:!Hg},{getPrototypeOf:function(e){return Vg(Bg(e))}});var Ug=P.Object.getPrototypeOf;B({target:`Object`,stat:!0,sham:!k},{create:Pa});var Wg=P.Object,Gg=function(e,t){return Wg.create(e,t)},Kg=r(Gg),qg=P,Jg=p;qg.JSON||={stringify:JSON.stringify};var Yg=r(function(e,t,n){return Jg(qg.JSON.stringify,null,arguments)}),Xg=typeof Bun==`function`&&Bun&&typeof Bun.version==`string`,Zg=TypeError,Qg=function(e,t){if(e<t)throw new Zg(`Not enough arguments`);return e},$g=o,e_=p,t_=D,n_=Xg,r_=De,i_=Oc,a_=Qg,o_=$g.Function,s_=/MSIE .\./.test(r_)||n_&&(function(){var e=$g.Bun.version.split(`.`);return e.length<3||e[0]===`0`&&(e[1]<3||e[1]===`3`&&e[2]===`0`)})(),c_=function(e,t){var n=t?2:1;return s_?function(r,i){var a=a_(arguments.length,1)>n,o=t_(r)?r:o_(r),s=a?i_(arguments,n):[],c=a?function(){e_(o,this,s)}:o;return t?e(c,i):e(c)}:e},l_=B,u_=o,d_=c_(u_.setInterval,!0);l_({global:!0,bind:!0,forced:u_.setInterval!==d_},{setInterval:d_});var f_=B,p_=o,m_=c_(p_.setTimeout,!0);f_({global:!0,bind:!0,forced:p_.setTimeout!==m_},{setTimeout:m_});var h_=P.setTimeout,g_=r(h_),__={exports:{}};(function(e){function t(e){if(e)return n(e);this._callbacks=new Map}function n(e){return Object.assign(e,t.prototype),e._callbacks=new Map,e}t.prototype.on=function(e,t){let n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},t.prototype.once=function(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},t.prototype.off=function(e,t){if(e===void 0&&t===void 0)return this._callbacks.clear(),this;if(t===void 0)return this._callbacks.delete(e),this;let n=this._callbacks.get(e);if(n){for(let[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}n.length===0?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e,...t){let n=this._callbacks.get(e);if(n){let e=[...n];for(let n of e)n.apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks.get(e)??[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(let e of this._callbacks.values())t+=e.length;return t},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t})(__);var v_=__.exports,y_=r(v_);function b_(){return b_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b_.apply(this,arguments)}function x_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function S_(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}var C_=typeof Object.assign==`function`?Object.assign:function(e){if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!=null)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},w_=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],T_=typeof document>`u`?{style:{}}:document.createElement(`div`),E_=`function`,D_=Math.round,O_=Math.abs,k_=Date.now;function A_(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),a=0;a<w_.length;){if(n=w_[a],r=n?n+i:t,r in e)return r;a++}}var j_=typeof window>`u`?{}:window,M_=A_(T_.style,`touchAction`),N_=M_!==void 0;function P_(){if(!N_)return!1;var e={},t=j_.CSS&&j_.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(n){return e[n]=t?j_.CSS.supports(`touch-action`,n):!0}),e}var F_=`compute`,I_=`auto`,L_=`manipulation`,R_=`none`,z_=`pan-x`,B_=`pan-y`,V_=P_(),H_=/mobile|tablet|ip(ad|hone|od)|android/i,U_=`ontouchstart`in j_,W_=A_(j_,`PointerEvent`)!==void 0,G_=U_&&H_.test(navigator.userAgent),K_=`touch`,q_=`pen`,J_=`mouse`,Y_=`kinect`,X_=25,Z_=1,Q_=2,$_=4,ev=8,tv=1,nv=2,rv=4,iv=8,av=16,ov=nv|rv,sv=iv|av,cv=ov|sv,lv=[`x`,`y`],uv=[`clientX`,`clientY`];function dv(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==void 0)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function fv(e,t){return typeof e===E_?e.apply(t&&t[0]||void 0,t):e}function pv(e,t){return e.indexOf(t)>-1}function mv(e){if(pv(e,R_))return R_;var t=pv(e,z_),n=pv(e,B_);return t&&n?R_:t||n?t?z_:B_:pv(e,L_)?L_:I_}var hv=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===F_&&(e=this.compute()),N_&&this.manager.element.style&&V_[e]&&(this.manager.element.style[M_]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var e=[];return dv(this.manager.recognizers,function(t){fv(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),mv(e.join(` `))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented){t.preventDefault();return}var r=this.actions,i=pv(r,R_)&&!V_[R_],a=pv(r,B_)&&!V_[B_],o=pv(r,z_)&&!V_[z_];if(i){var s=e.pointers.length===1,c=e.distance<2,l=e.deltaTime<250;if(s&&c&&l)return}if(!(o&&a)&&(i||a&&n&ov||o&&n&sv))return this.preventSrc(t)},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function gv(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function _v(e){var t=e.length;if(t===1)return{x:D_(e[0].clientX),y:D_(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:D_(n/t),y:D_(r/t)}}function vv(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:D_(e.pointers[n].clientX),clientY:D_(e.pointers[n].clientY)},n++;return{timeStamp:k_(),pointers:t,center:_v(t),deltaX:e.deltaX,deltaY:e.deltaY}}function yv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function bv(e,t,n){n||=lv;var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.atan2(i,r)*180/Math.PI}function xv(e,t){return e===t?tv:O_(e)>=O_(t)?e<0?nv:rv:t<0?iv:av}function Sv(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},a=e.prevInput||{};(t.eventType===Z_||a.eventType===$_)&&(i=e.prevDelta={x:a.deltaX||0,y:a.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function Cv(e,t,n){return{x:t/e||0,y:n/e||0}}function wv(e,t){return yv(t[0],t[1],uv)/yv(e[0],e[1],uv)}function Tv(e,t){return bv(t[1],t[0],uv)+bv(e[1],e[0],uv)}function Ev(e,t){var n=e.lastInterval||t,r=t.timeStamp-n.timeStamp,i,a,o,s;if(t.eventType!==ev&&(r>X_||n.velocity===void 0)){var c=t.deltaX-n.deltaX,l=t.deltaY-n.deltaY,u=Cv(r,c,l);a=u.x,o=u.y,i=O_(u.x)>O_(u.y)?u.x:u.y,s=xv(c,l),e.lastInterval=t}else i=n.velocity,a=n.velocityX,o=n.velocityY,s=n.direction;t.velocity=i,t.velocityX=a,t.velocityY=o,t.direction=s}function Dv(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||=vv(t),i>1&&!n.firstMultiple?n.firstMultiple=vv(t):i===1&&(n.firstMultiple=!1);var a=n.firstInput,o=n.firstMultiple,s=o?o.center:a.center,c=t.center=_v(r);t.timeStamp=k_(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=bv(s,c),t.distance=yv(s,c),Sv(n,t),t.offsetDirection=xv(t.deltaX,t.deltaY);var l=Cv(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=O_(l.x)>O_(l.y)?l.x:l.y,t.scale=o?wv(o.pointers,r):1,t.rotation=o?Tv(o.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,Ev(n,t);var u=e.element,d=t.srcEvent,f=d.composedPath?d.composedPath()[0]:d.path?d.path[0]:d.target;gv(f,u)&&(u=f),t.target=u}function Ov(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,a=t&Z_&&r-i===0,o=t&($_|ev)&&r-i===0;n.isFirst=!!a,n.isFinal=!!o,a&&(e.session={}),n.eventType=t,Dv(e,n),e.emit(`hammer.input`,n),e.recognize(n),e.session.prevInput=n}function kv(e){return e.trim().split(/\s+/g)}function Av(e,t,n){dv(kv(t),function(t){e.addEventListener(t,n,!1)})}function W(e,t,n){dv(kv(t),function(t){e.removeEventListener(t,n,!1)})}function jv(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||window}var Mv=function(){function e(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){fv(e.options.enable,[e])&&n.handler(t)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Av(this.element,this.evEl,this.domHandler),this.evTarget&&Av(this.target,this.evTarget,this.domHandler),this.evWin&&Av(jv(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(jv(this.element),this.evWin,this.domHandler)},e}();function Nv(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}var Pv={pointerdown:Z_,pointermove:Q_,pointerup:$_,pointercancel:ev,pointerout:ev},Fv={2:K_,3:q_,4:J_,5:Y_},Iv=`pointerdown`,Lv=`pointermove pointerup pointercancel`;j_.MSPointerEvent&&!j_.PointerEvent&&(Iv=`MSPointerDown`,Lv=`MSPointerMove MSPointerUp MSPointerCancel`);var Rv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Iv,r.evWin=Lv,n=e.apply(this,arguments)||this,n.store=n.manager.session.pointerEvents=[],n}var n=t.prototype;return n.handler=function(e){var t=this.store,n=!1,r=Pv[e.type.toLowerCase().replace(`ms`,``)],i=Fv[e.pointerType]||e.pointerType,a=i===K_,o=Nv(t,e.pointerId,`pointerId`);r&Z_&&(e.button===0||a)?o<0&&(t.push(e),o=t.length-1):r&($_|ev)&&(n=!0),!(o<0)&&(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(o,1))},t}(Mv);function zv(e){return Array.prototype.slice.call(e,0)}function Bv(e,t,n){for(var r=[],i=[],a=0;a<e.length;){var o=t?e[a][t]:e[a];Nv(i,o)<0&&r.push(e[a]),i[a]=o,a++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}var Vv={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},Hv=`touchstart touchmove touchend touchcancel`,Uv=function(e){x_(t,e);function t(){var n;return t.prototype.evTarget=Hv,n=e.apply(this,arguments)||this,n.targetIds={},n}var n=t.prototype;return n.handler=function(e){var t=Vv[e.type],n=Wv.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})},t}(Mv);function Wv(e,t){var n=zv(e.touches),r=this.targetIds;if(t&(Z_|Q_)&&n.length===1)return r[n[0].identifier]=!0,[n,n];var i,a,o=zv(e.changedTouches),s=[],c=this.target;if(a=n.filter(function(e){return gv(e.target,c)}),t===Z_)for(i=0;i<a.length;)r[a[i].identifier]=!0,i++;for(i=0;i<o.length;)r[o[i].identifier]&&s.push(o[i]),t&($_|ev)&&delete r[o[i].identifier],i++;if(s.length)return[Bv(a.concat(s),`identifier`,!0),s]}var Gv={mousedown:Z_,mousemove:Q_,mouseup:$_},Kv=`mousedown`,qv=`mousemove mouseup`,Jv=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evEl=Kv,r.evWin=qv,n=e.apply(this,arguments)||this,n.pressed=!1,n}var n=t.prototype;return n.handler=function(e){var t=Gv[e.type];t&Z_&&e.button===0&&(this.pressed=!0),t&Q_&&e.which!==1&&(t=$_),this.pressed&&(t&$_&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:J_,srcEvent:e}))},t}(Mv),Yv=2500,Xv=25;function Zv(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY},r=this.lastTouches;this.lastTouches.push(n),setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},Yv)}}function Qv(e,t){e&Z_?(this.primaryTouch=t.changedPointers[0].identifier,Zv.call(this,t)):e&($_|ev)&&Zv.call(this,t)}function $v(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],a=Math.abs(t-i.x),o=Math.abs(n-i.y);if(a<=Xv&&o<=Xv)return!0}return!1}var ey=function(){return function(e){x_(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.handler=function(e,t,n){var i=n.pointerType===K_,a=n.pointerType===J_;if(!(a&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Qv.call(S_(S_(r)),t,n);else if(a&&$v.call(S_(S_(r)),n))return;r.callback(e,t,n)}},r.touch=new Uv(r.manager,r.handler),r.mouse=new Jv(r.manager,r.handler),r.primaryTouch=null,r.lastTouches=[],r}var n=t.prototype;return n.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Mv)}();function ty(e){var t;return t=e.options.inputClass||(W_?Rv:G_?Uv:U_?ey:Jv),new t(e,Ov)}function ny(e,t,n){return Array.isArray(e)?(dv(e,n[t],n),!0):!1}var ry=1,iy=2,ay=4,oy=8,sy=oy,cy=16,ly=32,uy=1;function dy(){return uy++}function G(e,t){var n=t.manager;return n?n.get(e):e}function K(e){return e&cy?`cancel`:e&oy?`end`:e&ay?`move`:e&iy?`start`:``}var fy=function(){function e(e){e===void 0&&(e={}),this.options=b_({enable:!0},e),this.id=dy(),this.manager=null,this.state=ry,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return C_(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(ny(e,`recognizeWith`,this))return this;var t=this.simultaneous;return e=G(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},t.dropRecognizeWith=function(e){return ny(e,`dropRecognizeWith`,this)?this:(e=G(e,this),delete this.simultaneous[e.id],this)},t.requireFailure=function(e){if(ny(e,`requireFailure`,this))return this;var t=this.requireFail;return e=G(e,this),Nv(t,e)===-1&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(ny(e,`dropRequireFailure`,this))return this;e=G(e,this);var t=Nv(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},t.hasRequireFailures=function(){return this.requireFail.length>0},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<oy&&r(t.options.event+K(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=oy&&r(t.options.event+K(n))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=ly},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(ly|ry)))return!1;e++}return!0},t.recognize=function(e){var t=C_({},e);if(!fv(this.options.enable,[this,t])){this.reset(),this.state=ly;return}this.state&(sy|cy|ly)&&(this.state=ry),this.state=this.process(t),this.state&(iy|ay|oy|cy)&&this.tryEmit(t)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),py=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},t))||this,n.pTime=!1,n.pCenter=!1,n._timer=null,n._input=null,n.count=0,n}var n=t.prototype;return n.getTouchAction=function(){return[L_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime<n.time;if(this.reset(),e.eventType&Z_&&this.count===0)return this.failTimeout();if(i&&a&&r){if(e.eventType!==$_)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<n.interval:!0,s=!this.pCenter||yv(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,!s||!o?this.count=1:this.count+=1,this._input=e,this.count%n.taps===0)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.interval),iy):sy}return ly},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=ly},this.options.interval),ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){this.state===sy&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},t}(fy),my=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({pointers:1},t))||this}var n=t.prototype;return n.attrTest=function(e){var t=this.options.pointers;return t===0||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,r=t&(iy|ay),i=this.attrTest(e);return r&&(n&ev||!i)?t|cy:r||i?n&$_?t|oy:t&iy?t|ay:iy:ly},t}(fy);function hy(e){return e===av?`down`:e===iv?`up`:e===nv?`left`:e===rv?`right`:``}var gy=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`pan`,threshold:10,pointers:1,direction:cv},t))||this,n.pX=null,n.pY=null,n}var n=t.prototype;return n.getTouchAction=function(){var e=this.options.direction,t=[];return e&ov&&t.push(B_),e&sv&&t.push(z_),t},n.directionTest=function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,a=e.deltaX,o=e.deltaY;return i&t.direction||(t.direction&ov?(i=a===0?tv:a<0?nv:rv,n=a!==this.pX,r=Math.abs(e.deltaX)):(i=o===0?tv:o<0?iv:av,n=o!==this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},n.attrTest=function(e){return my.prototype.attrTest.call(this,e)&&(this.state&iy||!(this.state&iy)&&this.directionTest(e))},n.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var n=hy(t.direction);n&&(t.additionalEvent=this.options.event+n),e.prototype.emit.call(this,t)},t}(my),_y=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`swipe`,threshold:10,velocity:.3,direction:ov|sv,pointers:1},t))||this}var n=t.prototype;return n.getTouchAction=function(){return gy.prototype.getTouchAction.call(this)},n.attrTest=function(t){var n=this.options.direction,r;return n&(ov|sv)?r=t.overallVelocity:n&ov?r=t.overallVelocityX:n&sv&&(r=t.overallVelocityY),e.prototype.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&O_(r)>this.options.velocity&&t.eventType&$_},n.emit=function(e){var t=hy(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},t}(my),vy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`pinch`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&iy)},n.emit=function(t){if(t.scale!==1){var n=t.scale<1?`in`:`out`;t.additionalEvent=this.options.event+n}e.prototype.emit.call(this,t)},t}(my),yy=function(e){x_(t,e);function t(t){return t===void 0&&(t={}),e.call(this,b_({event:`rotate`,threshold:0,pointers:2},t))||this}var n=t.prototype;return n.getTouchAction=function(){return[R_]},n.attrTest=function(t){return e.prototype.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&iy)},t}(my),by=function(e){x_(t,e);function t(t){var n;return t===void 0&&(t={}),n=e.call(this,b_({event:`press`,pointers:1,time:251,threshold:9},t))||this,n._timer=null,n._input=null,n}var n=t.prototype;return n.getTouchAction=function(){return[I_]},n.process=function(e){var t=this,n=this.options,r=e.pointers.length===n.pointers,i=e.distance<n.threshold,a=e.deltaTime>n.time;if(this._input=e,!i||!r||e.eventType&($_|ev)&&!a)this.reset();else if(e.eventType&Z_)this.reset(),this._timer=setTimeout(function(){t.state=sy,t.tryEmit()},n.time);else if(e.eventType&$_)return sy;return ly},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){this.state===sy&&(e&&e.eventType&$_?this.manager.emit(this.options.event+`up`,e):(this._input.timeStamp=k_(),this.manager.emit(this.options.event,this._input)))},t}(fy),xy={domEvents:!1,touchAction:F_,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}},Sy=[[yy,{enable:!1}],[vy,{enable:!1},[`rotate`]],[_y,{direction:ov}],[gy,{direction:ov},[`swipe`]],[py],[py,{event:`doubletap`,taps:2},[`tap`]],[by]],Cy=1,wy=2;function Ty(e,t){var n=e.element;if(n.style){var r;dv(e.options.cssProps,function(i,a){r=A_(n.style,a),t?(e.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=e.oldCssProps[r]||``}),t||(e.oldCssProps={})}}function Ey(e,t){var n=document.createEvent(`Event`);n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var Dy=function(){function e(e,t){var n=this;this.options=C_({},xy,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=ty(this),this.touchAction=new hv(this,this.options.touchAction),Ty(this,!0),dv(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return C_(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?wy:Cy},t.recognize=function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&sy)&&(t.curRecognizer=null,i=null);for(var a=0;a<r.length;)n=r[a],t.stopped!==wy&&(!i||n===i||n.canRecognizeWith(i))?n.recognize(e):n.reset(),!i&&n.state&(iy|ay|oy)&&(t.curRecognizer=n,i=n),a++}},t.get=function(e){if(e instanceof fy)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(ny(e,`add`,this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},t.remove=function(e){if(ny(e,`remove`,this))return this;var t=this.get(e);if(e){var n=this.recognizers,r=Nv(n,t);r!==-1&&(n.splice(r,1),this.touchAction.update())}return this},t.on=function(e,t){if(e===void 0||t===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(e===void 0)return this;var n=this.handlers;return dv(kv(e),function(e){t?n[e]&&n[e].splice(Nv(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){this.options.domEvents&&Ey(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(!(!n||!n.length)){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},t.destroy=function(){this.element&&Ty(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),Oy={touchstart:Z_,touchmove:Q_,touchend:$_,touchcancel:ev},ky=`touchstart`,Ay=`touchstart touchmove touchend touchcancel`,jy=function(e){x_(t,e);function t(){var n,r=t.prototype;return r.evTarget=ky,r.evWin=Ay,n=e.apply(this,arguments)||this,n.started=!1,n}var n=t.prototype;return n.handler=function(e){var t=Oy[e.type];if(t===Z_&&(this.started=!0),this.started){var n=My.call(this,e,t);t&($_|ev)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:K_,srcEvent:e})}},t}(Mv);function My(e,t){var n=zv(e.touches),r=zv(e.changedTouches);return t&($_|ev)&&(n=Bv(n.concat(r),`identifier`,!0)),[n,r]}function Ny(e,t,n){var r=`DEPRECATED METHOD: `+t+`
4
4
  `+n+` AT
@@ -48,4 +48,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function tE(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 nE(e){var t=function(){if(typeof Reflect>`u`||!sv||sv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(sv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=sv(r,arguments,i)}else n=r.apply(this,arguments);return Rv(this,n)}}var rE=function(e){Lv(r,e);var n=nE(r);function r(e,i){var a;return t(this,r),Yu(W(a=n.call(this)),`_queue`,null),e&&!tm(e)&&(i=e,e=[]),a._options=i||{},a._data=new Cw,a.length=0,a._idProp=a._options.fieldId||`id`,e&&e.length&&a.add(e),a.setOptions(i),a}return Ju(r,[{key:`idProp`,get:function(){return this._idProp}},{key:`setOptions`,value:function(e){e&&e.queue!==void 0&&(!1===e.queue?this._queue&&=(this._queue.destroy(),null):(this._queue||=GT.extend(this,{replace:[`add`,`update`,`remove`]}),e.queue&&typeof e.queue==`object`&&this._queue.setOptions(e.queue)))}},{key:`add`,value:function(e,t){var n,r=this,i=[];if(tm(e)){var a=Wd(e).call(e,(function(e){return e[r._idProp]}));if(kw(a).call(a,(function(e){return r._data.has(e)})))throw Error(`A duplicate id was found in the parameter array.`);for(var o=0,s=e.length;o<s;o++)n=this._addItem(e[o]),i.push(n)}else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);n=this._addItem(e),i.push(n)}return i.length&&this._trigger(`add`,{items:i},t),i}},{key:`update`,value:function(e,t){var n=this,r=[],i=[],a=[],o=[],s=this._idProp,c=function(e){var t=e[s];if(t!=null&&n._data.has(t)){var c=e,l=oh({},n._data.get(t)),u=n._updateItem(c);i.push(u),o.push(c),a.push(l)}else{var d=n._addItem(e);r.push(d)}};if(tm(e))for(var l=0,u=e.length;l<u;l++)e[l]&&typeof e[l]==`object`?c(e[l]):console.warn(`Ignoring input item, which is not an object at index `+l);else{if(!e||typeof e!=`object`)throw Error(`Unknown dataType`);c(e)}if(r.length&&this._trigger(`add`,{items:r},t),i.length){var d={items:i,oldData:a,data:o};this._trigger(`update`,d,t)}return Kp(r).call(r,i)}},{key:`updateOnly`,value:function(e,t){var n,r=this;tm(e)||(e=[e]);var i=Wd(n=Wd(e).call(e,(function(e){var t=r._data.get(e[r._idProp]);if(t==null)throw Error(`Updating non-existent items is not allowed.`);return{oldData:t,update:e}}))).call(n,(function(e){var t=e.oldData,n=e.update,i=t[r._idProp],a=function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return L_.apply(void 0,Kp(t=[{},e]).call(t,r))}(t,n);return r._data.set(i,a),{id:i,oldData:t,updatedData:a}}));if(i.length){var a={items:Wd(i).call(i,(function(e){return e.id})),oldData:Wd(i).call(i,(function(e){return e.oldData})),data:Wd(i).call(i,(function(e){return e.updatedData}))};return this._trigger(`update`,a,t),a.items}return[]}},{key:`get`,value:function(e,t){var n=void 0,r=void 0,i=void 0;WT(e)?(n=e,i=t):tm(e)?(r=e,i=t):i=e;var a=i&&i.returnType===`Object`?`Object`:`Array`,o=i&&Rd(i),s=[],c=void 0,l=void 0,u=void 0;if(n!=null)(c=this._data.get(n))&&o&&!o(c)&&(c=void 0);else if(r!=null)for(var d=0,f=r.length;d<f;d++)(c=this._data.get(r[d]))==null||o&&!o(c)||s.push(c);else for(var p,m=0,h=(l=Bp(Lw(p=this._data).call(p))).length;m<h;m++)u=l[m],(c=this._data.get(u))==null||o&&!o(c)||s.push(c);if(i&&i.order&&n==null&&this._sort(s,i.order),i&&i.fields){var g=i.fields;if(n!=null&&c!=null)c=this._filterFields(c,g);else for(var _=0,v=s.length;_<v;_++)s[_]=this._filterFields(s[_],g)}if(a==`Object`){for(var y={},b=0,x=s.length;b<x;b++){var S=s[b];y[S[this._idProp]]=S}return y}return n==null?s:c??null}},{key:`getIds`,value:function(e){var t=this._data,n=e&&Rd(e),r=e&&e.order,i=Bp(Lw(t).call(t)),a=[];if(n)if(r){for(var o=[],s=0,c=i.length;s<c;s++){var l=i[s],u=this._data.get(l);u!=null&&n(u)&&o.push(u)}this._sort(o,r);for(var d=0,f=o.length;d<f;d++)a.push(o[d][this._idProp])}else for(var p=0,m=i.length;p<m;p++){var h=i[p],g=this._data.get(h);g!=null&&n(g)&&a.push(g[this._idProp])}else if(r){for(var _=[],v=0,y=i.length;v<y;v++){var b=i[v];_.push(t.get(b))}this._sort(_,r);for(var x=0,S=_.length;x<S;x++)a.push(_[x][this._idProp])}else for(var ee=0,C=i.length;ee<C;ee++){var te=i[ee],w=t.get(te);w!=null&&a.push(w[this._idProp])}return a}},{key:`getDataSet`,value:function(){return this}},{key:`forEach`,value:function(e,t){var n=t&&Rd(t),r=this._data,i=Bp(Lw(r).call(r));if(t&&t.order)for(var a=this.get(t),o=0,s=a.length;o<s;o++){var c=a[o];e(c,c[this._idProp])}else for(var l=0,u=i.length;l<u;l++){var d=i[l],f=this._data.get(d);f==null||n&&!n(f)||e(f,d)}}},{key:`map`,value:function(e,t){for(var n=t&&Rd(t),r=[],i=this._data,a=Bp(Lw(i).call(i)),o=0,s=a.length;o<s;o++){var c=a[o],l=this._data.get(c);l==null||n&&!n(l)||r.push(e(l,c))}return t&&t.order&&this._sort(r,t.order),r}},{key:`_filterFields`,value:function(e,t){var n;return e&&Md(n=tm(t)?t:im(t)).call(n,(function(t,n){return t[n]=e[n],t}),{})}},{key:`_sort`,value:function(e,t){if(typeof t==`string`){var n=t;bT(e).call(e,(function(e,t){var r=e[n],i=t[n];return r>i?1:r<i?-1:0}))}else{if(typeof t!=`function`)throw TypeError(`Order must be a function or a string`);bT(e).call(e,t)}}},{key:`remove`,value:function(e,t){for(var n=[],r=[],i=tm(e)?e:[e],a=0,o=i.length;a<o;a++){var s=this._remove(i[a]);if(s){var c=s[this._idProp];c!=null&&(n.push(c),r.push(s))}}return n.length&&this._trigger(`remove`,{items:n,oldData:r},t),n}},{key:`_remove`,value:function(e){var t;if(WT(e)?t=e:e&&typeof e==`object`&&(t=e[this._idProp]),t!=null&&this._data.has(t)){var n=this._data.get(t)||null;return this._data.delete(t),--this.length,n}return null}},{key:`clear`,value:function(e){for(var t,n=Bp(Lw(t=this._data).call(t)),r=[],i=0,a=n.length;i<a;i++)r.push(this._data.get(n[i]));return this._data.clear(),this.length=0,this._trigger(`remove`,{items:n,oldData:r},e),n}},{key:`max`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s>i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`min`,value:function(e){var t,n,r=null,i=null,a=eE(OT(t=this._data).call(t));try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o[e];typeof s==`number`&&(i==null||s<i)&&(r=o,i=s)}}catch(e){a.e(e)}finally{a.f()}return r||null}},{key:`distinct`,value:function(e){for(var t=this._data,n=Bp(Lw(t).call(t)),r=[],i=0,a=0,o=n.length;a<o;a++){for(var s=n[a],c=t.get(s)[e],l=!1,u=0;u<i;u++)if(r[u]==c){l=!0;break}l||c===void 0||(r[i]=c,i++)}return r}},{key:`_addItem`,value:function(e){var t=function(e,t){return e[t]??(e[t]=UT()),e}(e,this._idProp),n=t[this._idProp];if(this._data.has(n))throw Error(`Cannot add item: item with id `+n+` already exists`);return this._data.set(n,t),++this.length,n}},{key:`_updateItem`,value:function(e){var t=e[this._idProp];if(t==null)throw Error(`Cannot update item: item has no id (item: `+gh(e)+`)`);var n=this._data.get(t);if(!n)throw Error(`Cannot update item: no item with id `+t+` found`);return this._data.set(t,$T($T({},n),e)),t}},{key:`stream`,value:function(e){if(e){var t=this._data;return new ZT({[kT]:()=>vC.mark((function n(){var r,i,a,o;return vC.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=eE(e),n.prev=1,r.s();case 3:if((i=r.n()).done){n.next=11;break}if(a=i.value,(o=t.get(a))==null){n.next=9;break}return n.next=9,[a,o];case 9:n.next=3;break;case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(1),r.e(n.t0);case 16:return n.prev=16,r.f(),n.finish(16);case 19:case`end`:return n.stop()}}),n,null,[[1,13,16,19]])}))()})}var n;return new ZT({[kT]:gd(n=LT(this._data)).call(n,this._data)})}}]),r}(KT);function iE(e,t){var n=Vp!==void 0&&Zf(e)||e[`@@iterator`];if(!n){if(tm(e)||(n=function(e,t){var n;if(e){if(typeof e==`string`)return aE(e,t);var r=qp(n=Object.prototype.toString.call(e)).call(n,8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Jf(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aE(e,t)}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function aE(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 oE(e){var t=function(){if(typeof Reflect>`u`||!sv||sv.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(sv(Boolean,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=sv(r,arguments,i)}else n=r.apply(this,arguments);return Rv(this,n)}}var sE=function(e){Lv(r,e);var n=oE(r);function r(e,i){var a,o;return t(this,r),Yu(W(o=n.call(this)),`length`,0),Yu(W(o),`_ids`,new qT),o._options=i||{},o._listener=gd(a=o._onEvent).call(a,W(o)),o.setData(e),o}return Ju(r,[{key:`idProp`,get:function(){return this.getDataSet().idProp}},{key:`setData`,value:function(e){if(this._data){this._data.off&&this._data.off(`*`,this._listener);var t=this._data.getIds({filter:Rd(this._options)}),n=this._data.get(t);this._ids.clear(),this.length=0,this._trigger(`remove`,{items:t,oldData:n})}if(e!=null){this._data=e;for(var r=this._data.getIds({filter:Rd(this._options)}),i=0,a=r.length;i<a;i++){var o=r[i];this._ids.add(o)}this.length=r.length,this._trigger(`add`,{items:r})}else this._data=new rE;this._data.on&&this._data.on(`*`,this._listener)}},{key:`refresh`,value:function(){for(var e=this._data.getIds({filter:Rd(this._options)}),t=Bp(this._ids),n={},r=[],i=[],a=[],o=0,s=e.length;o<s;o++){var c=e[o];n[c]=!0,this._ids.has(c)||(r.push(c),this._ids.add(c))}for(var l=0,u=t.length;l<u;l++){var d=t[l],f=this._data.get(d);f==null?console.error(`If you see this, report it please.`):n[d]||(i.push(d),a.push(f),this._ids.delete(d))}this.length+=r.length-i.length,r.length&&this._trigger(`add`,{items:r}),i.length&&this._trigger(`remove`,{items:i,oldData:a})}},{key:`get`,value:function(e,t){if(this._data==null)return null;var n,r=null;WT(e)||tm(e)?(r=e,n=t):n=e;var i=oh({},this._options,n),a=Rd(this._options),o=n&&Rd(n);return a&&o&&(i.filter=function(e){return a(e)&&o(e)}),r==null?this._data.get(i):this._data.get(r,i)}},{key:`getIds`,value:function(e){if(this._data.length){var t,n=Rd(this._options),r=e==null?null:Rd(e);return t=r?n?function(e){return n(e)&&r(e)}:r:n,this._data.getIds({filter:t,order:e&&e.order})}return[]}},{key:`forEach`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);r=a?i?function(e){return i(e)&&a(e)}:a:i,hm(n=this._data).call(n,e,{filter:r,order:t&&t.order})}}},{key:`map`,value:function(e,t){if(this._data){var n,r,i=Rd(this._options),a=t&&Rd(t);return r=a?i?function(e){return i(e)&&a(e)}:a:i,Wd(n=this._data).call(n,e,{filter:r,order:t&&t.order})}return[]}},{key:`getDataSet`,value:function(){return this._data.getDataSet()}},{key:`stream`,value:function(e){var t;return this._data.stream(e||{[kT]:gd(t=Lw(this._ids)).call(t,this._ids)})}},{key:`dispose`,value:function(){var e;(e=this._data)!=null&&e.off&&this._data.off(`*`,this._listener);var t,n=`This data view has already been disposed of.`,i={get:function(){throw Error(n)},set:function(){throw Error(n)},configurable:!1},a=iE(em(r.prototype));try{for(a.s();!(t=a.n()).done;){var o=t.value;Av(this,o,i)}}catch(e){a.e(e)}finally{a.f()}}},{key:`_onEvent`,value:function(e,t,n){if(t&&t.items&&this._data){var r=t.items,i=[],a=[],o=[],s=[],c=[],l=[];switch(e){case`add`:for(var u=0,d=r.length;u<d;u++){var f=r[u];this.get(f)&&(this._ids.add(f),i.push(f))}break;case`update`:for(var p=0,m=r.length;p<m;p++){var h=r[p];this.get(h)?this._ids.has(h)?(a.push(h),c.push(t.data[p]),s.push(t.oldData[p])):(this._ids.add(h),i.push(h)):this._ids.has(h)&&(this._ids.delete(h),o.push(h),l.push(t.oldData[p]))}break;case`remove`:for(var g=0,_=r.length;g<_;g++){var v=r[g];this._ids.has(v)&&(this._ids.delete(v),o.push(v),l.push(t.oldData[g]))}}this.length+=i.length-o.length,i.length&&this._trigger(`add`,{items:i},n),a.length&&this._trigger(`update`,{items:a,oldData:s,data:c},n),o.length&&this._trigger(`remove`,{items:o,oldData:l},n)}}}]),r}(KT);function cE(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof t.add==`function`&&typeof t.clear==`function`&&typeof t.distinct==`function`&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.max==`function`&&typeof t.min==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.remove==`function`&&typeof t.setOptions==`function`&&typeof t.stream==`function`&&typeof t.update==`function`&&typeof t.updateOnly==`function`}e.DELETE=I_,e.DataSet=rE,e.DataStream=ZT,e.DataView=sE,e.Queue=GT,e.createNewDataPipeFrom=function(e){return new cf(e)},e.isDataSetLike=cE,e.isDataViewLike=function(e,t){return typeof t==`object`&&!!t&&e===t.idProp&&typeof hm(t)==`function`&&typeof t.get==`function`&&typeof t.getDataSet==`function`&&typeof t.getIds==`function`&&typeof t.length==`number`&&typeof Wd(t)==`function`&&typeof t.off==`function`&&typeof t.on==`function`&&typeof t.stream==`function`&&cE(e,t.getDataSet())}}))}))(),A=re(),ae=d(),j=e(r(),1);function oe(e){let t=new URLSearchParams(e),n=t.get(`nodeId`);if(n)return{kind:`focus`,nodeId:n,nodeLabel:t.get(`label`)};let r=t.get(`label`);return r?{kind:`labels`,labels:[r]}:null}function se(e){return!e.inNeighbourhood&&!e.searchActive&&e.selectedLabelsCount===0&&e.topLevelTotal!==null&&e.nodeCount>0}function ce(e,t){let n=t===1?`node`:`nodes`;return`Showing ${e.toLocaleString()} of ${t.toLocaleString()} top-level ${n}`}function le(e,t){let n=`/api/admin/graph-subgraph`,r=t.includeAgentActions?`&includeAgentActions=1`:``;if(e.kind===`neighbourhood`){let i=t.search&&t.search.q?`&q=${encodeURIComponent(t.search.q)}&limit=${t.search.limit}`:``;return`${n}?mode=neighbourhood&elementId=${encodeURIComponent(e.rootElementId)}${r}${i}`}let i=e.includeTrashed?`&includeTrashed=1`:``;return e.selectedLabels.length===0?`${n}?mode=default&topLevel=1${i}${r}`:`${n}?mode=default&labels=${encodeURIComponent(e.selectedLabels.join(`,`))}${i}${r}`}function ue(e,t){return e.length<10?[...e,t]:[e[0],...e.slice(e.length-8),t]}function de(e){return e.length<=1?e:e.slice(0,-1)}function fe(e){return[e]}function pe(e){let t=e[e.length-1];return t.kind===`filter`?`f:${[...t.selectedLabels].sort().join(`,`)}:${t.includeTrashed?1:0}:${t.includeAgentActions?1:0}`:`n:${t.rootElementId}`}function me(e){let t=e[0];if(t.kind!==`filter`)throw Error(`view-stack invariant: root must be filter view`);return t}var he=`admin-sessions`;function ge(){if(typeof window>`u`)return null;if(typeof BroadcastChannel>`u`)return console.warn(`[admin-sessions/broadcast] unsupported — manual refresh only`),null;try{return new BroadcastChannel(he)}catch(e){return console.warn(`[admin-sessions/broadcast] ctor failed: ${e instanceof Error?e.message:String(e)} — manual refresh only`),null}}function _e(e){let t=ge();if(t)try{let n={type:`mutated`,reason:e};t.postMessage(n)}catch(e){console.warn(`[admin-sessions/broadcast] postMessage failed: ${e instanceof Error?e.message:String(e)}`)}finally{try{t.close()}catch{}}}function ve(e){return e.trashed===!0?`skip-trashed`:`pivot`}function ye(e,t,n,r){let i=[],a=[];for(let o of e){let e=t.get(o.nodeId);if(!e)continue;a.push(o.nodeId);let{colour:s}=n(e.labels),c=e.trashed?`${s}40`:s;i.push({id:o.nodeId,borderWidth:3,color:{background:c,border:r}})}return{updates:i,inWindow:a}}function be(e,t){let n=t.length>0?new Set(t):null,r=new Map,i=new Set,a=[];for(let t of e)n&&!t.labels.some(e=>n.has(e))||r.set(t.nodeId,{id:t.nodeId,labels:t.labels,properties:t.properties});for(let t of e)if(r.has(t.nodeId))for(let e of t.related){if(n&&!e.labels.some(e=>n.has(e)))continue;r.has(e.nodeId)||r.set(e.nodeId,{id:e.nodeId,labels:e.labels,properties:e.properties});let[o,s]=e.direction===`outgoing`?[t.nodeId,e.nodeId]:[e.nodeId,t.nodeId],c=`${o}|${s}|${e.relationship}`;i.has(c)||(i.add(c),a.push({id:c,from:o,to:s,type:e.relationship}))}return{nodes:[...r.values()],edges:a}}var xe=2e3;function Se(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<=0?100:Math.min(Math.max(Math.floor(t),1),xe)}function M(e,t,n,r){let i=encodeURIComponent(t.join(`,`));return`/api/admin/graph-search?q=${encodeURIComponent(e)}&labels=${i}&limit=${n}${r?`&threshold=0`:``}`}var N=ne(),P=new Set([`Conversation`,`AdminConversation`,`PublicConversation`]),Ce=/^(\d{4}-\d{2}-\d{2})T/,we=24;function Te(e){let t=e.match(Ce);return t?t[1]:null}function F(e,t){if(e.length===0)return``;let n=e.split(/\s+/).filter(e=>e.length>0);if(n.length===0)return``;if(n.length===1){let e=n[0];return e.length<=we?e:e.slice(0,we-1)+`…`}let r=[],i=0;for(;r.length<t&&i<n.length;){let e=``;for(;i<n.length;){let t=e.length===0?n[i]:`${e} ${n[i]}`;if(t.length<=we)e=t,i++;else break}e.length===0&&(e=n[i].slice(0,we-1)+`…`,i++),r.push(e)}if(i<n.length&&r.length>0){let e=n.slice(i).join(` `),t=r.length-1;r[t]=(r[t].length===0?e:`${r[t]} ${e}`).slice(0,we-1)+`…`}return r.join(`
50
50
  `)}function I(e){return F(e,2)}function Ee(e,t){let n=e.labels[0];if(!n||!P.has(n)||t<.7)return(0,N.pickShortLabel)(e);let r=I((0,N.pickDisplayName)(e));if(t<1.3)return r;let i=e.properties,a=typeof i.createdAt==`string`?i.createdAt:``,o=typeof i.messageCount==`number`?i.messageCount:null;if(a.length===0||o===null)return r;let s=Te(a);return s===null?r:`${r}\n${s} · ${o} msgs`}var De=new Set([`Person`,`Organization`,`Concept`]),Oe=80;function ke(e,t){let n=(0,N.pickDisplayName)(e);if(t<1.3)return F(n,3);let r=n.length<=24?n:n.slice(0,23)+`…`,i=e.properties.compiledTruth;if(typeof i!=`string`||i.length===0)return F((0,N.pickDisplayName)(e),3);let a=F(i.length>Oe?i.slice(0,Oe-1)+`…`:i,2);return a.length===0?r:`${r}\n${a}`}function Ae(e,t){if(t<.7)return(0,N.pickShortLabel)(e);let n=e.labels[0];return n&&P.has(n)?Ee(e,t):n&&De.has(n)?ke(e,t):F((0,N.pickDisplayName)(e),3)}function je(e){let t=e.properties,n=typeof t.createdAt==`string`?t.createdAt:``,r=typeof t.updatedAt==`string`?t.updatedAt:``,i=e.labels.join(` · `);return[(0,N.pickDisplayName)(e),i,`id: ${e.id}`,n?`createdAt: ${n}`:``,r?`updatedAt: ${r}`:``].filter(e=>e.length>0).join(`
51
- `)}var Me={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Ne=220,Pe=3;function Fe(e){if(!(e.nodes.length<=5))return{physics:Me,nodePositions:new Map};let t=new Map,n=(Pe-1)*Ne/2,r=(Math.ceil(e.nodes.length/Pe)-1)*Ne/2;for(let i=0;i<e.nodes.length;i++){let a=i%Pe,o=Math.floor(i/Pe);t.set(e.nodes[i].id,{x:a*Ne-n,y:o*Ne-r})}return{physics:!1,nodePositions:t}}function Ie(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function Le(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function Re(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Ie(r,a),t=Le(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var ze=`graph-side-panel-size`;function Be(e,t){let n=Math.max(320,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,320),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function Ve(e){try{localStorage.setItem(ze,JSON.stringify({width:e.width,height:e.height}))}catch{}}function He(){try{let e=localStorage.getItem(ze);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function Ue(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function We(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function Ge(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=We(e);if(t)return t}return JSON.stringify(e)}return String(e)}var L=f(),Ke=76,qe=36,Je=16,Ye=520;function Xe(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-qe-Je,maxHeight:r-Ke-Je}}function Ze(e){return typeof e==`string`?e:Ge(e)}function Qe(e){return Ue(e)?(0,L.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):Ge(e)}function $e({value:e,label:t,field:n}){let{status:r,copy:i}=b({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${n}`):console.warn(`[graph-panel] op=copy result=error field=${n} msg=clipboard-write-failed`)}}),a=r===`ok`?`Copied`:r===`fail`?`Copy failed`:`Copy ${t}`;return(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-copy${r===`ok`?` graph-side-copy-ok`:``}${r===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>i(e),"aria-label":a,title:a,children:[r===`ok`?(0,L.jsx)(c,{size:12}):(0,L.jsx)(y,{size:12}),r!==`idle`&&(0,L.jsx)(`span`,{className:`graph-side-copy-feedback`,children:r===`ok`?`Copied`:`Copy failed`})]})}function et({node:e,edges:t,nodesById:n,adminFetch:r,onClose:a,onRestored:s,onTrashed:c}){let u=Object.entries(e.properties).filter(([,e])=>e!=null),d=t.filter(t=>t.from===e.id||t.to===e.id),f=d.length>0,[p,h]=(0,j.useState)(!1),[g,_]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=m(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(He()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:320,height:Ye}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{h(!1),_(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=Xe(w.current),t=Be(ne.current.size??{width:320,height:Ye},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=Xe(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=Be({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),Ve({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{h(!0),_(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);s()}).catch(e=>{_(e instanceof Error?e.message:String(e)),h(!1)})},[e.id,s,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);c()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,c,r]),A=S===`connections`&&f?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,L.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,L.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,L.jsxs)(`header`,{className:`graph-side-header`,children:[(0,L.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>P.has(e))){let t=(0,N.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,N.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,L.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,L.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,L.jsx)(`span`,{children:a}),(0,L.jsx)($e,{value:e.id,label:`id`,field:`id`})]})]})}return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,L.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,L.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,L.jsx)($e,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,L.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:a,"aria-label":`Close`,children:(0,L.jsx)(i,{size:14})})]}),e.trashed&&(0,L.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedAt`}),(0,L.jsx)(`dd`,{children:Ge(e.properties.trashedAt)})]}),(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedBy`}),(0,L.jsx)(`dd`,{children:Ge(e.properties.trashedBy)})]})]}),(0,L.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),f&&(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,d.length,`)`]})]}),(0,L.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,L.jsxs)(`dl`,{className:`graph-side-props`,children:[u.length===0&&(0,L.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),u.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:Qe(t)}),(0,L.jsx)($e,{value:Ze(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&f&&(0,L.jsx)(`section`,{className:`graph-side-edges`,children:d.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,N.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,L.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,L.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,L.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,L.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,L.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,L.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:Qe(t)}),(0,L.jsx)($e,{value:Ze(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!p&&!g&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,L.jsx)(C,{size:14}),` Restore`]}),p&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(o,{size:14,className:`spin`}),` Restoring…`]})}),g&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Restore failed: `,g]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{_(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,L.jsx)(l,{size:14}),` Trash`]}),v&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(o,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var tt=`graph-shell`,nt=`graph-shell--fullscreen`;function rt(e,t){return t&&e?`${tt} ${nt}`:tt}function it(e){return e}function at(e){return e.isFullscreen&&!e.filterOpen}function ot(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var st=150,ct=`#FBBF24`;function lt(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var ut=`maxy-graph-search-limit-v1`,dt=250,ft=1200;function pt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,s]=(0,j.useState)(void 0),[c,l]=(0,j.useState)(null),[d,f]=(0,j.useState)(void 0),[m,h]=(0,j.useState)(null),[_,v]=(0,j.useState)(null),y=(0,j.useMemo)(()=>typeof window>`u`?null:oe(window.location.search),[]),b=(0,j.useMemo)(()=>y?.kind===`focus`?{nodeId:y.nodeId,nodeLabel:y.nodeLabel}:null,[y]),x=(0,j.useMemo)(()=>y?.kind===`labels`?y.labels:null,[y]);(0,j.useEffect)(()=>{b&&_t(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||_t(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&l(e.sessionId??null),v(e.role??null),f(e.userName===void 0?null:e.userName),h(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await p();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,L.jsx)(u,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,L.jsx)(g,{cacheKey:e,businessName:i,sessionId:c,onLogout:S,onDisconnect:te,disconnecting:ee,userName:d,userAvatar:m,role:_,children:(0,L.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(a,{size:18}),` Graph`]})}),(0,L.jsx)(`main`,{className:`graph-main`,children:(0,L.jsx)(mt,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,L.jsxs)(`div`,{className:`data-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(a,{size:18}),` Graph`]})}),(0,L.jsxs)(`div`,{className:`data-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,L.jsx)(`div`,{className:`data-page`,children:(0,L.jsxs)(`div`,{className:`data-loading`,children:[(0,L.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}function mt({cacheKey:e,initialFocus:t=null,initialLabels:r=null,allowFullscreen:a=!1}){let{adminFetch:s,cacheKey:c,sessionRefetchNonce:u}=n({initialCacheKey:e,surface:`graph`}),d=(0,j.useRef)(null),f=(0,j.useRef)(null),[p,m]=(0,j.useState)(!1),g=(0,j.useRef)(null),y=(0,j.useRef)(null),b=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(new Map),k=(0,j.useRef)([]),re=(0,j.useRef)(null),ae=(0,j.useRef)(null),oe=(0,j.useRef)(null),he=(0,j.useRef)([]),ge=(0,j.useRef)(null),xe=(0,j.useRef)(null),N=(0,j.useRef)(null),P=(0,j.useRef)(null),[Ce,we]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&we(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let Te=r&&r.length>0?[...r].sort().join(`,`):null;(0,j.useEffect)(()=>{Te&&(It.current=!0,we([{kind:`filter`,selectedLabels:Te.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[Te]);let[F,I]=(0,j.useState)(!1),[Ee,De]=(0,j.useState)(null),[Oe,ke]=(0,j.useState)(null),[Me,Ne]=(0,j.useState)(0),[Pe,Ie]=(0,j.useState)(null),[Le,ze]=(0,j.useState)(null),[Be,Ve]=(0,j.useState)(!1),[He,Ue]=(0,j.useState)(!1),[We,Ge]=(0,j.useState)(null),[Ke,qe]=(0,j.useState)(``),[Je,Ye]=(0,j.useState)(``),[Xe,Ze]=(0,j.useState)(null),[Qe,$e]=(0,j.useState)(null),[tt,nt]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(ut);return e?Se(e):100}),[pt,mt]=(0,j.useState)(tt),[vt,yt]=(0,j.useState)(`hybrid`),[bt,xt]=(0,j.useState)(0),[St,Ct]=(0,j.useState)(!1),[wt,Tt]=(0,j.useState)(0),[Et,Dt]=(0,j.useState)(0),[Ot,kt]=(0,j.useState)([]),[At,jt]=(0,j.useState)({labels:[],includeTrashed:!1}),[Mt,Nt]=(0,j.useState)(!1),[Pt,Ft]=(0,j.useState)(!1),It=(0,j.useRef)(!1),Lt=(0,j.useRef)(null),Rt=(0,j.useMemo)(()=>{let e=new Set;for(let t of ne.current.values()){let n=(0,w.pickDisplayLabel)(t.labels);n&&e.add(n)}return[...e].sort()},[Me]);(0,j.useEffect)(()=>{let e=!1,t=s(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=s(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&(kt(t.labels),jt(n),!It.current)){It.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&we(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[c,u,s]);let zt=Ce[0].kind===`filter`?Ce[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!It.current)return;let e=!1;return s(`/api/admin/graph-labels-in-graph?includeAgentActions=${zt?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||kt(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[c,u,zt,Et,s]),(0,j.useEffect)(()=>{if(!Mt)return;let e=e=>{Lt.current&&(Lt.current.contains(e.target)||Nt(!1))},t=e=>{e.key===`Escape`&&Nt(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[Mt]);let Bt=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),Vt=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),m(!1)},[]);(0,j.useEffect)(()=>{if(!a||!p)return;let e=e=>{e.key===`Escape`&&at({isFullscreen:p,filterOpen:Mt})&&Vt(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,p,Mt,Vt]);let Ht=(0,j.useRef)(p);(0,j.useEffect)(()=>{if(!a)return;let e=Ht.current!==p;if(Ht.current=p,!e)return;let t=requestAnimationFrame(()=>{let e=f.current;try{e?.redraw()}catch{}if(!p)return;let t=g.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&Bt(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=d.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&Bt(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[a,p,Bt]);let Ut=(0,j.useCallback)(()=>{if(b.current)try{b.current.clear()}catch{}if(C.current)try{C.current.clear()}catch{}},[]),Wt=(0,j.useCallback)((e,t)=>{Ge(null),s(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);ze(null);try{f.current?.unselectAll()}catch{}we(e=>[me(e)]),Tt(e=>e+1),_e(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);Ge(`Failed to delete: ${r}`),Ue(!0),window.setTimeout(()=>Ue(!1),ft);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[s]),Gt=(0,j.useCallback)(e=>{Ge(null);let t=e.length;Promise.allSettled(e.map(e=>s(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);ze(null);try{f.current?.unselectAll()}catch{}if(we(e=>[me(e)]),Tt(e=>e+1),_e(`graph-trash`),n.length>0){let e=t-n.length;Ge(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),Ue(!0),window.setTimeout(()=>Ue(!1),ft);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[s]),Kt=Ce[Ce.length-1],qt=(0,j.useMemo)(()=>pe(Ce),[Ce]),Jt=(0,j.useRef)(qt);(0,j.useEffect)(()=>{Jt.current=qt},[qt]);let Yt=(0,j.useRef)(Ce);(0,j.useEffect)(()=>{Yt.current=Ce},[Ce]),(0,j.useEffect)(()=>{if(Je){re.current?.abort(),re.current=null;return}let e=window.setTimeout(()=>{re.current?.abort();let e=new AbortController;re.current=e,I(!0),De(null),ke(null),s(le(Kt,{includeAgentActions:me(Ce).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new ht(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(ne.current=new Map(t.nodes.map(e=>[e.id,e])),Ne(t.nodes.length),Ie(typeof t.total==`number`?t.total:null),Xt(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(t instanceof ht){ke(t.body),Ne(0),ne.current=new Map,Ut();return}De(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||I(!1)})},dt);return()=>{window.clearTimeout(e)}},[c,qt,wt,u,Je,pt]),(0,j.useEffect)(()=>()=>{re.current?.abort(),y.current?.(),y.current=null,f.current?.destroy(),f.current=null,P.current!==null&&(clearTimeout(P.current),P.current=null)},[]);let Xt=(0,j.useCallback)((e,t)=>{if(!d.current)return;k.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=d.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=e.map(e=>{let t=e.labels[0]??`Unknown`,n=(0,w.resolveNodeColour)(e.labels);n.displayLabel;let r=n.colour;n.driftCandidates;let a=i.get(e.id),o=a?{x:a.x,y:a.y,physics:!1}:{};return e.trashed?{id:e.id,label:Ae(e,1),title:je(e),color:{background:`${r}40`,border:r},borderWidth:2,shapeProperties:{borderDashes:[6,4]},group:t,...o}:{id:e.id,label:Ae(e,1),title:je(e),color:r,group:t,...o}}),s=new Set(o.map(e=>e.id)),c=t.filter(e=>e.type!==`PART_OF`||s.has(e.from)&&s.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),l=Fe({nodes:e,edges:t});b.current=new ie.DataSet(l.nodePositions.size>0?o.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=l.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):o),C.current=new ie.DataSet(c);let u={autoResize:!0,layout:{improvedLayout:!1,randomSeed:lt(Jt.current)},physics:l.physics===!1?!1:{solver:l.physics.solver,forceAtlas2Based:l.physics.forceAtlas2Based,stabilization:l.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=20,e.borderWidth=3,e.borderColor=`#0F172A`,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:`#CBD5E1`,highlight:`#475569`},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{y.current?.(),y.current=null,f.current?.destroy(),P.current!==null&&(clearTimeout(P.current),P.current=null),N.current=null;let e=new A.Network(d.current,{nodes:b.current,edges:C.current},u);f.current=e,l.physics!==!1&&(y.current=Re(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}})),e.on(`zoom`,()=>{P.current!==null&&clearTimeout(P.current),P.current=setTimeout(()=>{P.current=null;let e=f.current,t=b.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=ot(n);if(r===N.current)return;N.current=r;let i=[];for(let e of ne.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t;i.push({id:e.id,label:Ae(e,n),color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},st)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=ne.current.get(t);if(!n)return;if(ve(n)===`skip-trashed`){ze(n);return}let r=Yt.current[Yt.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){ze(e=>e?.id===t?null:n);return}ze(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};we(e=>{let n=ue(e,i),r=n.length-1;return n.length>e.length&&_t(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&_t(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{ze(null)});let t=e=>{let t=d.current,n=ae.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=d.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){oe.current=null,he.current=[];return}he.current=[...e.nodes],oe.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(he.current.length===0)return;let n=t(e.pointer.DOM);Ve(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=he.current;if(he.current=[],oe.current=null,Ve(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=ne.current.get(r[0])?.labels[0]??`Unknown`;Wt(r[0],e)}else Gt(r)})}catch(e){let t=e instanceof Error?e.message:String(e);De(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]);(0,j.useEffect)(()=>{let e=d.current;if(!e)return;let t=t=>{let n=xe.current,r=ge.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=xe.current;xe.current=null;let a=ge.current;a&&(a.style.display=`none`);let o=f.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,p=Math.min(c,u),m=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-p<3&&g-m<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=p&&n.x<=h&&n.y>=m&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=f.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),xe.current={clientX:r.clientX,clientY:r.clientY};let c=ge.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=Ke.trim();if(!e){Ye(``),Ze(null),$e(null),yt(`hybrid`),xt(0),Ct(!1),f.current?.unselectAll();return}Ct(!1);let t=setTimeout(()=>Ye(e),300);return()=>clearTimeout(t)},[Ke]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Se(tt);mt(e);try{window.localStorage.setItem(ut,String(e))}catch{}},200);return()=>clearTimeout(e)},[tt]);let Zt=(0,j.useCallback)(e=>{let t=f.current,n=b.current;if(!t||!n)return;let{updates:r,inWindow:i}=ye(e,ne.current,w.resolveNodeColour,ct);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),Qt=me(Ce);(0,j.useEffect)(()=>{if(!Je)return;let e=!1;return $e(null),s(M(Je,Qt.selectedLabels,pt,St)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;Ze(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(yt(n),xt(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${Je}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=be(t.results,Qt.selectedLabels);ne.current=new Map(r.map(e=>[e.id,e])),Ne(r.length),ke(null),Xt(r,i),Zt(t.results),console.info(`[graph-page] search-applied view=${Kt.kind} q="${Je}" labels=${Qt.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||$e(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[Je,pt,c,u,s,Zt,Kt.kind,Qt.selectedLabels,Xt,St]);let $t=(0,j.useCallback)(e=>{we(t=>{let n=me(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),fe({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),en=(0,j.useCallback)(()=>{we(e=>{let t=me(e);return fe({...t,includeTrashed:!t.includeTrashed})})},[]),tn=(0,j.useCallback)(()=>{we(e=>{let t=me(e);return fe({...t,includeAgentActions:!t.includeAgentActions})})},[]),nn=(0,j.useCallback)(()=>{qe(``),Ye(``),Ze(null),$e(null),yt(`hybrid`),xt(0),Ct(!1);try{f.current?.unselectAll()}catch{}},[]),rn=(0,j.useCallback)(()=>{we(()=>fe({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),an=(0,j.useCallback)(()=>{ze(null);try{f.current?.unselectAll()}catch{}we(e=>{let t=de(e);return t!==e&&_t(`nav-pop`,{depth:t.length-1}),t})},[]),on=(0,j.useCallback)(()=>{ze(null);try{f.current?.unselectAll()}catch{}we(e=>e.length<=1?e:(_t(`nav-home`,{depth:0,popped:e.length-1}),[me(e)]))},[]),sn=(0,j.useCallback)(()=>{let e=me(Ce),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};Ft(!0),s(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}jt(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>Ft(!1))},[s,Ce]),cn=(0,j.useCallback)(()=>{ze(null);try{f.current?.unselectAll()}catch{}Tt(e=>e+1),_e(`graph-restore`)},[]),ln=(0,j.useCallback)(()=>{ze(null);try{f.current?.unselectAll()}catch{}we(e=>[me(e)]),Tt(e=>e+1),_e(`graph-trash`)},[]),un=(0,j.useCallback)(()=>{Tt(e=>e+1),Dt(e=>e+1)},[]),dn=Kt.kind===`neighbourhood`,fn=me(Ce),pn=fn.selectedLabels,mn=fn.includeTrashed,hn=fn.includeAgentActions,gn=(0,j.useMemo)(()=>{if(mn!==At.includeTrashed||pn.length!==At.labels.length)return!0;for(let e=0;e<pn.length;e++)if(pn[e]!==At.labels[e])return!0;return!1},[mn,pn,At]);return(0,L.jsxs)(`div`,{ref:g,className:rt(p,a),children:[(0,L.jsxs)(`div`,{className:`graph-toolbar`,children:[Ce.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:on,title:`Clear breadcrumb — return to filter root`,children:[(0,L.jsx)(E,{size:12}),` Home`]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:on,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,L.jsx)(E,{size:14})}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:an,children:`← Back`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:an,"aria-label":`Back`,children:(0,L.jsx)(v,{size:16})})]}),(0,L.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,L.jsx)(te,{size:14}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:Ke,onChange:e=>qe(e.target.value),autoComplete:`off`,spellCheck:!1}),Je&&!Xe&&!Qe&&(0,L.jsx)(o,{size:14,className:`spin`}),Ke.length>0&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:nn,"aria-label":`Clear search`,title:`Clear search`,children:(0,L.jsx)(i,{size:14})})]}),Je&&(0,L.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${tt} matches (1-2000)`,children:[(0,L.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>nt(Se(tt-1)),disabled:tt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,L.jsx)(O,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:tt,onChange:e=>nt(Se(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>nt(Se(tt+1)),disabled:tt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,L.jsx)(S,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:tt,onChange:e=>nt(Se(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:un,disabled:F,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,L.jsx)(x,{size:14,className:F?`spin`:void 0})}),it(a)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{p?Vt(`button`):m(!0)},"aria-label":p?`Exit full screen`:`Full screen`,title:p?`Exit full screen`:`Full screen`,"aria-pressed":p,children:p?(0,L.jsx)(D,{size:14}):(0,L.jsx)(ee,{size:14})}),!dn&&(0,L.jsxs)(`div`,{className:`graph-filter-wrap`,ref:Lt,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${Mt?` is-open`:``}${pn.length>0||mn||hn?` has-selection`:``}`,onClick:()=>Nt(e=>!e),"aria-haspopup":`true`,"aria-expanded":Mt,"aria-label":`Filter node types`,children:[(0,L.jsx)(h,{size:14}),(0,L.jsx)(`span`,{children:`Filter`}),pn.length>0&&(0,L.jsx)(`span`,{className:`graph-filter-count`,children:pn.length})]}),Mt&&(0,L.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,L.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${mn?` active`:``}`,onClick:en,"aria-pressed":mn,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,L.jsx)(T,{size:14}),` Show trashed`]}),(pn.length>0||mn||hn)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:rn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,L.jsx)(i,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,L.jsx)(_,{checked:hn,onChange:tn,label:`Include agent actions`})}),Ot.length===0&&(0,L.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,L.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:Ot.map(({label:e,nodeCount:t})=>{let n=pn.includes(e),r=(0,w.colourForLabel)(e);return(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>$t(e),"aria-pressed":n,children:[(0,L.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,L.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,L.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,L.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:sn,disabled:!gn||Pt,children:Pt?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,L.jsx)(`div`,{className:`graph-meta`,children:se({inNeighbourhood:dn,searchActive:!!Je,selectedLabelsCount:pn.length,topLevelTotal:Pe,nodeCount:Me})?(0,L.jsx)(`span`,{className:`graph-meta-count`,children:ce(Me,Pe)}):Me>0&&(0,L.jsxs)(`span`,{className:`graph-meta-count`,children:[Me,` node`,Me===1?``:`s`]})})]}),Ce.length>1&&(0,L.jsx)(gt,{viewStack:Ce}),Je&&vt===`bm25`&&!Qe&&(0,L.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),Qe&&(0,L.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,Qe]}),Je&&bt>0&&!St&&!Qe&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>Ct(!0),children:[bt,` low-confidence match`,bt===1?``:`es`,` hidden — show all`]}),Je&&St&&!Qe&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>Ct(!1),children:`Showing all matches — hide low-confidence`}),Xe&&Xe.length===0&&!Qe&&(0,L.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,L.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[F&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(o,{size:20,className:`spin`}),` Loading your graph…`]}),Ee&&!F&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsx)(`p`,{children:Ee}),(0,L.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{De(null),Tt(e=>e+1)},children:`Retry`})]}),Oe&&!F&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsxs)(`p`,{children:[`Refine your filter — `,(0,L.jsx)(`strong`,{children:Oe.matched}),` matches exceed the 2000 cap.`]}),(0,L.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!F&&!Ee&&!Oe&&Me===0&&!dn&&pn.length===0&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(h,{size:20}),(0,L.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!F&&!Ee&&!Oe&&Me===0&&!dn&&pn.length>0&&(0,L.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,L.jsxs)(`p`,{children:[`No `,pn.join(`, `),` nodes match this view.`]})}),(0,L.jsx)(`div`,{ref:d,className:`graph-canvas`}),(0,L.jsx)(`div`,{ref:ge,className:`graph-marquee`,"aria-hidden":`true`}),Me>0&&(0,L.jsx)(`div`,{ref:ae,className:`graph-trash-drop-zone${Be?` is-hover`:``}${He?` is-error`:``}`,"aria-hidden":`true`,children:(0,L.jsx)(l,{size:18})}),We&&(0,L.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,L.jsx)(`span`,{children:We}),(0,L.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>Ge(null),"aria-label":`Dismiss`,children:(0,L.jsx)(i,{size:14})})]})]}),Le&&(0,L.jsx)(et,{node:Le,edges:k.current,nodesById:ne.current,adminFetch:s,onClose:()=>{ze(null);try{f.current?.unselectAll()}catch{}},onRestored:cn,onTrashed:ln}),Me>0&&Rt.length>0&&(0,L.jsx)(`div`,{className:`graph-legend`,children:Rt.map(e=>(0,L.jsxs)(`div`,{className:`graph-legend-item`,children:[(0,L.jsx)(`span`,{className:`graph-legend-swatch`,style:{backgroundColor:(0,w.colourForLabel)(e)}}),(0,L.jsx)(`span`,{children:e})]},e))})]})}var ht=class extends Error{body;constructor(e){super(e.error),this.body=e}};function gt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,L.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,L.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,L.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,L.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function _t(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ae.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(pt,{}));
51
+ `)}var Me={solver:`forceAtlas2Based`,forceAtlas2Based:{gravitationalConstant:-50,centralGravity:.01,springLength:100,springConstant:.08,damping:.4,avoidOverlap:0},stabilization:{iterations:2e3}},Ne=220,Pe=3;function Fe(e){if(!(e.nodes.length<=5))return{physics:Me,nodePositions:new Map};let t=new Map,n=(Pe-1)*Ne/2,r=(Math.ceil(e.nodes.length/Pe)-1)*Ne/2;for(let i=0;i<e.nodes.length;i++){let a=i%Pe,o=Math.floor(i/Pe);t.set(e.nodes[i].id,{x:a*Ne-n,y:o*Ne-r})}return{physics:!1,nodePositions:t}}function Ie(e,t){let n=(t.t-e.t)/1e3;if(n<=0)return 0;let r=0,i=0;for(let n of Object.keys(t.positions)){let a=e.positions[n];if(!a)continue;let o=t.positions[n];r+=Math.hypot(o.x-a.x,o.y-a.y),i++}return i===0?0:r/i/n}function Le(e,t,n){if(t>n.threshold)return{belowCount:0,freeze:!1};let r=e+1;return{belowCount:r,freeze:r>=n.needed}}function Re(e,t){let n=Date.now(),r=null,i=0,a=null,o=()=>{a!==null&&(clearInterval(a),a=null)},s=(r,i,a)=>{o();try{e.setOptions({physics:!1})}catch{}t.report?.({avgMotion:r,settleMs:Date.now()-n,capped:a,nodeCount:i})};return a=setInterval(()=>{let t;try{t=e.getPositions()}catch{o();return}let a={t:Date.now(),positions:t},c=Object.keys(t).length;if(r){let e=Ie(r,a),t=Le(i,e,{threshold:5,needed:2});if(i=t.belowCount,t.freeze){s(e,c,!1);return}if(Date.now()-n>=3e4){s(e,c,!0);return}}r=a},250),o}var ze=`graph-side-panel-size`;function Be(e,t){let n=Math.max(320,t.maxWidth),r=Math.max(240,t.maxHeight),i=Math.min(Math.max(e.width,320),n),a=Math.min(Math.max(e.height,240),r);return{width:i,height:a,clampedW:i!==e.width,clampedH:a!==e.height}}function Ve(e){try{localStorage.setItem(ze,JSON.stringify({width:e.width,height:e.height}))}catch{}}function He(){try{let e=localStorage.getItem(ze);if(!e)return{size:null,source:`default`};let t=JSON.parse(e);return t&&typeof t==`object`&&typeof t.width==`number`&&typeof t.height==`number`&&Number.isFinite(t.width)&&Number.isFinite(t.height)?{size:{width:t.width,height:t.height},source:`storage`}:{size:null,source:`default`}}catch{return{size:null,source:`default`}}}function Ue(e){return typeof e==`string`?/^https?:\/\/\S+$/i.test(e.trim()):!1}function We(e){let t=t=>{let n=e[t];if(n&&typeof n==`object`&&`low`in n){let e=n.low;return typeof e==`number`?e:null}return null},n=t(`year`),r=t(`month`),i=t(`day`);if(n===null||r===null||i===null)return null;let a=`${String(n).padStart(4,`0`)}-${String(r).padStart(2,`0`)}-${String(i).padStart(2,`0`)}`;if(!(`hour`in e))return a;let o=t(`hour`),s=t(`minute`),c=t(`second`);return o===null||s===null||c===null?a:`${a} ${String(o).padStart(2,`0`)}:${String(s).padStart(2,`0`)}:${String(c).padStart(2,`0`)}`}function Ge(e){if(e==null)return``;if(Array.isArray(e))return e.length>8?`[${e.length} items]`:e.map(String).join(`, `);if(typeof e==`object`){if(`year`in e&&`month`in e&&`day`in e&&typeof e.year==`object`){let t=We(e);if(t)return t}return JSON.stringify(e)}return String(e)}var L=f(),Ke=76,qe=36,Je=16,Ye=520;function Xe(e){let t=e?.offsetParent??null,n=t?.clientWidth??0,r=t?.clientHeight??0;return{maxWidth:n-qe-Je,maxHeight:r-Ke-Je}}function Ze(e){return typeof e==`string`?e:Ge(e)}function Qe(e){return Ue(e)?(0,L.jsx)(`a`,{className:`graph-side-link`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:e}):Ge(e)}function $e({value:e,label:t,field:n}){let{status:r,copy:i}=b({onResult:e=>{e?console.log(`[graph-panel] op=copy result=ok field=${n}`):console.warn(`[graph-panel] op=copy result=error field=${n} msg=clipboard-write-failed`)}}),a=r===`ok`?`Copied`:r===`fail`?`Copy failed`:`Copy ${t}`;return(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-copy${r===`ok`?` graph-side-copy-ok`:``}${r===`fail`?` graph-side-copy-fail`:``}`,onClick:()=>i(e),"aria-label":a,title:a,children:[r===`ok`?(0,L.jsx)(c,{size:12}):(0,L.jsx)(y,{size:12}),r!==`idle`&&(0,L.jsx)(`span`,{className:`graph-side-copy-feedback`,children:r===`ok`?`Copied`:`Copy failed`})]})}function et({node:e,edges:t,nodesById:n,adminFetch:r,onClose:a,onRestored:s,onTrashed:c}){let u=Object.entries(e.properties).filter(([,e])=>e!=null),d=t.filter(t=>t.from===e.id||t.to===e.id),f=d.length>0,[p,h]=(0,j.useState)(!1),[g,_]=(0,j.useState)(null),[v,y]=(0,j.useState)(!1),[b,x]=(0,j.useState)(null),[S,ee]=(0,j.useState)(`properties`),te=m(`(max-width: 640px)`),w=(0,j.useRef)(null),ne=(0,j.useRef)(He()),[T,E]=(0,j.useState)(()=>ne.current.size??{width:320,height:Ye}),D=(0,j.useRef)(!1),O=(0,j.useRef)(null);(0,j.useEffect)(()=>()=>{O.current?.()},[]),(0,j.useEffect)(()=>{h(!1),_(null),y(!1),x(null),ee(`properties`)},[e.id]),(0,j.useLayoutEffect)(()=>{if(D.current)return;D.current=!0;let e=Xe(w.current),t=Be(ne.current.size??{width:320,height:Ye},e);E({width:t.width,height:t.height}),console.log(`[graph-panel] op=restore-size w=${t.width} h=${t.height} source=${ne.current.source}`)},[]);let k=(0,j.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=e.clientY,r=T.width,i=T.height,a=Xe(w.current);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}let o={width:r,height:i,clampedW:!1,clampedH:!1},s=e=>{o=Be({width:r+(t-e.clientX),height:i+(e.clientY-n)},a),E({width:o.width,height:o.height})},c=()=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l),O.current=null},l=()=>{c(),Ve({width:o.width,height:o.height}),console.log(`[graph-panel] op=resize w=${o.width} h=${o.height} clampedW=${o.clampedW} clampedH=${o.clampedH}`)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l),O.current=c},[T.width,T.height]),re=(0,j.useCallback)(()=>{h(!0),_(null),r(`/api/admin/graph-restore`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);s()}).catch(e=>{_(e instanceof Error?e.message:String(e)),h(!1)})},[e.id,s,r]),ie=(0,j.useCallback)(()=>{y(!0),x(null),r(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e.id,by:`graph-side-panel-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);c()}).catch(e=>{x(e instanceof Error?e.message:String(e)),y(!1)})},[e.id,c,r]),A=S===`connections`&&f?`connections`:`properties`,ae=te?void 0:{width:`${T.width}px`,height:`${T.height}px`};return(0,L.jsxs)(`aside`,{ref:w,className:`graph-side-panel${e.trashed?` graph-side-panel-trashed`:``}`,style:ae,children:[!te&&(0,L.jsx)(`div`,{className:`graph-side-resize-handle`,role:`separator`,"aria-label":`Resize panel`,"aria-orientation":`vertical`,onPointerDown:k}),(0,L.jsxs)(`header`,{className:`graph-side-header`,children:[(0,L.jsx)(`div`,{children:(()=>{if(e.labels.some(e=>P.has(e))){let t=(0,N.pickDisplayName)(e),n=e.properties.createdAt,r=typeof n==`string`?n:``,i=r?(0,N.formatRunTimestamp)(r):null,a=e.labels.join(` · `)+(e.trashed?` · Trashed`:``)+` · ${e.id}`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h2`,{className:`graph-side-name`,title:t,children:t}),i&&(0,L.jsx)(`div`,{className:`graph-side-created`,children:i}),(0,L.jsxs)(`div`,{className:`graph-side-meta`,children:[(0,L.jsx)(`span`,{children:a}),(0,L.jsx)($e,{value:e.id,label:`id`,field:`id`})]})]})}return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`graph-side-labels`,children:[e.labels.join(` · `),e.trashed?` · Trashed`:``]}),(0,L.jsxs)(`div`,{className:`graph-side-id-row`,children:[(0,L.jsx)(`span`,{className:`graph-side-id`,children:e.id}),(0,L.jsx)($e,{value:e.id,label:`id`,field:`id`})]})]})})()}),(0,L.jsx)(`button`,{type:`button`,className:`graph-side-close`,onClick:a,"aria-label":`Close`,children:(0,L.jsx)(i,{size:14})})]}),e.trashed&&(0,L.jsxs)(`dl`,{className:`graph-side-props graph-side-trash-meta`,children:[(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedAt`}),(0,L.jsx)(`dd`,{children:Ge(e.properties.trashedAt)})]}),(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:`trashedBy`}),(0,L.jsx)(`dd`,{children:Ge(e.properties.trashedBy)})]})]}),(0,L.jsxs)(`div`,{className:`graph-side-tabs`,role:`tablist`,"aria-label":`Node detail sections`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`properties`,className:`graph-side-tab${A===`properties`?` graph-side-tab-on`:``}`,onClick:()=>ee(`properties`),children:`Properties`}),f&&(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":A===`connections`,className:`graph-side-tab${A===`connections`?` graph-side-tab-on`:``}`,onClick:()=>ee(`connections`),children:[`Connections (`,d.length,`)`]})]}),(0,L.jsxs)(`div`,{className:`graph-side-body`,children:[A===`properties`&&(0,L.jsxs)(`dl`,{className:`graph-side-props`,children:[u.length===0&&(0,L.jsx)(`div`,{className:`graph-side-empty`,children:`No properties.`}),u.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:Qe(t)}),(0,L.jsx)($e,{value:Ze(t),label:e,field:`prop`})]})]},e))]}),A===`connections`&&f&&(0,L.jsx)(`section`,{className:`graph-side-edges`,children:d.map(t=>{let r=t.from===e.id,i=r?t.to:t.from,a=n.get(i),o=a?(0,N.pickShortLabel)(a):i,s=r?`→`:`←`,c=Object.entries(t.properties??{}).filter(([,e])=>e!=null&&e!==``);return(0,L.jsxs)(`div`,{className:`graph-side-edge`,children:[(0,L.jsxs)(`div`,{className:`graph-side-edge-header`,children:[(0,L.jsx)(`span`,{className:`graph-side-edge-type`,children:t.type}),(0,L.jsx)(`span`,{className:`graph-side-edge-arrow`,children:s}),(0,L.jsx)(`span`,{className:`graph-side-edge-other`,title:o,children:o})]}),c.length>0&&(0,L.jsx)(`dl`,{className:`graph-side-edge-props`,children:c.map(([e,t])=>(0,L.jsxs)(`div`,{className:`graph-side-prop`,children:[(0,L.jsx)(`dt`,{children:e}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`span`,{className:`graph-side-prop-value`,children:Qe(t)}),(0,L.jsx)($e,{value:Ze(t),label:e,field:`edge-prop`})]})]},e))})]},t.id)})})]}),e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!p&&!g&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-restore`,onClick:re,children:[(0,L.jsx)(C,{size:14}),` Restore`]}),p&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(o,{size:14,className:`spin`}),` Restoring…`]})}),g&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Restore failed: `,g]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{_(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:re,children:`Retry`})]})]})]}),!e.trashed&&(0,L.jsxs)(`footer`,{className:`graph-side-footer`,children:[!v&&!b&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-side-trash`,onClick:ie,children:[(0,L.jsx)(l,{size:14}),` Trash`]}),v&&(0,L.jsx)(`div`,{className:`graph-delete-confirm`,children:(0,L.jsxs)(`p`,{children:[(0,L.jsx)(o,{size:14,className:`spin`}),` Trashing…`]})}),b&&(0,L.jsxs)(`div`,{className:`graph-delete-confirm graph-delete-confirm-error`,children:[(0,L.jsxs)(`p`,{children:[`Trash failed: `,b]}),(0,L.jsxs)(`div`,{className:`graph-delete-confirm-buttons`,children:[(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-cancel`,onClick:()=>{x(null)},children:`Close`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-delete-confirm-do`,onClick:ie,children:`Retry`})]})]})]})]})}var tt=`graph-shell`,nt=`graph-shell--fullscreen`;function rt(e,t){return t&&e?`${tt} ${nt}`:tt}function it(e){return e}function at(e){return e.isFullscreen&&!e.filterOpen}function ot(e){return e<.7?`compact`:e<1.3?`wrapped`:`detailed`}var st=150,ct=`#FBBF24`;function lt(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}var ut=`maxy-graph-search-limit-v1`,dt=250,ft=1200;function pt(){let[e,t]=(0,j.useState)(null),[n,r]=(0,j.useState)(!1),[i,s]=(0,j.useState)(void 0),[c,l]=(0,j.useState)(null),[d,f]=(0,j.useState)(void 0),[m,h]=(0,j.useState)(null),[_,v]=(0,j.useState)(null),y=(0,j.useMemo)(()=>typeof window>`u`?null:oe(window.location.search),[]),b=(0,j.useMemo)(()=>y?.kind===`focus`?{nodeId:y.nodeId,nodeLabel:y.nodeLabel}:null,[y]),x=(0,j.useMemo)(()=>y?.kind===`labels`?y.labels:null,[y]);(0,j.useEffect)(()=>{b&&_t(`deep-link`,{nodeId:b.nodeId.length>16?b.nodeId.slice(0,16)+`…`:b.nodeId,label:b.nodeLabel??``})},[b]),(0,j.useEffect)(()=>{!x||x.length===0||_t(`label-seed`,{label:x[0]})},[x]),(0,j.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(async i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}if(i.ok)try{let e=await i.json();typeof e.businessName==`string`&&s(e.businessName),e.sessionId!==void 0&&l(e.sessionId??null),v(e.role??null),f(e.userName===void 0?null:e.userName),h(e.avatar??null)}catch{}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]);let S=(0,j.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),[ee,C]=(0,j.useState)(!1),te=(0,j.useCallback)(async()=>{C(!0);try{let e=await p();if(e){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`}return e}finally{C(!1)}},[]);return n?e?(0,L.jsx)(u,{cacheKey:e,surface:`graph`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=graph`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,L.jsx)(g,{cacheKey:e,businessName:i,sessionId:c,onLogout:S,onDisconnect:te,disconnecting:ee,userName:d,userAvatar:m,role:_,children:(0,L.jsxs)(`div`,{className:`data-page graph-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(a,{size:18}),` Graph`]})}),(0,L.jsx)(`main`,{className:`graph-main`,children:(0,L.jsx)(mt,{cacheKey:e,initialFocus:b,initialLabels:x,allowFullscreen:!0})})]})})}):(0,L.jsxs)(`div`,{className:`data-page`,children:[(0,L.jsx)(`header`,{className:`data-header`,children:(0,L.jsxs)(`h1`,{className:`data-title`,children:[(0,L.jsx)(a,{size:18}),` Graph`]})}),(0,L.jsxs)(`div`,{className:`data-empty`,children:[(0,L.jsx)(`p`,{children:`You are not signed in.`}),(0,L.jsxs)(`p`,{children:[`Open the `,(0,L.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,L.jsx)(`div`,{className:`data-page`,children:(0,L.jsxs)(`div`,{className:`data-loading`,children:[(0,L.jsx)(o,{size:18,className:`spin`}),` Loading…`]})})}function mt({cacheKey:e,initialFocus:t=null,initialLabels:r=null,allowFullscreen:a=!1}){let{adminFetch:s,cacheKey:c,sessionRefetchNonce:u}=n({initialCacheKey:e,surface:`graph`}),d=(0,j.useRef)(null),f=(0,j.useRef)(null),[p,m]=(0,j.useState)(!1),g=(0,j.useRef)(null),y=(0,j.useRef)(null),b=(0,j.useRef)(null),C=(0,j.useRef)(null),ne=(0,j.useRef)(new Map),k=(0,j.useRef)([]),re=(0,j.useRef)(null),ae=(0,j.useRef)(null),oe=(0,j.useRef)(null),he=(0,j.useRef)([]),ge=(0,j.useRef)(null),xe=(0,j.useRef)(null),N=(0,j.useRef)(null),P=(0,j.useRef)(null),Ce=(0,j.useRef)(!1),[we,Te]=(0,j.useState)([{kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}]);(0,j.useEffect)(()=>{t?.nodeId&&Te(e=>{let n=e[e.length-1];return n.kind===`neighbourhood`&&n.rootElementId===t.nodeId?e:[e[0],{kind:`neighbourhood`,rootElementId:t.nodeId,rootLabel:t.nodeLabel}]})},[t?.nodeId,t?.nodeLabel]);let F=r&&r.length>0?[...r].sort().join(`,`):null;(0,j.useEffect)(()=>{F&&(Lt.current=!0,Te([{kind:`filter`,selectedLabels:F.split(`,`),includeTrashed:!1,includeAgentActions:!1}]))},[F]);let[I,Ee]=(0,j.useState)(!1),[De,Oe]=(0,j.useState)(null),[ke,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(0),[Ie,Le]=(0,j.useState)(null),[ze,Be]=(0,j.useState)(null),[Ve,He]=(0,j.useState)(!1),[Ue,We]=(0,j.useState)(!1),[Ge,Ke]=(0,j.useState)(null),[qe,Je]=(0,j.useState)(``),[Ye,Xe]=(0,j.useState)(``),[Ze,Qe]=(0,j.useState)(null),[$e,tt]=(0,j.useState)(null),[nt,pt]=(0,j.useState)(()=>{if(typeof window>`u`)return 100;let e=window.localStorage.getItem(ut);return e?Se(e):100}),[mt,vt]=(0,j.useState)(nt),[yt,bt]=(0,j.useState)(`hybrid`),[xt,St]=(0,j.useState)(0),[Ct,wt]=(0,j.useState)(!1),[Tt,Et]=(0,j.useState)(0),[Dt,Ot]=(0,j.useState)(0),[kt,At]=(0,j.useState)([]),[jt,Mt]=(0,j.useState)({labels:[],includeTrashed:!1}),[Nt,Pt]=(0,j.useState)(!1),[Ft,It]=(0,j.useState)(!1),Lt=(0,j.useRef)(!1),Rt=(0,j.useRef)(null),zt=(0,j.useMemo)(()=>{let e=new Set;for(let t of ne.current.values()){let n=(0,w.pickDisplayLabel)(t.labels);n&&e.add(n)}return[...e].sort()},[Ne]);(0,j.useEffect)(()=>{let e=!1,t=s(`/api/admin/graph-labels-in-graph`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[]}}),n=s(`/api/admin/graph-default-view`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}return{labels:[],includeTrashed:!1}});return Promise.all([t,n]).then(([t,n])=>{if(!e&&(At(t.labels),Mt(n),!Lt.current)){Lt.current=!0;let e=new Set(t.labels.map(e=>e.label)),r=n.labels.filter(t=>e.has(t));(r.length>0||n.includeTrashed)&&Te(e=>[{kind:`filter`,selectedLabels:r,includeTrashed:n.includeTrashed,includeAgentActions:!1},...e.slice(1)])}}),()=>{e=!0}},[c,u,s]);let Bt=we[0].kind===`filter`?we[0].includeAgentActions:!1;(0,j.useEffect)(()=>{if(!Lt.current)return;let e=!1;return s(`/api/admin/graph-labels-in-graph?includeAgentActions=${Bt?`1`:`0`}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.json()}).then(t=>{e||At(t.labels)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-labels-in-graph-refetch`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}),()=>{e=!0}},[c,u,Bt,Dt,s]),(0,j.useEffect)(()=>{if(!Nt)return;let e=e=>{Rt.current&&(Rt.current.contains(e.target)||Pt(!1))},t=e=>{e.key===`Escape`&&Pt(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[Nt]);let Vt=(0,j.useCallback)((e,t)=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:e,msg:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),Ht=(0,j.useCallback)(e=>{console.log(`[graph-fullscreen] op=exit reason=${e}`),m(!1)},[]);(0,j.useEffect)(()=>{if(!a||!p)return;let e=e=>{e.key===`Escape`&&at({isFullscreen:p,filterOpen:Nt})&&Ht(`escape`)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,p,Nt,Ht]);let Ut=(0,j.useRef)(p);(0,j.useEffect)(()=>{if(!a)return;let e=Ut.current!==p;if(Ut.current=p,!e)return;let t=requestAnimationFrame(()=>{let e=f.current;try{e?.redraw()}catch{}if(!p)return;let t=g.current?.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t?Math.round(t.width):0,a=t?Math.round(t.height):0;console.log(`[graph-fullscreen] op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`),t&&(t.width<n-2||t.height<r-2)&&Vt(`graph-fullscreen-not-covering`,`op=enter viewportW=${n} viewportH=${r} overlayW=${i} overlayH=${a}`);try{let t=e?.canvas?.frame?.canvas,n=d.current;if(t&&n){let e=t.clientWidth,r=t.clientHeight,i=n.clientWidth,a=n.clientHeight;console.log(`[graph-fullscreen] op=resized canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`),(Math.abs(e-i)>2||Math.abs(r-a)>2)&&Vt(`graph-fullscreen-canvas-mismatch`,`canvasW=${e} canvasH=${r} containerW=${i} containerH=${a}`)}}catch{}});return()=>cancelAnimationFrame(t)},[a,p,Vt]);let Wt=(0,j.useCallback)(()=>{if(b.current)try{b.current.clear()}catch{}if(C.current)try{C.current.clear()}catch{}},[]),Gt=(0,j.useCallback)((e,t)=>{Ke(null),s(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);Be(null);try{f.current?.unselectAll()}catch{}Te(e=>[me(e)]),Et(e=>e+1),_e(`graph-trash`)}).catch(n=>{let r=n instanceof Error?n.message:String(n);Ke(`Failed to delete: ${r}`),We(!0),window.setTimeout(()=>We(!1),ft);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete`,elementId:e,label:t,msg:r}),keepalive:!0}).catch(()=>{})}catch{}})},[s]),Kt=(0,j.useCallback)(e=>{Ke(null);let t=e.length;Promise.allSettled(e.map(e=>s(`/api/admin/graph-delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({elementId:e,by:`graph-drag-trash`})}).then(async t=>{let n=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);return e}))).then(e=>{let n=e.filter(e=>e.status===`rejected`);Be(null);try{f.current?.unselectAll()}catch{}if(Te(e=>[me(e)]),Et(e=>e+1),_e(`graph-trash`),n.length>0){let e=t-n.length;Ke(e===0?`Failed to delete ${t} node${t===1?``:`s`}.`:`Deleted ${e} of ${t}; ${n.length} failed.`),We(!0),window.setTimeout(()=>We(!1),ft);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-drag-delete-batch`,total:t,failed:n.length}),keepalive:!0}).catch(()=>{})}catch{}}})},[s]),qt=we[we.length-1],Jt=(0,j.useMemo)(()=>pe(we),[we]),Yt=(0,j.useRef)(Jt);(0,j.useEffect)(()=>{Yt.current=Jt},[Jt]);let Xt=(0,j.useRef)(we);(0,j.useEffect)(()=>{Xt.current=we},[we]),(0,j.useEffect)(()=>{if(Ye){re.current?.abort(),re.current=null;return}let e=window.setTimeout(()=>{re.current?.abort();let e=new AbortController;re.current=e,Ee(!0),Oe(null),Me(null),s(le(qt,{includeAgentActions:me(we).includeAgentActions,search:null}),{signal:e.signal}).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(e.status===413)throw new ht(t);if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{e.signal.aborted||(ne.current=new Map(t.nodes.map(e=>[e.id,e])),Pe(t.nodes.length),Le(typeof t.total==`number`?t.total:null),Zt(t.nodes,t.edges))}).catch(t=>{if(!e.signal.aborted){if(t instanceof ht){Me(t.body),Pe(0),ne.current=new Map,Wt();return}Oe(t instanceof Error?t.message:String(t))}}).finally(()=>{e.signal.aborted||Ee(!1)})},dt);return()=>{window.clearTimeout(e)}},[c,Jt,Tt,u,Ye,mt]),(0,j.useEffect)(()=>()=>{re.current?.abort(),y.current?.(),y.current=null,f.current?.destroy(),f.current=null,P.current!==null&&(clearTimeout(P.current),P.current=null)},[]);let Zt=(0,j.useCallback)((e,t)=>{if(!d.current)return;k.current=t;let n=new Set([`Message`,`UserMessage`,`AssistantMessage`]),r=e=>e.labels.some(e=>n.has(e)),i=new Map,a=e.filter(r);if(a.length>0){let e=new Set(a.map(e=>e.id)),n=new Map,r=new Set;for(let i of t)i.type===`NEXT`&&e.has(i.from)&&e.has(i.to)&&(n.set(i.from,i.to),r.add(i.to));let o=[],s=new Set;for(let e of a){if(r.has(e.id))continue;let t=e.id;for(;t&&!s.has(t);)s.add(t),o.push(t),t=n.get(t)}for(let e of a)s.has(e.id)||(o.push(e.id),s.add(e.id));let c=d.current?.clientWidth??1200,l=Math.max(c-160,300),u=Math.max(Math.floor(l/150),2);o.forEach((e,t)=>{let n=t%u,r=Math.floor(t/u);i.set(e,{x:n*150,y:r*90})})}let o=e.map(e=>{let t=e.labels[0]??`Unknown`,n=(0,w.resolveNodeColour)(e.labels);n.displayLabel;let r=n.colour;n.driftCandidates;let a=i.get(e.id),o=a?{x:a.x,y:a.y,physics:!1}:{};return e.trashed?{id:e.id,label:Ce.current?Ae(e,1):``,title:je(e),color:{background:`${r}40`,border:r},borderWidth:2,shapeProperties:{borderDashes:[6,4]},group:t,...o}:{id:e.id,label:Ce.current?Ae(e,1):``,title:je(e),color:r,group:t,...o}}),s=new Set(o.map(e=>e.id)),c=t.filter(e=>e.type!==`PART_OF`||s.has(e.from)&&s.has(e.to)).map(e=>({id:e.id,from:e.from,to:e.to,label:e.type})),l=Fe({nodes:e,edges:t});b.current=new ie.DataSet(l.nodePositions.size>0?o.map(e=>{if(e.x!==void 0||e.y!==void 0)return e;let t=l.nodePositions.get(e.id);return t?{...e,x:t.x,y:t.y,physics:!1}:e}):o),C.current=new ie.DataSet(c);let u={autoResize:!0,layout:{improvedLayout:!1,randomSeed:lt(Yt.current)},physics:l.physics===!1?!1:{solver:l.physics.solver,forceAtlas2Based:l.physics.forceAtlas2Based,stabilization:l.physics.stabilization},nodes:{shape:`dot`,size:18,font:{color:`#1F2937`,size:12,face:`DM Sans, sans-serif`},scaling:{label:{enabled:!0,min:12,max:30,drawThreshold:0}},borderWidth:0,chosen:{node:e=>{e.size=20,e.borderWidth=3,e.borderColor=`#0F172A`,e.shadow=!0,e.shadowColor=`rgba(15, 23, 42, 0.55)`,e.shadowSize=8,e.shadowX=0,e.shadowY=0},label:e=>{e.size=14}}},edges:{arrows:{to:{enabled:!0,scaleFactor:.4}},color:{color:`#CBD5E1`,highlight:`#475569`},font:{color:`#64748B`,size:9,face:`DM Sans, sans-serif`,align:`middle`,strokeWidth:0},smooth:{enabled:!0,type:`continuous`,roundness:.4},width:1,chosen:{edge:!0,label:!1}},interaction:{hover:!0,tooltipDelay:150,multiselect:!0}};try{y.current?.(),y.current=null,f.current?.destroy(),P.current!==null&&(clearTimeout(P.current),P.current=null),N.current=null;let e=new A.Network(d.current,{nodes:b.current,edges:C.current},u);f.current=e,l.physics!==!1&&(y.current=Re(e,{report:({avgMotion:e,settleMs:t,capped:n,nodeCount:r})=>{try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`event`,source:`graph-settle`,avgMotion:Math.round(e*100)/100,settleMs:t,capped:n,nodeCount:r}),keepalive:!0}).catch(()=>{})}catch{}}})),e.on(`zoom`,()=>{P.current!==null&&clearTimeout(P.current),P.current=setTimeout(()=>{P.current=null;let e=f.current,t=b.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=ot(n);if(r===N.current)return;N.current=r;let i=[];for(let e of ne.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),r=e.trashed?{background:`${t}40`,border:t}:t,a=Ce.current?Ae(e,n):``;i.push({id:e.id,label:a,color:r})}i.length>0&&t.update(i),console.error(`[graph-page] zoom-tier scale=${n.toFixed(3)} tier=${r} nodes=${i.length}`)},st)}),e.on(`click`,e=>{let t=e.nodes[0];if(!t)return;let n=ne.current.get(t);if(!n)return;if(ve(n)===`skip-trashed`){Be(n);return}let r=Xt.current[Xt.current.length-1];if(r.kind===`neighbourhood`&&r.rootElementId===t){Be(e=>e?.id===t?null:n);return}Be(null);let i={kind:`neighbourhood`,rootElementId:t,rootLabel:n.labels[0]??null};Te(e=>{let n=ue(e,i),r=n.length-1;return n.length>e.length&&_t(`nav-push`,{depth:r,kind:i.kind,rootElementId:t}),n.length===10&&e.length===10&&_t(`view-stack-cap-hit`,{depth:10,rootElementId:t}),n})}),e.on(`deselectNode`,()=>{Be(null)});let t=e=>{let t=d.current,n=ae.current;if(!t||!n)return!1;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),a=r.left+e.x,o=r.top+e.y;return a>=i.left&&a<=i.right&&o>=i.top&&o<=i.bottom},n=d.current?.parentElement??null;e.on(`dragStart`,e=>{if(e.nodes.length===0){oe.current=null,he.current=[];return}he.current=[...e.nodes],oe.current=e.nodes[0],n?.classList.add(`graph-dragging`)}),e.on(`dragging`,e=>{if(he.current.length===0)return;let n=t(e.pointer.DOM);He(e=>e===n?e:n)}),e.on(`dragEnd`,e=>{let r=he.current;if(he.current=[],oe.current=null,He(!1),n?.classList.remove(`graph-dragging`),r.length!==0&&t(e.pointer.DOM))if(r.length===1){let e=ne.current.get(r[0])?.labels[0]??`Unknown`;Gt(r[0],e)}else Kt(r)})}catch(e){let t=e instanceof Error?e.message:String(e);Oe(`Visualisation failed to load: ${t}`);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-render`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}},[]),Qt=(0,j.useCallback)(()=>{let e=f.current,t=b.current;if(!e||!t)return;let n;try{n=e.getScale()}catch{return}let r=[];for(let e of ne.current.values()){if(!e.labels[0])continue;let{colour:t}=(0,w.resolveNodeColour)(e.labels),i=e.trashed?{background:`${t}40`,border:t}:t;r.push({id:e.id,label:Ce.current?Ae(e,n):``,color:i})}r.length>0&&t.update(r)},[]),$t=(0,j.useCallback)(()=>{Ce.current||(Ce.current=!0,Qt())},[Qt]);(0,j.useEffect)(()=>{let e=g.current;if(!e)return;let t=()=>$t();return e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`wheel`,t,!0),e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`wheel`,t,!0),e.removeEventListener(`keydown`,t,!0)}},[$t]),(0,j.useEffect)(()=>{let e=d.current;if(!e)return;let t=t=>{let n=xe.current,r=ge.current,i=e.parentElement;if(!n||!r||!i)return;let a=i.getBoundingClientRect(),o=Math.min(n.clientX,t.clientX)-a.left,s=Math.min(n.clientY,t.clientY)-a.top,c=Math.max(n.clientX,t.clientX)-a.left,l=Math.max(n.clientY,t.clientY)-a.top;r.style.left=`${o}px`,r.style.top=`${s}px`,r.style.width=`${c-o}px`,r.style.height=`${l-s}px`},n=r=>{document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0);let i=xe.current;xe.current=null;let a=ge.current;a&&(a.style.display=`none`);let o=f.current;if(!i||!o)return;let s=e.getBoundingClientRect(),c=i.clientX-s.left,l=i.clientY-s.top,u=r.clientX-s.left,d=r.clientY-s.top,p=Math.min(c,u),m=Math.min(l,d),h=Math.max(c,u),g=Math.max(l,d);if(h-p<3&&g-m<3)return;let _=o.getPositions(),v=[];for(let[e,t]of Object.entries(_)){let n=o.canvasToDOM(t);n.x>=p&&n.x<=h&&n.y>=m&&n.y<=g&&v.push(e)}try{o.selectNodes(v,!1)}catch{}},r=r=>{if(!r.shiftKey||r.button!==0)return;let i=f.current,a=e.parentElement;if(!i||!a)return;let o=e.getBoundingClientRect(),s={x:r.clientX-o.left,y:r.clientY-o.top};if(i.getNodeAt(s))return;r.preventDefault(),r.stopImmediatePropagation(),xe.current={clientX:r.clientX,clientY:r.clientY};let c=ge.current,l=a.getBoundingClientRect();c&&(c.style.display=`block`,c.style.left=`${r.clientX-l.left}px`,c.style.top=`${r.clientY-l.top}px`,c.style.width=`0px`,c.style.height=`0px`),document.addEventListener(`mousemove`,t,!0),document.addEventListener(`mouseup`,n,!0)};return e.addEventListener(`mousedown`,r,!0),()=>{e.removeEventListener(`mousedown`,r,!0),document.removeEventListener(`mousemove`,t,!0),document.removeEventListener(`mouseup`,n,!0)}},[]),(0,j.useEffect)(()=>{let e=qe.trim();if(!e){Xe(``),Qe(null),tt(null),bt(`hybrid`),St(0),wt(!1),f.current?.unselectAll();return}wt(!1);let t=setTimeout(()=>Xe(e),300);return()=>clearTimeout(t)},[qe]),(0,j.useEffect)(()=>{let e=setTimeout(()=>{let e=Se(nt);vt(e);try{window.localStorage.setItem(ut,String(e))}catch{}},200);return()=>clearTimeout(e)},[nt]);let en=(0,j.useCallback)(e=>{let t=f.current,n=b.current;if(!t||!n)return;let{updates:r,inWindow:i}=ye(e,ne.current,w.resolveNodeColour,ct);r.length>0&&(n.update(r),t.fit({nodes:i,animation:{duration:400,easingFunction:`easeInOutQuad`}}))},[]),tn=me(we);(0,j.useEffect)(()=>{if(!Ye)return;let e=!1;return tt(null),s(M(Ye,tn.selectedLabels,mt,Ct)).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(t=>{if(e)return;Qe(t.results);let n=t.mode===`bm25`?`bm25`:`hybrid`;if(bt(n),St(typeof t.suppressed==`number`?t.suppressed:0),n===`bm25`)try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-page`,msg:`[graph-page] search-result-degraded mode=bm25 query="${Ye}"`}),keepalive:!0}).catch(()=>{})}catch{}let{nodes:r,edges:i}=be(t.results,tn.selectedLabels);ne.current=new Map(r.map(e=>[e.id,e])),Pe(r.length),Me(null),Zt(r,i),en(t.results),console.info(`[graph-page] search-applied view=${qt.kind} q="${Ye}" labels=${tn.selectedLabels.join(`|`)} hits=${r.length}`)}).catch(t=>{e||tt(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[Ye,mt,c,u,s,en,qt.kind,tn.selectedLabels,Zt,Ct]);let nn=(0,j.useCallback)(e=>{Te(t=>{let n=me(t),r=new Set(n.selectedLabels);return r.has(e)?r.delete(e):r.add(e),fe({kind:`filter`,selectedLabels:[...r].sort(),includeTrashed:n.includeTrashed,includeAgentActions:n.includeAgentActions})})},[]),rn=(0,j.useCallback)(()=>{Te(e=>{let t=me(e);return fe({...t,includeTrashed:!t.includeTrashed})})},[]),an=(0,j.useCallback)(()=>{Te(e=>{let t=me(e);return fe({...t,includeAgentActions:!t.includeAgentActions})})},[]),on=(0,j.useCallback)(()=>{Je(``),Xe(``),Qe(null),tt(null),bt(`hybrid`),St(0),wt(!1);try{f.current?.unselectAll()}catch{}},[]),sn=(0,j.useCallback)(()=>{Te(()=>fe({kind:`filter`,selectedLabels:[],includeTrashed:!1,includeAgentActions:!1}))},[]),cn=(0,j.useCallback)(()=>{Be(null);try{f.current?.unselectAll()}catch{}Te(e=>{let t=de(e);return t!==e&&_t(`nav-pop`,{depth:t.length-1}),t})},[]),ln=(0,j.useCallback)(()=>{Be(null);try{f.current?.unselectAll()}catch{}Te(e=>e.length<=1?e:(_t(`nav-home`,{depth:0,popped:e.length-1}),[me(e)]))},[]),un=(0,j.useCallback)(()=>{let e=me(we),t={labels:[...e.selectedLabels].sort(),includeTrashed:e.includeTrashed};It(!0),s(`/api/admin/graph-default-view`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));throw Error(t.error??`HTTP ${e.status}`)}Mt(t)}).catch(e=>{let t=e instanceof Error?e.message:String(e);try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-default-view-save`,msg:t}),keepalive:!0}).catch(()=>{})}catch{}}).finally(()=>It(!1))},[s,we]),dn=(0,j.useCallback)(()=>{Be(null);try{f.current?.unselectAll()}catch{}Et(e=>e+1),_e(`graph-restore`)},[]),fn=(0,j.useCallback)(()=>{Be(null);try{f.current?.unselectAll()}catch{}Te(e=>[me(e)]),Et(e=>e+1),_e(`graph-trash`)},[]),pn=(0,j.useCallback)(()=>{Et(e=>e+1),Ot(e=>e+1)},[]),mn=qt.kind===`neighbourhood`,hn=me(we),gn=hn.selectedLabels,_n=hn.includeTrashed,vn=hn.includeAgentActions,yn=(0,j.useMemo)(()=>{if(_n!==jt.includeTrashed||gn.length!==jt.labels.length)return!0;for(let e=0;e<gn.length;e++)if(gn[e]!==jt.labels[e])return!0;return!1},[_n,gn,jt]);return(0,L.jsxs)(`div`,{ref:g,className:rt(p,a),children:[(0,L.jsxs)(`div`,{className:`graph-toolbar`,children:[we.length>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-desktop`,onClick:ln,title:`Clear breadcrumb — return to filter root`,children:[(0,L.jsx)(E,{size:12}),` Home`]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-home-to-filter graph-home-mobile`,onClick:ln,"aria-label":`Home`,title:`Clear breadcrumb — return to filter root`,children:(0,L.jsx)(E,{size:14})}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-desktop`,onClick:cn,children:`← Back`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-back-to-filter graph-back-mobile`,onClick:cn,"aria-label":`Back`,children:(0,L.jsx)(v,{size:16})})]}),(0,L.jsxs)(`div`,{className:`data-search-input graph-search-input`,children:[(0,L.jsx)(te,{size:14}),(0,L.jsx)(`input`,{type:`text`,placeholder:`Search nodes…`,value:qe,onChange:e=>Je(e.target.value),autoComplete:`off`,spellCheck:!1}),Ye&&!Ze&&!$e&&(0,L.jsx)(o,{size:14,className:`spin`}),qe.length>0&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-clear`,onClick:on,"aria-label":`Clear search`,title:`Clear search`,children:(0,L.jsx)(i,{size:14})})]}),Ye&&(0,L.jsxs)(`div`,{className:`graph-search-limit`,title:`Show top ${nt} matches (1-2000)`,children:[(0,L.jsx)(`label`,{htmlFor:`graph-search-limit-input`,className:`graph-search-limit-label`,children:`Top`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>pt(Se(nt-1)),disabled:nt<=1,"aria-label":`Decrement search limit`,title:`Decrement`,children:(0,L.jsx)(O,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-input`,type:`number`,min:1,max:2e3,step:1,value:nt,onChange:e=>pt(Se(e.target.value)),className:`graph-search-limit-number`,"aria-label":`Maximum search results to render`}),(0,L.jsx)(`button`,{type:`button`,className:`graph-search-limit-step`,onClick:()=>pt(Se(nt+1)),disabled:nt>=2e3,"aria-label":`Increment search limit`,title:`Increment`,children:(0,L.jsx)(S,{size:12})}),(0,L.jsx)(`input`,{id:`graph-search-limit-slider`,type:`range`,min:1,max:2e3,step:1,value:nt,onChange:e=>pt(Se(e.target.value)),"aria-label":`Maximum search results to render (drag for ballpark)`})]}),(0,L.jsx)(`button`,{type:`button`,className:`graph-refresh-button`,onClick:pn,disabled:I,"aria-label":`Refresh graph`,title:`Refresh graph`,children:(0,L.jsx)(x,{size:14,className:I?`spin`:void 0})}),it(a)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-fullscreen-toggle`,onClick:()=>{p?Ht(`button`):m(!0)},"aria-label":p?`Exit full screen`:`Full screen`,title:p?`Exit full screen`:`Full screen`,"aria-pressed":p,children:p?(0,L.jsx)(D,{size:14}):(0,L.jsx)(ee,{size:14})}),!mn&&(0,L.jsxs)(`div`,{className:`graph-filter-wrap`,ref:Rt,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-toggle${Nt?` is-open`:``}${gn.length>0||_n||vn?` has-selection`:``}`,onClick:()=>Pt(e=>!e),"aria-haspopup":`true`,"aria-expanded":Nt,"aria-label":`Filter node types`,children:[(0,L.jsx)(h,{size:14}),(0,L.jsx)(`span`,{children:`Filter`}),gn.length>0&&(0,L.jsx)(`span`,{className:`graph-filter-count`,children:gn.length})]}),Nt&&(0,L.jsxs)(`div`,{className:`graph-filter-popover`,role:`dialog`,"aria-label":`Node type filter`,children:[(0,L.jsxs)(`div`,{className:`graph-filter-popover-header`,children:[(0,L.jsxs)(`button`,{type:`button`,className:`graph-toggle-trashed${_n?` active`:``}`,onClick:rn,"aria-pressed":_n,title:`Show trashed nodes — restored with Restore button on each node`,children:[(0,L.jsx)(T,{size:14}),` Show trashed`]}),(gn.length>0||_n||vn)&&(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-clear`,onClick:sn,"aria-label":`Clear filter selection`,title:`Clear filter selection`,children:(0,L.jsx)(i,{size:14})})]}),(0,L.jsx)(`div`,{className:`graph-toggle-agent-actions`,title:`Hide ToolCall, StepResult, WorkflowStep, WorkflowRun — agent-execution telemetry. Flip on for audit/debug.`,children:(0,L.jsx)(_,{checked:vn,onChange:an,label:`Include agent actions`})}),kt.length===0&&(0,L.jsx)(`p`,{className:`graph-filter-popover-empty`,children:`No node types in your graph yet.`}),(0,L.jsx)(`div`,{className:`graph-filter-rows`,role:`group`,"aria-label":`Node type filter`,children:kt.map(({label:e,nodeCount:t})=>{let n=gn.includes(e),r=(0,w.colourForLabel)(e);return(0,L.jsxs)(`button`,{type:`button`,className:`graph-filter-row${n?` active`:``}`,onClick:()=>nn(e),"aria-pressed":n,children:[(0,L.jsx)(`span`,{className:`graph-filter-row-swatch`,style:{backgroundColor:r}}),(0,L.jsx)(`span`,{className:`graph-filter-row-label`,children:e}),(0,L.jsx)(`span`,{className:`graph-filter-row-count`,children:t})]},e)})}),(0,L.jsx)(`div`,{className:`graph-filter-popover-footer`,children:(0,L.jsx)(`button`,{type:`button`,className:`graph-filter-set-default`,onClick:un,disabled:!yn||Ft,children:Ft?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(o,{size:12,className:`spin`}),` Saving…`]}):`Set default view`})})]})]}),(0,L.jsx)(`div`,{className:`graph-meta`,children:se({inNeighbourhood:mn,searchActive:!!Ye,selectedLabelsCount:gn.length,topLevelTotal:Ie,nodeCount:Ne})?(0,L.jsx)(`span`,{className:`graph-meta-count`,children:ce(Ne,Ie)}):Ne>0&&(0,L.jsxs)(`span`,{className:`graph-meta-count`,children:[Ne,` node`,Ne===1?``:`s`]})})]}),we.length>1&&(0,L.jsx)(gt,{viewStack:we}),Ye&&yt===`bm25`&&!$e&&(0,L.jsx)(`div`,{className:`graph-error-banner graph-search-degraded`,role:`status`,children:`Vector ranking unavailable — showing keyword-only results.`}),$e&&(0,L.jsxs)(`div`,{className:`data-error graph-error-banner`,children:[`Search unavailable: `,$e]}),Ye&&xt>0&&!Ct&&!$e&&(0,L.jsxs)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>wt(!0),children:[xt,` low-confidence match`,xt===1?``:`es`,` hidden — show all`]}),Ye&&Ct&&!$e&&(0,L.jsx)(`button`,{type:`button`,className:`graph-search-suppressed`,onClick:()=>wt(!1),children:`Showing all matches — hide low-confidence`}),Ze&&Ze.length===0&&!$e&&(0,L.jsx)(`div`,{className:`graph-search-status`,children:`No matches in your graph.`}),(0,L.jsxs)(`div`,{className:`graph-canvas-wrap`,children:[I&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(o,{size:20,className:`spin`}),` Loading your graph…`]}),De&&!I&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsx)(`p`,{children:De}),(0,L.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:()=>{Oe(null),Et(e=>e+1)},children:`Retry`})]}),ke&&!I&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay graph-canvas-error`,children:[(0,L.jsxs)(`p`,{children:[`Refine your filter — `,(0,L.jsx)(`strong`,{children:ke.matched}),` matches exceed the 2000 cap.`]}),(0,L.jsx)(`p`,{className:`graph-canvas-hint`,children:`Pick a more specific label combination, or narrow your brand's data.`})]}),!I&&!De&&!ke&&Ne===0&&!mn&&gn.length===0&&(0,L.jsxs)(`div`,{className:`graph-canvas-overlay`,children:[(0,L.jsx)(h,{size:20}),(0,L.jsx)(`p`,{children:`No nodes in your graph yet.`})]}),!I&&!De&&!ke&&Ne===0&&!mn&&gn.length>0&&(0,L.jsx)(`div`,{className:`graph-canvas-overlay`,children:(0,L.jsxs)(`p`,{children:[`No `,gn.join(`, `),` nodes match this view.`]})}),(0,L.jsx)(`div`,{ref:d,className:`graph-canvas`}),(0,L.jsx)(`div`,{ref:ge,className:`graph-marquee`,"aria-hidden":`true`}),Ne>0&&(0,L.jsx)(`div`,{ref:ae,className:`graph-trash-drop-zone${Ve?` is-hover`:``}${Ue?` is-error`:``}`,"aria-hidden":`true`,children:(0,L.jsx)(l,{size:18})}),Ge&&(0,L.jsxs)(`div`,{className:`graph-drag-error-banner`,role:`alert`,children:[(0,L.jsx)(`span`,{children:Ge}),(0,L.jsx)(`button`,{type:`button`,className:`graph-drag-error-dismiss`,onClick:()=>Ke(null),"aria-label":`Dismiss`,children:(0,L.jsx)(i,{size:14})})]})]}),ze&&(0,L.jsx)(et,{node:ze,edges:k.current,nodesById:ne.current,adminFetch:s,onClose:()=>{Be(null);try{f.current?.unselectAll()}catch{}},onRestored:dn,onTrashed:fn}),Ne>0&&zt.length>0&&(0,L.jsx)(`div`,{className:`graph-legend`,children:zt.map(e=>(0,L.jsxs)(`div`,{className:`graph-legend-item`,children:[(0,L.jsx)(`span`,{className:`graph-legend-swatch`,style:{backgroundColor:(0,w.colourForLabel)(e)}}),(0,L.jsx)(`span`,{children:e})]},e))})]})}var ht=class extends Error{body;constructor(e){super(e.error),this.body=e}};function gt({viewStack:e}){let t=e.map(e=>e.kind===`filter`?`Filter`:e.rootLabel??`Node`);return(0,L.jsx)(`div`,{className:`graph-breadcrumb`,role:`navigation`,"aria-label":`Graph navigation breadcrumb`,children:t.map((e,n)=>(0,L.jsxs)(`span`,{className:`graph-breadcrumb-item`,children:[n>0&&(0,L.jsx)(`span`,{className:`graph-breadcrumb-separator`,"aria-hidden":`true`,children:`›`}),(0,L.jsx)(`span`,{className:`graph-breadcrumb-label${n===t.length-1?` is-current`:``}`,children:e})]},n))})}function _t(e,t){let n=`[graph-page] ${e} ${Object.entries(t).map(([e,t])=>`${e}=${String(t)}`).join(` `)}`;try{fetch(`/api/_client-error`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({kind:`graph-nav`,msg:n}),keepalive:!0}).catch(()=>{})}catch{}}(0,ae.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(pt,{}));
@@ -1 +1 @@
1
- import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as i,t as a}from"./AdminLoginScreens-DeR71H29.js";import"./useVoiceRecorder-DCyJQkFK.js";import"./AdminShell-DlAVQUda.js";import"./Checkbox-B629mOPp.js";import{t as o}from"./page-3g0A19Rv.js";import"./useCopyFeedback-CSk9KjhY.js";import"./file-download-4mKJxUi-.js";var s=n(),c=e(t(),1),l=r();function u(){let e=i(`operator`),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.appState!==`chat`&&t.current!==e.appState&&(t.current=e.appState,console.info(`[operator-ui] op=auth-gate state=${e.appState}`))},[e.appState]),e.appState===`chat`?(0,l.jsx)(o,{variant:`operator`,forceCanonicalSession:window.location.pathname!==`/chat`}):(0,l.jsx)(a,{auth:e})}(0,s.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(u,{}));
1
+ import{o as e}from"./chunk-Ck5AOu5v.js";import{E as t,w as n,x as r}from"./useSubAccountSwitcher-DLJFISqf.js";import{n as i,t as a}from"./AdminLoginScreens-CukwQufW.js";import"./useVoiceRecorder-b7HzTFs0.js";import"./AdminShell-BwEBH6tT.js";import"./Checkbox-B629mOPp.js";import{t as o}from"./page-DMeJHVfA.js";import"./useCopyFeedback-DHoYHiK9.js";import"./file-download-4mKJxUi-.js";var s=n(),c=e(t(),1),l=r();function u(){let e=i(`operator`),t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.appState!==`chat`&&t.current!==e.appState&&(t.current=e.appState,console.info(`[operator-ui] op=auth-gate state=${e.appState}`))},[e.appState]),e.appState===`chat`?(0,l.jsx)(o,{variant:`operator`,forceCanonicalSession:window.location.pathname!==`/chat`}):(0,l.jsx)(a,{auth:e})}(0,s.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(u,{}));