@undefineds.co/xpod 0.4.8 → 0.4.10

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 (96) hide show
  1. package/dist/identity/drizzle/PodLookupRepository.d.ts +5 -16
  2. package/dist/identity/drizzle/PodLookupRepository.js +40 -201
  3. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +1 -0
  4. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +1 -0
  5. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +94 -16
  6. package/node_modules/@undefineds.co/solid-sdk/dist/index.cjs +112 -11
  7. package/node_modules/@undefineds.co/solid-sdk/dist/session.d.ts +2 -0
  8. package/node_modules/@undefineds.co/solid-sdk/dist/session.js +135 -11
  9. package/package.json +8 -2
  10. package/static/app/assets/main.js +12 -12
  11. package/static/auth-callback/assets/{AiConfigContext-DJKvxduw.js → AiConfigContext-C81deMM9.js} +1 -1
  12. package/static/auth-callback/assets/{AiConfigPage-DgGmHb18.js → AiConfigPage-evWI8T56.js} +1 -1
  13. package/static/auth-callback/assets/{DocumentProcessingPanel-CJmxu8x1.js → DocumentProcessingPanel-B9GrDEMe.js} +1 -1
  14. package/static/auth-callback/assets/{IndexLifecyclePanel-byCa7h7L.js → IndexLifecyclePanel-qCo8ABQZ.js} +1 -1
  15. package/static/auth-callback/assets/{IndexSubjectPanel-CDwT4Yx1.js → IndexSubjectPanel-C4YG0whI.js} +1 -1
  16. package/static/auth-callback/assets/{ModelAssignmentsPanel-CwM3k8w7.js → ModelAssignmentsPanel-DG7Lxh3t.js} +1 -1
  17. package/static/auth-callback/assets/ModelsPage-CgEuqE6p.js +10 -0
  18. package/static/auth-callback/assets/{NetworkPage-DkVgxtNj.js → NetworkPage-Cbdn_P1e.js} +1 -1
  19. package/static/auth-callback/assets/{PaneListHeader-DRI0hjmt.js → PaneListHeader-jy70Q00L.js} +1 -1
  20. package/static/auth-callback/assets/{SearchIndexingPanel-mbppDZFE.js → SearchIndexingPanel-ByU3u7kp.js} +1 -1
  21. package/static/auth-callback/assets/{StatusSubjectPanel-DNsW76aC.js → StatusSubjectPanel-hfjoB5aS.js} +1 -1
  22. package/static/auth-callback/assets/{StatusWorkspace-DGcTbHT5.js → StatusWorkspace-BZd617sV.js} +1 -1
  23. package/static/auth-callback/assets/{SystemSettingsPage-C6qklJ9k.js → SystemSettingsPage-BirzWAQM.js} +1 -1
  24. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-B4VV9xkG.js → SystemSettingsSubjectPanel-CmsVWNCx.js} +1 -1
  25. package/static/auth-callback/assets/{activity-Ck-Mfxxo.js → activity-BcsZZxxw.js} +1 -1
  26. package/static/auth-callback/assets/{auth-callback-DG4Ge40c.js → auth-callback-atKg_oig.js} +124 -124
  27. package/static/auth-callback/assets/{badge-GSSnw1VV.js → badge-BWbRHThQ.js} +1 -1
  28. package/static/auth-callback/assets/{download-BYyRX-K2.js → download-BmvG1Vya.js} +1 -1
  29. package/static/auth-callback/assets/{external-link-WEC0Ki-0.js → external-link-DZ34d3g3.js} +1 -1
  30. package/static/auth-callback/assets/{index-kju2k4Dp.js → index-BpV1hsqs.js} +1 -1
  31. package/static/auth-callback/assets/{index-DlsMCgo8.js → index-D9oE6FXK.js} +1 -1
  32. package/static/auth-callback/assets/{index-browser-D8YW6coF.js → index-browser-B9Z7GU-T.js} +1 -1
  33. package/static/auth-callback/assets/{key-round-DJUT5Nh0.js → key-round-tjP76Se-.js} +1 -1
  34. package/static/auth-callback/assets/{rotate-ccw-CXwfZUKU.js → rotate-ccw-C_L5ZLx1.js} +1 -1
  35. package/static/auth-callback/assets/{skeleton-DWPtNhUB.js → skeleton-C7tGDQIs.js} +1 -1
  36. package/static/auth-callback/assets/{waypoints-l1oDnRJ0.js → waypoints-VMNQlWdU.js} +1 -1
  37. package/static/auth-callback/assets/{workspace-layout-B7iKpK-Q.js → workspace-layout-SAp6BtYK.js} +1 -1
  38. package/static/auth-callback/auth-callback.html +1 -1
  39. package/static/dashboard/assets/{AiConfigContext-U0cCSY28.js → AiConfigContext-De-OtAWo.js} +1 -1
  40. package/static/dashboard/assets/{AiConfigPage-CMi0uJdo.js → AiConfigPage-macP4Mop.js} +1 -1
  41. package/static/dashboard/assets/{DocumentProcessingPanel-DEZiEpft.js → DocumentProcessingPanel-C5ObvCCl.js} +1 -1
  42. package/static/dashboard/assets/{IndexLifecyclePanel-CGZfLUog.js → IndexLifecyclePanel-xVNa2l40.js} +1 -1
  43. package/static/dashboard/assets/{IndexSubjectPanel-DiDZauHk.js → IndexSubjectPanel-DQFPP6-p.js} +1 -1
  44. package/static/dashboard/assets/{ModelAssignmentsPanel-DaGGZKuf.js → ModelAssignmentsPanel-DMOATFpQ.js} +1 -1
  45. package/static/dashboard/assets/ModelsPage-91UbnETA.js +25 -0
  46. package/static/dashboard/assets/{NetworkPage-DI5-O7GT.js → NetworkPage-CHQ3YxIB.js} +1 -1
  47. package/static/dashboard/assets/{PaneListHeader-4oa7uf59.js → PaneListHeader-DsXemAdR.js} +1 -1
  48. package/static/dashboard/assets/{SearchIndexingPanel-DoqEwocD.js → SearchIndexingPanel-Dh70PNFZ.js} +1 -1
  49. package/static/dashboard/assets/{StatusSubjectPanel-CLzBC5fu.js → StatusSubjectPanel-D3PGEYT4.js} +1 -1
  50. package/static/dashboard/assets/{StatusWorkspace-UyKADZoM.js → StatusWorkspace-BcpePYUW.js} +1 -1
  51. package/static/dashboard/assets/{SystemSettingsPage-qP0hLHNV.js → SystemSettingsPage-BiN5GcKx.js} +1 -1
  52. package/static/dashboard/assets/{SystemSettingsSubjectPanel-EaWax9Ot.js → SystemSettingsSubjectPanel-B9QrSiFp.js} +1 -1
  53. package/static/dashboard/assets/{activity-CjIoNU4S.js → activity-j5zrznu-.js} +1 -1
  54. package/static/dashboard/assets/{badge-dcDZpKh3.js → badge-CzeBdG7h.js} +1 -1
  55. package/static/dashboard/assets/{dashboard-BY8GdnEI.js → dashboard-D-xANHk1.js} +103 -103
  56. package/static/dashboard/assets/{download-BeYCrc-_.js → download-IcNdEZWi.js} +1 -1
  57. package/static/dashboard/assets/{external-link-626-5KVx.js → external-link-DxBxK8Vu.js} +1 -1
  58. package/static/dashboard/assets/{index-CBbk6hx-.js → index-FWZ-s52O.js} +1 -1
  59. package/static/dashboard/assets/{index-CsxH6Hmz.js → index-ZiQZ96oC.js} +1 -1
  60. package/static/dashboard/assets/{key-round-B9IL4Wua.js → key-round-D1K7warM.js} +1 -1
  61. package/static/dashboard/assets/{rotate-ccw-DM4vCfiI.js → rotate-ccw-CcN1N6p9.js} +1 -1
  62. package/static/dashboard/assets/{skeleton-ChlFAPvP.js → skeleton-CKnmJMUH.js} +1 -1
  63. package/static/dashboard/assets/{waypoints-CvpZzf_I.js → waypoints-DuZPO_wu.js} +1 -1
  64. package/static/dashboard/assets/{workspace-layout-Bxv7V-tt.js → workspace-layout-BUj3wZ_m.js} +1 -1
  65. package/static/dashboard/dashboard.html +1 -1
  66. package/static/settings/assets/{AiConfigContext-CDVIHLBb.js → AiConfigContext-C0cQMPfG.js} +1 -1
  67. package/static/settings/assets/{AiConfigPage-C7qfiiaJ.js → AiConfigPage-CPhB4iFb.js} +1 -1
  68. package/static/settings/assets/{DocumentProcessingPanel-B59QTe-V.js → DocumentProcessingPanel-sYI7OpuH.js} +1 -1
  69. package/static/settings/assets/{IndexLifecyclePanel-C-e-3eVi.js → IndexLifecyclePanel-yj8iyiT8.js} +1 -1
  70. package/static/settings/assets/{IndexSubjectPanel-B-scRZ1u.js → IndexSubjectPanel-73sM16Ma.js} +1 -1
  71. package/static/settings/assets/{ModelAssignmentsPanel-Wy8jzVg4.js → ModelAssignmentsPanel-BFIgUX5v.js} +1 -1
  72. package/static/settings/assets/ModelsPage-BdppXl7E.js +10 -0
  73. package/static/settings/assets/{NetworkPage-tBB-4Ox8.js → NetworkPage-i6j-M2RY.js} +1 -1
  74. package/static/settings/assets/{PaneListHeader-DuD6glzn.js → PaneListHeader-DpqC0jd5.js} +1 -1
  75. package/static/settings/assets/{SearchIndexingPanel-CiDHc0nx.js → SearchIndexingPanel-BlPnrkT3.js} +1 -1
  76. package/static/settings/assets/{StatusSubjectPanel-OF5cgWwt.js → StatusSubjectPanel-Dv4q3PGh.js} +1 -1
  77. package/static/settings/assets/{StatusWorkspace-CZ8Oa0gV.js → StatusWorkspace-CKD_Rzdr.js} +1 -1
  78. package/static/settings/assets/{SystemSettingsPage-DT2tC0F_.js → SystemSettingsPage-CiOm2NzV.js} +1 -1
  79. package/static/settings/assets/{SystemSettingsSubjectPanel-Bkta1oDw.js → SystemSettingsSubjectPanel-Cd-GECon.js} +1 -1
  80. package/static/settings/assets/{activity-2M1f5eBS.js → activity-DaFkk8f3.js} +1 -1
  81. package/static/settings/assets/{badge-CRKan0qX.js → badge-d5SHdc-x.js} +1 -1
  82. package/static/settings/assets/{download-PCHldCdu.js → download-CpkwomDr.js} +1 -1
  83. package/static/settings/assets/{external-link-tmKe7eYO.js → external-link-_4YT42Mf.js} +1 -1
  84. package/static/settings/assets/{index-Cek02M79.js → index-BFi9yn7_.js} +1 -1
  85. package/static/settings/assets/{index-BDCNTwWz.js → index-BGgEhIUy.js} +1 -1
  86. package/static/settings/assets/{index-browser-EVDVm9T5.js → index-browser-B06xjBdZ.js} +1 -1
  87. package/static/settings/assets/{key-round-CUGvQCkt.js → key-round-Dlqmp1Kq.js} +1 -1
  88. package/static/settings/assets/{rotate-ccw-BRA3lIHM.js → rotate-ccw-TAY65xWT.js} +1 -1
  89. package/static/settings/assets/{settings-BdlKrzJ3.js → settings-ExBXGgbj.js} +103 -103
  90. package/static/settings/assets/{skeleton-CuDeifWb.js → skeleton-DKIWjNr9.js} +1 -1
  91. package/static/settings/assets/{waypoints-w6LxsFY1.js → waypoints-9erLIxyR.js} +1 -1
  92. package/static/settings/assets/{workspace-layout-TN-BWmT5.js → workspace-layout-CYXfYIa3.js} +1 -1
  93. package/static/settings/settings.html +1 -1
  94. package/static/auth-callback/assets/ModelsPage-DapY2Dwf.js +0 -10
  95. package/static/dashboard/assets/ModelsPage-DZgAOdxO.js +0 -25
  96. package/static/settings/assets/ModelsPage-DHNiaodk.js +0 -10
@@ -0,0 +1,25 @@
1
+ import{j as y,r as J,P as bn,o as Vs,q as xi,x as Nd,z as Mp,E as Fe,X as Dp,f as Ke,i as Pp,F as Tp,H as Fd,I as Qs,J as Gs,K as Bd,M as Ld,Q as et,T as Gr,U as iu,V as Js,W as ct,Y as Do,Z as me,_ as di,$ as Vr,a0 as As,a1 as wo,a2 as mn,a3 as tr,a4 as kp,a5 as Op,a6 as Et,a7 as ur,a8 as Ud,a9 as jp,aa as Ys,ab as Vt,ac as Br,ad as Po,ae as To,af as qd,ag as ko,B as _e,ah as kt,ai as st,aj as Np,ak as ou,al as er,am as au,t as pt,an as Fp,ao as Bp,ap as Lp,aq as Up,ar as Kd,as as or,at as vt,au as Qt,av as St,aw as zd,ax as Ie,ay as Be,az as yt,aA as qp,aB as Kp,aC as zp,u as Wp}from"./dashboard-D-xANHk1.js";import{A as Wd,a as Hp,b as Vp,n as Hd,d as Qp,e as Gp}from"./ai-connections-CHNTKemd.js";import{W as Jp,T as Yp}from"./workspace-layout-BUj3wZ_m.js";import{a as Oo,P as Xp,c as Lt,h as Zp,g as $p,R as ey,d as ty,F as ry,D as Vd,e as Qd,u as yo,C as ny,i as iy,b as Gd,f as oy,A as ay}from"./index-FWZ-s52O.js";import{B as go}from"./badge-CzeBdG7h.js";import{QueryEngine as sy}from"@comunica/query-sparql-solid";var ly=Object.defineProperty,Mt=(e,t)=>ly(e,"name",{value:t,configurable:!0}),Xs="Dialog",[Jd,QA]=Nd(Xs),[uy,Kt]=Jd(Xs),cy=Mt(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=J.useRef(null),u=J.useRef(null),[d,p]=Qd({prop:n,defaultProp:i??!1,onChange:o,caller:Xs}),[g,v]=J.useState(0),[I,C]=J.useState(0);return y.jsx(uy,{scope:t,triggerRef:s,contentRef:u,contentId:yo(),titleId:yo(),descriptionId:yo(),titlePresent:g>0,descriptionPresent:I>0,setTitleCount:v,setDescriptionCount:C,open:d,onOpenChange:p,onOpenToggle:J.useCallback(()=>p(_=>!_),[p]),modal:a,children:r})},"Dialog"),dy="DialogTrigger",fy=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(dy,n),a=xi(r,o.triggerRef);return y.jsx(bn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":jo(o.open),...i,ref:a,onClick:Lt(t.onClick,o.onOpenToggle)})},"DialogTrigger")),Yd="DialogPortal",[hy,Xd]=Jd(Yd,{forceMount:void 0}),py=Mt(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Kt(Yd,t);return y.jsx(hy,{scope:t,forceMount:r,children:J.Children.map(n,a=>y.jsx(Oo,{present:r||o.open,children:y.jsx(Xp,{asChild:!0,container:i,children:a})}))})},"DialogPortal"),_s="DialogOverlay",Zd=J.forwardRef(Mt(function(t,r){const n=Xd(_s,t.__scopeDialog),{forceMount:i=n.forceMount,...o}=t,a=Kt(_s,t.__scopeDialog);return a.modal?y.jsx(Oo,{present:i||a.open,children:y.jsx(gy,{...o,ref:r})}):null},"DialogOverlay")),yy=Mp("DialogOverlay.RemoveScroll"),gy=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(_s,n),a=$p(),s=xi(r,a);return y.jsx(ey,{as:yy,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(bn.div,{"data-state":jo(o.open),...i,ref:s,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),yi="DialogContent",$d=J.forwardRef(Mt(function(t,r){const n=Xd(yi,t.__scopeDialog),{forceMount:i=n.forceMount,...o}=t,a=Kt(yi,t.__scopeDialog);return y.jsx(Oo,{present:i||a.open,children:a.modal?y.jsx(by,{...o,ref:r}):y.jsx(my,{...o,ref:r})})},"DialogContent")),by=J.forwardRef(Mt(function(t,r){const n=Kt(yi,t.__scopeDialog),i=J.useRef(null),o=xi(r,n.contentRef,i);return J.useEffect(()=>{const a=i.current;if(a)return Zp(a)},[]),y.jsx(ef,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Lt(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lt(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&a.preventDefault()}),onFocusOutside:Lt(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),my=J.forwardRef(Mt(function(t,r){const n=Kt(yi,t.__scopeDialog),i=J.useRef(!1),o=J.useRef(!1);return y.jsx(ef,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(i.current||n.triggerRef.current?.focus(),a.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;n.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})},"DialogContentNonModal")),ef=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=t,u=Kt(yi,n);return ty(),y.jsx(y.Fragment,{children:y.jsx(ry,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:y.jsx(Vd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":jo(u.open),...s,ref:r,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),wy="DialogTitle",tf=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(wy,n),{setTitleCount:a}=o;return Vs(()=>(a(s=>s+1),()=>a(s=>s-1)),[a]),y.jsx(bn.h2,{id:o.titleId,...i,ref:r})},"DialogTitle")),Ay="DialogDescription",rf=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(Ay,n),{setDescriptionCount:a}=o;return Vs(()=>(a(s=>s+1),()=>a(s=>s-1)),[a]),y.jsx(bn.p,{id:o.descriptionId,...i,ref:r})},"DialogDescription")),_y="DialogClose",vy=J.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(_y,n);return y.jsx(bn.button,{type:"button",...i,ref:r,onClick:Lt(t.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function jo(e){return e?"open":"closed"}Mt(jo,"getState");const Sy=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Ao=Fe("box",Sy);const Ey=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],nf=Fe("brain",Ey);const xy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qr=Fe("check",xy);const Iy=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],vs=Fe("copy",Iy);const Ry=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],No=Fe("external-link",Ry);const Cy=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],My=Fe("eye-off",Cy);const Dy=[["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"}]],Py=Fe("eye",Dy);const Ty=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],of=Fe("globe",Ty);const ky=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Oy=Fe("grip-vertical",ky);const jy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],af=Fe("image",jy);const Ny=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sf=Fe("info",Ny);const Fy=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ss=Fe("key-round",Fy);const By=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Ly=Fe("log-out",By);const Uy=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],qy=Fe("pause",Uy);const Ky=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],lf=Fe("pencil",Ky);const zy=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Wy=Fe("play",zy);const Hy=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],Vy=Fe("plug-zap",Hy);const Qy=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wn=Fe("plus",Qy);const Gy=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],su=Fe("refresh-ccw",Gy);const Jy=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Es=Fe("rotate-cw",Jy);const Yy=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uf=Fe("search",Yy);const Xy=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Zy=Fe("settings-2",Xy);const $y=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],eg=Fe("square-terminal",$y);const tg=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Zs=Fe("trash-2",tg);const rg=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],ng=Fe("wallet",rg),Ii=cy,ig=fy,og=py,cf=J.forwardRef(({className:e,...t},r)=>y.jsx(Zd,{ref:r,className:Ke("fixed inset-0 z-50 bg-black/40","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));cf.displayName=Zd.displayName;const An=J.forwardRef(({className:e,children:t,variant:r="center",...n},i)=>y.jsxs(og,{children:[y.jsx(cf,{}),y.jsxs($d,{ref:i,className:Ke(r==="sheet-left"?"fixed inset-y-0 left-0 z-50 flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":r==="sheet-right"?"fixed inset-y-0 right-0 z-50 flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,y.jsxs(vy,{className:Ke("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",Pp),children:[y.jsx(Dp,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));An.displayName=$d.displayName;const Ri=({className:e,...t})=>y.jsx("div",{className:Ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ri.displayName="DialogHeader";const gi=({className:e,...t})=>y.jsx("div",{className:Ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gi.displayName="DialogFooter";const _n=J.forwardRef(({className:e,...t},r)=>y.jsx(tf,{ref:r,className:Ke("text-lg font-semibold leading-none tracking-tight",e),...t}));_n.displayName=tf.displayName;const ag=J.forwardRef(({className:e,...t},r)=>y.jsx(rf,{ref:r,className:Ke("text-sm text-muted-foreground",e),...t}));ag.displayName=rf.displayName;var sg=Object.defineProperty,Xe=(e,t)=>sg(e,"name",{value:t,configurable:!0}),[$s,GA]=Nd("Tooltip",[Gd]),el=Gd(),lg="TooltipProvider",ug=700,xs="tooltip.open",[cg,tl]=$s(lg),dg=Xe(e=>{const{__scopeTooltip:t,delayDuration:r=ug,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,a=J.useRef(!0),s=J.useRef(!1),u=J.useRef(0);return J.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),y.jsx(cg,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:J.useCallback(()=>{n<=0||(window.clearTimeout(u.current),a.current=!1)},[n]),onClose:J.useCallback(()=>{n<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,n))},[n]),isPointerInTransitRef:s,onPointerInTransitChange:J.useCallback(d=>{s.current=d},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),Is="Tooltip",[fg,Fo]=$s(Is),hg=Xe(e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,u=tl(Is,e.__scopeTooltip),d=el(t),[p,g]=J.useState(null),[v,I]=J.useState(void 0),C=yo(),_=J.useRef(0),w=a??u.disableHoverableContent,R=s??u.delayDuration,E=J.useRef(!1),[S,Q]=Qd({prop:n,defaultProp:i??!1,onChange:Xe(M=>{M?(u.onOpen(),document.dispatchEvent(new CustomEvent(xs))):u.onClose(),o?.(M)},"onChange"),caller:Is}),Y=J.useMemo(()=>S?E.current?"delayed-open":"instant-open":"closed",[S]),te=J.useCallback(()=>{window.clearTimeout(_.current),_.current=0,E.current=!1,Q(!0)},[Q]),G=J.useCallback(()=>{window.clearTimeout(_.current),_.current=0,Q(!1)},[Q]),q=J.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{E.current=!0,Q(!0),_.current=0},R)},[R,Q]);J.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const ce=v??C;return y.jsx(oy,{...d,children:y.jsx(fg,{scope:t,contentId:ce,setContentId:I,open:S,stateAttribute:Y,trigger:p,onTriggerChange:g,onTriggerEnter:J.useCallback(()=>{u.isOpenDelayedRef.current?q():te()},[u.isOpenDelayedRef,q,te]),onTriggerLeave:J.useCallback(()=>{w?G():(window.clearTimeout(_.current),_.current=0)},[G,w]),onOpen:te,onClose:G,disableHoverableContent:w,children:r})})},"Tooltip"),lu="TooltipTrigger",pg=J.forwardRef(Xe(function(t,r){const{__scopeTooltip:n,...i}=t,o=Fo(lu,n),a=tl(lu,n),s=el(n),u=J.useRef(null),d=xi(r,u,o.onTriggerChange),p=J.useRef(!1),g=J.useRef(!1),v=J.useCallback(()=>p.current=!1,[]);return J.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),y.jsx(ay,{asChild:!0,...s,children:y.jsx(bn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:d,onPointerMove:Lt(t.onPointerMove,I=>{I.pointerType!=="touch"&&!g.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Lt(t.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Lt(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Lt(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:Lt(t.onBlur,o.onClose),onClick:Lt(t.onClick,o.onClose)})})},"TooltipTrigger")),yg="TooltipPortal",[JA,gg]=$s(yg,{forceMount:void 0}),bi="TooltipContent",bg=J.forwardRef(Xe(function(t,r){const n=gg(bi,t.__scopeTooltip),{forceMount:i=n.forceMount,side:o="top",...a}=t,s=Fo(bi,t.__scopeTooltip);return y.jsx(Oo,{present:i||s.open,children:s.disableHoverableContent?y.jsx(df,{side:o,...a,ref:r}):y.jsx(mg,{side:o,...a,ref:r})})},"TooltipContent")),mg=J.forwardRef(Xe(function(t,r){const n=Fo(bi,t.__scopeTooltip),i=tl(bi,t.__scopeTooltip),o=J.useRef(null),a=xi(r,o),[s,u]=J.useState(null),{trigger:d,onClose:p}=n,g=o.current,{onPointerInTransitChange:v}=i,I=J.useCallback(()=>{u(null),v(!1)},[v]),C=J.useCallback((_,w)=>{const R=_.currentTarget,E={x:_.clientX,y:_.clientY},S=ff(E,R.getBoundingClientRect()),Q=hf(E,S),Y=pf(w.getBoundingClientRect()),te=gf([...Q,...Y]);u(te),v(!0)},[v]);return J.useEffect(()=>()=>I(),[I]),J.useEffect(()=>{if(d&&g){const _=Xe(R=>C(R,g),"handleTriggerLeave"),w=Xe(R=>C(R,d),"handleContentLeave");return d.addEventListener("pointerleave",_),g.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",_),g.removeEventListener("pointerleave",w)}}},[d,g,C,I]),J.useEffect(()=>{if(s){const _=Xe(w=>{const R=w.target,E={x:w.clientX,y:w.clientY},S=d?.contains(R)||g?.contains(R),Q=!yf(E,s);S?I():Q&&(I(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,g,s,p,I]),y.jsx(df,{...t,ref:a})},"TooltipContentHoverable")),wg=Tp("TooltipContent"),df=J.forwardRef(Xe(function(t,r){const{__scopeTooltip:n,children:i,"aria-label":o,id:a,onEscapeKeyDown:s,onPointerDownOutside:u,...d}=t,p=Fo(bi,n),g=el(n),{onClose:v}=p;J.useEffect(()=>(document.addEventListener(xs,v),()=>document.removeEventListener(xs,v)),[v]),J.useEffect(()=>{if(p.trigger){const C=Xe(_=>{_.target instanceof Node&&_.target.contains(p.trigger)&&v()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[p.trigger,v]);const{setContentId:I}=p;return Vs(()=>(I(a),()=>{I(void 0)}),[a,I]),y.jsx(Vd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:u,onFocusOutside:C=>C.preventDefault(),onDismiss:v,children:y.jsxs(ny,{"data-state":p.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:p.contentId,...g,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(wg,{children:i}),o?y.jsx(iy,{id:p.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl"));function ff(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Xe(ff,"getExitSideFromRect");function hf(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}Xe(hf,"getPaddedExitPoints");function pf(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}Xe(pf,"getPointsFromRect");function yf(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],u=t[a],d=s.x,p=s.y,g=u.x,v=u.y;p>n!=v>n&&r<(g-d)*(n-p)/(v-p)+d&&(i=!i)}return i}Xe(yf,"isPointInPolygon");function gf(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),bf(t)}Xe(gf,"getHull");function bf(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}Xe(bf,"getHullPresorted");var Ag=dg,_g=hg,vg=pg,mf=bg;const wf=Ag,Bo=_g,Lo=vg,Ci=J.forwardRef(({className:e,sideOffset:t=4,...r},n)=>y.jsx(mf,{ref:n,sideOffset:t,className:Ke("z-50 overflow-hidden rounded-md border border-border/50 bg-popover","px-2 py-1 text-xs text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ci.displayName=mf.displayName;function Sg(e){const t=Fd(e).type;return Array.isArray(t)&&t.includes(Qs.AccessControlResource)}async function Uo(e,t){if(!Oi(e))return{resourceAcl:null,fallbackAcl:null};try{const r=await Af(e,t);return r===null?{resourceAcl:null,fallbackAcl:await _f(e,t)}:{resourceAcl:r,fallbackAcl:null}}catch(r){if(r instanceof Rs)return{resourceAcl:null,fallbackAcl:null};throw r}}async function Af(e,t){if(!Oi(e))return null;try{const r=await Bd(e.internal_resourceInfo.aclUrl,t);if(Sg(r))throw new Rs(e,r);return Ld({...r,internal_accessTo:et(e)})}catch(r){if(r instanceof Rs)throw r;return null}}async function _f(e,t){const r=new URL(et(e)),n=r.pathname;if(n==="/")return null;const i=Eg(n),o=new URL(i,r.origin).href,a=await Gr(o,t);if(!Oi(a))return null;const s=await Af(a,t);return s===null?_f(a,t):s}function Eg(e){const t=e.substring(e.length-1)==="/"?e.substring(0,e.length-1):e;return`${e.substring(0,t.lastIndexOf("/"))}/`}function mr(e){return Js(e).filter(xg)}function xg(e){return ct(e,Do.type).includes(me.Authorization)}function rl(e,t){return e.filter(r=>Ig(r,t))}function Ig(e,t){return ct(e,me.accessTo).includes(t)}function qo(e,t){return e.filter(r=>Rg(r,t))}function Rg(e,t){return ct(e,me.default).includes(t)||ct(e,me.defaultForNew).includes(t)}function Mi(e){const t=ct(e,me.mode);return t.includes(Ut.write)?{read:t.includes(Ut.read),append:!0,write:!0,control:t.includes(Ut.control)}:{read:t.includes(Ut.read),append:t.includes(Ut.append),write:!1,control:t.includes(Ut.control)}}function Di(e){return e.reduce((t,r)=>t.write||r.write?{read:t.read||r.read,append:!0,write:!0,control:t.control||r.control}:{read:t.read||r.read,append:t.append||r.append,write:!1,control:t.control||r.control},{read:!1,append:!1,write:!1,control:!1})}function Cg(e){return mr(e).filter(Mg).reduce(kp,e)}function Mg(e){return Op(e.predicates,Et.namedNode(e.url),Et.defaultGraph()).some(t=>!Dg(t))?!1:ur(e,me.accessTo)===null&&ur(e,me.default)===null&&ur(e,me.defaultForNew)===null||ur(e,me.mode)===null||ur(e,me.agent)===null&&ur(e,me.agentGroup)===null&&ur(e,me.agentClass)===null}function Dg(e){const{predicate:t}=e,{object:r}=e;return!!(t.equals(Et.namedNode(Do.type))&&r.equals(Et.namedNode(me.Authorization))||t.equals(Et.namedNode(me.accessTo))||t.equals(Et.namedNode(me.default))||t.equals(Et.namedNode(me.defaultForNew))||t.equals(Et.namedNode(me.mode))&&Object.values(Ut).some(n=>r.equals(Et.namedNode(n)))||t.equals(Et.namedNode(me.agent))||t.equals(Et.namedNode(me.agentGroup))||t.equals(Et.namedNode(me.agentClass))||t.equals(Et.namedNode(me.origin)))}const Ut={read:"http://www.w3.org/ns/auth/acl#Read",append:"http://www.w3.org/ns/auth/acl#Append",write:"http://www.w3.org/ns/auth/acl#Write",control:"http://www.w3.org/ns/auth/acl#Control"};function Pg(e,t,r){return e.filter(n=>ct(n,r).includes(t))}function Tg(e,t){const r={};return e.forEach(n=>{const i=ct(n,t),o=Mi(n);i.forEach(a=>{r[a]=typeof r[a]>"u"?o:Di([r[a],o])})}),r}function vf(e){let t=mn();return t=Vr(t,Do.type,me.Authorization),e.read&&(t=tr(t,me.mode,Ut.read)),e.append&&!e.write&&(t=tr(t,me.mode,Ut.append)),e.write&&(t=tr(t,me.mode,Ut.write)),e.control&&(t=tr(t,me.mode,Ut.control)),t}function kg(e){let t=mn();t=Vr(t,Do.type,me.Authorization);function r(n,i,o){return ct(n,o).reduce((a,s)=>tr(a,o,s),i)}return t=r(e,t,me.accessTo),t=r(e,t,me.default),t=r(e,t,me.defaultForNew),t=r(e,t,me.agent),t=r(e,t,me.agentGroup),t=r(e,t,me.agentClass),t=r(e,t,me.origin),t=r(e,t,me.mode),t}function Pi(e,t){return Object.assign(Gs(e),{internal_acl:t})}const Og=[me.agent,me.agentClass,me.agentGroup,me.origin];function jg(e,t,r,n,i){if(!ct(e,r).includes(t)){const s=vf({read:!1,append:!1,write:!1,control:!1});return[e,s]}const o=As(e,r,t);let a=kg(e);return a=As(a,me.accessTo,n),a=Vr(a,r,t),Og.filter(s=>s!==r).forEach(s=>{a=wo(a,s)}),[o,a]}function Sf(e,t,r,n,i){let o=e;Js(e).forEach(u=>{const[d,p]=jg(u,i,r,e.internal_accessTo);o=di(o,d),o=di(o,p)});let a=vf(t);a=Vr(a,me.accessTo,e.internal_accessTo),a=Vr(a,r,i);const s=di(o,a);return Cg(s)}function Ef(e,t){return Pi(e,{resourceAcl:t,fallbackAcl:null})}function Ng(e){return e.internal_acl.resourceAcl}class Rs extends Error{constructor(t,r){super(`[${iu(t)}] is governed by Access Control Policies in [${iu(r)}] rather than by Web Access Control.`)}}function Ti(e){return e.internal_acl.resourceAcl!==null&&et(e)===e.internal_acl.resourceAcl.internal_accessTo&&e.internal_resourceInfo.aclUrl===et(e.internal_acl.resourceAcl)}function nl(e){return Ti(e)?e.internal_acl.resourceAcl:null}function ki(e){return e.internal_acl.fallbackAcl!==null}function Fg(e){return ki(e)?e.internal_acl.fallbackAcl:null}function Bg(e){return Ld({...jp(),internal_accessTo:et(e),internal_resourceInfo:{sourceIri:e.internal_resourceInfo.aclUrl,isRawData:!1,linkedResources:{}}})}function Lg(e){const t=Bg(e),r=mr(e.internal_acl.fallbackAcl);return qo(r,e.internal_acl.fallbackAcl.internal_accessTo).map(a=>(a=wo(a,me.default),a=wo(a,me.defaultForNew),a=Vr(a,me.accessTo,et(e)),a=Vr(a,me.default,et(e)),a)).reduce(di,t)}async function Ug(e,t,r){if(!Oi(e))throw new Error(`Could not determine the location of the ACL for the Resource at [${et(e)}]; possibly the current user does not have Control access to that Resource. Try calling \`hasAccessibleAcl()\` before calling \`saveAclFor()\`.`);return{...await Ud(e.internal_resourceInfo.aclUrl,t,r),internal_accessTo:et(e)}}function Oi(e){return typeof e.internal_resourceInfo.aclUrl=="string"}function xf(e,t){return Ti(e)?Kg(e.internal_acl.resourceAcl,t):ki(e)?Hg(e.internal_acl.fallbackAcl,t):null}function qg(e){if(Ti(e)){const t=nl(e);return zg(t)}if(ki(e)){const t=Fg(e);return Vg(t)}return null}function Kg(e,t){const r=mr(e),n=rl(r,e.internal_accessTo),o=If(n,t).map(Mi);return Di(o)}function zg(e){const t=mr(e),r=rl(t,e.internal_accessTo),n=Rf(r);return Cf(n)}function Wg(e,t,r){return Sf(e,r,me.agent,"resource",t)}function Hg(e,t){const r=mr(e),n=qo(r,e.internal_accessTo),o=If(n,t).map(Mi);return Di(o)}function Vg(e){const t=mr(e),r=qo(t,e.internal_accessTo),n=Rf(r);return Cf(n)}function If(e,t){return Pg(e,t,me.agent)}function Rf(e){return e.filter(Qg)}function Qg(e){return ur(e,me.agent)!==null}function Cf(e){return Tg(e,me.agent)}function Mf(e){return Ti(e)?Gg(e.internal_acl.resourceAcl):ki(e)?Jg(e.internal_acl.fallbackAcl):null}function Gg(e){const t=mr(e),r=rl(t,e.internal_accessTo),i=Df(r,Ys.Agent).map(Mi);return Di(i)}function Jg(e){const t=mr(e),r=qo(t,e.internal_accessTo),i=Df(r,Ys.Agent).map(Mi);return Di(i)}function Yg(e,t){return Sf(e,t,me.agentClass,"resource",Ys.Agent)}function Df(e,t){return e.filter(r=>Xg(r,t))}function Xg(e,t){return ct(e,me.agentClass).includes(t)}async function Pf(e,t){if(typeof e.internal_resourceInfo.aclUrl!="string")return null;try{return await Gr(e.internal_resourceInfo.aclUrl,t)}catch{return null}}const Dt="http://www.w3.org/ns/solid/acp#",qe={AccessControlResource:Dt.concat("AccessControlResource"),PublicAgent:Dt.concat("PublicAgent"),access:Dt.concat("access"),accessControl:Dt.concat("accessControl"),agent:Dt.concat("agent"),allOf:Dt.concat("allOf"),allow:Dt.concat("allow"),anyOf:Dt.concat("anyOf"),apply:Dt.concat("apply"),deny:Dt.concat("deny"),memberAccessControl:Dt.concat("memberAccessControl"),noneOf:Dt.concat("noneOf")},aa="http://www.w3.org/ns/auth/acl#",nn={Append:aa.concat("Append"),Read:aa.concat("Read"),Write:aa.concat("Write")};async function Tf(e,t){const r=bt(e),n=await Ud(et(r),r,t);return $g(e,n)}function Zg(e){return typeof e.internal_acp=="object"&&e.internal_acp!==null&&typeof e.internal_acp.acr=="object"&&e.internal_acp.acr!==null}function bt(e){if(!Zg(e))throw new Error(`An Access Control Resource for [${et(e)}] is not available. This could be because the current user is not allowed to see it, or because their Pod Server does not support Access Control Resources.`);return e.internal_acp.acr}function $g(e,t){return Object.assign(Gs(e),{internal_acp:{...e.internal_acp,acr:t}})}function kf(e){const t=bt(e),r=et(t);return Vt(t,r)}function Of(e){const t=kf(e);return t===null?[]:ct(t,qe.accessControl)}function jf(e,t,r){const n=bt(e);return Array.from(new Set(t.map(i=>{const o=Vt(n,i);return o!==null?ct(o,r):[]}).reduce((i,o)=>i.concat(o),[])))}function eb(e){return jf(e,Of(e),qe.apply)}function tb(e){return jf(e,Of(e),qe.access)}function Nf(e,t){const r=ct(e,t);return{read:r.includes(nn.Read),append:r.includes(nn.Append),write:r.includes(nn.Write),controlRead:!1,controlWrite:!1}}function rb(e){return Nf(e,qe.allow)}function nb(e){return Nf(e,qe.deny)}function uu(e,t,r){const n=Br(t,qe.allOf).map(d=>Vt(bt(e),d)).filter(d=>d!==null),i=n.every(d=>Br(d,qe.agent).includes(r)),o=Br(t,qe.anyOf).map(d=>Vt(bt(e),d)).filter(d=>d!==null),a=o.some(d=>Br(d,qe.agent).includes(r)),s=Br(t,qe.noneOf).map(d=>Vt(bt(e),d)).filter(d=>d!==null),u=s.some(d=>Br(d,qe.agent).includes(r));return n.length+o.length>0&&(n.length===0||i)&&(o.length===0||a)&&(s.length===0||!u)}function cu(e,t,r){const n=rb(e),i=nb(e);return r==="control"?{read:t.read,append:t.append,write:t.write,controlRead:(t.controlRead||n.read)&&!i.read,controlWrite:(t.controlWrite||n.write)&&!i.write}:{read:(t.read||n.read)&&!i.read,append:(t.append||n.append)&&!i.append,write:(t.write||n.write)&&!i.write,controlRead:t.controlRead,controlWrite:t.controlWrite}}async function Ko(e,t){let r={read:!1,append:!1,write:!1,controlRead:!1,controlWrite:!1};return eb(e).map(o=>Vt(bt(e),o)).filter(o=>o!==null).forEach(o=>{uu(e,o,t)&&(r=cu(o,r,"resource"))}),tb(e).map(o=>Vt(bt(e),o)).filter(o=>o!==null).forEach(o=>{uu(e,o,t)&&(r=cu(o,r,"control"))}),r}function Ff(e,t){var r,n,i,o;if(e.controlRead!==e.controlWrite)throw new Error("For Pods using Web Access Control, controlRead and controlWrite must be equal.");return{read:(r=e.read)!==null&&r!==void 0?r:t.read,append:(n=e.append)!==null&&n!==void 0?n:t.append,write:(i=e.write)!==null&&i!==void 0?i:t.write,control:(o=e.controlRead)!==null&&o!==void 0?o:t.control}}function il(e){return{read:e.read,write:e.write,append:e.append,controlRead:e.control,controlWrite:e.control}}async function ib(e,t,r,n){const i=await Uo(e,n),o=r(Pi(e,i),t);return o===null?null:il(o)}async function ob(e,t,r){const n=await Uo(e,r),i=t(Pi(e,n));return i===null?null:il(i)}async function ab(e,t,r){const n=await Uo(e,r),i=t(Pi(e,n));if(i===null)return null;const o={};for(const[a,s]of Object.entries(i))o[a]=il(s);return o}function Bf(e,t,r){return ib(e,t,xf,r)}function Lf(e,t){return ob(e,Mf,t)}function sb(e,t){return ab(e,qg,t)}async function Uf(e,t){if(!Oi(e))return null;const r=await Uo(e,t),n=Pi(e,r);let i;if(Ti(n))i=Ng(n);else if(ki(n))i=Lg(n);else return null;return Ef(n,i)}async function qf(e,t,r){let n=null;try{return n=await Ug(e,t,r),Ef(e,n)}catch{return null}}async function lb(e,t,r,n,i){const o=await Uf(e,i);if(o===null)return null;const a=nl(o),s=r(o),u=Ff(t,s),d=n(a,u);return qf(o,d,i)}async function ub(e,t,r,n,i,o){const a=await Uf(e,o);if(a===null)return null;const s=n(a,t),u=nl(a),d=Ff(r,s),p=i(u,t,d);return qf(a,p,o)}async function cb(e,t,r,n){return ub(e,t,r,xf,Wg,n)}async function db(e,t,r){return lb(e,t,Mf,Yg,r)}async function fb(e,t){const r=await Pf(e,t);if(r===null)return null;const n=Fd(r).type;return Array.isArray(n)&&n.includes(qe.AccessControlResource)?et(r):null}async function ji(e,t){const r=await fb(e,t);if(r===null)return null;let n;try{n=await Bd(r,t)}catch{return null}return{...e,internal_acp:{acr:{...n,accessTo:et(e)}}}}async function Kf(e,t,r){const n=await Gr(e,r),i=await ji(n,r);return i===null?Bf(n,t,r):Ko(i,t)}function hb(e){return Array.from(new Set(Js(bt(e)).map(t=>Br(t,qe.agent)).reduce((t,r)=>t.concat(r),[])))}async function pb(e){return(await Promise.all(hb(e).map(async t=>({[t]:await Ko(e,t)})))).reduce((t,r)=>({...t,...r}),{})}async function yb(e,t){const r=await Gr(e,t),n=await ji(r,t);return n===null?sb(r,t):pb(n)}async function gb(e){return Ko(e,qe.PublicAgent)}async function zf(e,t){const r=await Gr(e,t),n=await ji(r,t);return n===null?Lf(r,t):gb(n)}function Ni(e,t){return Object.assign(Gs(e),{internal_acp:{...e.internal_acp,acr:di(e.internal_acp.acr,t)}})}const fi="defaultAccessControl",_o="defaultAcrAccessControl";function ol(e,t){const r=bt(e);return et(r).concat("#").concat(t)}function al(e,t,r){return ol(e,t).concat("AgentMatcher").concat(r.charAt(0).toUpperCase()+r.slice(1)).concat("Policy")}function Wf(e,t){const r=bt(e),n=ol(e,t),i=Vt(r,n);return i===null||typeof i>"u"?mn({url:n}):i}function du(e){return e.includes("Member")?qe.memberAccessControl:qe.accessControl}function Hf(e,t){const r=ol(e,t),n=bt(e);let i=kf(e);return(i===null||typeof i>"u")&&(i=mn({url:et(n)})),ct(i,du(t)).includes(r)?e:(i=Po(i).addUrl(du(t),r).build(),Ni(e,i))}function bb(e,t){const r=Hf(e,_o),n=Wf(r,_o);return Ni(r,Po(n).addUrl(qe.access,t).build())}function mb(e,t){const r=Hf(e,fi),n=Wf(r,fi);return Ni(r,Po(n).addUrl(qe.apply,t).build())}function wb(e,t,r){const n=al(e,t,r);return n.includes("Acr")?bb(e,n):mb(e,n)}function Vf(e,t,r){return al(e,t,r).concat("Matcher")}function Ab(e,t,r){let n=wo(e,r);return(t.read||t.controlRead)&&(n=tr(n,r,nn.Read)),t.append&&(n=tr(n,r,nn.Append)),(t.write||t.controlWrite)&&(n=tr(n,r,nn.Write)),n}const fu=qe.anyOf;function _b(e,t,r){const n=al(e,t,r),i=Vf(e,t,r);let o=Vt(bt(e),n);return o||(e=wb(e,t,r),o=mn({url:n}),o=Ab(o,{[r]:!0},qe.allow)),ct(o,fu).includes(i)?e:(o=Po(o).addUrl(fu,i).build(),Ni(e,o))}function vb(e,t){return tr(e,Qs.agent,t)}function Sb(e,t){return As(e,Qs.agent,t)}function Ln(e,t,r,n,i){var o;const a=Vf(e,r,n),s=_b(e,r,n),u=(o=Vt(bt(s),a))!==null&&o!==void 0?o:mn({url:a});return Ni(s,i==="add"?vb(u,t):Sb(u,t))}async function Qf(e,t,r){const n=await Ko(e,t);return typeof r.read=="boolean"&&n.read!==r.read&&(e=Ln(e,t,fi,"read",r.read?"add":"remove")),typeof r.append=="boolean"&&n.append!==r.append&&(e=Ln(e,t,fi,"append",r.append?"add":"remove")),typeof r.write=="boolean"&&n.write!==r.write&&(e=Ln(e,t,fi,"write",r.write?"add":"remove")),typeof r.controlRead=="boolean"&&n.controlRead!==r.controlRead&&(e=Ln(e,t,_o,"controlRead",r.controlRead?"add":"remove")),typeof r.controlWrite=="boolean"&&n.controlWrite!==r.controlWrite&&(e=Ln(e,t,_o,"controlWrite",r.controlWrite?"add":"remove")),e}async function Eb(e,t,r,n){const i=await Gr(e,n),o=await ji(i,n);if(o===null)return await cb(i,t,r,n),Bf(i,t,n);try{return await Tf(await Qf(o,t,r),n),await Kf(e,t,n)}catch{return null}}async function xb(e,t){return Qf(e,qe.PublicAgent,t)}async function Ib(e,t,r){const n=await Gr(e,r),i=await ji(n,r);if(i===null)return await db(n,t,r),Lf(n,r);try{return await Tf(await xb(i,t),r),await zf(e,r)}catch{return null}}const Rb=Object.freeze(Object.defineProperty({__proto__:null,getAclServerResourceInfo:Pf,getAgentAccess:Kf,getAgentAccessAll:yb,getPublicAccess:zf,setAgentAccess:Eb,setPublicAccess:Ib},Symbol.toStringTag,{value:"Module"}));function Cb(e){if(!Gf(e))throw new Error("Applet layout descriptor must be an object");if(typeof e.type!="string")throw new Error("Applet layout descriptor type must be a string");switch(e.type){case"single-pane":case"two-pane":return hu(e.context),e;case"three-pane":return hu(e.context),e;default:throw new Error(`Unsupported applet layout type: ${e.type}`)}}function Gf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hu(e){if(e!==void 0){if(!Gf(e))throw new Error("Applet layout descriptor context must be an object");if("collapsible"in e&&typeof e.collapsible!="boolean")throw new Error("Applet layout descriptor context.collapsible must be a boolean");if("initiallyCollapsed"in e&&typeof e.initiallyCollapsed!="boolean")throw new Error("Applet layout descriptor context.initiallyCollapsed must be a boolean")}}function Mb(e){const t=e.access??Rb;return{inspectAgentAccess:r=>Db(r,e.fetch,t),ensureAgentAccess:async r=>{try{for(const n of r.resources){await Pb(n.url,n.mediaType,e.fetch);const i=await t.setAgentAccess(n.url,r.service.webId,kb(n.access),{fetch:e.fetch});if(!i||!Jf(i,n.access))return $t("permissionDenied",r,"Pod did not grant the requested service access.")}return $t("granted",r)}catch(n){return $t("permissionDenied",r,Cs(n))}},revokeAgentAccess:async r=>{try{for(const n of r.resources)if(!await t.setAgentAccess(n.url,r.service.webId,{read:!1,append:!1,write:!1,controlRead:!1,controlWrite:!1},{fetch:e.fetch}))return $t("permissionDenied",r,"Pod did not revoke the service access.");return $t("missing",r)}catch(n){return $t("permissionDenied",r,Cs(n))}}}}async function Db(e,t,r){try{for(const n of e.resources){const i=await r.getAgentAccess(n.url,e.service.webId,{fetch:t});if(!i||!Jf(i,n.access))return $t("missing",e)}return $t("granted",e)}catch(n){return $t("permissionDenied",e,Cs(n))}}async function Pb(e,t,r){const n=await r(e,{method:"HEAD"});if(n.ok)return;if(n.status!==404)throw new Error(`Unable to inspect Pod resource (${n.status}).`);await Tb(e,r);const i=await r(e,{method:"PUT",headers:{"content-type":t},body:`# Created by the Xpod applet permission broker.
2
+ `});if(!i.ok)throw new Error(`Unable to create Pod resource (${i.status}).`)}async function Tb(e,t){const r=new URL(e),n=[];let i=new URL("./",r);for(;i.pathname!=="/";){const o=await t(i.href,{method:"HEAD"});if(o.ok)break;if(o.status!==404)throw new Error(`Unable to inspect Pod container (${o.status}).`);n.push(i.href),i=new URL("../",i)}for(const o of n.reverse()){const a=await t(o,{method:"PUT",headers:{"content-type":"text/turtle",link:'<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'},body:""});if(!a.ok&&a.status!==409)throw new Error(`Unable to create Pod container (${a.status}).`)}}function kb(e){return{read:e.read===!0,append:e.append===!0,write:e.write===!0,controlRead:!1,controlWrite:!1}}function Jf(e,t){return(!t.read||e.read===!0)&&(!t.append||e.append===!0)&&(!t.write||e.write===!0)}function $t(e,t,r){return{status:e,resources:t.resources,...r?{message:r}:{}}}function Cs(e){return e instanceof Error?e.message:"Unable to update Pod service access."}const Ob=Cb;function jb(e,t){return Nb(e,t)}function Nb(e,t){const r=Fb(e),n=e.createController(t);return r.type==="single-pane"?{layout:"single-pane",controller:n,element:J.createElement(r.render,{controller:n,host:t})}:r.type==="two-pane"?{layout:"two-pane",controller:n,slots:{listHeader:J.createElement(r.slots.listHeader,{controller:n,host:t}),list:J.createElement(r.slots.list,{controller:n,host:t}),mainHeader:J.createElement(r.slots.mainHeader,{controller:n,host:t}),main:J.createElement(r.slots.main,{controller:n,host:t})}}:{layout:"three-pane",controller:n,contextConfig:r.contextConfig,slots:{listHeader:J.createElement(r.slots.listHeader,{controller:n,host:t}),list:J.createElement(r.slots.list,{controller:n,host:t}),mainHeader:J.createElement(r.slots.mainHeader,{controller:n,host:t}),main:J.createElement(r.slots.main,{controller:n,host:t}),context:J.createElement(r.slots.context,{controller:n,host:t})}}}function Fb(e){if("layout"in e){const t=Ub(e.layout),r=Ob(t.descriptor),n=r.type;if(e.manifest.layout!==n)throw new Error(`Applet manifest layout ${e.manifest.layout} does not match descriptor layout ${n}`);if(n==="single-pane"){if(!("render"in t))throw new Error("Applet descriptor single-pane render must be a function");return Kr(t.render,"Applet descriptor single-pane render"),{type:"single-pane",render:t.render}}if(!("slots"in t))throw new Error(`Applet descriptor declares ${n} but no slots were provided`);return n==="two-pane"?(Ms(t.slots,"Applet descriptor two-pane"),{type:"two-pane",slots:t.slots}):(Bb(t.slots,"Applet descriptor three-pane"),{type:"three-pane",contextConfig:r.context,slots:t.slots})}if(e.manifest.layout==="single-pane"){if(!("render"in e))throw new Error("Applet manifest declares single-pane but no single-pane renderer was provided");return Kr(e.render,"Applet single-pane render"),{type:"single-pane",render:e.render}}if(e.manifest.layout==="two-pane"&&"slots"in e)return Ms(e.slots,"Applet two-pane"),{type:"two-pane",slots:e.slots};throw new Error(`Applet manifest declares ${e.manifest.layout} but no supported applet layout was provided`)}function Ms(e,t){Lb(e,t),Kr(e.listHeader,`${t} slot listHeader`),Kr(e.list,`${t} slot list`),Kr(e.mainHeader,`${t} slot mainHeader`),Kr(e.main,`${t} slot main`)}function Bb(e,t){Ms(e,t),Kr(e.context,`${t} slot context`)}function Lb(e,t){if(typeof e!="object"||e===null)throw new Error(`${t} slots must be an object`)}function Kr(e,t){if(typeof e!="function")throw new Error(`${t} must be a function`)}function Ub(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error("Applet descriptor layout must be an object");if(!("descriptor"in e)||e.descriptor===void 0)throw new Error("Applet descriptor required");return e}const qb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAACXBIWXMAAB7CAAAewgFu0HU+AAA0PUlEQVR4nO2dZ1gUZ9fH/7O7swMEkCJSROyKmgQ1VuyKsaBRQJSIIUEFGyjmERVbjMaGHUVB0ViIEnkpRlGMEmMkiSjWCLF3rIiKtK3zfvCaDTEwO7tsQ+f3Jc9zueyc3Z3/3Oec+5xzE05OTjR4eHiqRGBsA3h4TBleIDw8LPAC4eFhgRcIDw8LvEB4eFjgBcLDwwIvEB4eFniB8PCwwAuEh4cFXiA8PCzwAuHhYYEXCA8PC7xAeHhY4AXCw8MCLxAeHhZ4gfDwsMALhIeHBV4gPDws8ALh4WGBFwgPDwu8QHh4WOAFwsPDAi8QHh4WeIHw8LDAC4SHhwVeIDw8LPAC4eFhgRcIDw8LvEB4eFgQGduAd5U2bdqgTp06EIlEsLGxQb169UCSJJydnfHq1SuUlZVBKpXiyZMnUCgUuHr1KoqKivDy5Utjm85TCV4gOsDMzAzNmzeHm5sbPDw80L59e7Rq1Qrm5uYQCoUQi8Vq3+PRo0coKytDXl4e7t+/j4yMDFy7dg2lpaUG+AQ81UHw54NoT/PmzdG7d294eXmhc+fOoChK9W8KhQJKpRIAVP+tCoIgAAAikQgCwT8eb3l5OW7cuIFffvkF586dw2+//YaKigo9fRKe6uAFogXe3t7o1q0bAgICQFEUBAIBZDIZqxA0RSAQgCRJAIBcLkdeX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ath%20d%3D%22M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z%22/%3E%3C/svg%3E",Gb={openai:qb,anthropic:Kb,kimi:zb,bailian:Hb,zhipu:Vb,ollama:Qb,deepseek:Wb},Jb={kimi:"#000000",ollama:"#FFFFFF"};function vo(e){return Gb[e]}function So(e){return Jb[e]}const at=[{id:"openai",name:"OpenAI",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"OpenAI 模型与编码能力",homeUrl:"https://openai.com",apiKeyUrl:"https://platform.openai.com/api-keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.openai.com/v1"},{id:"anthropic",name:"Anthropic",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"Claude 模型与编码能力",homeUrl:"https://www.anthropic.com",apiKeyUrl:"https://console.anthropic.com/settings/keys",apiKeyPlaceholder:"sk-ant-...",defaultBaseUrl:"https://api.anthropic.com"},{id:"kimi",name:"Kimi",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"Moonshot AI 模型服务",homeUrl:"https://www.moonshot.cn",apiKeyUrl:"https://platform.moonshot.cn/console/api-keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.moonshot.cn/v1"},{id:"bailian",name:"百炼",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"阿里云百炼模型服务",homeUrl:"https://www.aliyun.com/product/bailian",apiKeyUrl:"https://bailian.console.aliyun.com/#/api-key",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1"},{id:"deepseek",name:"DeepSeek",browserMode:"connectUnsupported",browserLabel:"不支持登录",description:"DeepSeek 模型服务",homeUrl:"https://www.deepseek.com",apiKeyUrl:"https://platform.deepseek.com/api_keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.deepseek.com/v1"},{id:"zhipu",name:"智谱 AI",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"智谱 AI / GLM 模型服务",homeUrl:"https://open.bigmodel.cn",apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys",apiKeyPlaceholder:"id.secret-...",defaultBaseUrl:"https://open.bigmodel.cn/api/paas/v4"},{id:"ollama",name:"Ollama",browserMode:"connectUnsupported",browserLabel:"本地服务",description:"本地 Ollama 模型服务",homeUrl:"https://ollama.com",defaultBaseUrl:"http://localhost:11434/v1"},{id:"custom",name:"Custom",browserMode:"browserAssistedApiKey",browserLabel:"配置",description:"OpenAI / Anthropic 兼容的自定义模型服务",homeUrl:"https://undefineds.co",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://example.com/v1"}],sl=[{id:"keys",label:"API Keys",title:"API KEYS"}];if(at.map(e=>e.id).join(",")!==Wd.join(","))throw new Error("AI Connection provider UI is out of sync with the client catalog");class pu extends Error{}function Yb(e){const t=e.solid.session.getSnapshot(),r=e.solid.pod,n=r?.status==="ready"?r:void 0,i=t.status==="authenticated"&&n!==void 0;let o=0,a,s;const u=new Set,d=()=>{const G=e.solid.session.getSnapshot();return i&&G.status==="authenticated"&&G.webId===t.webId},p=()=>{o+=1,s=void 0,a=void 0;for(const G of u)G.cancel()},g=()=>{const G=o;let q=!d(),ce=!1,M=()=>{};const D={assertCurrent(){if(q||G!==o||!d())throw new pu},dispose(){ce||(ce=!0,u.delete(D),M())},cancel(){q=!0,D.dispose()}};u.add(D);let z=!0;return M=e.solid.session.subscribe(x=>{(!z||x.status!=="authenticated"||x.webId!==t.webId)&&p()}),z=!1,ce&&M(),D},v=i?Zb(Xb(Hp({webId:t.webId,podBaseUrl:n.current.podUrl,authenticatedFetch:e.solid.session.fetch}),e.capabilities.aiClientCredentials),e.capabilities.aiConnectionsPodStore,g):null;let I="keys",C="openai",_,w="",R={},E={},S;const Q=new Set,Y=()=>Q.forEach(G=>G()),te={client:v,openExternal:e.navigation.openExternal,clientConfigurationBridge:e.capabilities.aiClientConfiguration,get selectedSection(){return I},get selectedProvider(){return C},get selectedCredentialId(){return _},get searchQuery(){return w},get providerStates(){return R},get providerSummaries(){return E},get providerLoadError(){return S},selectSection(G){I!==G&&(I=G,Y())},selectProvider(G,q){const ce=G==="custom"?q:void 0;I==="provider"&&C===G&&_===ce||(I="provider",C=G,_=ce,Y())},selectFirstUnconfiguredProvider(){const G=at.findIndex(M=>M.id===C),ce=(G<0?at:[...at.slice(G+1),...at.slice(0,G+1)]).find(M=>R[M.id]==="unconfigured"&&M.id!==C)??at.find(M=>R[M.id]==="unconfigured")??at[0];ce&&te.selectProvider(ce.id)},setSearchQuery(G){w!==G&&(w=G,Y())},setProviderState(G,q){if(R[G]===q)return;o+=1,R={...R,[G]:q};const ce=E[G]?void 0:am(G,q);ce&&(E={...E,[G]:ce}),Y()},cancelProviderLoads:p,async loadProviders(){if(!v)return;if(a)return a;const G={};s=G;const q=++o,ce=Promise.resolve().then(async()=>{if(s===G){S=void 0,Y();try{const M=await v.listProviders();if(q!==o||!d())return;E=Object.fromEntries(M.map(D=>[D.id,D])),R=Object.fromEntries(at.map(D=>[D.id,tm(E[D.id])])),Y()}catch(M){if(M instanceof pu||q!==o||!d())return;S=sm(M),Y()}finally{s===G&&(s=void 0,a=void 0)}}});return a=ce,ce},subscribe(G){return Q.add(G),()=>Q.delete(G)}};return te}function Xb(e,t){return{...e,async createGatewayKey(r){if(!t)throw new Error("当前账号登录状态不支持创建客户端凭据。");const n=await t.create({name:r.name,webId:e.webId});try{return await e.createGatewayKey({...r,apiKey:n.apiKey,credentialResource:n.resource})}catch(i){try{await t.revoke({clientId:lm(n.apiKey),resource:n.resource,webId:e.webId})}catch{throw new Error("API Key 未能保存到 Pod,且账号凭据撤销失败。该凭据尚未应用到客户端。")}throw i}},async deleteGatewayKey(r){const n=(await e.listGatewayKeys()).find(i=>i.id===r);if(n?.kind==="client-credentials"){if(!t||!n.clientCredentialId)throw new Error("当前账号登录状态无法撤销此客户端凭据,Key 记录已保留。");const o=(await t.list()).find(a=>a.clientId===n.clientCredentialId);if(!o)throw new Error("账号服务中已找不到该客户端凭据,请刷新后重试。");await t.revoke({clientId:o.clientId,resource:o.resource,webId:e.webId})}await e.deleteGatewayKey(r)}}}function Zb(e,t,r){const n=async()=>{const s=r();try{s.assertCurrent();const u=t?await t.listProviders():await e.listProviders();if(s.assertCurrent(),!t)return u;const d=e.listAuthorizationMethods?await e.listAuthorizationMethods():[];return s.assertCurrent(),im(u,d)}finally{s.dispose()}};if(!t)return{...e,listProviders:n};const i=new Map,o=t.readCredentialSecret&&t.updateOAuthCredential?(s,u)=>{const d=JSON.stringify([s,u]),p=i.get(d);if(p)return p;const g=(async()=>{const I=(await t.listProviders()).find(S=>S.id===s)?.credentials.find(S=>S.id===u);if(!I)throw new Error("oauth_credential_not_found");const C=await t.readCredentialSecret(s,u),_=typeof C.refreshToken=="string"?C.refreshToken:void 0;if(!_)throw new Error("oauth_refresh_token_required");const w=await e.refreshOAuthCredential(s,u,_,I.version,I.offeringId,C.authorizationMethodId==="browser-oauth"?"authorizationCodeOAuth":void 0);if(w.status!=="completed"||!w.oauthCredential)throw new Error("oauth_refresh_failed");await t.updateOAuthCredential(s,u,I.version,w.oauthCredential);const{oauthCredential:R,...E}=w;return E})().finally(()=>{i.delete(d)});return i.set(d,g),g}:e.refreshOAuthCredential,a=async(s,u,d=!1)=>{let p=!1,g=await t.readCredentialSecret(s,u.id);const v=typeof g.expiresAt=="string"?g.expiresAt:u.expiresAt;if((u.authMode==="oauth"||u.authMode==="deviceCode")&&(d||v&&Date.parse(v)<=Date.now()+6e4)){if(!t.updateOAuthCredential)throw new Error("oauth_refresh_unavailable");await o(s,u.id,"",u.version);const C=(await t.listProviders()).find(_=>_.id===s)?.credentials.find(_=>_.id===u.id);if(!C)throw new Error("oauth_credential_not_found");p=!0,u=C,g=await t.readCredentialSecret(s,u.id)}return{credential:u,secret:g,didRefresh:p}};return{...e,listProviders:n,listModels:t.listModels?async()=>t.listModels():e.listModels,createApiKeyCredential:t.createApiKeyCredential?async(s,u)=>t.createApiKeyCredential(s,u):e.createApiKeyCredential,createLocalCredential:t.createLocalCredential?async(s,u)=>u.authorizationMethodId==="local-session-import"||!u.authorizationMethodId&&u.offeringId==="official-subscription"?e.createLocalCredential(s,u):t.createLocalCredential(s,u):e.createLocalCredential,updateProviderCredential:t.updateProviderCredential?async(s,u,d)=>t.updateProviderCredential(s,u,d):e.updateProviderCredential,deleteProviderCredential:t.deleteProviderCredential?async(s,u)=>t.deleteProviderCredential(s,u):e.deleteProviderCredential,pollDevice:t.saveOAuthCredential?async(s,u)=>{const d=await e.pollDevice(s,u);if(d.status!=="completed"||!d.oauthCredential)return d;const p=await t.saveOAuthCredential(s,d.oauthCredential),{oauthCredential:g,...v}=d;return{...v,credentialId:p?.id??d.credentialId}}:e.pollDevice,refreshOAuthCredential:o,quota:t.readCredentialSecret?async(s,u=!1,d)=>{const g=(await t.listProviders()).find(w=>w.id===s)?.credentials??[],v=d?.credentialId??d?.credentialIri,I=v?g.find(w=>w.id===v):g.find(w=>w.enabled&&(!d?.offeringId||w.offeringId===d.offeringId));if(!I)throw new Error("quota_credential_not_found");const{secret:C}=await a(s,I),_=la(C,I.authMode);if(!_)throw new Error("credential_secret_unavailable");return e.quotaFromSecret(s,{credentialId:I.id,credentialIri:I.id,authMode:I.authMode==="deviceCode"||I.authMode==="oauth"?"deviceCodeOAuth":"apiKey",offeringId:I.offeringId,baseUrl:I.baseUrl,proxyUrl:I.proxyUrl,compatibility:I.compatibility,secret:_})}:e.quota,disconnect:async(s,u)=>!u||!t.deleteProviderCredential?e.disconnect(s,u):await t.deleteProviderCredential(s,u),testProviderCredential:t.readCredentialSecret?async(s,u)=>{let p=(await t.listProviders()).find(w=>w.id===s)?.credentials.find(w=>w.id===u.credentialId);if(!p)throw new Error("test_credential_not_found");const g=await a(s,p);p=g.credential;const{secret:v}=g,I=la(v,p.authMode);if(!I)throw new Error("test_secret_missing");let C;try{C=await e.discoverModels(s,{credentialId:p.id,offeringId:p.offeringId,authMode:p.authMode==="deviceCode"||p.authMode==="oauth"?"deviceCodeOAuth":p.authMode==="local"?"local":"apiKey",secret:I,baseUrl:p.baseUrl,proxyUrl:p.proxyUrl,compatibility:p.compatibility})}catch(w){throw await t.markCredentialHealth?.(s,p.id,"invalid",p.version).catch(()=>{}),w}const _=await t.markCredentialHealth?.(s,p.id,"healthy",p.version);return{ok:!0,credentialId:p.id,..._?{credential:_}:{},modelCount:C.models.length,observedAt:C.observedAt}}:e.testProviderCredential,discoverModels:t.readCredentialSecret?async(s,u)=>{const g=(await t.listProviders()).find(E=>E.id===s)?.credentials.filter(E=>E.enabled&&(!u?.offeringId||E.offeringId===u.offeringId)&&(!u?.credentialId||E.id===u.credentialId))??[];if(g.length===0)throw new Error("models_credential_not_found");const v=E=>JSON.stringify([s,E.offeringId,(E.baseUrl??"").trim().replace(/\/+$/u,""),u?.compatibility??E.compatibility??"auto",s==="custom"?E.id:void 0]),I=new Map;for(const E of[...g].sort((S,Q)=>S.priority-Q.priority)){const S=v(E),Q=I.get(S)??[];Q.push(E),I.set(S,Q)}const C=await Promise.allSettled([...I.values()].map(async E=>{let S;for(const Q of E)try{let Y=await a(s,Q);const te=()=>{const q=la(Y.secret,Q.authMode);if(!q)throw new Error("models_secret_missing");return e.discoverModels(s,{credentialId:Q.id,offeringId:Q.offeringId,authMode:Q.authMode==="deviceCode"||Q.authMode==="oauth"?"deviceCodeOAuth":Q.authMode==="local"?"local":"apiKey",secret:q,baseUrl:Q.baseUrl,proxyUrl:Q.proxyUrl,compatibility:u?.compatibility??Q.compatibility})};let G;try{G=await te()}catch(q){if(Y.didRefresh||!(q instanceof Vp)||q.code!=="provider_models_fetch_failed"||q.providerStatus!==401||Q.authMode!=="oauth"&&Q.authMode!=="deviceCode")throw q;Y=await a(s,Y.credential,!0),G=await te()}return{...G,credential:Q.id,credentialVersion:Y.credential.version,models:G.models.map(q=>({...q,offeringId:Q.offeringId,...s==="custom"?{credentialId:Q.id}:{}}))}}catch(Y){S=Y}throw S})),_=C.flatMap(E=>E.status==="fulfilled"?[E.value]:[]);if(_.length===0)throw C[0].reason;for(const E of _)await t.markCredentialHealth?.(s,E.credential,"healthy",E.credentialVersion);const w=E=>`${E.offeringId}\0${E.credentialId??""}\0${("resourceId"in E?E.resourceId:void 0)??E.id}`;if(t.saveDiscoveredModels)try{const E=new Set([...I.values()].flatMap((Q,Y)=>C[Y]?.status==="rejected"?[Q[0].offeringId]:[])),S=new Map;for(const Q of _){const Y=g.find(q=>q.id===Q.credential);if(s!=="custom"&&E.has(Y.offeringId))continue;const te=s==="custom"?Y.id:Y.offeringId,G=S.get(te)??{credential:Y.id,models:[]};G.models.push(...Q.models),S.set(te,G)}for(const Q of S.values())await t.saveDiscoveredModels(s,Q.credential,[...new Map(Q.models.map(Y=>[w(Y),Y])).values()])}catch{throw new Error("models_persistence_failed")}const R=[...new Map(_.flatMap(E=>E.models).map(E=>[w(E),E])).values()];return{..._[0],models:R,complete:_.length===I.size}}:e.discoverModels,saveModelSelection:t.saveModelSelection?async(s,u,d)=>t.saveModelSelection(s,u,d):e.saveModelSelection}}function ll(e){return J.useSyncExternalStore(e.subscribe,()=>e.selectedSection??"provider",()=>e.selectedSection??"provider")}function ul(e){return J.useSyncExternalStore(e.subscribe,()=>e.selectedProvider,()=>e.selectedProvider)}function Yf(e){return J.useSyncExternalStore(e.subscribe,()=>e.selectedCredentialId,()=>e.selectedCredentialId)}function Xf(e){return J.useSyncExternalStore(e.subscribe,()=>e.searchQuery,()=>e.searchQuery)}function $b(e){return J.useSyncExternalStore(e.subscribe,()=>e.providerStates,()=>e.providerStates)}function em(e){return J.useSyncExternalStore(e.subscribe,()=>gu(e.providerSummaries),()=>gu(e.providerSummaries))}function cl(e){return J.useSyncExternalStore(e.subscribe,()=>e.providerSummaries,()=>e.providerSummaries)}function Zf(e){return J.useSyncExternalStore(e.subscribe,()=>e.providerLoadError,()=>e.providerLoadError)}function tm(e){if(!e||e.status==="unconfigured"||e.status==="unavailable")return"unconfigured";if(e.status==="configured")return"configured";if(e.status==="attention")return"attention";const t=$f(e);return t?.authMode==="oauth"||t?.authMode==="deviceCode"?"connected":"configured"}const yu=new WeakMap;function gu(e){const t=yu.get(e);if(t)return t;const r=Object.fromEntries(Object.values(e).filter(eh).map(n=>[n.id,rm(n)]));return yu.set(e,r),r}function rm(e){const t=$f(e),r=e.status==="available"?"connected":e.status==="attention"?"reauthRequired":"disconnected",n=t?.authMode;return{provider:e.id,status:r,authMode:n==="oauth"||n==="deviceCode"?"deviceCodeOAuth":n?"browserAssistedApiKey":void 0,accountLabel:t?.label,expiresAt:t?.expiresAt,reauthRequired:r==="reauthRequired"?!0:void 0,credentialIri:t?.id,version:t?.version,connect:{modes:nm(e),configured:e.status!=="unavailable"}}}function nm(e){const t=[...e.offerings.flatMap(r=>r.authModes??[]),...e.credentials.map(r=>r.authMode)].map(r=>r==="oauth"||r==="deviceCode"?"deviceCodeOAuth":r==="apiKey"||r==="local"?"browserAssistedApiKey":void 0).filter(eh);return t.length>0?[...new Set(t)]:["browserAssistedApiKey"]}function $f(e){return e.credentials.find(t=>t.enabled)??e.credentials[0]}function im(e,t){if(t.length===0)return e;const r=new Map(t.map(n=>[`${n.provider}:${n.offeringId}`,n]));return e.map(n=>({...n,offerings:n.offerings.map(i=>{const o=r.get(`${n.id}:${i.id}`);if(!o)return i;const a=o.authorizationMethods;return{...i,...o.endpoints?{endpoints:o.endpoints}:{},...a.length?{authorizationMethods:a,authModes:om(i.authModes,a.map(s=>s.authMode))}:{}}})}))}function om(e,t){return Array.from(new Set([...e??[],...t]))}function am(e,t){if(t==="configured")return{id:e,name:sa(e),offerings:[],credentials:[bu(e,"apiKey")],selectedModels:[],status:"available"};if(t==="connected")return{id:e,name:sa(e),offerings:[],credentials:[bu(e,"deviceCode")],selectedModels:[],status:"available"};if(t!=="attention"&&t!=="loading")return{id:e,name:sa(e),offerings:[],credentials:[],selectedModels:[],status:"unconfigured"}}function bu(e,t){return{id:`${e}:current`,offeringId:t==="deviceCode"||t==="oauth"?"official-subscription":"api-platform",authMode:t,enabled:!0,priority:0,health:"healthy",version:0}}function sa(e){return at.find(t=>t.id===e)?.name??e}function la(e,t){if(t==="deviceCode"||t==="oauth"){const n=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken:void 0;return n?{type:"oauth",accessToken:n}:void 0}if(t==="local")return{type:"local"};const r=typeof e.apiKey=="string"&&e.apiKey.trim()?e.apiKey:void 0;return r?{type:"apiKey",apiKey:r}:void 0}function eh(e){return e!==void 0}function sm(e){return Hd(e)}function lm(e){const t=atob(e.replace(/^sk-/u,"")),r=t.indexOf(":");if(r<=0)throw new Error("客户端凭据格式无效。");return t.slice(0,r)}function um({controller:e}){const t=J.useContext(Jp),r=ll(e),n=ul(e),i=Yf(e),o=Xf(e).trim().toLocaleLowerCase(),a=$b(e),s=cl(e),u=Zf(e),d=at.reduce((_,w)=>{if(w.id!=="custom")return[..._,{...w}];const R=s.custom?.credentials??[];return[..._,...R.map(E=>({...w,name:E.label||w.name,credentialId:E.id}))]},[]),p=o?d.filter(_=>ua(_,s).toLocaleLowerCase().includes(o)):d,g=[...sl.map(_=>({kind:"section",id:_.id,label:_.label})),...p.map(_=>({kind:"provider",provider:_}))],v=J.useRef([]),I=g.findIndex(_=>_.kind==="section"?r===_.id:r==="provider"&&_.provider.id===n&&_.provider.credentialId===i),C=_=>{_.kind==="section"?e.selectSection(_.id):e.selectProvider(_.provider.id,_.provider.credentialId),t?.mode==="stack"&&t.openMain()};return y.jsxs("div",{role:"listbox","aria-label":"AI 服务","aria-orientation":"vertical",className:"py-2",children:[y.jsx("section",{className:"mb-3","aria-label":"API Keys",children:g.filter(_=>_.kind==="section").map(_=>{const w=g.indexOf(_);return y.jsxs(mu,{index:w,selected:r===_.id,tabbable:I===w||I<0&&w===0,label:_.label,optionRefs:v,onActivate:()=>C(_),onMove:R=>wu(g,R,e,v),children:[y.jsx(cm,{section:_.id}),y.jsx("span",{className:Ke("min-w-0 flex-1 truncate text-sm font-medium",r===_.id?"text-foreground":"text-foreground/80"),children:_.label})]},_.id)})}),y.jsxs("section",{children:[y.jsx("h2",{className:"px-5 py-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Provider"}),p.map(_=>{const w=g.findIndex(S=>S.kind==="provider"&&S.provider.id===_.id&&S.provider.credentialId===_.credentialId),R=r==="provider"&&n===_.id&&_.credentialId===i,E=a[_.id]??"loading";return y.jsxs(mu,{index:w,selected:R,tabbable:R||I<0&&w===0,label:ua(_,s),describedBy:`ai-connections-provider-${_.id}-${_.credentialId??"default"}-status`,optionRefs:v,onActivate:()=>C({kind:"provider",provider:_}),onMove:S=>wu(g,S,e,v),children:[y.jsxs(To,{className:"h-9 w-9 shrink-0 rounded-md border border-border/20",style:So(_.id)?{backgroundColor:So(_.id)}:void 0,children:[y.jsx(qd,{src:vo(_.id),className:"object-cover"}),y.jsx(ko,{className:"rounded-md bg-muted text-[10px] font-bold uppercase text-muted-foreground",children:fm(_.id)})]}),y.jsx("span",{className:Ke("min-w-0 flex-1 truncate text-sm font-medium",R?"text-foreground":"text-foreground/80"),children:ua(_,s)}),y.jsx(dm,{state:E,statusId:`ai-connections-provider-${_.id}-${_.credentialId??"default"}-status`})]},`${_.id}:${_.credentialId??"default"}`)}),p.length===0?y.jsx("p",{className:"p-8 text-center text-xs text-muted-foreground",children:"无结果"}):null]}),u?y.jsxs("p",{className:"px-4 py-2 text-xs text-destructive",children:["Provider 状态读取失败:",u]}):null]})}function mu({index:e,selected:t,tabbable:r,label:n,describedBy:i,statusId:o,optionRefs:a,onActivate:s,onMove:u,children:d}){const p=g=>{if(g.key==="ArrowDown")u(e+1);else if(g.key==="ArrowUp")u(e-1);else if(g.key==="Home")u(0);else if(g.key==="End")u(Number.POSITIVE_INFINITY);else if(g.key==="Enter"||g.key===" "){g.preventDefault(),s();return}else return;g.preventDefault()};return y.jsx("button",{ref:g=>{a.current[e]=g},type:"button",role:"option","aria-selected":t,"aria-label":n,"aria-describedby":i??o,tabIndex:r?0:-1,onClick:s,onKeyDown:p,className:Ke("group flex w-full items-center gap-3 border-l-[3px] border-transparent px-4 py-3 text-left transition-colors",t?"border-l-primary bg-accent/80":"hover:bg-muted/40"),children:d})}function wu(e,t,r,n){const i=Math.min(Math.max(t,0),e.length-1),o=e[i];o&&(o.kind==="section"?r.selectSection(o.id):r.selectProvider(o.provider.id,o.provider.credentialId),n.current[i]?.focus())}function cm({section:e}){return y.jsx(To,{className:"h-9 w-9 shrink-0 rounded-md border border-border/20 bg-muted",children:y.jsx(ko,{className:"rounded-md bg-muted text-[10px] font-bold uppercase text-muted-foreground",children:"XP"})})}function dm({state:e,statusId:t}){const r=e==="configured"||e==="connected";return y.jsxs("span",{id:t,role:"status","aria-live":"polite",className:"flex shrink-0 items-center gap-1.5",children:[r?y.jsx("span",{className:"h-2 w-2 rounded-full bg-primary","aria-hidden":"true"}):null,y.jsx("span",{className:"text-[11px] font-normal text-muted-foreground",children:hm(e)})]})}function fm(e){switch(e){case"openai":return"OA";case"anthropic":return"A";case"kimi":return"K";case"bailian":return"百";case"deepseek":return"DS";case"zhipu":return"智";case"ollama":return"O";case"custom":return"C"}}function ua(e,t){return e.name||t[e.id]?.name||e.id}function hm(e){switch(e){case"unconfigured":return"未设置";case"configured":return"已配置";case"connected":return"已连接";case"attention":return"需处理";default:return"读取中"}}function on(e){if(e.authorizationMethods?.length)return e.authorizationMethods;const t=e.lifecycle==="unavailable"?"unavailable":"active";return[...new Set(e.authModes??[])].map(r=>{if(r==="apiKey")return{id:"api-key",authMode:"apiKey",connectMode:"browserAssistedApiKey",label:"API Key",lifecycle:t};if(r==="local"){const n=e.kind==="local";return{id:n?"local-service":"local-session-import",authMode:"local",label:n?"本地服务":"已有登录态",lifecycle:t}}return{id:"device-code",authMode:r,connectMode:"deviceCodeOAuth",label:"",lifecycle:t}})}function zo(e){if(e.connectMode)return e.connectMode;if(e.authMode==="oauth"||e.authMode==="deviceCode")return"deviceCodeOAuth";if(e.authMode==="apiKey")return"browserAssistedApiKey"}function zr(e){return e==="deviceCodeOAuth"||e==="authorizationCodeOAuth"}function Ds(e){return zr(zo(e))}function th(e){return e.authMode==="apiKey"||zo(e)==="browserAssistedApiKey"}function Ps(e){return e.authMode==="local"}function pm(e,t){const r=e.authModes??[];return r.some(n=>n==="oauth"||n==="deviceCode")?"deviceCodeOAuth":r.some(n=>n==="apiKey"||n==="local")||t.browserMode==="connectUnsupported"?"browserAssistedApiKey":t.browserMode}function bo(e){return e?.status==="pending"||e?.status==="authorization_pending"||e?.status==="slow_down"}const rh={"oauth-subscription":"Subscription","api-platform":"API Platform","token-plan":"Token Plan",local:"Local"};function $e(e){const t=e.label?.trim();if(t)return t;const r=e.kind?rh[e.kind]:void 0;return r||(e.authModes?.some(n=>n==="apiKey")?"API Key":e.authModes?.some(n=>n==="oauth"||n==="deviceCode")?"Account":e.id)}function ym(e){return rh[e]??e}function gm(e,t){const r=(t?.length?t:on(e)).map(n=>n.authMode==="apiKey"?"API Key":n.authMode==="local"?n.label:"账号授权");return[...new Set(r)].join(" / ")}function bm(e){return e.length===0?10:Math.max(...e.map(t=>t.priority))+10}function an(e){return e.label?.trim()?e.label:e.maskedHint?`API Key · ${e.maskedHint}`:e.authMode==="oauth"||e.authMode==="deviceCode"?"已授权账号":"API Key"}function Au(e){const t=e.indexOf("@");if(t>0){const r=e.slice(0,t);return`${r.length>6?`${r.slice(0,3)}***${r.slice(-2)}`:r.length>1?`${r[0]}***${r[r.length-1]}`:`${r[0]}***`}${e.slice(t)}`}return e}function mm(e){return e==="healthy"?"有效":e==="unknown"?"未验证":e==="expired"?"已过期":"错误"}function wm(e){return e==="healthy"?{row:"border-emerald-500/40 bg-emerald-500/5",dot:"bg-emerald-500"}:e==="unknown"?{row:"border-border/50 bg-background",dot:"bg-muted-foreground/50"}:{row:"border-destructive/40 bg-destructive/5",dot:"bg-destructive"}}function Am({providerName:e,offeringName:t,quota:r,busy:n,disabled:i=!1,credentialLabel:o,multiple:a=!1,compact:s=!1,paused:u=!1,error:d,onRefresh:p}){if(s){const g=!n&&!d&&r?.status==="available";return y.jsx("div",{className:`min-w-0 text-xs text-muted-foreground ${u?"opacity-60":""}`,children:y.jsxs("div",{className:"flex items-start gap-1",children:[y.jsxs("div",{className:"min-w-0 flex-1 truncate py-1 [&>span+span]:ml-3",children:[u?y.jsx("span",{children:"已停用 · 不参与全部刷新"}):null,n?y.jsx("span",{role:"status",children:"正在查询额度…"}):d?y.jsx("span",{role:"alert",title:d,className:"text-destructive",children:d}):r?r.status==="unsupported"?y.jsx("span",{children:"官方额度接口不支持"}):r.status==="error"?y.jsx("span",{role:"alert",className:"text-destructive",children:"额度查询失败"}):y.jsx(_u,{quota:r}):y.jsx("span",{children:o?"尚未检查":`连接${t}后可查询`}),g&&r.stale?y.jsx("span",{children:"数据可能已过期"}):null]}),y.jsx(_m,{quota:r,label:o??t}),y.jsx(_e,{className:"h-6 w-6 shrink-0 p-0",variant:"ghost",size:"sm","aria-label":`刷新 ${e} ${t}${o?` ${o}`:""}额度`,disabled:n||i,onClick:p,children:n?y.jsx(kt,{"aria-hidden":"true",className:"h-3 w-3 animate-spin"}):y.jsx(su,{"aria-hidden":"true",className:"h-3 w-3"})})]})})}return y.jsxs("div",{className:`${a?"space-y-1.5":"space-y-3"} border-t border-border/40 pt-3 ${u?"opacity-60":""}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a?null:y.jsx(ng,{className:"h-4 w-4 shrink-0 text-primary"}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"break-all text-sm font-medium text-foreground/90",children:a?`凭证:${o}`:"剩余额度"}),a&&!n&&!d&&r?.status==="available"?y.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:y.jsx(_u,{quota:r})}):null]})]}),y.jsxs(_e,{className:"shrink-0",variant:"ghost",size:"sm","aria-label":`刷新 ${e} ${t}${a?` ${o}`:""}额度`,disabled:n||i,onClick:p,children:[n?y.jsx(kt,{"aria-hidden":"true",className:"mr-2 h-3.5 w-3.5 animate-spin"}):y.jsx(su,{"aria-hidden":"true",className:"mr-2 h-3.5 w-3.5"}),n?"查询中":"刷新"]})]}),o&&!a?y.jsxs("p",{className:"text-xs text-muted-foreground",children:["凭证:",o]}):null,u?y.jsx("p",{className:"text-xs text-muted-foreground",children:"已停用 · 不参与全部刷新"}):null,n?y.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"正在查询额度…"}):d?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:d}):r?r.status==="unsupported"?y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"text-sm",children:"官方额度接口不支持"}),y.jsxs("p",{className:"text-xs text-muted-foreground",children:["来源:",r.source]})]}):r.status==="error"?y.jsx("p",{className:"text-sm text-destructive",children:"额度查询失败"}):a?y.jsxs("details",{className:"text-xs text-muted-foreground",children:[y.jsx("summary",{className:"cursor-pointer","aria-label":`${o}额度详情`,children:"详情"}),y.jsx("div",{className:"pt-3",children:y.jsx(Ts,{quota:r,hideBalance:!0})})]}):y.jsx(Ts,{quota:r}):y.jsx("p",{className:"text-xs text-muted-foreground",children:o?"尚未检查":`连接${t}后可查询`})]})}function _m({quota:e,label:t}){const[r,n]=J.useState({left:16,top:16,maxHeight:400}),[i,o]=J.useState(!1),a=J.useRef(null),s=J.useRef(null),u=J.useRef(!1);return J.useEffect(()=>{if(!i)return;const d=g=>{!(g.target instanceof Node)||a.current?.contains(g.target)||s.current?.contains(g.target)||(u.current=!0,o(!1))},p=g=>{g.type==="scroll"&&g.target instanceof Node&&s.current?.contains(g.target)||(u.current=!0,o(!1))};return document.addEventListener("pointerdown",d,!0),document.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("pointerdown",d,!0),document.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[i]),y.jsxs(Ii,{modal:!1,open:i,onOpenChange:d=>{u.current=!1,o(d)},children:[y.jsx(ig,{asChild:!0,children:y.jsx(_e,{ref:a,className:"h-6 w-6 shrink-0 p-0",variant:"ghost",size:"sm","aria-label":`${t}额度详情`,disabled:!e||e.status==="error",onClick:d=>{const p=d.currentTarget.getBoundingClientRect(),g=Math.min(320,window.innerWidth-32),v=Math.max(16,Math.min(p.right-g,window.innerWidth-g-16)),I=Math.max(16,Math.min(p.bottom+8,window.innerHeight-320));n({left:v,top:I,maxHeight:window.innerHeight-I-16})},children:y.jsx(sf,{"aria-hidden":"true",className:"h-3 w-3"})})}),y.jsxs(An,{ref:s,className:"w-[calc(100vw-2rem)] max-w-xs overflow-y-auto p-4",onEscapeKeyDown:()=>a.current?.focus(),onCloseAutoFocus:d=>{u.current&&d.preventDefault()},style:{...r,transform:"none",animation:"none"},"aria-describedby":void 0,children:[y.jsx(_n,{className:"pr-8 text-sm",children:"额度详情"}),e?.status==="available"?y.jsx(Ts,{quota:e}):e?y.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["来源:",e.source]}):null]})]})}function _u({quota:e}){return y.jsxs(y.Fragment,{children:[typeof e.balance=="number"?y.jsxs("span",{children:["余额:",e.balance]}):null,e.windows.map((t,r)=>y.jsxs("span",{children:[ks(t.name)," · ",nh(t)]},r)),typeof e.balance!="number"&&e.windows.length===0?y.jsx("span",{children:"服务商未返回额度数据"}):null]})}function Ts({quota:e,hideBalance:t=!1}){return y.jsxs("div",{className:"space-y-3 text-sm",children:[!t&&typeof e.balance=="number"?y.jsxs("div",{children:["余额:",e.balance]}):null,e.windows.map((r,n)=>y.jsxs("div",{className:"space-y-1.5",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("span",{className:"font-medium text-foreground",children:ks(r.name)}),y.jsx("span",{className:"text-muted-foreground",children:nh(r)})]}),ii(r)!==void 0?y.jsx("div",{"aria-label":`${ks(r.name)}剩余 ${String(ii(r))}%`,className:"h-1.5 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ii(r),children:y.jsx("div",{className:"h-full rounded-full bg-primary",style:{width:`${String(ii(r))}%`}})}):null,r.resetsAt?y.jsxs("p",{className:"text-xs text-muted-foreground",children:["重置:",vu(r.resetsAt)]}):null]},`${String(r.name)}-${n}`)),y.jsxs("p",{className:"text-xs text-muted-foreground",children:["更新:",vu(e.observedAt)]}),y.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["来源:",e.source,e.stale?" · 数据可能已过期":""]})]})}function ks(e){switch(e){case"five-hour":return"5 小时限制";case"weekly":return"周限制";case"monthly":return"月限制";case"weekly-opus":return"Opus 周限制";case"weekly-sonnet":return"Sonnet 周限制";case"available_balance":return"可用余额";case"voucher_balance":return"赠送余额";case"cash_balance":return"现金余额";default:return typeof e=="string"&&e?e:"额度"}}function ii(e){if(!(typeof e.remaining!="number"||typeof e.limit!="number"||e.limit<=0))return Math.max(0,Math.min(100,Math.round(e.remaining/e.limit*1e4)/100))}function nh(e){const t=ii(e);if(t!==void 0)return`剩余 ${String(t)}%`;if(typeof e.remaining=="number"){const r=typeof e.currency=="string"?` ${e.currency}`:"";return`剩余 ${String(e.remaining)}${r}`}return"官方数据可用"}function vu(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function vm({methods:e,offering:t,hasCredentials:r,busy:n,disabled:i,onBeginOffering:o,onCreateLocalCredential:a}){return e.length===0?null:y.jsx("div",{className:"space-y-2",children:y.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(s=>{const u=zo(s);return zr(u)?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:n||i||!o,onClick:()=>o?.(t,u,s),children:[n?y.jsx(kt,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(No,{className:"h-3.5 w-3.5"}),s.label||(r?"添加账号":"登录")]},s.id):Ps(s)?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",title:"导入当前设备已有登录态,不会发起新的浏览器授权。",disabled:n||i||!a,onClick:()=>{a?.(t,s)},children:[n?y.jsx(kt,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(wn,{className:"h-3.5 w-3.5"}),s.label||"已有登录态"]},s.id):null})})})}function Sm(e){const t=e.modelDiscovery?.endpointProtocol;return e.endpoints?.find(r=>r.protocol===t)?.baseUrl??e.endpoints?.[0]?.baseUrl}function Em(e){try{const t=new URL(e);return`${t.host}${t.pathname.replace(/\/$/u,"")}`}catch{return e}}function xm(e){return e==="responses"?"Responses API":e==="chatCompletions"?"Chat API":e==="anthropic"?"Anthropic API":e}function Im({definition:e,offering:t,createOfferings:r,status:n,credentials:i,attempt:o,apiKey:a,baseUrl:s,busy:u,disabled:d,error:p,onApiKeyChange:g,onBaseUrlChange:v,onBeginApiKey:I,onBeginBrowser:C,onSaveApiKey:_,onDisconnect:w,onCreateApiKeyCredential:R,onUpdateCredential:E,initialEditing:S,initialCreate:Q=!1,onSavingChange:Y,onCloseEdit:te}){const G=o?.mode==="browserAssistedApiKey"&&o.status==="pending",q=n==="configured",ce=n==="connected",M=!!R,[D,z]=J.useState(t.id),x=r.find(m=>m.id===D)??t,[Z,re]=J.useState(!1),[ie,he]=J.useState(S?"edit":Q&&R?"create":void 0),[F,oe]=J.useState(S),[b,T]=J.useState(S?.label??""),[$,O]=J.useState(""),[ae,ue]=J.useState(S?.baseUrl??""),[le,se]=J.useState(S?.proxyUrl??""),[k,U]=J.useState(),[ne,de]=J.useState(!1),[V,l]=J.useState(!1),f=J.useRef(!1),A=J.useRef(!1);J.useEffect(()=>{Q&&!R&&!A.current&&(A.current=!0,I())},[Q,R,I]);const j=()=>{z(t.id),he("create"),oe(void 0),T(""),O(""),ue(""),se(""),U(void 0),de(!1)},B=()=>{te(),he(void 0),oe(void 0),T(""),O(""),ue(""),se(""),U(void 0),de(!1)},K=async()=>{if(u||d||f.current)return;let m;try{m=Qp(le)}catch{U("Proxy URL 格式无效(支持 http、https)");return}if(U(void 0),ie==="create"){const L=$.trim();if(!L||!R)return;f.current=!0,l(!0),Y?.(!0);try{await R(x,{apiKey:L,label:b.trim()||void 0,baseUrl:ae.trim()||void 0,proxyUrl:m,priority:bm(i.filter(X=>X.offeringId===x.id))}),B()}catch(X){U(X instanceof Error?X.message:"保存失败,请重试")}finally{f.current=!1,l(!1),Y?.(!1)}return}if(ie==="edit"&&F&&E){const L=le.trim()!==(F.proxyUrl??"").trim();f.current=!0,l(!0),Y?.(!0);try{await E(F,{label:b.trim()||void 0,baseUrl:ae.trim()||void 0,...L?{proxyUrl:m}:{}}),B()}catch(X){U(X instanceof Error?X.message:"保存失败,请重试")}finally{f.current=!1,l(!1),Y?.(!1)}}};return y.jsxs("div",{className:Ke("space-y-3",ie&&"w-full"),children:[o?.userCode?y.jsxs("div",{className:"border-l-2 border-primary bg-muted/30 px-3 py-2 text-sm",children:["验证码:",y.jsx("strong",{className:"font-mono",children:o.userCode})]}):null,!Q&&!S?y.jsxs("div",{className:"flex flex-wrap gap-2",children:[R&&r.length>0?y.jsxs(_e,{variant:"outline",size:"sm",disabled:u||d||V,onClick:j,children:[y.jsx(wn,{className:"mr-2 h-4 w-4"}),"添加 API Key"]}):null,M?null:ce?y.jsxs(y.Fragment,{children:[y.jsxs(_e,{variant:"outline",size:"sm",disabled:u||d||V,onClick:C,children:[u?y.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}):y.jsx(Es,{className:"mr-2 h-4 w-4"}),"重新连接"]}),y.jsxs(_e,{variant:"ghost",size:"sm",disabled:u||d||V,onClick:w,children:[y.jsx(Ly,{className:"mr-2 h-4 w-4"}),"断开连接"]})]}):q?y.jsxs(y.Fragment,{children:[y.jsxs(_e,{variant:"outline",size:"sm","aria-label":"更新 API Key",disabled:u||d||V,onClick:I,children:[y.jsx(Ss,{className:"mr-2 h-4 w-4"}),"更新 API Key"]}),y.jsx(_e,{variant:"ghost",size:"sm",disabled:u||d||V,onClick:w,children:"移除配置"})]}):y.jsxs(y.Fragment,{children:[y.jsxs(_e,{variant:"outline",size:"sm",disabled:u||d||V||e.browserMode==="connectUnsupported",onClick:C,children:[u?y.jsx(kt,{className:"mr-2 h-4 w-4 animate-spin"}):y.jsx(No,{className:"mr-2 h-4 w-4"}),e.browserLabel]}),y.jsxs(_e,{variant:"outline",size:"sm","aria-label":`${e.name} API Key`,disabled:u||d||V,onClick:I,children:[y.jsx(Ss,{className:"mr-2 h-4 w-4"}),"配置 API Key"]})]})]}):null,ie?y.jsxs("div",{className:"space-y-2 rounded-lg border border-border/50 bg-muted/10 p-3",children:[ie==="create"&&r.length>1?y.jsxs("label",{className:"block space-y-1 text-xs text-muted-foreground",children:[y.jsx("span",{children:"套餐 / 区域"}),y.jsx("select",{"aria-label":`${e.name} 套餐 / 区域`,value:D,disabled:u||d||V,onChange:m=>{z(m.target.value),U(void 0)},className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:r.map(m=>y.jsx("option",{value:m.id,children:$e(m)},m.id))})]}):null,ie==="edit"?y.jsx(st,{disabled:u||d||V,autoComplete:"off","aria-label":`${e.name} API Key 标签`,placeholder:"名称,例如 Work key",value:b,onChange:m=>T(m.target.value)}):null,ie==="create"?y.jsx(st,{disabled:u||d||V,type:Z?"text":"password",autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} API Key 输入`,placeholder:e.apiKeyPlaceholder||"从官方控制台复制 API Key",value:$,onChange:m=>O(m.target.value),className:"font-mono"}):null,ie==="edit"||ne?y.jsxs(y.Fragment,{children:[y.jsx(st,{disabled:u||d||V,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Base URL 输入`,placeholder:Sm(ie==="edit"?t:x)||e.defaultBaseUrl||"默认服务地址",value:ae,onChange:m=>ue(m.target.value),className:"font-mono text-xs"}),y.jsx(st,{disabled:u||d||V,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Proxy URL 输入`,placeholder:"http://127.0.0.1:7890",value:le,onChange:m=>se(m.target.value),className:"font-mono text-xs"})]}):null,k?y.jsx("p",{className:"text-xs text-destructive",children:k}):null,y.jsxs("div",{className:"flex flex-wrap gap-2",children:[y.jsx(_e,{size:"sm","aria-label":ie==="create"?`保存 ${e.name} API Key`:"保存凭证",disabled:u||d||V||ie==="create"&&!$.trim(),onClick:K,children:ie==="create"?"保存 API Key":"保存凭证"}),y.jsx(_e,{variant:"ghost",size:"sm",disabled:V,onClick:B,children:"取消"}),ie==="create"?y.jsx(_e,{variant:"ghost",size:"sm",disabled:V,onClick:()=>de(m=>!m),children:ne?"收起高级设置":"高级设置"}):null]})]}):null,G&&!ie?y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-sm font-medium",children:"API Key"}),e.apiKeyUrl?y.jsx("a",{href:e.apiKeyUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-primary hover:underline",children:"获取 API Key"}):null]}),y.jsxs("div",{className:"group relative",children:[y.jsx(st,{disabled:u||d||V,type:Z?"text":"password",autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} API Key 输入`,placeholder:e.apiKeyPlaceholder||"从官方控制台复制 API Key",value:a,onChange:m=>g(m.target.value),className:"border-border/60 bg-muted/20 pr-10 font-mono transition-colors focus:border-primary/50 focus:bg-background"}),y.jsx("div",{className:"absolute bottom-1 right-1 top-1 flex items-center",children:y.jsx(_e,{variant:"ghost",size:"icon",className:"h-full w-8 rounded hover:bg-muted",onClick:()=>re(m=>!m),"aria-label":Z?"隐藏 API Key":"显示 API Key",children:Z?y.jsx(My,{className:"h-4 w-4 text-muted-foreground"}):y.jsx(Py,{className:"h-4 w-4 text-muted-foreground"})})})]}),v?y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Base URL(选填)"}),y.jsx(st,{disabled:u||d||V,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Base URL 输入`,placeholder:e.defaultBaseUrl||"默认服务地址",value:s,onChange:m=>v(m.target.value),className:"border-border/60 bg-muted/20 font-mono text-xs transition-colors focus:border-primary/50 focus:bg-background"}),y.jsxs("p",{className:"break-all font-mono text-[11px] text-muted-foreground opacity-80",children:[y.jsx("span",{className:"mr-1 select-none opacity-50",children:"预览:"}),(s.trim()||e.defaultBaseUrl||"").replace(/\/+$/,""),"/chat/completions"]})]}):null,y.jsx(_e,{size:"sm","aria-label":`保存 ${e.name} API Key`,disabled:!a.trim()||u||d,onClick:_,children:"保存 API Key"})]}):null,p?y.jsx("p",{className:"text-sm text-destructive",children:p}):null]})}function Rm({controller:e,definition:t,offerings:r,apiOfferings:n,credentials:i,status:o,attempt:a,attemptOfferingId:s,apiKey:u,baseUrl:d="",busy:p,disabled:g=!1,error:v,onApiKeyChange:I,onBaseUrlChange:C,onBeginApiKey:_,onBeginBrowser:w,onSaveApiKey:R,onDisconnect:E,onUpdateCredential:S,onCreateApiKeyCredential:Q,onBeginOffering:Y,onCancelConnect:te,onDismissError:G}){const{editing:q,authorizationOfferingId:ce,error:M,saving:D}=e,z=q||ce?r.filter(x=>x.id===(q?.offeringId??ce)):n;return y.jsx(Ii,{open:e.open,onOpenChange:x=>{x||D||(a&&bo(a)&&zr(a.mode)&&te?.({mode:a.mode,attemptId:a.attemptId,state:a.state,signature:a.signature,...a.offeringId?{offeringId:a.offeringId}:{}}),e.close())},children:y.jsxs(An,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg","aria-describedby":void 0,children:[y.jsx(Ri,{children:y.jsx(_n,{children:e.title})}),y.jsx("div",{className:"space-y-5","aria-label":"添加连接",children:z.map(x=>{const Z=bo(a)&&zr(a?.mode)&&(s??a?.offeringId)!==x.id,re=g||D||Z,ie=on(x),he=ie.filter(ue=>ue.lifecycle==="active"),F=he.some(th),oe=s===x.id?a:void 0,b=v?.offeringId===x.id?v.authorization:void 0,T=ie.find(ue=>ue.id===(b?.authorizationMethodId??oe?.authorizationMethodId))??he.find(Ds),$=b?.mode??oe?.mode??(T?zo(T):pm(x,t)),O=v?.offeringId===x.id?v.message:void 0;if(x.lifecycle==="unavailable"&&he.length===0)return y.jsxs("fieldset",{"data-create-offering":x.id,className:"space-y-2 border-t border-border/50 pt-3 first:border-t-0 first:pt-0",children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(x)}),y.jsx("p",{className:"text-xs text-muted-foreground",children:x.kind==="oauth-subscription"?"暂不可用:账号订阅需在 Xpod 桌面版中导入本机客户端(如 Codex CLI)的登录态,浏览器中无法完成。":"暂不可用:该接入方式尚未提供可用的连接流程。"})]},x.id);const ae=b?.mode;return O&&zr(ae)?y.jsxs("fieldset",{"data-create-offering":x.id,disabled:re,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(x)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(x)}),oe?.status==="unsupported"?y.jsx("p",{className:"text-sm",children:"当前部署未启用账号授权"}):y.jsx(Np,{title:"登录未完成",description:O,primaryLabel:"重试登录",onPrimary:()=>Y?.(x,ae,T),secondaryLabel:"关闭",onSecondary:()=>{G?.(),e.close()}})]},x.id):bo(oe)&&zr($)?y.jsxs("fieldset",{"data-create-offering":x.id,disabled:re,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(x)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(x)}),y.jsx(ou,{title:"正在连接",detail:$==="authorizationCodeOAuth"?"等待网页授权,请在打开的页面完成登录。":oe?.userCode?`验证码:${oe.userCode}`:"请在打开的页面完成授权。",providerLabel:T?.label??$e(x),providerHost:t.name}),y.jsx(_e,{variant:"ghost",size:"sm",disabled:g,onClick:()=>{oe&&te?.({mode:oe.mode,attemptId:oe.attemptId,state:oe.state,signature:oe.signature,...oe.offeringId?{offeringId:oe.offeringId}:{}}),e.close()},children:"取消连接"})]},x.id):y.jsxs("fieldset",{"data-create-offering":x.id,disabled:re,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(x)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(x)}),F?y.jsx(Im,{definition:t,offering:x,status:o,createOfferings:[x],initialCreate:!q,credentials:i,initialEditing:q?.offeringId===x.id?q:void 0,onCloseEdit:e.close,onSavingChange:e.setSaving,attempt:oe??(a?.mode==="browserAssistedApiKey"?a:void 0),apiKey:u,baseUrl:d,busy:p,disabled:re,onApiKeyChange:I,onBaseUrlChange:C,onBeginApiKey:_,onBeginBrowser:w,onSaveApiKey:R,onDisconnect:E,onUpdateCredential:S,onCreateApiKeyCredential:Q},`${x.id}:${q?.id??""}`):null,ce&&!O?y.jsx(ou,{title:"正在连接",detail:"正在启动授权,请稍候。",providerLabel:$e(x),providerHost:t.name}):null,O?y.jsx("p",{className:"w-full text-sm text-destructive",children:O}):null]},x.id)})}),M?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:M}):null]})})}function Cm({credential:e,label:t,busy:r,disabled:n,dragHandle:i,kindLabel:o,quota:a,onToggle:s,onTest:u,onEdit:d,onDelete:p,deleteAriaLabel:g}){const v=n||r,I=wm(e.health),C=`${e.enabled?"已启用":"已停用"} · ${mm(e.health)}`;return y.jsxs("div",{"data-credential-state":e.enabled?"enabled":"disabled",className:Ke("flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border px-3 py-2.5 transition-colors",e.enabled?I.row:"border-border/50 bg-muted/40 opacity-70"),children:[i,y.jsxs(Bo,{children:[y.jsx(Lo,{asChild:!0,children:y.jsx("span",{"aria-label":C,className:Ke("h-2 w-2 shrink-0 rounded-full",e.enabled?I.dot:"bg-muted-foreground/40")})}),y.jsx(Ci,{className:"text-xs",children:C})]}),y.jsxs("div",{className:"min-w-0 flex-1 basis-24",children:[y.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t}),o?y.jsx("p",{className:"text-xs text-muted-foreground",children:o}):null,e.maskedHint&&!t.includes(e.maskedHint)?y.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:e.maskedHint}):null]}),y.jsx("div",{className:"order-last w-full min-w-0 sm:order-none sm:w-auto sm:max-w-[45%]",role:"group","aria-label":`${an(e)}额度`,children:a}),y.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u?y.jsx(Xi,{label:`测试连接 ${t}`,disabled:v,onClick:()=>u(e),children:y.jsx(Vy,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,d?y.jsx(Xi,{label:`编辑 ${t}`,disabled:v,onClick:d,children:y.jsx(lf,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,s?y.jsx(Xi,{label:`${e.enabled?"停用":"启用"} ${t}`,disabled:v,onClick:()=>s(e,{enabled:!e.enabled}),children:e.enabled?y.jsx(qy,{"aria-hidden":"true",className:"h-3.5 w-3.5"}):y.jsx(Wy,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,p?y.jsx(Xi,{label:g??`删除 ${t}`,disabled:v,onClick:p,children:y.jsx(Zs,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null]})]})}function Xi({label:e,disabled:t,onClick:r,children:n}){return y.jsxs(Bo,{children:[y.jsx(Lo,{asChild:!0,children:y.jsx(_e,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":e,disabled:t,onClick:r,children:n})}),y.jsx(Ci,{className:"text-xs",children:e})]})}function Mm({offering:e,methods:t}){const r=e.endpoints??[],n=$e(e),i=e.kind?ym(e.kind):void 0,o=i&&i!==n?[i]:[];return y.jsxs("section",{className:"space-y-2","aria-labelledby":`offering-${e.id}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("h4",{id:`offering-${e.id}`,className:"text-sm font-medium text-foreground",children:n}),o.length?y.jsx("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:o.map(a=>y.jsx("span",{children:a},a))}):null]}),y.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-3 gap-y-1 text-xs",children:[y.jsx("span",{className:"text-muted-foreground",children:gm(e,t)}),e.consoleUrl?y.jsx(Zi,{href:e.consoleUrl,label:"控制台"}):null,e.subscriptionUrl?y.jsx(Zi,{href:e.subscriptionUrl,label:"订阅与账单"}):null,e.quota?.url?y.jsx(Zi,{href:e.quota.url,label:"额度与用量"}):null,e.usagePolicyUrl?y.jsx(Zi,{href:e.usagePolicyUrl,label:"使用政策"}):null]})]}),e.lifecycle==="unavailable"&&!on(e).some(a=>a.lifecycle==="active")?y.jsx("p",{className:"text-xs text-muted-foreground",children:e.kind==="oauth-subscription"?"暂不可用:账号订阅需在 Xpod 桌面版中导入本机客户端(如 Codex CLI)的登录态,浏览器中无法完成。":"暂不可用:该接入方式尚未提供可用的连接流程。"}):null,r.length?y.jsx("dl",{className:"space-y-1 text-[11px] text-muted-foreground",children:r.map(a=>y.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[y.jsx("dt",{className:"shrink-0 text-foreground/70",children:xm(a.protocol)}),y.jsx("dd",{className:"min-w-0 truncate font-mono",title:a.baseUrl,children:Em(a.baseUrl)})]},`${a.protocol}:${a.baseUrl}`))}):null]})}function Zi({href:e,label:t}){return y.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:t})}function Dm({credentials:e,disabled:t,onMove:r,children:n}){const i=J.useRef(null),o=J.useRef(null),a=J.useRef(void 0),s=J.useRef(void 0),u=J.useRef(null),d=J.useRef(void 0),p=J.useRef(t),[g,v]=J.useState(""),I=t||!r||e.length<2,C=e.map(te=>te.id).join("\0"),_=()=>Array.from(i.current?.querySelectorAll("[data-sortable-credential]")??[]),w=()=>{a.current!==void 0&&cancelAnimationFrame(a.current),s.current!==void 0&&clearTimeout(s.current),a.current=void 0,s.current=void 0;for(const te of _()){for(const G of["transform","transition","zIndex","position","boxShadow","willChange","backgroundColor"])te.style[G]="";delete te.dataset.dragging}},R=()=>{const te=u.current;if(!te)return;u.current=null,w();const G=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,q=_();for(const ce of q){const M=te.get(ce.dataset.sortableCredential);if(!M||G)continue;const D=ce.getBoundingClientRect();ce.style.transition="none",ce.style.transform=`translateY(${M.top-D.top}px)`}i.current?.getBoundingClientRect(),a.current=requestAnimationFrame(()=>{a.current=void 0;for(const ce of q)ce.style.transition=G?"none":"transform 160ms ease-out, box-shadow 160ms ease-out",ce.style.transform="translateY(0px)";s.current=setTimeout(w,G?0:180)})},E=te=>{const G=o.current;if(G){if(a.current!==void 0&&cancelAnimationFrame(a.current),u.current=new Map(G.rows.map(q=>[q.dataset.sortableCredential,q.getBoundingClientRect()])),d.current=C,te&&G.from!==G.to&&!I){const q=G.rects[G.from],ce=G.rects[G.to],M=Math.max(0,G.rects[1].top-G.rects[0].bottom),D=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;G.rows.forEach((z,x)=>{const Z=x===G.from?G.from<G.to?ce.bottom-q.bottom:ce.top-q.top:G.from<x&&x<=G.to?-(q.height+M):G.to<=x&&x<G.from?q.height+M:0;z.style.transition=D?"none":"transform 160ms ease-out",z.style.transform=`translateY(${Z}px)`;const re=G.rects[x];u.current.set(z.dataset.sortableCredential,{...re,top:re.top+Z,bottom:re.bottom+Z})})}o.current=null,G.handle.hasPointerCapture?.(G.pointerId)&&G.handle.releasePointerCapture?.(G.pointerId),te&&!I&&e[G.from]?.id===G.id&&S(G.from,G.to),a.current=requestAnimationFrame(()=>{a.current=void 0,(!te||!p.current)&&R()}),s.current=setTimeout(R,1e4)}},S=(te,G)=>{I||te===G||G<0||G>=e.length||(r?.(te,G),v(`已请求将${an(e[te])}移至第 ${G+1} 位`))},Q=J.useRef({finish:E,settle:R,clearMotion:w});J.useLayoutEffect(()=>{Q.current={finish:E,settle:R,clearMotion:w},p.current=t}),J.useLayoutEffect(()=>{o.current&&Q.current.finish(!1),u.current&&(d.current!==C||!t)&&Q.current.settle()},[C,I,t]),J.useEffect(()=>()=>{const te=o.current;o.current=null,u.current=null,te?.handle.hasPointerCapture?.(te.pointerId)&&te.handle.releasePointerCapture?.(te.pointerId),Q.current.clearMotion()},[]);const Y=()=>{a.current=void 0;const te=o.current;if(!te)return;const G=te.rects[te.from],q=te.rects.length>1?Math.max(0,te.rects[1].top-te.rects[0].bottom):0;te.rows.forEach((ce,M)=>{const D=M===te.from?te.y-te.startY:te.from<M&&M<=te.to?-(G.height+q):te.to<=M&&M<te.from?G.height+q:0;ce.style.transform=`translateY(${D}px)`})};return y.jsxs("div",{ref:i,className:"space-y-2",children:[y.jsx("span",{className:"sr-only",role:"status",children:g}),e.map((te,G)=>y.jsx("div",{"data-sortable-credential":te.id,className:"rounded-lg",children:n(te,r?y.jsx("button",{type:"button",disabled:I,"aria-label":`拖动排序 ${an(te)}`,title:e.length<2?"至少添加两条连接后可拖动排序":"拖动调整优先级,或使用方向键、Home / End 排序",className:"flex h-8 w-6 shrink-0 touch-none select-none items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-40 enabled:cursor-grab active:cursor-grabbing",onKeyDown:q=>{if(q.key==="Escape"){E(!1);return}const ce=q.key==="ArrowUp"?G-1:q.key==="ArrowDown"?G+1:q.key==="Home"?0:q.key==="End"?e.length-1:void 0;ce!==void 0&&(q.preventDefault(),S(G,ce))},onPointerDown:q=>{if(I||q.button!==0||o.current)return;q.preventDefault(),u.current=null,w(),q.currentTarget.focus(),q.currentTarget.setPointerCapture?.(q.pointerId);const ce=_(),M=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;o.current={id:te.id,from:G,to:G,pointerId:q.pointerId,startY:q.clientY,y:q.clientY,handle:q.currentTarget,rows:ce,rects:ce.map(D=>D.getBoundingClientRect())};for(const[D,z]of ce.entries())z.style.willChange="transform",z.style.transition=M||D===G?"none":"transform 160ms ease-out",D===G&&(z.dataset.dragging="true",z.style.position="relative",z.style.zIndex="10",z.style.boxShadow="0 8px 24px rgb(0 0 0 / 0.18)",z.style.backgroundColor="hsl(var(--card))")},onPointerMove:q=>{const ce=o.current;if(!ce||ce.pointerId!==q.pointerId||I)return;ce.y=q.clientY;let M=1/0;ce.rects.forEach((D,z)=>{const x=Math.abs(q.clientY-(D.top+D.bottom)/2);x<M&&(M=x,ce.to=z)}),a.current===void 0&&(a.current=requestAnimationFrame(Y))},onPointerUp:q=>{o.current?.pointerId===q.pointerId&&E(!0)},onPointerCancel:q=>{o.current?.pointerId===q.pointerId&&E(!1)},onLostPointerCapture:q=>{o.current?.pointerId===q.pointerId&&E(!1)},children:y.jsx(Oy,{"aria-hidden":"true",className:"h-4 w-4"})}):null)},te.id))]})}function Pm({attempt:e,onDismissError:t,onBeginOffering:r,onBeginBrowser:n,onCreateLocalCredential:i}){const[o,a]=J.useState(!1),[s,u]=J.useState(),[d,p]=J.useState(),[g,v]=J.useState(),[I,C]=J.useState(!1),_=o||!!s||!!d,w=J.useCallback(()=>{a(!1),p(void 0),u(void 0),v(void 0)},[]),R=J.useRef(e);J.useEffect(()=>{const q=R.current;R.current=e,_&&e!==q&&e?.status==="completed"&&w()},[e,_,w]);const E=J.useCallback(()=>{v(void 0),t?.()},[t]),S=J.useCallback(()=>{E(),a(!0)},[E]),Q=J.useCallback(()=>{E(),n()},[E,n]),Y=J.useCallback((q,ce,M)=>{E(),p(q.id),r?.(q,ce,M)},[E,r]),te=J.useCallback(async(q,ce)=>{if(i){E(),C(!0);try{await i(q,ce)}catch(M){v(M instanceof Error?M.message:"连接失败,请重试")}finally{C(!1)}}},[E,i]),G=J.useCallback(q=>{u(q)},[]);return{open:_,title:s?"编辑连接":d?"连接账号":"新建连接",...s?{editing:s}:{},...d?{authorizationOfferingId:d}:{},...g?{error:g}:{},saving:I,beginApiKey:S,beginEdit:G,beginAuthorization:Y,beginBrowser:Q,beginLocal:te,setSaving:C,close:w}}function Tm({definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s="",busy:u,disabled:d=!1,error:p,suppressError:g=!1,quotas:v={},onApiKeyChange:I,onBaseUrlChange:C,onBeginApiKey:_,onBeginOffering:w,onCancelConnect:R,onBeginBrowser:E,onSaveApiKey:S,onDisconnect:Q,onCreateApiKeyCredential:Y,onCreateLocalCredential:te,onUpdateCredential:G,onDeleteCredential:q,onTestCredential:ce,onReorderCredentials:M,onRefreshQuota:D,onDismissError:z}){const x=[{id:"api-platform",label:"API Key",kind:"api-platform",authModes:["apiKey"]}],Z=t?.credentials??[],re=t?.offerings.length?t.offerings:x,ie=re.filter(T=>on(T).some($=>$.lifecycle==="active"&&th($))),he=bo(i)&&zr(i?.mode),F=[...Z].sort((T,$)=>T.priority-$.priority),oe=Z.some(T=>v[T.id]?.busy),b=Pm({attempt:i,onDismissError:z,onBeginOffering:w,onBeginBrowser:E,onCreateLocalCredential:te});return y.jsx(wf,{children:y.jsxs("section",{className:"space-y-3","aria-label":"当前连接",children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[y.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium text-foreground/90",children:[y.jsx(Zy,{className:"h-4 w-4 text-primary"}),"当前连接"]}),y.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[Z.length>1?y.jsx(_e,{variant:"ghost",size:"sm","aria-label":`刷新全部 ${e.name}额度`,disabled:d||oe||!Z.some(T=>T.enabled)||!D,onClick:()=>re.forEach(T=>D?.(T)),children:oe?"查询中":"刷新全部额度"}):null,re.map(T=>{const $=on(T).filter(O=>O.lifecycle==="active"&&(Ds(O)||Ps(O)));return $.length?y.jsx("div",{role:"group","aria-label":`${$e(T)}快捷接入`,children:y.jsx(vm,{methods:$,offering:T,hasCredentials:Z.some(O=>O.offeringId===T.id),busy:u||b.saving,disabled:d||he,onBeginOffering:w?b.beginAuthorization:void 0,onCreateLocalCredential:te?b.beginLocal:void 0})},T.id):null}),ie.length>0&&!re.some(T=>on(T).some($=>$.lifecycle==="active"&&(Ds($)||Ps($))))&&e.browserMode==="browserAssistedApiKey"?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs","aria-label":`${e.name} 登录`,disabled:u||b.saving||d||he,onClick:b.beginBrowser,children:[y.jsx(No,{className:"h-3.5 w-3.5"}),e.browserLabel]}):null,ie.length>0?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs","aria-label":"新建 API Key 连接",disabled:u||b.saving||d||he||!t&&r==="pending"&&!i,onClick:b.beginApiKey,children:[y.jsx(wn,{className:"h-3.5 w-3.5"}),"API Key"]}):null]})]}),y.jsxs("div",{"aria-label":"凭据列表",className:"space-y-2",children:[y.jsx(Dm,{credentials:F,disabled:u||d,onMove:M?(T,$)=>{const O=re.find(ae=>ae.id===F[T]?.offeringId);O&&M(O,F,T,$)}:void 0,children:(T,$)=>{const O=re.find(se=>se.id===T.offeringId);if(!O)return null;const ae=T.authMode==="apiKey"?an(T):T.label?Au(T.label):an(T),ue=v[T.id],le=ue?.credentialId===T.id?ue:void 0;return y.jsx(Cm,{credential:T,label:ae,dragHandle:$,kindLabel:T.authMode==="apiKey"?"API Key":$e(O),busy:u,disabled:d,onToggle:G,onTest:ce,onEdit:T.authMode==="apiKey"?()=>b.beginEdit(T):void 0,onDelete:()=>T.authMode==="apiKey"?q?.(T):Q(T),deleteAriaLabel:T.authMode==="apiKey"?`删除 ${ae}`:`${ae} 移除`,quota:y.jsx(Am,{compact:!0,providerName:e.name,offeringName:$e(O),credentialLabel:an(T),multiple:Z.length>1,quota:le?.quota,busy:le?.busy??!1,error:le?.error,paused:!T.enabled,disabled:d||!D,onRefresh:()=>D?.(O,T)})})}}),Z.length?null:y.jsx("p",{className:"py-2 text-xs text-muted-foreground",children:n?Au(n):"尚未添加连接"}),Z.length===0&&(r==="configured"||r==="connected")?y.jsx(_e,{variant:"ghost",size:"sm",disabled:u||d,onClick:()=>Q(),children:r==="configured"?"移除配置":"断开连接"}):null]}),y.jsx(Rm,{controller:b,definition:e,offerings:re,apiOfferings:ie,credentials:Z,status:r,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s,busy:u,disabled:d,error:p,onApiKeyChange:I,onBaseUrlChange:C,onBeginApiKey:_,onBeginBrowser:E,onSaveApiKey:S,onDisconnect:Q,onUpdateCredential:G,onCreateApiKeyCredential:Y,onBeginOffering:w,onCancelConnect:R,onDismissError:z}),y.jsxs("details",{className:"text-xs text-muted-foreground",children:[y.jsx("summary",{className:"w-fit cursor-pointer",children:"接入信息"}),y.jsx("div",{className:"mt-2 space-y-3",children:re.map(T=>y.jsx(Mm,{offering:T},T.id))})]}),b.error&&!b.open&&b.error!==p?.message?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b.error}):null,p&&(p.offeringId?!b.open:!g)?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:p.message}):null]})})}function km({definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s="",busy:u,disabled:d=!1,error:p,quotas:g,models:v,verifyPending:I=!1,onApiKeyChange:C,onBaseUrlChange:_,onBeginApiKey:w,onBeginOffering:R,onCancelConnect:E,onBeginBrowser:S,onSaveApiKey:Q,onDisconnect:Y,onCreateApiKeyCredential:te,onCreateLocalCredential:G,onUpdateCredential:q,onDeleteCredential:ce,onTestCredential:M,onReorderCredentials:D,onRefreshQuota:z,onVerify:x,onAddModel:Z,onEditModel:re,onDeleteModel:ie,selectedModelIds:he,modelSelectionStatus:F,onModelSelectionChange:oe,onDismissError:b}){const T=r==="configured",$=r==="connected",O=v.length===0&&p?.message&&!p.offeringId?p.message:void 0,[ae,ue]=J.useState(""),[le,se]=J.useState(),[k,U]=J.useState(he??[]),ne=he??k,de=J.useMemo(()=>Nm(v),[v]),V=fe=>fe.selectionIds.some(we=>ne.includes(we)),l=J.useMemo(()=>{const fe=ae.trim().toLocaleLowerCase();return fe?de.filter(we=>we.searchText.includes(fe)):de},[de,ae]),f=l.filter(fe=>fe.availability!=="unavailable"),A=f.filter(V).length,j=f.length>0&&A===f.length,B=A>0&&!j,K=de.filter(V).length,m=de.filter(fe=>fe.availability==="unavailable").length,L=async fe=>{try{await navigator.clipboard.writeText(fe),se(fe),setTimeout(()=>se(we=>we===fe?void 0:we),1500)}catch{se(void 0)}},X=fe=>{const we=new Set(ne),pe=V(fe);for(const Ae of pe?fe.selectionIds:fe.availableSelectionIds)pe?we.delete(Ae):we.add(Ae);const ve=[...we];he===void 0&&U(ve),oe?.(e.id,ve)},H=()=>{const fe=new Set(ne);for(const pe of f)for(const ve of j?pe.selectionIds:pe.availableSelectionIds)j?fe.delete(ve):fe.add(ve);const we=[...fe];he===void 0&&U(we),oe?.(e.id,we)};return y.jsx(wf,{children:y.jsxs("div",{className:"space-y-8",children:[y.jsxs("header",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(To,{className:"h-9 w-9 shrink-0 rounded-lg border border-border/50 bg-muted/50 shadow-sm",style:So(e.id)?{backgroundColor:So(e.id)}:void 0,children:[y.jsx(qd,{src:vo(e.id),className:"object-cover"}),y.jsx(ko,{className:"rounded-lg bg-transparent text-sm font-bold uppercase text-muted-foreground",children:jm(e.id)})]}),y.jsxs("div",{className:"flex flex-col justify-center gap-0.5",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h2",{className:"text-base font-semibold leading-none tracking-tight text-foreground",children:e.name}),y.jsxs(Bo,{children:[y.jsx(Lo,{asChild:!0,children:y.jsx("button",{type:"button","aria-label":"提供商说明",className:"cursor-help rounded-sm text-muted-foreground/50 focus:outline-none focus-visible:text-foreground",children:y.jsx(sf,{"aria-hidden":"true",className:"h-3.5 w-3.5"})})}),y.jsxs(Ci,{className:"max-w-xs space-y-2 text-xs",children:[y.jsx("p",{children:e.description}),y.jsx("p",{children:"Provider 凭证保存在当前 Pod,由 Pod 权限保护。"})]})]})]}),y.jsxs("a",{href:e.homeUrl,target:"_blank",rel:"noreferrer",className:"flex items-center gap-0.5 text-[10px] leading-none text-muted-foreground transition-colors hover:text-primary",children:["访问官网 ",y.jsx(No,{"aria-hidden":"true",className:"h-2.5 w-2.5"})]})]})]}),y.jsx(go,{variant:$||T?"default":"secondary",children:Fm(r)})]}),y.jsx(Tm,{definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s,busy:u,disabled:d,error:p,suppressError:!!O,quotas:g,onApiKeyChange:C,onBaseUrlChange:_,onBeginApiKey:w,onBeginOffering:R,onCancelConnect:E,onBeginBrowser:S,onSaveApiKey:Q,onDisconnect:Y,onCreateApiKeyCredential:t?.offerings.length?te:void 0,onCreateLocalCredential:t?.offerings.length?G:void 0,onUpdateCredential:q,onDeleteCredential:ce,onTestCredential:M,onReorderCredentials:D,onRefreshQuota:z,onDismissError:b}),y.jsxs("section",{className:"space-y-4",children:[y.jsxs("div",{"data-testid":"provider-models-header",className:"flex flex-col gap-3 border-b border-border/40 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[y.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[y.jsx(Ao,{className:"h-4 w-4 shrink-0 text-primary"}),y.jsx("h3",{className:"shrink-0 text-sm font-medium text-foreground/90",children:"可用模型"}),y.jsxs("span",{className:"text-xs text-muted-foreground",children:["共 ",de.length," · 已加入 ",K," · 已失效 ",m]}),y.jsxs("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:Ke("inline-flex items-center gap-1 text-xs",F==="error"?"text-destructive":"text-muted-foreground"),children:[F==="saving"?y.jsx(kt,{"aria-hidden":"true",className:"h-3 w-3 animate-spin motion-reduce:animate-none"}):F==="saved"?y.jsx(qr,{"aria-hidden":"true",className:"h-3 w-3"}):null,F==="saving"?"保存中…":F==="saved"?"已保存":F==="error"?"保存失败,请重试":"选择后自动保存"]})]}),y.jsxs("div",{"data-testid":"provider-models-actions",className:"flex w-full flex-wrap items-center gap-2 sm:w-auto sm:flex-nowrap sm:justify-end",children:[(T||$)&&(x||Z)?y.jsxs(y.Fragment,{children:[Z?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||u,onClick:Z,children:[y.jsx(wn,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"添加模型"]}):null,x&&v.length>0?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||u||I,onClick:x,children:[I?y.jsx(kt,{"aria-hidden":"true",className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Es,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),I?"同步中...":"刷新模型"]}):x?y.jsxs(_e,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||u||I,onClick:x,children:[I?y.jsx(kt,{"aria-hidden":"true",className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Es,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),I?"同步中...":"同步模型"]}):null]}):null,y.jsxs("div",{className:"relative w-full sm:w-auto",children:[y.jsx(uf,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),y.jsx(st,{value:ae,onChange:fe=>ue(fe.target.value),placeholder:"搜索模型...",className:"h-8 w-full bg-background pl-8 text-xs sm:w-[232px]",autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0})]})]})]}),v.length===0?y.jsx("div",{className:"rounded-lg border border-dashed border-border/50 bg-muted/5 py-12 text-center text-sm text-muted-foreground",children:O?y.jsx("p",{className:"text-destructive",children:O}):"暂无可用模型"}):l.length===0?y.jsx("div",{className:"rounded-lg border border-dashed border-border/50 bg-muted/5 py-12 text-center text-sm text-muted-foreground",children:"未找到匹配的模型"}):y.jsxs("div",{className:"grid gap-2",children:[y.jsx("div",{className:"flex items-center justify-between px-1 py-1",children:y.jsxs("button",{type:"button",role:"checkbox","aria-label":"全选当前结果","aria-checked":B?"mixed":j,disabled:d||u||f.length===0,onClick:H,className:"flex items-center gap-2 text-xs text-muted-foreground disabled:opacity-50",children:[y.jsx("span",{className:Ke("flex h-4 w-4 items-center justify-center rounded border",j||B?"border-primary bg-primary text-primary-foreground":"border-border"),children:B?y.jsx("span",{"aria-hidden":"true",children:"−"}):y.jsx(qr,{"aria-hidden":"true",className:Ke("h-3 w-3",!j&&"invisible")})}),"全选当前结果"]})}),l.map(fe=>{const we=ih(fe),pe=V(fe),ve=fe.availability==="unavailable",Ae=fe.displayName??fe.id,Ce=[...(fe.inputModalities??[]).filter(De=>De!=="text"),...fe.capabilities??[]];return y.jsxs("div",{className:Ke("group flex items-center gap-3 rounded-lg border bg-card p-3 transition-all duration-200 hover:border-border/60 hover:bg-accent/30",pe?"border-primary/40 bg-primary/[0.03]":"border-border/40",ve&&"opacity-75"),children:[y.jsx("button",{type:"button",role:"checkbox","aria-checked":pe,"aria-label":`${pe?"取消选择":"选择"} ${Ae}`,className:Ke("flex h-5 w-5 shrink-0 items-center justify-center rounded border transition-colors focus:outline-none focus-visible:border-ring",pe?"border-primary bg-primary text-primary-foreground":"border-border text-transparent hover:border-primary/60"),disabled:d||u||ve&&!pe,onClick:()=>X(fe),children:y.jsx(qr,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}),y.jsx("div",{className:"shrink-0 rounded bg-muted/50 p-2 text-muted-foreground transition-colors group-hover:text-primary",children:y.jsx(Ao,{className:"h-4 w-4"})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"truncate text-sm font-medium text-foreground/90",children:Ae}),y.jsx("div",{className:"flex items-center gap-1",children:Ce.map(De=>y.jsx(Om,{type:De},De))}),fe.custom?y.jsx(go,{variant:"outline",className:"shrink-0 text-[10px] font-normal",children:"手工"}):null,ve?y.jsx(go,{variant:"destructive",className:"shrink-0 text-[10px] font-normal",children:"已失效"}):null]}),fe.displayName?y.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[y.jsx("code",{className:"max-w-[300px] truncate font-mono text-[10px] text-muted-foreground opacity-70",children:fe.id}),y.jsx("button",{type:"button",onClick:()=>{L(fe.id)},className:"rounded p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100","aria-label":`复制 ${fe.displayName} ID`,title:"复制 ID",children:le===fe.id?y.jsx(qr,{"aria-hidden":"true",className:"h-3 w-3 text-primary"}):y.jsx(vs,{"aria-hidden":"true",className:"h-3 w-3"})})]}):null]}),fe.custom&&(re||ie)?y.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 focus-within:opacity-100",children:[re?y.jsx(_e,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`编辑 ${fe.displayName??fe.id}`,onClick:()=>re(fe),children:y.jsx(lf,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"})}):null,ie?y.jsx(_e,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`删除 ${fe.displayName??fe.id}`,onClick:()=>ie(fe),children:y.jsx(Zs,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"})}):null]}):null]},we)})]})]})]})})}function Om({type:e}){const t={image:{icon:af,label:"视觉识别",className:"text-green-500"},web:{icon:of,label:"联网搜索",className:"text-blue-500"},tool_call:{icon:Ao,label:"函数调用",className:"text-orange-500"},reasoning:{icon:nf,label:"推理",className:"text-purple-500"}}[e];if(!t)return null;const r=t.icon;return y.jsxs(Bo,{children:[y.jsx(Lo,{asChild:!0,children:y.jsx("button",{type:"button","aria-label":t.label,className:"flex cursor-help items-center justify-center rounded-sm opacity-80 transition-opacity hover:opacity-100 focus:outline-none focus-visible:opacity-100",children:y.jsx(r,{"aria-hidden":"true",className:Ke("h-3.5 w-3.5",t.className)})})}),y.jsx(Ci,{children:t.label})]})}function jm(e){switch(e){case"openai":return"OA";case"anthropic":return"A";case"kimi":return"K";case"bailian":return"百";case"deepseek":return"DS";case"zhipu":return"智";case"ollama":return"O";case"custom":return"C"}}function ih(e){return e.resourceId??(e.offeringId?`${e.offeringId}:${e.id}`:e.id)}function Nm(e){const t=new Map;for(const r of e){const n=`${r.provider}\0${r.id}`,i=ih(r),o=t.get(n),a=[r.id,r.displayName].filter(Boolean).join(`
3
+ `).toLocaleLowerCase();if(!o){t.set(n,{...r,selectionIds:[i],availableSelectionIds:r.availability==="unavailable"?[]:[i],searchText:a});continue}o.selectionIds.includes(i)||o.selectionIds.push(i),r.availability!=="unavailable"&&!o.availableSelectionIds.includes(i)&&o.availableSelectionIds.push(i),r.availability!=="unavailable"&&(o.availability=r.availability),o.capabilities=[...new Set([...o.capabilities??[],...r.capabilities??[]])],o.inputModalities=[...new Set([...o.inputModalities??[],...r.inputModalities??[]])],o.searchText+=`
4
+ ${a}`}return[...t.values()]}function Fm(e){switch(e){case"pending":return"连接中";case"configured":return"已配置";case"connected":return"已连接";case"disconnected":return"未设置";case"reauthRequired":return"需要重新登录";case"failed":return"连接失败";default:return"未检查"}}const Bm=[{id:"image",label:"视觉识别",icon:af}],Lm=[{id:"tool_call",label:"函数调用",icon:Ao},{id:"reasoning",label:"推理",icon:nf},{id:"web",label:"联网搜索",icon:of}];function Um({open:e,providerName:t,initialValue:r,error:n,saving:i=!1,onOpenChange:o,onSave:a}){const s=!!r,[u,d]=J.useState(""),[p,g]=J.useState(""),[v,I]=J.useState([]),[C,_]=J.useState([]);J.useEffect(()=>{e&&(d(r?.id??""),g(r?.name??""),I(r?.inputModalities??[]),_(r?.capabilities??[]))},[r,e]);const w=u.trim(),R=!!w&&!i,E=(Q,Y,te)=>{Y(Q.includes(te)?Q.filter(G=>G!==te):[...Q,te])},S=(Q,Y,te)=>{const G=Y.includes(Q.id),q=Q.icon;return y.jsxs("button",{type:"button","aria-pressed":G,disabled:i,onClick:()=>E(Y,te,Q.id),className:Ke("flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs transition-colors",G?"border-primary/50 bg-primary/10 text-primary":"border-border/60 text-muted-foreground hover:border-border hover:text-foreground"),children:[y.jsx(q,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),Q.label]},Q.id)};return y.jsx(Ii,{open:e,onOpenChange:o,children:y.jsxs(An,{className:"max-w-md",children:[y.jsx(Ri,{children:y.jsxs(_n,{children:[s?"编辑模型":"添加模型"," · ",t]})}),y.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-model-id",children:"模型 ID"}),y.jsx(st,{id:"ai-model-id",value:u,disabled:s||i,placeholder:"例如 gpt-4o-mini",onChange:Q=>d(Q.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-model-name",children:"显示名称"}),y.jsx(st,{id:"ai-model-name",value:p,disabled:i,placeholder:"留空则使用模型 ID",onChange:Q=>g(Q.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{children:"输入模态"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:Bm.map(Q=>S(Q,v,I))})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{children:"能力标记"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:Lm.map(Q=>S(Q,C,_))})]}),n?y.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n}):null]}),y.jsxs(gi,{children:[y.jsx(_e,{variant:"outline",disabled:i,onClick:()=>o(!1),children:"取消"}),y.jsx(_e,{disabled:!R,onClick:()=>a({id:w,name:p.trim(),inputModalities:v,capabilities:C}),children:i?"保存中...":"保存"})]})]})})}const qm="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20800%22%3E%3Crect%20width%3D%22800%22%20height%3D%22800%22%20rx%3D%22120%22%20fill%3D%22%2309090b%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22%20M165.29%20165.29%20H517.36%20V400%20H400%20V517.36%20H282.65%20V634.72%20H165.29%20Z%20M282.65%20282.65%20V400%20H400%20V282.65%20Z%20%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M517.36%20400%20H634.72%20V634.72%20H517.36%20Z%22%2F%3E%3C%2Fsvg%3E",Km="data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url(%23clip0_5110_14771)%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2220%22%20fill%3D%22url(%23paint0_linear_5110_14771)%22%2F%3E%3Cg%20filter%3D%22url(%23filter0_f_5110_14771)%22%3E%3Ccircle%20cx%3D%2212.6071%22%20cy%3D%2234.9794%22%20r%3D%2214.081%22%20fill%3D%22%2332E6B9%22%20fill-opacity%3D%220.4%22%2F%3E%3C%2Fg%3E%3Cg%20filter%3D%22url(%23filter1_f_5110_14771)%22%3E%3Ccircle%20cx%3D%2233.3404%22%20cy%3D%2243.6185%22%20r%3D%2212.8704%22%20fill%3D%22%2332E6B9%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M27.6897%203.3426C28.057%203.01322%2028.0795%202.99983%2028.3485%202.98366C28.7851%202.95177%2029.1858%203.16107%2029.8664%203.78072C31.4566%205.22574%2033.6703%208.19724%2035.047%2010.7343L35.5796%2011.7191L36.3309%2012.0927C37.0562%2012.4593%2038.2459%2013.2111%2038.7428%2013.614C38.9673%2013.7997%2038.9992%2013.8032%2039.2326%2013.7124C40.2872%2013.3017%2041.7982%2013.846%2043.1307%2015.1244C44.3302%2016.274%2045.479%2018.2384%2045.9191%2019.8778C45.9833%2020.1417%2046.0683%2020.709%2046.0994%2021.1314C46.1997%2022.6144%2045.7243%2023.7986%2044.8085%2024.3349C44.6213%2024.443%2044.6085%2024.4725%2044.6137%2024.939C44.6559%2027.1604%2044.0571%2029.3777%2042.8543%2031.54C41.4965%2033.9678%2039.0794%2036.4798%2035.8073%2038.846C34.0502%2040.1247%2029.8918%2042.5469%2028.0122%2043.3973C23.5096%2045.4244%2019.8999%2046.2022%2016.7645%2045.8181C14.8943%2045.5915%2012.7771%2044.8611%2011.5246%2044.0137C11.1951%2043.786%2011.1428%2043.7719%2010.8909%2043.8439C9.55017%2044.2289%207.79442%2043.4374%206.30272%2041.7817C5.70771%2041.1197%204.74709%2039.4939%204.43575%2038.6241C3.71569%2036.5887%203.85859%2034.752%204.81783%2033.6551C5.0657%2033.3725%205.07387%2033.3607%205.01972%2032.8856C4.93033%2032.1079%204.88982%2030.9566%204.93066%2030.2138L4.96343%2029.5205L3.92091%2027.6777C2.3078%2024.8074%201.28326%2022.3968%200.887982%2020.5554C0.679402%2019.546%200.692781%2019.0981%200.949061%2018.7667C1.10529%2018.5666%201.61622%2018.3594%202.23252%2018.2455C3.78518%2017.9729%207.17203%2018.2198%2010.9394%2018.885L11.3303%2018.9525L12.1903%2018.1921C13.6179%2016.9275%2014.5665%2016.2176%2016.315%2015.1274C18.1373%2013.9872%2020.1943%2013.0498%2022.5103%2012.3071L23.2533%2012.0687L23.6615%2010.9964C25.1239%207.13587%2026.6218%204.28969%2027.6897%203.3426ZM15.4393%2023.1261C13.7864%2024.0804%2012.9602%2024.5582%2012.3529%2025.093C9.89364%2027.2585%208.9738%2030.6888%2010.0208%2033.7938C10.2794%2034.5606%2010.7568%2035.387%2011.7111%2037.0398C12.6653%2038.6926%2013.1424%2039.5194%2013.6771%2040.1267C15.8426%2042.5859%2019.2732%2043.5045%2022.3783%2042.4574C23.145%2042.1989%2023.972%2041.7223%2025.6248%2040.768L35.1333%2035.2783C36.7862%2034.324%2037.6124%2033.8462%2038.2196%2033.3114C40.6789%2031.1459%2041.5988%2027.7156%2040.5518%2024.6105C40.2932%2023.8438%2039.8157%2023.0174%2038.8615%2021.3646C37.9072%2019.7117%2037.4302%2018.885%2036.8955%2018.2777C34.7299%2015.8185%2031.2993%2014.8999%2028.1943%2015.947C27.4275%2016.2055%2026.6006%2016.6821%2024.9478%2017.6364L15.4393%2023.1261Z%22%20fill%3D%22url(%23paint1_linear_5110_14771)%22%2F%3E%3Crect%20x%3D%2215.8816%22%20y%3D%2230.0273%22%20width%3D%224.00904%22%20height%3D%228.32646%22%20rx%3D%222.00452%22%20transform%3D%22rotate(-30%2015.8816%2030.0273)%22%20fill%3D%22white%22%2F%3E%3Crect%20x%3D%2226.6978%22%20y%3D%2223.7812%22%20width%3D%224.00904%22%20height%3D%228.32646%22%20rx%3D%222.00452%22%20transform%3D%22rotate(-30%2026.6978%2023.7812)%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3Cfilter%20id%3D%22filter0_f_5110_14771%22%20x%3D%22-14.9163%22%20y%3D%227.45599%22%20width%3D%2255.0468%22%20height%3D%2255.047%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.72123%22%20result%3D%22effect1_foregroundBlur_5110_14771%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22filter1_f_5110_14771%22%20x%3D%229.46959%22%20y%3D%2219.7477%22%20width%3D%2247.7417%22%20height%3D%2247.741%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%225.50019%22%20result%3D%22effect1_foregroundBlur_5110_14771%22%2F%3E%3C%2Ffilter%3E%3ClinearGradient%20id%3D%22paint0_linear_5110_14771%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%236C4DFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23583ED3%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_5110_14771%22%20x1%3D%2214.639%22%20y1%3D%2210.7917%22%20x2%3D%2232.1712%22%20y2%3D%2241.1585%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22white%22%20stop-opacity%3D%220.8%22%2F%3E%3Cstop%20offset%3D%220.437689%22%20stop-color%3D%22white%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_5110_14771%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2220%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",zm={codex:vo("openai"),"claude-code":vo("anthropic"),pi:qm,codebuddy:Km};function Wm(e){return zm[e]}const oh=["codex","claude-code","pi","codebuddy"],Zt={codex:"Codex","claude-code":"Claude Code",pi:"Pi",codebuddy:"CodeBuddy"};function Hm({client:e,className:t="h-4 w-4"}){const r=Wm(e);return r?y.jsx("img",{src:r,alt:"","aria-hidden":"true",className:`${t} shrink-0 rounded-[3px] object-cover`}):y.jsx(eg,{className:t,"aria-hidden":"true"})}function Vm(e,t,r){const n=r??"<粘贴 Xpod API Key>",i=t.trim().replace(/\/+$/,""),o=i.endsWith("/v1")?i:`${i}/v1`,a=i.replace(/\/v1$/,"");switch(e){case"codex":return["# ~/.codex/config.toml","# 将 model_provider 放在第一个配置节之前;已有同名顶层字段时替换",'model_provider = "xpod"',"","[model_providers.xpod]",'name = "Xpod AI Connection"',`base_url = ${JSON.stringify(o)}`,'wire_api = "responses"',"requires_openai_auth = false",`experimental_bearer_token = ${JSON.stringify(n)}`,"# 保留现有订阅登录,Xpod 单独使用此 provider 的 Key"].join(`
5
+ `);case"claude-code":return["# ~/.claude/settings.json(合并 env 到现有 JSON)",JSON.stringify({env:{ANTHROPIC_BASE_URL:a,ANTHROPIC_AUTH_TOKEN:n}},null,2)].join(`
6
+ `);case"pi":return["# ~/.pi/agent/settings.json(合并到现有 JSON,并将 <model-id> 替换为实际模型)",JSON.stringify({defaultProvider:"xpod",defaultModel:"<model-id>"},null,2),"","# ~/.pi/agent/models.json(合并 providers.xpod 到现有 JSON)",JSON.stringify({providers:{xpod:{baseUrl:o,apiKey:n,authHeader:!0,api:"openai-responses",models:[{id:"<model-id>",name:"<model-id>"}]}}},null,2)].join(`
7
+ `);case"codebuddy":return["# ~/.codebuddy/settings.json(合并 env 到现有 JSON)",JSON.stringify({env:{CODEBUDDY_BASE_URL:o,CODEBUDDY_API_KEY:n}},null,2)].join(`
8
+ `)}}function Qm({record:e,busy:t,onDestroy:r}){const n=e.name||"未命名 API Key",i=Gm(e),o=e.kind!=="client-credentials"||!!e.clientCredentialId;return y.jsxs("li",{"data-key-id":e.id,"data-key-binding":e.appliedTo?"bound":"unbound",className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-border/60 px-4 py-3 first:rounded-t-xl last:rounded-b-xl last:border-b-0",children:[y.jsxs("dl",{className:"flex min-w-0 flex-1 basis-64 flex-wrap items-center gap-x-6 gap-y-2",children:[y.jsx(ca,{label:"用途",className:"min-w-0 flex-1 basis-28",children:y.jsx("span",{className:"block truncate text-sm font-medium text-foreground/90",title:n,children:n})}),y.jsx(ca,{label:"绑定",className:"min-w-0 flex-1 basis-28",children:y.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[i.clientId?y.jsx(Hm,{client:i.clientId,className:"h-3.5 w-3.5"}):null,y.jsx("span",{className:"truncate",title:i.label,children:i.label})]})}),y.jsx(ca,{label:"最后使用",className:"shrink-0",children:y.jsx("span",{className:"block text-xs text-muted-foreground",children:e.lastUsedAt?Jm(e.lastUsedAt):"暂无调用记录"})})]}),o?y.jsxs(_e,{variant:"ghost",size:"sm",className:"h-8 shrink-0 gap-1.5 text-xs text-muted-foreground hover:text-destructive","aria-label":`销毁 ${n}`,title:`销毁 ${n}`,disabled:t,onClick:r,children:[y.jsx(Zs,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"销毁"]}):y.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:"缺少 CSS 凭据标识,无法在此销毁"})]})}function Gm(e){const t=e.appliedTo?.trim();if(!t)return{label:"未绑定"};const r=oh.find(o=>o===t),n=r?Zt[r]:t,i=e.appliedOn?.trim();return{clientId:r,label:i?`${n} · ${i}`:n}}function ca({label:e,className:t,children:r}){return y.jsxs("div",{className:t,children:[y.jsx("dt",{className:"text-[11px] leading-tight text-muted-foreground/80",children:e}),y.jsx("dd",{className:"mt-0.5",children:r})]})}function Jm(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}const da="我的 API Key",Ym="API Key 已创建,请复制或应用到客户端。",Xm="这个 API Key 只在创建时可见:请销毁它,然后重新创建并立即复制或应用。",Zm="这个 API Key 只在创建时可见:请销毁它,然后重新创建并直接应用到客户端。",$m=["flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm transition-[border-color]","disabled:cursor-not-allowed disabled:opacity-50",Fp].join(" ");function e0({client:e,clientConfigurationBridge:t,gatewayModels:r}){const[n,i]=J.useState([]),[o,a]=J.useState(!0),[s,u]=J.useState(!1),[d,p]=J.useState(da),[g,v]=J.useState(""),[I,C]=J.useState(!1),[_,w]=J.useState(),[R,E]=J.useState(),[S,Q]=J.useState(),[Y,te]=J.useState(!1),[G,q]=J.useState(),[ce,M]=J.useState(),[D,z]=J.useState(),x=J.useRef(new Map),Z=J.useRef(!1),re=J.useRef(void 0),ie=J.useRef(void 0),he=J.useCallback(le=>{re.current&&au(re.current),re.current=pt(le)},[]),F=J.useCallback(le=>{he({variant:"destructive",description:Un(le),duration:8e3})},[he]);J.useEffect(()=>{let le=!0;return a(!0),z(void 0),x.current.clear(),e.listGatewayKeys().then(se=>{le&&i(se.filter(k=>!k.revokedAt))}).catch(se=>{le&&F(se)}).finally(()=>{le&&a(!1)}),()=>{le=!1,clearTimeout(ie.current),re.current&&au(re.current)}},[e,F]);const oe=()=>{z(void 0),p(da),v(""),q(void 0),u(!0)},b=()=>{w(void 0),E(void 0),Q(void 0),q(void 0),z(void 0),p(da),v("")},T=async()=>{const le=d.trim();if(!le){z("请填写 API Key 名称。");return}if(!g){z("请选择 API Key 的用途。");return}C(!0),z(void 0);try{const se=await e.createGatewayKey({name:le,appliedTo:g});x.current.set(se.record.id,se.plaintext),i(k=>[se.record,...k.filter(U=>U.id!==se.record.id)]),w(se.record),E(g),Q(void 0),q(void 0),he({variant:"success",description:Ym})}catch(se){z(Un(se))}finally{C(!1)}},$=(le,se)=>{const k=x.current.get(le.id);if(!k)throw new Error(se);return k},O=async(le,se)=>{z(void 0);try{const k=$(le,Xm);if(!navigator.clipboard?.writeText)throw new Error("当前浏览器无法访问剪贴板,请允许剪贴板访问后重试。");await navigator.clipboard.writeText(se==="key"?k:Vm(se,e.apiBase,k)),q(se),clearTimeout(ie.current),ie.current=setTimeout(()=>q(void 0),2e3)}catch(k){z(Un(k))}},ae=async()=>{if(!_||!R||!t)return;z(void 0);let le;try{le=$(_,Zm)}catch(se){z(Un(se));return}te(!0);try{const se=await t.plan({client:R,endpoint:e.apiBase,...R==="codex"&&r!==void 0?{activeModels:r.map(({id:k,provider:U,displayName:ne,availability:de,contextWindow:V,inputModalities:l,capabilities:f})=>({id:k,provider:U,displayName:ne,availability:de,contextWindow:V,inputModalities:l,capabilities:f}))}:{}});await t.apply({client:se.client,planId:se.planId,apiKey:le,...se.confirmation?.required?{confirmation:{token:se.confirmation.token,targetHash:se.confirmation.targetHash}}:{}}),Q(se.client),i(k=>k.map(U=>U.id===_.id?{...U,appliedTo:se.client}:U)),he({variant:"success",description:se.client==="codex"&&r===void 0?"Codex 连接配置已应用,模型目录尚未加载,请稍后刷新配置。":`${Zt[se.client]} 配置已应用。`})}catch(se){z(Un(se))}finally{te(!1)}},ue=async le=>{if(!Z.current){Z.current=!0,M(le.id),z(void 0);try{await e.deleteGatewayKey(le.id),x.current.delete(le.id),i(se=>se.filter(k=>k.id!==le.id)),_?.id===le.id&&(w(void 0),E(void 0),Q(void 0),q(void 0))}catch(se){F(se)}finally{Z.current=!1,M(void 0)}}};return y.jsxs("section",{className:"space-y-8 [container-type:inline-size]","aria-label":"API Keys",children:[y.jsxs("header",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx(To,{className:"h-9 w-9 shrink-0 rounded-lg border border-border/50 bg-muted/50 shadow-sm",children:y.jsx(ko,{className:"rounded-lg bg-transparent text-sm font-bold uppercase text-muted-foreground",children:"XP"})}),y.jsxs("div",{className:"flex flex-col justify-center gap-1",children:[y.jsx("h2",{className:"text-base font-semibold leading-none tracking-tight text-foreground",children:"Xpod"}),y.jsx("p",{className:"max-w-3xl text-xs leading-snug text-muted-foreground",children:"API Key 用于让客户端把 Xpod 当作 Provider 接入;Xpod 不保存 Key 明文。"})]})]}),y.jsx(go,{variant:n.length>0?"default":"secondary",children:n.length>0?`已签发 ${n.length} 个`:"未配置"})]}),y.jsxs("section",{className:"space-y-3","aria-label":"已签发 API Key",children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[y.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium text-foreground/90",children:[y.jsx(Ss,{"aria-hidden":"true",className:"h-4 w-4 text-primary"}),"已签发 API Key"]}),y.jsxs(_e,{size:"sm","aria-label":"新建 API Key",disabled:I||o,onClick:oe,children:[y.jsx(wn,{"aria-hidden":"true",className:"mr-2 h-4 w-4"}),"新建 API Key"]})]}),o?y.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[y.jsx(kt,{"aria-hidden":"true",className:"h-4 w-4 animate-spin"}),"正在读取 API Key"]}):n.length===0?y.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"尚未签发 API Key。"}):y.jsx("ul",{"aria-label":"API Key 列表",className:"rounded-xl border border-border/70",children:n.map(le=>y.jsx(Qm,{record:le,busy:!!ce,onDestroy:()=>{ue(le)}},le.id))})]}),y.jsx(Ii,{open:s,onOpenChange:le=>{!le&&(I||Y)||u(le)},children:y.jsxs(An,{className:"sm:max-w-md","aria-describedby":void 0,children:[y.jsx(Ri,{children:y.jsx(_n,{children:_?"API Key 已签发":"新建 API Key"})}),_&&R?y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"space-y-1.5",children:[y.jsxs("p",{className:"text-sm",children:["已签发「",_.name||"未命名 API Key","」,用途:",Zt[R],"。"]}),y.jsx("p",{className:"text-xs text-muted-foreground",children:"Xpod 不保存 Key 明文,请立即复制或直接应用到客户端;离开本次会话后无法再次获取。"})]}),_.maskedHint?y.jsx("code",{className:"block truncate rounded-md border border-border/60 bg-muted/30 px-3 py-2 font-mono text-xs text-muted-foreground",children:_.maskedHint}):null,t?null:y.jsx("p",{className:"text-xs text-muted-foreground",children:"当前 Web 环境无法自动写入客户端配置,请复制后手动粘贴;自动应用需要本机连接。"}),D?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:D}):null,y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.jsxs(_e,{type:"button",variant:"outline",size:"sm","aria-label":"复制 API Key",disabled:Y,onClick:()=>{O(_,"key")},children:[G==="key"?y.jsx(qr,{"aria-hidden":"true",className:"mr-1.5 h-3.5 w-3.5 text-emerald-600"}):y.jsx(vs,{"aria-hidden":"true",className:"mr-1.5 h-3.5 w-3.5"}),G==="key"?"已复制":"复制 API Key"]}),y.jsxs(_e,{type:"button",variant:"outline",size:"sm",disabled:Y,"aria-label":`复制 ${Zt[R]} 配置`,onClick:()=>{O(_,R)},children:[G===R?y.jsx(qr,{"aria-hidden":"true",className:"mr-1.5 h-3.5 w-3.5 text-emerald-600"}):y.jsx(vs,{"aria-hidden":"true",className:"mr-1.5 h-3.5 w-3.5"}),G===R?"已复制":`复制 ${Zt[R]} 配置`]}),t?S?y.jsxs("span",{role:"status",className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[y.jsx(qr,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"已应用到 ",Zt[S]]}):y.jsxs(_e,{type:"button",size:"sm",disabled:Y,"aria-label":`应用到 ${Zt[R]}`,onClick:()=>{ae()},children:[Y?y.jsx(kt,{"aria-hidden":"true",className:"mr-2 h-4 w-4 animate-spin"}):null,Y?"正在应用…":`应用到 ${Zt[R]}`]}):null]}),y.jsxs(gi,{children:[y.jsx(_e,{type:"button",variant:"ghost",disabled:Y,onClick:b,children:"再建一个"}),y.jsx(_e,{type:"button",variant:"outline",onClick:()=>u(!1),children:"完成"})]})]}):y.jsxs("form",{className:"space-y-5",onSubmit:le=>{le.preventDefault(),I||T()},children:[y.jsxs("label",{className:"block space-y-2",children:[y.jsx("span",{className:"text-sm font-medium",children:"名称"}),y.jsx(st,{autoFocus:!0,"aria-label":"API Key 名称",value:d,disabled:I,onChange:le=>p(le.target.value)})]}),y.jsxs("label",{className:"block space-y-2",children:[y.jsx("span",{className:"text-sm font-medium",children:"用途"}),y.jsxs("select",{"aria-label":"API Key 用途",className:$m,value:g,disabled:I,onChange:le=>v(le.target.value),children:[y.jsx("option",{value:"",disabled:!0,children:"选择客户端应用"}),oh.map(le=>y.jsx("option",{value:le,children:Zt[le]},le))]})]}),y.jsx("p",{className:"text-xs text-muted-foreground",children:"用途在创建时确定,Key 会绑定到该客户端应用。"}),D?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:D}):null,y.jsxs(gi,{children:[y.jsx(_e,{type:"button",variant:"outline",disabled:I,onClick:()=>u(!1),children:"取消"}),y.jsxs(_e,{type:"submit","aria-label":"创建 API Key",disabled:I||!d.trim()||!g,children:[I?y.jsx(kt,{"aria-hidden":"true",className:"mr-2 h-4 w-4 animate-spin"}):null,I?"正在创建…":"创建 API Key"]})]})]})]})})]})}function Un(e){const t=e instanceof Error?e.message.trim():"";return/failed to fetch|networkerror|load failed/i.test(t)?"无法连接配置服务,请检查连接后重试。":/EACCES|permission denied/i.test(t)?"没有权限写入配置文件,请检查文件权限后重试。":t==="Client configuration could not be verified locally."?"配置文件写入后的本地检查未通过,请检查文件内容和权限后重试。":!t||/^(?:AI Connection |AI client configuration )?request failed(?:\. Please try again\.)?$/i.test(t)?"API Key 操作失败,请重试。":t}const t0={};function r0({client:e,renderToaster:t=!0,openExternal:r=l0,clientConfigurationBridge:n,selectedSection:i="provider",selectedProvider:o,selectedCredentialId:a,providerSummaries:s=t0,providerProducts:u={},providerLoadError:d,providerLoading:p=!1,onProviderStateChange:g,onModelSelectionChange:v}){const[I,C]=J.useState({}),[_,w]=J.useState([]),[R,E]=J.useState(),[S,Q]=J.useState(0),[Y,te]=J.useState({}),[G,q]=J.useState({}),[ce,M]=J.useState({}),[D,z]=J.useState({}),[x,Z]=J.useState({}),[re,ie]=J.useState({}),[he,F]=J.useState({}),[oe,b]=J.useState({}),[T,$]=J.useState({}),[O,ae]=J.useState({}),[ue,le]=J.useState(),[se,k]=J.useState(),[U,ne]=J.useState(!1),[de,V]=J.useState({}),l=J.useRef(0),f=J.useRef({}),A={...u,...de},j=J.useCallback((P,c)=>{C(h=>({...h,[P]:c})),g?.(P,o0(c))},[g]);J.useEffect(()=>{C(Object.fromEntries(Object.values(s).filter(Cu).map(P=>[P.provider,P.status==="connected"&&P.authMode==="browserAssistedApiKey"?"configured":P.status]))),ie(Object.fromEntries(Object.values(s).filter(Cu).map(P=>[P.provider,P.baseUrl??""])))},[s]),J.useEffect(()=>{te(P=>{const c={...P};let h=!1;for(const[W,N]of Object.entries(u)){if(!N)continue;const ee=N.selectedModels.map(dr),ge=P[W];(!ge||ge.join("\0")!==ee.join("\0"))&&(c[W]=ee,h=!0)}return h?c:P})},[u]),J.useEffect(()=>{let P=!0;return e.listModels().then(c=>{P&&w(c)}).catch(()=>{}),()=>{P=!1,l.current+=1}},[e]),J.useEffect(()=>{let P=!0;return E(void 0),e.listGatewayModels?.().then(c=>{P&&E(c)}).catch(()=>{}),()=>{P=!1}},[e,S]);const B=(P,c)=>{F(h=>({...h,[P]:c}))},K=(P,c,h,W)=>{b(N=>({...N,[P]:c?{message:c,offeringId:h,authorization:W}:void 0}))},m=J.useCallback(async P=>{const c=P.verificationUriComplete??P.authorizationUrl??P.verificationUri;c&&await r(c)},[r]),L=async P=>{B(P,!0),K(P),z(c=>({...c,[P]:void 0}));try{const c=await e.beginConnect(P,"browserAssistedApiKey");M(W=>({...W,[P]:c}));const h=Os(c.status);if(j(P,h?"pending":c.status==="completed"?"configured":"failed"),!h&&c.status!=="completed"){K(P,c.message??Su(c.status));return}await m(c)}catch(c){j(P,"failed"),K(P,Qe(c))}finally{B(P,!1)}},X=async P=>{if(P.browserMode!=="connectUnsupported"){if(P.browserMode==="browserAssistedApiKey"){await L(P.id);return}await fe(P.id,P.browserMode)}},H=async(P,c,h,W)=>{if(h==="browserAssistedApiKey"){await L(P);return}await fe(P,h,c.id,W?.id)},fe=async(P,c,h,W)=>{if(c==="connectUnsupported")return;B(P,!0),K(P),z(ee=>({...ee,[P]:h}));const N=l.current+1;l.current=N;try{const ee=await e.beginConnect(P,c,{offeringId:h,authorizationMethodId:W});if(M(ge=>({...ge,[P]:ee})),!Os(ee.status)){const ge=ee.status==="completed";ge?await we(P):j(P,"failed"),ge||K(P,ee.status==="unsupported"?"当前部署未启用账号授权":ee.message??Su(ee.status),h,{mode:c,authorizationMethodId:W}),B(P,!1);return}j(P,"pending"),await m(ee),i0(e,P,ee,N,l,{onAttempt:ge=>M(be=>({...be,[P]:ge})),onConnected:()=>we(P),onFailed:ge=>{j(P,"failed"),K(P,ge,h,{mode:c,authorizationMethodId:W})},onFinished:()=>B(P,!1)})}catch(ee){j(P,"failed"),K(P,Qe(ee),h,{mode:c,authorizationMethodId:W}),B(P,!1)}},we=async P=>{j(P,"connected");try{const c=(await e.listProviders()).find(h=>h.id===P);c&&V(h=>({...h,[P]:c}))}catch(c){K(P,`账号已连接,连接信息刷新失败:${Qe(c)}`)}},pe=async(P,c)=>{l.current+=1,B(P,!1),M(h=>({...h,[P]:void 0})),z(h=>({...h,[P]:void 0})),j(P,"failed");try{await e.cancelConnect?.(P,c),K(P,"连接已取消")}catch(h){K(P,Qe(h))}},ve=async P=>{const c=x[P.id]?.trim(),h=re[P.id]??s[P.id]?.baseUrl??"",W=ce[P.id];if(!(!c||!W)){B(P.id,!0),K(P.id);try{const N=await e.completeApiKey(P.id,W,c,void 0,h.trim());M(ee=>({...ee,[P.id]:N})),Z(ee=>({...ee,[P.id]:""})),j(P.id,"configured"),pt({description:"API Key 已保存"})}catch(N){K(P.id,Qe(N)),j(P.id,"failed")}finally{B(P.id,!1)}}},Ae=async(P,c)=>{const h=c?A[P]?.credentials.find(W=>W.id===c)?.offeringId:void 0;B(P,!0),K(P);try{await e.disconnect(P,c),M(W=>({...W,[P]:void 0})),z(W=>({...W,[P]:void 0})),$(W=>({...W,[P]:h?{...W[P],[h]:void 0}:void 0})),c?(V(W=>({...W,[P]:xu(A[P],P,c)})),pt({description:"已从当前 Pod 移除账号"})):(j(P,"disconnected"),pt({description:"已断开连接"}))}catch(W){K(P,Qe(W),h)}finally{B(P,!1)}},Ce=(P,c)=>{V(h=>({...h,[P]:Eu(A[P],P,c)})),j(P,c.authMode==="apiKey"||c.authMode==="local"?"configured":"connected")},De=async(P,c,h=!1,W="")=>{ae(N=>({...N,[P]:!0})),K(P);try{const N=c?await e.discoverModels(P,c):await e.discoverModels(P);Q(be=>be+1);const ee=A[P]?.selectedModels??[],ge={...c0(P,c),...N.complete===!1?{markMissing:!1}:{}};try{const ze=(await e.listModels()).filter(Re=>Re.provider===P);w(Re=>{const zt=fa(Re,P,ze,ge),Nn=fa(zt,P,N.models,ge);return Ru(Nn,P,ee,N.models,ge)})}catch{w(be=>Ru(fa(be,P,N.models,ge),P,ee,N.models,ge))}try{const ze=(await e.listProviders()).find(Re=>Re.id===P);ze&&V(Re=>({...Re,[P]:ze}))}catch{}return N.complete===!1?K(P,"部分连接同步失败,已保留原有模型目录,可稍后重试。",c?.offeringId):h&&pt({variant:N.models.length>0?"success":"default",description:N.models.length>0?`连接成功,已同步 ${N.models.length} 个模型`:"连接成功,但服务商未返回任何模型。请确认该服务支持 /models 接口,或使用「添加模型」手工录入。"}),!0}catch(N){const ee=Qe(N);return K(P,`${W}${ee}`,c?.offeringId),!1}finally{ae(N=>({...N,[P]:!1}))}},Ft=async(P,c,h)=>{B(P,!0),K(P);try{const W=await e.createApiKeyCredential(P,{offeringId:c.id,apiKey:h.apiKey,label:h.label,baseUrl:h.baseUrl,proxyUrl:h.proxyUrl,priority:h.priority});Ce(P,W),pt({description:"API Key 已添加"}),await De(P,{offeringId:W.offeringId,credentialId:W.id})}catch(W){const N=Qe(W);throw K(P,N,c.id),new Error(N)}finally{B(P,!1)}},Me=async(P,c,h)=>{B(P,!0),K(P);try{const W=c.kind==="local",N=await e.createLocalCredential(P,{offeringId:c.id,authorizationMethodId:h?.id,label:c.label??$e(c),...W?{baseUrl:c.endpoints?.[0]?.baseUrl}:{},priority:10});Ce(P,N),pt({description:`${$e(c)} 已连接`}),c.modelDiscovery?.strategy!=="unsupported"&&await De(P,{offeringId:N.offeringId,credentialId:N.id},!1,W?"本地服务已连接,模型获取失败:":"订阅已读取,模型获取失败:")}catch(W){const N=Qe(W);throw K(P,N,c.id),new Error(N)}finally{B(P,!1)}},Dn=async(P,c,h)=>{B(P,!0),K(P);try{const W=await e.updateProviderCredential(P,c.id,{expectedVersion:c.version,...h});Ce(P,W),pt({description:"凭证已更新"}),W.enabled&&await De(P,{offeringId:W.offeringId,credentialId:W.id})}catch(W){const N=Qe(W);throw K(P,N,c.offeringId),new Error(N)}finally{B(P,!1)}},Pn=async(P,c)=>{if(c.id===`${P}:current`&&c.version===0){if(A[P]?.credentials.some(h=>h.id!==c.id)){K(P,"请重新加载连接后再移除旧连接。",c.offeringId);return}await Ae(P);return}B(P,!0),K(P);try{await e.deleteProviderCredential(P,c.id);const h=xu(A[P],P,c.id);V(W=>({...W,[P]:h})),j(P,ah(h)),pt({description:"凭证已删除"})}catch(h){K(P,Qe(h),c.offeringId)}finally{B(P,!1)}},Er=async(P,c)=>{B(P,!0),K(P);try{const h=await e.testProviderCredential(P,{credentialId:c.id}),W=a0(h);V(N=>({...N,[P]:W?Eu(A[P],P,W):Iu(A[P],P,c.id,"healthy")})),pt({variant:"success",description:"测试通过"})}catch(h){const W=(await e.listProviders().catch(()=>[])).find(N=>N.id===P);V(N=>({...N,[P]:W??Iu(A[P],P,c.id,"invalid")})),K(P,Qe(h),c.offeringId)}finally{B(P,!1)}},Tn=async(P,c,h,W,N)=>{if(N<0||N>=h.length)return;const ee=[...h],[ge]=ee.splice(W,1);if(ge){ee.splice(N,0,ge),B(P,!0),K(P);try{const be=[];for(const[ze,Re]of ee.entries()){const zt=(ze+1)*10;if(Re.priority===zt){be.push(Re);continue}be.push(await e.updateProviderCredential(P,Re.id,{expectedVersion:Re.version,priority:zt}))}V(ze=>({...ze,[P]:s0(A[P],P,c,be)})),pt({description:"顺序已保存"})}catch(be){K(P,Qe(be),c.id)}finally{B(P,!1)}}},xr=J.useRef(new Set),kn=async(P,c,h)=>{const W=h?[h]:(A[P]?.credentials??[]).filter(N=>N.enabled&&N.offeringId===c.id);await Promise.all(W.map(async N=>{const ee=`${P}\0${N.id}`;if(xr.current.has(ee))return;xr.current.add(ee);const ge=be=>{$(ze=>({...ze,[P]:{...ze[P],[N.id]:be}}))};ge({busy:!0,credentialId:N.id});try{const be=await e.quota(P,!0,{offeringId:c.id,credentialId:N.id,credentialIri:N.id});ge({quota:be,busy:!1,credentialId:N.id})}catch(be){ge({busy:!1,error:Qe(be),credentialId:N.id})}finally{xr.current.delete(ee)}}))},Ir=async P=>{await De(P,P==="custom"&&a?{credentialId:a}:void 0,!0)},lr=J.useCallback(async()=>{Q(P=>P+1);try{w(await e.listModels())}catch{}},[e]),en=(P,c)=>{k(void 0),le({provider:P,model:c})},Rr=async P=>{if(!ue)return;const c=!!ue.model;ne(!0),k(void 0);try{await e.saveProviderModel(ue.provider,{id:P.id,displayName:P.name||void 0,inputModalities:P.inputModalities.length>0?P.inputModalities:void 0,capabilities:P.capabilities.length>0?P.capabilities:void 0}),le(void 0),pt({description:c?"模型已更新":"模型已添加"}),await lr()}catch(h){k(Qe(h))}finally{ne(!1)}},Yt=async(P,c)=>{K(P);try{await e.deleteProviderModel(P,c.id),w(h=>h.filter(W=>!(W.provider===P&&W.id===c.id))),pt({description:"模型已移除"}),lr()}catch(h){K(P,Qe(h))}},On=J.useCallback((P,c)=>{const h=[...new Set(c)],W=Y[P]??A[P]?.selectedModels.map(dr)??[],N=(f.current[P]??0)+1;f.current[P]=N,te(ee=>({...ee,[P]:h})),q(ee=>({...ee,[P]:"saving"})),(async()=>{try{const ee=[..._.filter(be=>be.provider===P),...A[P]?.selectedModels??[]],ge=h.map(be=>{const ze=ee.find(Re=>dr(Re)===be);return ze?f0(ze):{id:be}});P==="custom"?await e.saveModelSelection?.(P,ge,a):await e.saveModelSelection?.(P,ge),f.current[P]===N&&(Q(be=>be+1),q(be=>({...be,[P]:"saved"})),v?.(P,h))}catch(ee){if(f.current[P]!==N)return;q(ge=>({...ge,[P]:"error"})),te(ge=>({...ge,[P]:W})),v?.(P,W),pt({variant:"destructive",description:Qe(ee)})}})()},[e,A,f,_,v,a,Y]),jn=y.jsxs("section",{children:[d?y.jsxs("p",{className:"mb-4 rounded-md border border-destructive/30 px-3 py-2 text-sm text-destructive",children:["Provider 状态读取失败:",d]}):null,at.filter(P=>P.id===(o??"openai")).map(P=>{const c=A[P.id],h=d0(_.filter(N=>N.provider===P.id&&(P.id!=="custom"||!a||N.credentialId===a)),c?.selectedModels??[]),W=Y[P.id]??c?.selectedModels.map(dr)??[];return y.jsx(km,{definition:P,product:c,status:n0(I[P.id],c),accountLabel:s[P.id]?.accountLabel,attempt:ce[P.id],attemptOfferingId:D[P.id],apiKey:x[P.id]??"",baseUrl:re[P.id]??s[P.id]?.baseUrl??"",busy:!!(he[P.id]||O[P.id]),disabled:p,error:oe[P.id],quotas:T[P.id],models:h,selectedModelIds:W,modelSelectionStatus:G[P.id],onApiKeyChange:N=>Z(ee=>({...ee,[P.id]:N})),onBaseUrlChange:N=>ie(ee=>({...ee,[P.id]:N})),onBeginApiKey:()=>{L(P.id)},onBeginOffering:(N,ee,ge)=>{H(P.id,N,ee,ge)},onCancelConnect:N=>{pe(P.id,N)},onBeginBrowser:()=>{X(P)},onSaveApiKey:()=>{ve(P)},onDisconnect:N=>{Ae(P.id,N?.id)},onCreateApiKeyCredential:(N,ee)=>Ft(P.id,N,ee),onCreateLocalCredential:(N,ee)=>Me(P.id,N,ee),onUpdateCredential:(N,ee)=>Dn(P.id,N,ee),onDeleteCredential:N=>{Pn(P.id,N)},onTestCredential:N=>{Er(P.id,N)},onReorderCredentials:(N,ee,ge,be)=>{Tn(P.id,N,ee,ge,be)},onRefreshQuota:(N,ee)=>{kn(P.id,N,ee)},verifyPending:!!O[P.id],onVerify:()=>{Ir(P.id)},onAddModel:()=>en(P.id),onEditModel:N=>en(P.id,N),onDeleteModel:N=>{Yt(P.id,N)},onModelSelectionChange:On,onDismissError:()=>K(P.id)},P.id)})]}),Xt=y.jsx(e0,{client:e,clientConfigurationBridge:n,gatewayModels:R});return y.jsxs("div",{"data-testid":"ai-connections-panel",className:"mx-auto w-full max-w-5xl space-y-10 px-4 py-6 sm:px-8 sm:py-8",children:[t?y.jsx(Bp,{}):null,i==="keys"?Xt:null,i==="provider"?jn:null,i==="provider"&&ue?y.jsx(Um,{open:!0,providerName:at.find(P=>P.id===ue.provider)?.name??ue.provider,initialValue:ue.model?{id:ue.model.id,name:ue.model.displayName??"",inputModalities:ue.model.inputModalities??[],capabilities:ue.model.capabilities??[]}:void 0,error:se,saving:U,onOpenChange:P=>{P||le(void 0)},onSave:P=>{Rr(P)}}):null]})}function ah(e){if(!e||e.status==="unconfigured"||e.status==="unavailable")return"disconnected";if(e.status==="configured")return"configured";if(e.status==="attention")return"reauthRequired";const t=e.credentials.find(r=>r.enabled)??e.credentials[0];return t?.authMode==="oauth"||t?.authMode==="deviceCode"?"connected":"configured"}function n0(e,t){return e==="pending"||e==="failed"?e:t?ah(t):e??"unknown"}async function i0(e,t,r,n,i,o){let a=r;try{for(;i.current===n&&Os(a.status);){if(await u0(Math.max(1,a.intervalSeconds??2)*1e3),i.current!==n)return;a={...a,...await e.pollDevice(t,a)},o.onAttempt(a)}a.status==="completed"?await o.onConnected():i.current===n&&o.onFailed(a.message||`连接${a.status==="expired"?"已过期":"失败"}`)}catch(s){i.current===n&&o.onFailed(Qe(s))}finally{i.current===n&&o.onFinished()}}function Os(e){return e==="pending"||e==="authorization_pending"||e==="slow_down"}function Su(e){return e==="expired"?"连接已过期,请重新开始":e==="cancelled"?"连接已取消":e==="unsupported"?"当前 Provider 不支持此连接方式":"连接失败"}function o0(e){return e==="configured"?"configured":e==="connected"?"connected":e==="failed"||e==="reauthRequired"?"attention":e==="pending"?"loading":"unconfigured"}function Eu(e,t,r){const n=e??Wo(t),i=sh([...n.credentials.filter(o=>o.id!==r.id),r]);return{...n,credentials:i,status:dl(i)}}function xu(e,t,r){const n=e??Wo(t),i=n.credentials.filter(o=>o.id!==r);return{...n,credentials:i,status:dl(i)}}function Iu(e,t,r,n){const i=e??Wo(t),o=i.credentials.map(a=>a.id===r?{...a,health:n}:a);return{...i,credentials:o,status:o.some(a=>a.enabled&&a.health==="invalid")?"attention":dl(o)}}function a0(e){const t=e.credential;if(!t||typeof t!="object")return;const r=t;return typeof r.id=="string"&&typeof r.offeringId=="string"&&(r.authMode==="oauth"||r.authMode==="deviceCode"||r.authMode==="apiKey"||r.authMode==="local")&&typeof r.version=="number"?r:void 0}function dl(e){if(e.length===0)return"unconfigured";const t=e.filter(r=>r.enabled);return t.length===0?"configured":t.some(r=>r.health==="expired"||r.health==="invalid")?"attention":"available"}function s0(e,t,r,n){const i=e??Wo(t),o=new Set(n.map(a=>a.id));return{...i,offerings:i.offerings.some(a=>a.id===r.id)?i.offerings:[...i.offerings,r],credentials:sh([...i.credentials.filter(a=>!o.has(a.id)),...n])}}function Wo(e){return{id:e,name:at.find(t=>t.id===e)?.name??e,offerings:[],credentials:[],selectedModels:[],status:"unconfigured"}}function sh(e){return[...e].sort((t,r)=>t.priority-r.priority)}function l0(e){window.open(e,"_blank","noopener,noreferrer")}function u0(e){return new Promise(t=>window.setTimeout(t,e))}function Qe(e){const t=Hd(e);return t==="AI Connection request failed. Please try again."?"请求未完成。请确认 Xpod 正在运行且登录仍有效,然后重试。":t}function c0(e,t){return e==="custom"?t?.credentialId?{markMissing:!0,credentialId:t.credentialId}:{markMissing:!t}:t?.offeringId?{markMissing:!0,offeringId:t.offeringId}:{markMissing:!t}}function fa(e,t,r,n={markMissing:!1}){const i=new Set(r.map(a=>a.id)),o=e.map(a=>n.markMissing&&a.provider===t&&!a.custom&&!i.has(a.id)&&(n.offeringId===void 0||a.offeringId===n.offeringId)&&(n.credentialId===void 0||a.credentialId===n.credentialId)?sn({...a,availability:"unavailable"}):a);for(const a of r){const s=a,u="provider"in a,d=s.offeringId??(u?void 0:n.offeringId),p=s.credentialId??(u?void 0:n.credentialId),g=o.findIndex(v=>v.provider!==t?!1:s.resourceId&&v.resourceId?s.resourceId===v.resourceId:p!==void 0?v.id===s.id&&v.credentialId===p:d!==void 0?v.id===s.id&&v.offeringId===d:v.id===s.id&&v.offeringId===void 0);g===-1?o.push(sn({...s,id:s.id,provider:t,availability:s.availability??"available",...d?{offeringId:d}:{},...p?{credentialId:p}:{}})):o[g]=sn({...o[g],...s,provider:t,displayName:s.displayName??o[g].displayName,availability:s.availability??"available",...d?{offeringId:d}:{},...p?{credentialId:p}:{}})}return o}function Ru(e,t,r,n,i){if(!i.markMissing||r.length===0)return e;const o=new Set(n.map(s=>s.id)),a=[...e];for(const s of r.filter(u=>u.provider===t)){if(s.custom||i.offeringId!==void 0&&s.offeringId!==i.offeringId||i.credentialId!==void 0&&s.credentialId!==i.credentialId||o.has(s.id))continue;const u=dr(s),d=a.findIndex(g=>g.provider===t&&dr(g)===u),p=sn({...s,availability:"unavailable"});d===-1?a.push(p):a[d]=sn({...a[d],...p,displayName:a[d].displayName??p.displayName})}return a}function d0(e,t){const r=[...e];for(const n of t){const i=r.findIndex(o=>dr(o)===dr(n));if(i===-1){r.push(n);continue}r[i]=sn({...r[i],...n,displayName:r[i].displayName??n.displayName,availability:r[i].availability==="unavailable"?"unavailable":n.availability})}return r}function sn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function dr(e){return e.resourceId??(e.offeringId?`${e.offeringId}:${e.id}`:e.id)}function f0(e){return{id:e.id,...e.offeringId?{offeringId:e.offeringId}:{},...e.resourceId?{resourceId:e.resourceId}:{}}}function Cu(e){return e!==void 0}function lh({controller:e,renderToaster:t=!0}){const r=ll(e),n=ul(e),i=Yf(e),o=em(e),a=cl(e),s=Zf(e),u=at.find(C=>C.id===n),d=n==="custom"?a.custom?.credentials.find(C=>C.id===i):void 0,p=sl.find(C=>C.id===r)?.title,g=d?.label??a[n]?.name??u?.name??n,v=p??`${g} 详情`,I=n==="custom"&&i&&a.custom?{...a,custom:{...a.custom,name:g,offerings:h0(a.custom,d),credentials:a.custom.credentials.filter(C=>C.id===i),selectedModels:a.custom.selectedModels.filter(C=>C.credentialId===i)}}:a;return J.useEffect(()=>(e.client&&e.loadProviders(),()=>e.cancelProviderLoads()),[e]),e.client?y.jsx("section",{role:"region","aria-label":v,children:y.jsx(r0,{client:e.client,renderToaster:t,clientConfigurationBridge:e.clientConfigurationBridge,selectedSection:r,selectedProvider:n,selectedCredentialId:i,openExternal:e.openExternal,providerSummaries:o,providerProducts:I,providerLoadError:s,providerLoading:!a[n]&&!s,onProviderStateChange:e.setProviderState})}):y.jsxs("section",{role:"alert","aria-label":"AI Connections unavailable",children:[y.jsx("h2",{children:"AI Connections 尚未就绪"}),y.jsx("p",{children:"宿主需要先提供已登录的 WebID 和可用的 Pod。"})]})}function h0(e,t){if(!t)return e.offerings;const r=t.compatibility??(t.offeringId==="anthropic-compatible"?"anthropic":"openai"),n=e.offerings.find(i=>i.id===t.offeringId)??e.offerings[0];return n?[{...n,id:t.offeringId,label:r==="auto"?"自动探测":r==="anthropic"?"Anthropic 兼容":"OpenAI 兼容",endpoints:t.baseUrl?[{protocol:r==="anthropic"?"anthropic":"chatCompletions",baseUrl:t.baseUrl}]:n.endpoints,modelDiscovery:r==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:r==="auto"?{strategy:"auto",path:"/models",endpointProtocol:"auto"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}}]:[]}function p0({open:e,saving:t=!1,error:r,onOpenChange:n,onSave:i}){const[o,a]=J.useState(""),[s,u]=J.useState("auto"),[d,p]=J.useState(""),[g,v]=J.useState(""),[I,C]=J.useState(""),[_,w]=J.useState();J.useEffect(()=>{e&&(a(""),u("auto"),p(""),v(""),C(""),w(void 0))},[e]);const R=()=>{w(void 0);let E;try{E=y0(d)}catch{w("Base URL 必须是有效的 http(s) 地址。");return}const S=o.trim(),Q=g.trim();if(!S){w("请输入 Provider 名称。");return}if(!Q){w("请输入 API Key。");return}i({offeringId:g0(s),apiKey:Q,label:S,baseUrl:E,priority:10,compatibility:s,...I.trim()?{proxyUrl:I.trim()}:{}})};return y.jsx(Ii,{open:e,onOpenChange:n,children:y.jsxs(An,{className:"max-w-md",style:{maxHeight:"calc(100vh - 2rem)",overflowY:"auto"},"aria-describedby":"ai-custom-provider-description",children:[y.jsx(Ri,{children:y.jsx(_n,{children:"添加自定义 Provider"})}),y.jsx("p",{id:"ai-custom-provider-description",className:"text-sm text-muted-foreground",children:"用 OpenAI/Anthropic 兼容协议接入第三方模型服务。Xpod 会把真实 API Key 存进当前 Pod。"}),y.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-name",children:"Provider 名称"}),y.jsx(st,{id:"ai-custom-provider-name",value:o,disabled:t,placeholder:"例如 OpenRouter",onChange:E=>a(E.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-compatibility",children:"兼容协议"}),y.jsxs("select",{id:"ai-custom-provider-compatibility",value:s,disabled:t,"aria-label":"兼容协议",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",onChange:E=>u(E.target.value),children:[y.jsx("option",{value:"auto",children:"自动探测"}),y.jsx("option",{value:"openai",children:"OpenAI 兼容优先"}),y.jsx("option",{value:"anthropic",children:"Anthropic 兼容优先"})]})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-base-url",children:"Base URL"}),y.jsx(st,{id:"ai-custom-provider-base-url",value:d,disabled:t,placeholder:"https://openrouter.ai/api 或 https://openrouter.ai/api/v1",onChange:E=>p(E.target.value)}),y.jsx("p",{className:"text-xs text-muted-foreground",children:"裸域名会自动补齐为 /v1。"})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-api-key",children:"API Key"}),y.jsx(st,{id:"ai-custom-provider-api-key",type:"password",value:g,disabled:t,autoComplete:"new-password","data-lpignore":"true",onChange:E=>v(E.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-proxy-url",children:"Proxy URL(可选)"}),y.jsx(st,{id:"ai-custom-provider-proxy-url",value:I,disabled:t,placeholder:"http://127.0.0.1:7890",onChange:E=>C(E.target.value)})]}),_||r?y.jsx("p",{className:"text-sm text-destructive",children:_??r}):null]}),y.jsxs(gi,{children:[y.jsx(_e,{type:"button",variant:"outline",disabled:t,onClick:()=>n(!1),children:"取消"}),y.jsx(_e,{type:"button",disabled:t,onClick:R,children:"保存自定义 Provider"})]})]})})}function y0(e){const t=e.trim(),r=new URL(t);if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("invalid_custom_base_url");r.hash="";const n=r.pathname.replace(/\/+$/u,"");return!n||n===""?r.pathname="/v1":r.pathname=n,r.href.replace(/\/$/u,"")}function g0(e){return e==="anthropic"?"anthropic-compatible":"openai-compatible"}function b0({controller:e}){const t=Xf(e),[r,n]=J.useState(!1),[i,o]=J.useState(!1),[a,s]=J.useState(),u=async d=>{if(!e.client){s("请先登录后再添加自定义 Provider。");return}o(!0),s(void 0);let p;try{const g=await e.client.createApiKeyCredential("custom",d);p=g.id,await e.client.discoverModels("custom",{offeringId:g.offeringId,credentialId:g.id,compatibility:d.compatibility}),e.selectProvider("custom",g.id),await e.loadProviders(),n(!1)}catch(g){p&&await e.client.deleteProviderCredential("custom",p).catch(()=>{}),s(g instanceof Error?g.message:"AI Connection request failed. Please try again.")}finally{o(!1)}};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex h-full min-w-0 items-center gap-2 px-3",children:[y.jsxs("div",{className:"relative min-w-0 flex-1",children:[y.jsx(uf,{"aria-hidden":"true",className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),y.jsx(st,{type:"search","aria-label":"搜索 Provider",placeholder:"搜索 Provider",value:t,onChange:d=>e.setSearchQuery(d.target.value),className:"h-8 border-transparent bg-muted/50 pl-8 text-xs focus-visible:bg-background"})]}),y.jsx(_e,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":"添加 AI Connection",title:"添加 AI Connection",onClick:()=>n(!0),children:y.jsx(wn,{className:"h-4 w-4","aria-hidden":"true"})})]}),y.jsx(p0,{open:r,saving:i,error:a,onOpenChange:n,onSave:d=>{u(d)}})]})}function m0({controller:e}){const t=ll(e),r=ul(e),n=cl(e),i=at.find(a=>a.id===r),o=sl.find(a=>a.id===t)?.title??n[r]?.name??i?.name??r;return y.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:y.jsx("h1",{className:"truncate text-sm font-medium text-foreground",children:o})})}const w0=["navigation.openExternal","aiClientConfiguration"];function A0(e){const t=ha(e,"Extension manifest");Mu(t.extensionId,"extensionId"),tn(t.name,"name"),tn(t.version,"version"),tn(t.sdkVersion,"sdkVersion");const r=ha(t.contributes,"contributes");if(!Array.isArray(r.applets)||r.applets.length===0)throw new Error("Extension manifest must contribute at least one Applet");const n=new Set;for(const i of r.applets){const o=ha(i,"Applet manifest"),a=Mu(o.appId,"appId");if(n.has(a))throw new Error(`Extension manifest has duplicate appId: ${a}`);if(n.add(a),tn(o.name,"Applet name"),tn(o.entry,"Applet entry"),!Array.isArray(o.commands))throw new Error("Applet commands must be an array");if(o.layout!=="single-pane"&&o.layout!=="two-pane")throw new Error("Applet layout must be single-pane or two-pane")}if(!Array.isArray(t.dataModels))throw new Error("Extension dataModels must be an array");if(!Array.isArray(t.hostCapabilities))throw new Error("Extension hostCapabilities must be an array");for(const i of t.hostCapabilities)if(!w0.includes(i))throw new Error(`Extension manifest requested unknown Host capability: ${String(i)}`);return e}function ha(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function tn(e,t){if(typeof e!="string"||e.trim().length===0)throw new Error(`${t} must be a non-empty string`);return e}function Mu(e,t){const r=tn(e,t);let n;try{n=new URL(r)}catch{throw new Error(`${t} must be a valid HTTPS URL`)}if(n.protocol!=="https:")throw new Error(`${t} must be a valid HTTPS URL`);return r}const uh=A0({extensionId:"https://undefineds.co/extensions/ai-connections",name:"AI Connection",version:"0.1.0",sdkVersion:"1",contributes:{applets:[{appId:"https://undefineds.co/applets/ai-connections",name:"AI Connection",entry:".",commands:[],layout:"two-pane"}]},dataModels:[],hostCapabilities:["navigation.openExternal","aiClientConfiguration"]}),fl=uh.contributes.applets[0],js={manifest:fl,createController:Yb,activate(e){e.loadProviders()},slots:{listHeader:b0,list:um,mainHeader:m0,main:lh}},Du={manifest:uh,applets:{[fl.appId]:js}};function _0(e={}){return e.renderToaster!==!1?Du:{...Du,applets:{[fl.appId]:{...js,slots:{...js.slots,main:({controller:t})=>J.createElement(lh,{controller:t,renderToaster:!1})}}}}}function v0({collection:e,assertCurrent:t,accountIndex:r,fetch:n=window.fetch.bind(window)}){const i=async(...u)=>{t();const d=await n(...u);try{t()}catch(p){throw d.body?.cancel().catch(()=>{}),p}return d},o=new Set,a=async u=>{t();const d=await Lp(u,i,r);if(t(),!d||!new URL(d).pathname.startsWith("/.account/"))throw new Error("客户端凭据地址不属于可信账号服务。");return d},s=(u,d,p)=>(t(),i(u,{method:d,credentials:"include",redirect:"error",headers:Up({Accept:"application/json",...p?{"Content-Type":"application/json"}:{}},r),...p?{body:JSON.stringify(p)}:{}}));return{async create({name:u,webId:d}){if(!u.trim()||!d)throw new Error("创建客户端凭据需要名称和当前 WebID。");const p=await s(await a(e),"POST",{name:u.trim(),webId:d});if(!p.ok)throw new Error(`创建客户端凭据失败(HTTP ${p.status})。`);const g=await p.json();if(t(),typeof g.id!="string"||!g.id||g.id.includes(":")||typeof g.secret!="string"||!g.secret||typeof g.resource!="string"||!g.resource)throw new Error("账号服务未返回有效的客户端凭据。");const v=await a(g.resource),I=new TextEncoder().encode(`${g.id}:${g.secret}`),C=btoa(Array.from(I,_=>String.fromCharCode(_)).join(""));return t(),{apiKey:`sk-${C}`,resource:v}},async list(){const u=await s(await a(e),"GET");if(!u.ok)throw new Error(`读取客户端凭据失败(HTTP ${u.status})。`);const d=await u.json();t();const p=Object.entries(d.clientCredentials??{}),g=await Promise.all(p.map(async([v,I])=>({clientId:v,label:v,resource:await a(String(I))})));return t(),g},async revoke({clientId:u,resource:d,webId:p}){const g=await a(d),v=JSON.stringify([g,u,p]),I=await s(g,"GET");if(I.status===404||I.status===410){if(o.has(v))return;throw new Error("无法确认客户端凭据已撤销,请检查当前 Account 登录;Key 记录已保留。")}if(!I.ok)throw new Error(`读取客户端凭据失败(HTTP ${I.status})。`);const C=await I.json();if(t(),C.id!==u||C.webId!==p)throw new Error("客户端凭据与当前 Key 或 WebID 不匹配,未执行删除。");const _=await s(g,"DELETE");if(!_.ok)throw new Error(`撤销客户端凭据失败(HTTP ${_.status})。`);o.add(v)}}}var Pr={},qn={},Tr={},kr={};var Eo="@@__IMMUTABLE_INDEXED__@@";function At(e){return!!(e&&e[Eo])}var xo="@@__IMMUTABLE_KEYED__@@";function ke(e){return!!(e&&e[xo])}function Ho(e){return ke(e)||At(e)}var ch="@@__IMMUTABLE_ITERABLE__@@";function _t(e){return!!(e&&e[ch])}var Je=function(t){return _t(t)?t:rt(t)},Ot=(function(e){function t(r){return ke(r)?r:Ar(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je),Jr=(function(e){function t(r){return At(r)?r:Nt(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je),vn=(function(e){function t(r){return _t(r)&&!Ho(r)?r:In(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je);Je.Keyed=Ot;Je.Indexed=Jr;Je.Set=vn;var Sn=0,Rt=1,Ct=2,Ns=typeof Symbol=="function"&&Symbol.iterator,dh="@@iterator",Vo=Ns||dh,Ee=function(t){this.next=t};Ee.prototype.toString=function(){return"[Iterator]"};Ee.KEYS=Sn;Ee.VALUES=Rt;Ee.ENTRIES=Ct;Ee.prototype.inspect=Ee.prototype.toSource=function(){return this.toString()};Ee.prototype[Vo]=function(){return this};function je(e,t,r,n){var i=e===Sn?t:e===Rt?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function tt(){return{value:void 0,done:!0}}function hl(e){return Array.isArray(e)?!0:!!Qo(e)}function Pu(e){return!!(e&&typeof e.next=="function")}function Fs(e){var t=Qo(e);return t&&t.call(e)}function Qo(e){var t=e&&(Ns&&e[Ns]||e[dh]);if(typeof t=="function")return t}function S0(e){var t=Qo(e);return t&&t===e.entries}function E0(e){var t=Qo(e);return t&&t===e.keys}var Fi="delete",Te=5,It=1<<Te,ut=It-1,Se={};function Bs(){return{value:!1}}function Tt(e){e&&(e.value=!0)}function pl(){}function un(e){return e.size===void 0&&(e.size=e.__iterate(fh)),e.size}function hr(e,t){if(typeof t!="number"){var r=t>>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?un(e)+t:t}function fh(){return!0}function Bi(e,t,r){return(e===0&&!ph(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function En(e,t){return hh(e,t,0)}function Li(e,t){return hh(e,t,t)}function hh(e,t,r){return e===void 0?r:ph(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function ph(e){return e<0||e===0&&1/e===-1/0}var yh="@@__IMMUTABLE_RECORD__@@";function wr(e){return!!(e&&e[yh])}function jt(e){return _t(e)||wr(e)}var pr="@@__IMMUTABLE_ORDERED__@@";function qt(e){return!!(e&&e[pr])}var gh="@@__IMMUTABLE_SEQ__@@";function Go(e){return!!(e&&e[gh])}var xn=Object.prototype.hasOwnProperty;function yl(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var rt=(function(e){function t(r){return r==null?bl():jt(r)?r.toSeq():I0(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var o=this._cache;if(o){for(var a=o.length,s=0;s!==a;){var u=o[i?a-++s:s++];if(n(u[1],u[0],this)===!1)break}return s}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var o=this._cache;if(o){var a=o.length,s=0;return new Ee(function(){if(s===a)return tt();var u=o[i?a-++s:s++];return je(n,u[0],u[1])})}return this.__iteratorUncached(n,i)},t})(Je),Ar=(function(e){function t(r){return r==null?bl().toKeyedSeq():_t(r)?ke(r)?r.toSeq():r.fromEntrySeq():wr(r)?r.toSeq():ml(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(rt),Nt=(function(e){function t(r){return r==null?bl():_t(r)?ke(r)?r.entrySeq():r.toIndexedSeq():wr(r)?r.toSeq().entrySeq():bh(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(rt),In=(function(e){function t(r){return(_t(r)&&!Ho(r)?r:Nt(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(rt);rt.isSeq=Go;rt.Keyed=Ar;rt.Set=In;rt.Indexed=Nt;rt.prototype[gh]=!0;var cn=(function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[hr(this,n)]:i},t.prototype.__iterate=function(n,i){for(var o=this._array,a=o.length,s=0;s!==a;){var u=i?a-++s:s++;if(n(o[u],u,this)===!1)break}return s},t.prototype.__iterator=function(n,i){var o=this._array,a=o.length,s=0;return new Ee(function(){if(s===a)return tt();var u=i?a-++s:s++;return je(n,u,o[u])})},t})(Nt),gl=(function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return xn.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var o=this._object,a=this._keys,s=a.length,u=0;u!==s;){var d=a[i?s-++u:u++];if(n(o[d],d,this)===!1)break}return u},t.prototype.__iterator=function(n,i){var o=this._object,a=this._keys,s=a.length,u=0;return new Ee(function(){if(u===s)return tt();var d=a[i?s-++u:u++];return je(n,d,o[d])})},t})(Ar);gl.prototype[pr]=!0;var x0=(function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var o=this._collection,a=Fs(o),s=0;if(Pu(a))for(var u;!(u=a.next()).done&&n(u.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=this._collection,a=Fs(o);if(!Pu(a))return new Ee(tt);var s=0;return new Ee(function(){var u=a.next();return u.done?u:je(n,s++,u.value)})},t})(Nt),Tu;function bl(){return Tu||(Tu=new cn([]))}function ml(e){var t=wl(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new gl(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function bh(e){var t=wl(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function I0(e){var t=wl(e);if(t)return S0(e)?t.fromEntrySeq():E0(e)?t.toSetSeq():t;if(typeof e=="object")return new gl(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function wl(e){return yl(e)?new cn(e):hl(e)?new x0(e):void 0}function Ui(){return this.__ensureOwner()}function qi(){return this.__ownerID?this:this.__ensureOwner(new pl)}var Kn=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function Jo(e){return e>>>1&1073741824|e&3221225471}var R0=Object.prototype.valueOf;function lt(e){if(e==null)return ku(e);if(typeof e.hashCode=="function")return Jo(e.hashCode(e));var t=O0(e);if(t==null)return ku(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return C0(t);case"string":return t.length>j0?M0(t):Ls(t);case"object":case"function":return T0(t);case"symbol":return P0(t);default:if(typeof t.toString=="function")return Ls(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function ku(e){return e===null?1108378658:1108378659}function C0(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return Jo(t)}function M0(e){var t=ga[e];return t===void 0&&(t=Ls(e),ya===N0&&(ya=0,ga={}),ya++,ga[e]=t),t}function Ls(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Jo(t)}var D0=(Math.random()*1048576|1)%1048576||40503;function Al(e){if(typeof e!="string")return lt(e);for(var t=0,r=0;r<e.length;r++)t=D0*t+e.charCodeAt(r)|0;return t}function P0(e){var t=Nu[e];return t!==void 0||(t=mh(),Nu[e]=t),t}function T0(e){var t;if(Us&&(t=qs.get(e),t!==void 0)||(t=e[Ur],t!==void 0)||!ju&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ur],t!==void 0||(t=k0(e),t!==void 0)))return t;if(t=mh(),Us)qs.set(e,t);else{if(Ou!==void 0&&Ou(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(ju)Object.defineProperty(e,Ur,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ur]=t;else if(e.nodeType!==void 0)e[Ur]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var Ou=Object.isExtensible,ju=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();function k0(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function O0(e){return e.valueOf!==R0&&typeof e.valueOf=="function"?e.valueOf(e):e}function mh(){var e=++pa;return pa&1073741824&&(pa=0),e}var Us=typeof WeakMap=="function",qs;Us&&(qs=new WeakMap);var Nu=Object.create(null),pa=0,Ur="__immutablehash__";typeof Symbol=="function"&&(Ur=Symbol(Ur));var j0=16,N0=255,ya=0,ga={},Yo=(function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=_l(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var o=this,a=Sh(this,n,i);return this._useKeys||(a.valueSeq=function(){return o._iter.toSeq().map(n,i)}),a},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a,s){return n(a,s,o)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t})(Ar);Yo.prototype[pr]=!0;var wh=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this,a=0;return i&&un(this),this._iter.__iterate(function(s){return n(s,i?o.size-++a:a++,o)},i)},t.prototype.__iterator=function(n,i){var o=this,a=this._iter.__iterator(Rt,i),s=0;return i&&un(this),new Ee(function(){var u=a.next();return u.done?u:je(n,i?o.size-++s:s++,u.value,u)})},t})(Nt),Ah=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(Rt,i);return new Ee(function(){var a=o.next();return a.done?a:je(n,a.value,a.value,a)})},t})(In),_h=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){if(a){Bu(a);var s=_t(a);return n(s?a.get(1):a[1],s?a.get(0):a[0],o)}},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(Rt,i);return new Ee(function(){for(;;){var a=o.next();if(a.done)return a;var s=a.value;if(s){Bu(s);var u=_t(s);return je(n,u?s.get(0):s[0],u?s.get(1):s[1],a)}}})},t})(Ar);wh.prototype.cacheResult=Yo.prototype.cacheResult=Ah.prototype.cacheResult=_h.prototype.cacheResult=El;function vh(e){var t=Jt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=El,t.__iterateUncached=function(r,n){var i=this;return e.__iterate(function(o,a){return r(a,o,i)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===Ct){var i=e.__iterator(r,n);return new Ee(function(){var o=i.next();if(!o.done){var a=o.value[0];o.value[0]=o.value[1],o.value[1]=a}return o})}return e.__iterator(r===Rt?Sn:Rt,n)},t}function Sh(e,t,r){var n=Jt(e);return n.size=e.size,n.has=function(i){return e.has(i)},n.get=function(i,o){var a=e.get(i,Se);return a===Se?o:t.call(r,a,i,e)},n.__iterateUncached=function(i,o){var a=this;return e.__iterate(function(s,u,d){return i(t.call(r,s,u,d),u,a)!==!1},o)},n.__iteratorUncached=function(i,o){var a=e.__iterator(Ct,o);return new Ee(function(){var s=a.next();if(s.done)return s;var u=s.value,d=u[0];return je(i,d,t.call(r,u[1],d,e),s)})},n}function _l(e,t){var r=Jt(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var n=vh(e);return n.reverse=function(){return e.flip()},n}),r.get=function(n,i){return e.get(t?n:-1-n,i)},r.has=function(n){return e.has(t?n:-1-n)},r.includes=function(n){return e.includes(n)},r.cacheResult=El,r.__iterate=function(n,i){var o=this,a=0;return i&&un(e),e.__iterate(function(s,u){return n(s,t?u:i?o.size-++a:a++,o)},!i)},r.__iterator=function(n,i){var o=0;i&&un(e);var a=e.__iterator(Ct,!i);return new Ee(function(){var s=a.next();if(s.done)return s;var u=s.value;return je(n,t?u[0]:i?r.size-++o:o++,u[1],s)})},r}function Eh(e,t,r,n){var i=Jt(e);return n&&(i.has=function(o){var a=e.get(o,Se);return a!==Se&&!!t.call(r,a,o,e)},i.get=function(o,a){var s=e.get(o,Se);return s!==Se&&t.call(r,s,o,e)?s:a}),i.__iterateUncached=function(o,a){var s=this,u=0;return e.__iterate(function(d,p,g){if(t.call(r,d,p,g))return u++,o(d,n?p:u-1,s)},a),u},i.__iteratorUncached=function(o,a){var s=e.__iterator(Ct,a),u=0;return new Ee(function(){for(;;){var d=s.next();if(d.done)return d;var p=d.value,g=p[0],v=p[1];if(t.call(r,v,g,e))return je(o,n?g:u++,v,d)}})},i}function F0(e,t,r){var n=Yr().asMutable();return e.__iterate(function(i,o){n.update(t.call(r,i,o,e),0,function(a){return a+1})}),n.asImmutable()}function B0(e,t,r){var n=ke(e),i=(qt(e)?Gt():Yr()).asMutable();e.__iterate(function(a,s){i.update(t.call(r,a,s,e),function(u){return u=u||[],u.push(n?[s,a]:a),u})});var o=Sl(e);return i.map(function(a){return Pe(e,o(a))}).asImmutable()}function L0(e,t,r){var n=ke(e),i=[[],[]];e.__iterate(function(a,s){i[t.call(r,a,s,e)?1:0].push(n?[s,a]:a)});var o=Sl(e);return i.map(function(a){return Pe(e,o(a))})}function vl(e,t,r,n){var i=e.size;if(Bi(t,r,i))return e;if(typeof i>"u"&&(t<0||r<0))return vl(e.toSeq().cacheResult(),t,r,n);var o=En(t,i),a=Li(r,i),s=a-o,u;s===s&&(u=s<0?0:s);var d=Jt(e);return d.size=u===0?u:e.size&&u||void 0,!n&&Go(e)&&u>=0&&(d.get=function(p,g){return p=hr(this,p),p>=0&&p<u?e.get(p+o,g):g}),d.__iterateUncached=function(p,g){var v=this;if(u===0)return 0;if(g)return this.cacheResult().__iterate(p,g);var I=0,C=!0,_=0;return e.__iterate(function(w,R){if(!(C&&(C=I++<o)))return _++,p(w,n?R:_-1,v)!==!1&&_!==u}),_},d.__iteratorUncached=function(p,g){if(u!==0&&g)return this.cacheResult().__iterator(p,g);if(u===0)return new Ee(tt);var v=e.__iterator(p,g),I=0,C=0;return new Ee(function(){for(;I++<o;)v.next();if(++C>u)return tt();var _=v.next();return n||p===Rt||_.done?_:p===Sn?je(p,C-1,void 0,_):je(p,C-1,_.value[1],_)})},d}function U0(e,t,r){var n=Jt(e);return n.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=0;return e.__iterate(function(u,d,p){return t.call(r,u,d,p)&&++s&&i(u,d,a)}),s},n.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(Ct,o),u=!0;return new Ee(function(){if(!u)return tt();var d=s.next();if(d.done)return d;var p=d.value,g=p[0],v=p[1];return t.call(r,v,g,a)?i===Ct?d:je(i,g,v,d):(u=!1,tt())})},n}function xh(e,t,r,n){var i=Jt(e);return i.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var u=!0,d=0;return e.__iterate(function(p,g,v){if(!(u&&(u=t.call(r,p,g,v))))return d++,o(p,n?g:d-1,s)}),d},i.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var u=e.__iterator(Ct,a),d=!0,p=0;return new Ee(function(){var g,v,I;do{if(g=u.next(),g.done)return n||o===Rt?g:o===Sn?je(o,p++,void 0,g):je(o,p++,g.value[1],g);var C=g.value;v=C[0],I=C[1],d&&(d=t.call(r,I,v,s))}while(d);return o===Ct?g:je(o,v,I,g)})},i}var q0=(function(e){function t(r){this._wrappedIterables=r.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,i){if(n!==void 0){var o=i.size;if(o!==void 0)return n+o}},0),this[xo]=this._wrappedIterables[0][xo],this[Eo]=this._wrappedIterables[0][Eo],this[pr]=this._wrappedIterables[0][pr]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(this._wrappedIterables.length!==0){if(i)return this.cacheResult().__iterate(n,i);for(var o=0,a=ke(this),s=a?Ct:Rt,u=this._wrappedIterables[o].__iterator(s,i),d=!0,p=0;d;){for(var g=u.next();g.done;){if(o++,o===this._wrappedIterables.length)return p;u=this._wrappedIterables[o].__iterator(s,i),g=u.next()}var v=a?n(g.value[1],g.value[0],this):n(g.value,p,this);d=v!==!1,p++}return p}},t.prototype.__iteratorUncached=function(n,i){var o=this;if(this._wrappedIterables.length===0)return new Ee(tt);if(i)return this.cacheResult().__iterator(n,i);var a=0,s=this._wrappedIterables[a].__iterator(n,i);return new Ee(function(){for(var u=s.next();u.done;){if(a++,a===o._wrappedIterables.length)return u;s=o._wrappedIterables[a].__iterator(n,i),u=s.next()}return u})},t})(rt);function K0(e,t){var r=ke(e),n=[e].concat(t).map(function(o){return _t(o)?r&&(o=Ot(o)):o=r?ml(o):bh(Array.isArray(o)?o:[o]),o}).filter(function(o){return o.size!==0});if(n.length===0)return e;if(n.length===1){var i=n[0];if(i===e||r&&ke(i)||At(e)&&At(i))return i}return new q0(n)}function Ih(e,t,r){var n=Jt(e);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;function u(d,p){d.__iterate(function(g,v){return(!t||p<t)&&_t(g)?u(g,p+1):(a++,i(g,r?v:a-1,n)===!1&&(s=!0)),!s},o)}return u(e,0),a},n.__iteratorUncached=function(i,o){if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(i,o),s=[],u=0;return new Ee(function(){for(;a;){var d=a.next();if(d.done!==!1){a=s.pop();continue}var p=d.value;if(i===Ct&&(p=p[1]),(!t||s.length<t)&&_t(p))s.push(a),a=p.__iterator(i,o);else return r?d:je(i,u++,p,d)}return tt()})},n}function z0(e,t,r){var n=Sl(e);return e.toSeq().map(function(i,o){return n(t.call(r,i,o,e))}).flatten(!0)}function W0(e,t){var r=Jt(e);return r.size=e.size&&e.size*2-1,r.__iterateUncached=function(n,i){var o=this,a=0;return e.__iterate(function(s){return(!a||n(t,a++,o)!==!1)&&n(s,a++,o)!==!1},i),a},r.__iteratorUncached=function(n,i){var o=e.__iterator(Rt,i),a=0,s;return new Ee(function(){return(!s||a%2)&&(s=o.next(),s.done)?s:a%2?je(n,a++,t):je(n,a++,s.value,s)})},r}function dn(e,t,r){t||(t=Rh);var n=ke(e),i=0,o=e.toSeq().map(function(a,s){return[s,a,i++,r?r(a,s,e):a]}).valueSeq().toArray();return o.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(n?function(a,s){o[s].length=2}:function(a,s){o[s]=a[1]}),n?Ar(o):At(e)?Nt(o):In(o)}function $i(e,t,r){if(t||(t=Rh),r){var n=e.toSeq().map(function(i,o){return[i,r(i,o,e)]}).reduce(function(i,o){return Fu(t,i[1],o[1])?o:i});return n&&n[0]}return e.reduce(function(i,o){return Fu(t,i,o)?o:i})}function Fu(e,t,r){var n=e(r,t);return n===0&&r!==t&&(r==null||r!==r)||n>0}function eo(e,t,r,n){var i=Jt(e),o=new cn(r).map(function(a){return a.size});return i.size=n?o.max():o.min(),i.__iterate=function(a,s){for(var u=this.__iterator(Rt,s),d,p=0;!(d=u.next()).done&&a(d.value,p++,this)!==!1;);return p},i.__iteratorUncached=function(a,s){var u=r.map(function(g){return g=Je(g),Fs(s?g.reverse():g)}),d=0,p=!1;return new Ee(function(){var g;return p||(g=u.map(function(v){return v.next()}),p=n?g.every(function(v){return v.done}):g.some(function(v){return v.done})),p?tt():je(a,d++,t.apply(null,g.map(function(v){return v.value})))})},i}function Pe(e,t){return e===t?e:Go(e)?t:e.constructor(t)}function Bu(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Sl(e){return ke(e)?Ot:At(e)?Jr:vn}function Jt(e){return Object.create((ke(e)?Ar:At(e)?Nt:In).prototype)}function El(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):rt.prototype.cacheResult.call(this)}function Rh(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function Ks(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function Ge(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(Ks(e)&&Ks(t)&&e.equals(t))}function xl(e,t,r,n){return Xr(e,[t],r,n)}function Ch(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Dh(this,e)}function Mh(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return Dh(this,t,e)}function Dh(e,t,r){for(var n=[],i=0;i<t.length;i++){var o=Ot(t[i]);o.size!==0&&n.push(o)}return n.length===0?e:e.toSeq().size===0&&!e.__ownerID&&n.length===1?wr(e)?e:e.constructor(n[0]):e.withMutations(function(a){for(var s=r?function(d,p){xl(a,p,Se,function(g){return g===Se?d:r(g,d,p)})}:function(d,p){a.set(p,d)},u=0;u<n.length;u++)n[u].forEach(s)})}var H0=Object.prototype.toString;function Il(e){if(!e||typeof e!="object"||H0.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t,n=Object.getPrototypeOf(t);n!==null;)r=n,n=Object.getPrototypeOf(r);return r===t}function yr(e){return typeof e=="object"&&(jt(e)||Array.isArray(e)||Il(e))}function Ki(e){return typeof e=="string"&&(e==="__proto__"||e==="constructor")}function Wt(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function Io(e){if(Array.isArray(e))return Wt(e);var t={};for(var r in e)Ki(r)||xn.call(e,r)&&(t[r]=e[r]);return t}function V0(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Wi(e,t)}function Q0(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Wi(t,r,e)}function G0(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return zi(e,t)}function J0(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return zi(t,r,e)}function zi(e,t,r){return Wi(e,t,Y0(r))}function Wi(e,t,r){if(!yr(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(jt(e))return typeof r=="function"&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,o=n?Jr:Ot,a=n?function(u){i===e&&(i=Io(i)),i.push(u)}:function(u,d){if(!Ki(d)){var p=xn.call(i,d),g=p&&r?r(i[d],u,d):u;(!p||g!==i[d])&&(i===e&&(i=Io(i)),i[d]=g)}},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function Y0(e){function t(r,n,i){return yr(r)&&yr(n)&&X0(r,n)?Wi(r,[n],t):e?e(r,n,i):n}return t}function X0(e,t){var r=rt(e),n=rt(t);return At(r)===At(n)&&ke(r)===ke(n)}function Ph(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return zi(this,e)}function Th(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return zi(this,t,e)}function Rl(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Xr(this,e,Ht(),function(n){return zi(n,t)})}function Cl(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Xr(this,e,Ht(),function(n){return Wi(n,t)})}function kh(e,t,r){return Xr(e,t,Se,function(){return r})}function Ml(e,t){return kh(this,e,t)}function Dl(e,t,r){return arguments.length===1?e(this):xl(this,e,t,r)}function Pl(e,t,r){return Xr(this,e,t,r)}function Tl(){return this.__altered}function Hi(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}var Oh="@@__IMMUTABLE_MAP__@@";function Xo(e){return!!(e&&e[Oh])}function hi(e,t){if(!e)throw new Error(t)}function xt(e){hi(e!==1/0,"Cannot perform this action with an infinite size.")}var Yr=(function(e){function t(r){return r==null?Ht():Xo(r)&&!qt(r)?r:Ht().withMutations(function(n){var i=e(r);xt(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return qu(this,n,i)},t.prototype.remove=function(n){return qu(this,n,Se)},t.prototype.deleteAll=function(n){var i=Je(n);return i.size===0?this:this.withMutations(function(o){i.forEach(function(a){return o.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ht()},t.prototype.sort=function(n){return Gt(dn(this,n))},t.prototype.sortBy=function(n,i){return Gt(dn(this,i,n))},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){a.forEach(function(s,u){a.set(u,n.call(i,s,u,o))})})},t.prototype.__iterator=function(n,i){return new Z0(this,n,i)},t.prototype.__iterate=function(n,i){var o=this,a=0;return this._root&&this._root.iterate(function(s){return a++,n(s[1],s[0],o)},i),a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?kl(this.size,this._root,n,this.__hash):this.size===0?Ht():(this.__ownerID=n,this.__altered=!1,this)},t})(Ot);Yr.isMap=Xo;var Ne=Yr.prototype;Ne[Oh]=!0;Ne[Fi]=Ne.remove;Ne.removeAll=Ne.deleteAll;Ne.setIn=Ml;Ne.removeIn=Ne.deleteIn=Fl;Ne.update=Dl;Ne.updateIn=Pl;Ne.merge=Ne.concat=Ch;Ne.mergeWith=Mh;Ne.mergeDeep=Ph;Ne.mergeDeepWith=Th;Ne.mergeIn=Cl;Ne.mergeDeepIn=Rl;Ne.withMutations=Hi;Ne.wasAltered=Tl;Ne.asImmutable=Ui;Ne["@@transducer/init"]=Ne.asMutable=qi;Ne["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Ne["@@transducer/result"]=function(e){return e.asImmutable()};var mi=function(t,r){this.ownerID=t,this.entries=r};mi.prototype.get=function(t,r,n,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(Ge(n,o[a][0]))return o[a][1];return i};mi.prototype.update=function(t,r,n,i,o,a,s){for(var u=o===Se,d=this.entries,p=0,g=d.length;p<g&&!Ge(i,d[p][0]);p++);var v=p<g;if(v?d[p][1]===o:u)return this;if(Tt(s),(u||!v)&&Tt(a),!(u&&d.length===1)){if(!v&&!u&&d.length>=iw)return $0(t,d,i,o);var I=t&&t===this.ownerID,C=I?d:Wt(d);return v?u?p===g-1?C.pop():C[p]=C.pop():C[p]=[i,o]:C.push([i,o]),I?(this.entries=C,this):new mi(t,C)}};var fn=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};fn.prototype.get=function(t,r,n,i){r===void 0&&(r=lt(n));var o=1<<((t===0?r:r>>>t)&ut),a=this.bitmap;return(a&o)===0?i:this.nodes[jh(a&o-1)].get(t+Te,r,n,i)};fn.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var u=(r===0?n:n>>>r)&ut,d=1<<u,p=this.bitmap,g=(p&d)!==0;if(!g&&o===Se)return this;var v=jh(p&d-1),I=this.nodes,C=g?I[v]:void 0,_=Ol(C,t,r+Te,n,i,o,a,s);if(_===C)return this;if(!g&&_&&I.length>=ow)return tw(t,I,p,u,_);if(g&&!_&&I.length===2&&Ku(I[v^1]))return I[v^1];if(g&&_&&I.length===1&&Ku(_))return _;var w=t&&t===this.ownerID,R=g?_?p:p^d:p|d,E=g?_?Nh(I,v,_,w):nw(I,v,w):rw(I,v,_,w);return w?(this.bitmap=R,this.nodes=E,this):new fn(t,R,E)};var wi=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};wi.prototype.get=function(t,r,n,i){r===void 0&&(r=lt(n));var o=(t===0?r:r>>>t)&ut,a=this.nodes[o];return a?a.get(t+Te,r,n,i):i};wi.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var u=(r===0?n:n>>>r)&ut,d=o===Se,p=this.nodes,g=p[u];if(d&&!g)return this;var v=Ol(g,t,r+Te,n,i,o,a,s);if(v===g)return this;var I=this.count;if(!g)I++;else if(!v&&(I--,I<aw))return ew(t,p,I,u);var C=t&&t===this.ownerID,_=Nh(p,u,v,C);return C?(this.count=I,this.nodes=_,this):new wi(t,I,_)};var gr=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entries=n,this._index=void 0};gr.prototype._positionOf=function(t,r){var n=this.entries,i=this._index;if(i===void 0&&r&&n.length>=sw&&(i=this._buildIndex()),i!==void 0){var o=i[Al(t)];if(o!==void 0)for(var a=0;a<o.length;a++){var s=o[a];if(Ge(t,n[s][0]))return s}return-1}for(var u=0,d=n.length;u<d;u++)if(Ge(t,n[u][0]))return u;return-1};gr.prototype._buildIndex=function(){for(var t=Object.create(null),r=this.entries,n=0,i=r.length;n<i;n++){var o=Al(r[n][0]),a=t[o];a!==void 0?a.push(n):t[o]=[n]}return this._index=t,t};gr.prototype.get=function(t,r,n,i){var o=this._positionOf(n,!0);return o===-1?i:this.entries[o][1]};gr.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var u=o===Se;if(n!==this.keyHash)return u?this:(Tt(s),Tt(a),jl(this,t,r,n,[i,o]));var d=this.entries,p=d.length,g=t&&t===this.ownerID,v=this._positionOf(i,g),I=v===-1?p:v,C=v!==-1;if(C?d[I][1]===o:u)return this;if(Tt(s),(u||!C)&&Tt(a),u&&p===2)return new rr(t,this.keyHash,d[I^1]);var _=g?d:Wt(d);if(C)u?(I===p-1?_.pop():_[I]=_.pop(),g&&(this._index=void 0)):_[I]=[i,o];else if(_.push([i,o]),g&&this._index!==void 0){var w=Al(i),R=this._index[w];R!==void 0?R.push(p):this._index[w]=[p]}return g?(this.entries=_,this):new gr(t,this.keyHash,_)};var rr=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entry=n};rr.prototype.get=function(t,r,n,i){return Ge(n,this.entry[0])?this.entry[1]:i};rr.prototype.update=function(t,r,n,i,o,a,s){var u=o===Se,d=Ge(i,this.entry[0]);if(d?o===this.entry[1]:u)return this;if(Tt(s),u){Tt(a);return}return d?t&&t===this.ownerID?(this.entry[1]=o,this):new rr(t,this.keyHash,[i,o]):(Tt(a),jl(this,t,r,lt(i),[i,o]))};mi.prototype.iterate=gr.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(e(r[t?i-n:n])===!1)return!1};fn.prototype.iterate=wi.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&o.iterate(e,t)===!1)return!1}};rr.prototype.iterate=function(e,t){return e(this.entry)};var Z0=(function(e){function t(r,n,i){this._type=n,this._reverse=i,this._stack=r._root&&Lu(r._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,i=this._stack;i;){var o=i.node,a=i.index++,s=void 0;if(o.entry){if(a===0)return ba(n,o.entry)}else if(o.entries){if(s=o.entries.length-1,a<=s)return ba(n,o.entries[this._reverse?s-a:a])}else if(s=o.nodes.length-1,a<=s){var u=o.nodes[this._reverse?s-a:a];if(u){if(u.entry)return ba(n,u.entry);i=this._stack=Lu(u,i)}continue}i=this._stack=this._stack.__prev}return tt()},t})(Ee);function ba(e,t){return je(e,t[0],t[1])}function Lu(e,t){return{node:e,index:0,__prev:t}}function kl(e,t,r,n){var i=Object.create(Ne);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Uu;function Ht(){return Uu||(Uu=kl(0))}function qu(e,t,r){var n,i;if(e._root){var o=Bs(),a=Bs();if(n=Ol(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===Se?-1:1:0)}else{if(r===Se)return e;i=1,n=new mi(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?kl(i,n):Ht()}function Ol(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===Se?e:(Tt(s),Tt(a),new rr(t,n,[i,o]))}function Ku(e){return e.constructor===rr||e.constructor===gr}function jl(e,t,r,n,i){if(e.keyHash===n)return new gr(t,n,[e.entry,i]);var o=(r===0?e.keyHash:e.keyHash>>>r)&ut,a=(r===0?n:n>>>r)&ut,s,u=o===a?[jl(e,t,r+Te,n,i)]:(s=new rr(t,n,i),o<a?[e,s]:[s,e]);return new fn(t,1<<o|1<<a,u)}function $0(e,t,r,n){e||(e=new pl);for(var i=new rr(e,lt(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function ew(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,u=1,d=t.length;s<d;s++,u<<=1){var p=t[s];p!==void 0&&s!==n&&(i|=u,a[o++]=p)}return new fn(e,i,a)}function tw(e,t,r,n,i){for(var o=0,a=new Array(It),s=0;r!==0;s++,r>>>=1)a[s]=r&1?t[o++]:void 0;return a[n]=i,new wi(e,o+1,a)}function jh(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Nh(e,t,r,n){var i=n?e:Wt(e);return i[t]=r,i}function rw(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}function nw(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}var iw=It/4,ow=It/2,aw=It/4,sw=16;function Fh(e){if(yl(e)&&typeof e!="string")return e;if(qt(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function Ai(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function Bh(e,t){return jt(e)?e.has(t):yr(e)&&xn.call(e,t)}function Nl(e,t,r){return jt(e)?e.get(t,r):Bh(e,t)?typeof e.get=="function"?e.get(t):e[t]:r}function Lh(e,t){if(!yr(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(jt(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!xn.call(e,t))return e;var r=Io(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function Uh(e,t,r){if(Ki(t))return e;if(!yr(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(jt(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(xn.call(e,t)&&r===e[t])return e;var n=Io(e);return n[t]=r,n}function Xr(e,t,r,n){n||(n=r,r=void 0);var i=qh(jt(e),e,Fh(t),0,r,n);return i===Se?r:i}function qh(e,t,r,n,i,o){var a=t===Se;if(n===r.length){var s=a?i:t,u=o(s);return u===s?t:u}if(!a&&!yr(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Ai)+"]: "+t);var d=r[n],p=a?Se:Nl(t,d,Se),g=qh(p===Se?e:jt(p),p,r,n+1,i,o);return g===p?t:g===Se?Lh(t,d):Uh(a?e?Ht():{}:t,d,g)}function Kh(e,t){return Xr(e,t,function(){return Se})}function Fl(e){return Kh(this,e)}var zh="@@__IMMUTABLE_LIST__@@";function Bl(e){return!!(e&&e[zh])}var Vi=(function(e){function t(r){var n=mo();if(r==null)return n;if(Bl(r))return r;var i=e(r),o=i.size;return o===0?n:(xt(o),o>0&&o<It?_i(0,o,Te,void 0,new fr(i.toArray())):n.withMutations(function(a){a.setSize(o),i.forEach(function(s,u){return a.set(u,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,i){if(n=hr(this,n),n>=0&&n<this.size){n+=this._origin;var o=Wh(this,n);return o&&o.array[n&ut]}return i},t.prototype.set=function(n,i){return lw(this,n,i)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,i){return this.splice(n,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Te,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mo()},t.prototype.push=function(){var n=arguments,i=this.size;return this.withMutations(function(o){cr(o,0,i+n.length);for(var a=0;a<n.length;a++)o.set(i+a,n[a])})},t.prototype.pop=function(){return cr(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(i){cr(i,-n.length);for(var o=0;o<n.length;o++)i.set(o,n[o])})},t.prototype.shift=function(){return cr(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(i){for(var o=i.size,a,s;o;)a=Math.floor(n()*o--),s=i.get(a),i.set(a,i.get(o)),i.set(o,s)})},t.prototype.concat=function(){for(var n=arguments,i=[],o=0;o<arguments.length;o++){var a=n[o],s=e(typeof a!="string"&&hl(a)?a:[a]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(u){i.forEach(function(d){return d.forEach(function(p){return u.push(p)})})})},t.prototype.setSize=function(n){return cr(this,0,n)},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){for(var s=0;s<o.size;s++)a.set(s,n.call(i,a.get(s),s,o))})},t.prototype.slice=function(n,i){var o=this.size;return Bi(n,i,o)?this:cr(this,En(n,o),Li(i,o))},t.prototype.__iterator=function(n,i){var o=i?this.size:0,a=zu(this,i);return new Ee(function(){var s=a();return s===pi?tt():je(n,i?--o:o++,s)})},t.prototype.__iterate=function(n,i){for(var o=i?this.size:0,a=zu(this,i),s;(s=a())!==pi&&n(s,i?--o:o++,this)!==!1;);return o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?_i(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?mo():(this.__ownerID=n,this.__altered=!1,this)},t})(Jr);Vi.isList=Bl;var We=Vi.prototype;We[zh]=!0;We[Fi]=We.remove;We.merge=We.concat;We.setIn=Ml;We.deleteIn=We.removeIn=Fl;We.update=Dl;We.updateIn=Pl;We.mergeIn=Cl;We.mergeDeepIn=Rl;We.withMutations=Hi;We.wasAltered=Tl;We.asImmutable=Ui;We["@@transducer/init"]=We.asMutable=qi;We["@@transducer/step"]=function(e,t){return e.push(t)};We["@@transducer/result"]=function(e){return e.asImmutable()};var fr=function(t,r){this.array=t,this.ownerID=r};fr.prototype.removeBefore=function(t,r,n){if((n&(1<<r+Te)-1)===0||this.array.length===0)return this;var i=n>>>r&ut;if(i>=this.array.length)return new fr([],t);var o=i===0,a;if(r>0){var s=this.array[i];if(a=s&&s.removeBefore(t,r-Te,n),a===s&&o)return this}if(o&&!a)return this;var u=hn(this,t);if(!o)for(var d=0;d<i;d++)u.array[d]=void 0;return a&&(u.array[i]=a),u};fr.prototype.removeAfter=function(t,r,n){if(n===(r?1<<r+Te:It)||this.array.length===0)return this;var i=n-1>>>r&ut;if(i>=this.array.length)return this;var o;if(r>0){var a=this.array[i];if(o=a&&a.removeAfter(t,r-Te,n),o===a&&i===this.array.length-1)return this}var s=hn(this,t);return s.array.splice(i+1),o&&(s.array[i]=o),s};var pi={};function zu(e,t){var r=e._origin,n=e._capacity,i=vi(n),o=e._tail;return a(e._root,e._level,0);function a(d,p,g){return p===0?s(d,g):u(d,p,g)}function s(d,p){var g=p===i?o&&o.array:d&&d.array,v=p>r?0:r-p,I=n-p;return I>It&&(I=It),function(){if(v===I)return pi;var C=t?--I:v++;return g&&g[C]}}function u(d,p,g){var v,I=d&&d.array,C=g>r?0:r-g>>p,_=(n-g>>p)+1;return _>It&&(_=It),function(){for(;;){if(v){var w=v();if(w!==pi)return w;v=null}if(C===_)return pi;var R=t?--_:C++;v=a(I&&I[R],p-Te,g+(R<<p))}}}}function _i(e,t,r,n,i,o,a){var s=Object.create(We);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function mo(){return _i(0,0,Te)}function lw(e,t,r){if(t=hr(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?cr(a,t).set(0,r):cr(a,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,o=Bs();return t>=vi(e._capacity)?n=zs(n,e.__ownerID,0,t,r,o):i=zs(i,e.__ownerID,e._level,t,r,o),o.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):_i(e._origin,e._capacity,e._level,i,n):e}function zs(e,t,r,n,i,o){var a=n>>>r&ut,s=e&&a<e.array.length;if(!s&&i===void 0)return e;var u;if(r>0){var d=e&&e.array[a],p=zs(d,t,r-Te,n,i,o);return p===d?e:(u=hn(e,t),u.array[a]=p,u)}return s&&e.array[a]===i?e:(o&&Tt(o),u=hn(e,t),i===void 0&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function hn(e,t){return t&&e&&t===e.ownerID?e:new fr(e?e.array.slice():[],t)}function Wh(e,t){if(t>=vi(e._capacity))return e._tail;if(t<1<<e._level+Te){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&ut],n-=Te;return r}}function uw(e,t,r){var n=e._origin+(t===void 0?0:t),i=r===void 0?e._capacity:r<0?e._capacity+r:e._origin+r;if(Number.isFinite(i)&&i>to||Number.isFinite(n)&&n<-to||Number.isFinite(i)&&Number.isFinite(n)&&i-n>to)throw new RangeError("Invalid List size: a List cannot hold more than "+to+" (2 ** 30) values.")}function cr(e,t,r){uw(e,t,r),t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new pl,i=e._origin,o=e._capacity,a=i+t,s=r===void 0?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,d=e._root,p=0;a+p<0;)d=new fr(d&&d.array.length?[void 0,d]:[],n),u+=Te,p+=Wu(u);p&&(a+=p,i+=p,s+=p,o+=p);for(var g=vi(o),v=vi(s);v>=Wu(u+Te);)d=new fr(d&&d.array.length?[d]:[],n),u+=Te;var I=e._tail,C=v<g?Wh(e,s-1):v>g?new fr([],n):I;if(I&&v>g&&a<o&&I.array.length){d=hn(d,n);for(var _=d,w=u;w>Te;w-=Te){var R=g>>>w&ut;_=_.array[R]=hn(_.array[R],n)}_.array[g>>>Te&ut]=I}if(s<o&&(C=C&&C.removeAfter(n,0,s)),a>=v)a-=v,s-=v,u=Te,d=void 0,C=C&&C.removeBefore(n,0,a);else if(a>i||v<g){for(p=0;d;){var E=a>>>u&ut;if(E!==v>>>u&ut)break;E&&(p+=(1<<u)*E),u-=Te,d=d.array[E]}d&&a>i&&(d=d.removeBefore(n,u,a-p)),d&&v<g&&(d=d.removeAfter(n,u,v-p)),p&&(a-=p,s-=p)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=d,e._tail=C,e.__hash=void 0,e.__altered=!0,e):_i(a,s,u,d,C)}function vi(e){return e<It?0:e-1>>>Te<<Te}var to=Math.pow(2,30);function Wu(e){return e<31?1<<e:Math.pow(2,e)}function Ll(e){return Xo(e)&&qt(e)}var Gt=(function(e){function t(r){return r==null?oi():Ll(r)?r:oi().withMutations(function(n){var i=Ot(r);xt(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,i){var o=this._map.get(n);return o!==void 0?this._list.get(o)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):oi()},t.prototype.set=function(n,i){return Vu(this,n,i)},t.prototype.remove=function(n){return Vu(this,n,Se)},t.prototype.__iterate=function(n,i){var o=this;return this._list.__iterate(function(a){return a&&n(a[1],a[0],o)},i)},t.prototype.__iterator=function(n,i){return this._list.fromEntrySeq().__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n),o=this._list.__ensureOwner(n);return n?Ul(i,o,n,this.__hash):this.size===0?oi():(this.__ownerID=n,this.__altered=!1,this._map=i,this._list=o,this)},t})(Yr);Gt.isOrderedMap=Ll;Gt.prototype[pr]=!0;Gt.prototype[Fi]=Gt.prototype.remove;function Ul(e,t,r,n){var i=Object.create(Gt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Hu;function oi(){return Hu||(Hu=Ul(Ht(),mo()))}function Vu(e,t,r){var n=e._map,i=e._list,o=n.get(t),a=o!==void 0,s,u;if(r===Se){if(!a)return e;i.size>=It&&i.size>=n.size*2?(u=i.filter(function(d,p){return d!==void 0&&o!==p}),s=u.toKeyedSeq().map(function(d){return d[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=u.__ownerID=e.__ownerID)):(s=n.remove(t),u=o===i.size-1?i.pop():i.set(o,void 0))}else if(a){if(r===i.get(o)[1])return e;s=n,u=i.set(o,[t,r])}else s=n.set(t,i.size),u=i.set(i.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=u,e.__hash=void 0,e.__altered=!0,e):Ul(s,u)}var Hh="@@__IMMUTABLE_STACK__@@";function Ro(e){return!!(e&&e[Hh])}var Zo=(function(e){function t(r){return r==null?ro():Ro(r)?r:ro().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var o=this._head;for(n=hr(this,n);o&&n--;)o=o.next;return o?o.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,o=this._head,a=arguments.length-1;a>=0;a--)o={value:n[a],next:o};return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ai(i,o)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&Ro(n))return n;xt(n.size);var i=this.size,o=this._head;return n.__iterate(function(a){i++,o={value:a,next:o}},!0),this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ai(i,o)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ro()},t.prototype.slice=function(n,i){if(Bi(n,i,this.size))return this;var o=En(n,this.size),a=Li(i,this.size);if(a!==this.size)return e.prototype.slice.call(this,n,i);for(var s=this.size-o,u=this._head;o--;)u=u.next;return this.__ownerID?(this.size=s,this._head=u,this.__hash=void 0,this.__altered=!0,this):ai(s,u)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?ai(this.size,this._head,n,this.__hash):this.size===0?ro():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var o=this;if(i)return new cn(this.toArray()).__iterate(function(u,d){return n(u,d,o)},i);for(var a=0,s=this._head;s&&n(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(n,i){if(i)return new cn(this.toArray()).__iterator(n,i);var o=0,a=this._head;return new Ee(function(){if(a){var s=a.value;return a=a.next,je(n,o++,s)}return tt()})},t})(Jr);Zo.isStack=Ro;var dt=Zo.prototype;dt[Hh]=!0;dt.shift=dt.pop;dt.unshift=dt.push;dt.unshiftAll=dt.pushAll;dt.withMutations=Hi;dt.wasAltered=Tl;dt.asImmutable=Ui;dt["@@transducer/init"]=dt.asMutable=qi;dt["@@transducer/step"]=function(e,t){return e.unshift(t)};dt["@@transducer/result"]=function(e){return e.asImmutable()};function ai(e,t,r,n){var i=Object.create(dt);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Qu;function ro(){return Qu||(Qu=ai(0))}function Gu(e,t,r,n,i,o){return xt(e.size),e.__iterate(function(a,s,u){i?(i=!1,r=a):r=t.call(n,r,a,s,u)},o),r}function cw(e,t){return t}function dw(e,t){return[t,e]}function ma(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return!e.apply(this,t)}}function Ju(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return-e.apply(this,t)}}function Yu(e,t){return e<t?1:e>t?-1:0}function ql(e,t){if(e===t)return!0;if(!_t(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||ke(e)!==ke(t)||At(e)!==At(t)||qt(e)!==qt(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!Ho(e);if(qt(e)){var n=e.entries();return t.every(function(u,d){var p=n.next().value;return p&&Ge(p[1],u)&&(r||Ge(p[0],d))})&&n.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(u,d){if(r?!e.has(u):i?!Ge(u,e.get(d,Se)):!Ge(e.get(d,Se),u))return a=!1,!1});return a&&e.size===s}var Vh=(function(e){function t(r,n,i){if(i===void 0&&(i=1),!(this instanceof t))return new t(r,n,i);if(hi(i!==0,"Cannot step a Range by 0"),hi(r!==void 0,"You must define a start value when using Range"),hi(n!==void 0,"You must define an end value when using Range"),i=Math.abs(i),n<r&&(i=-i),this._start=r,this._end=n,this._step=i,this.size=Math.max(0,Math.ceil((n-r)/i-1)+1),this.size===0){if(wa)return wa;wa=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,i){return this.has(n)?this._start+hr(this,n)*this._step:i},t.prototype.includes=function(n){var i=(n-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(n,i){return Bi(n,i,this.size)?this:(n=En(n,this.size),i=Li(i,this.size),i<=n?new t(0,0):new t(this.get(n,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(n){var i=n-this._start;if(i%this._step===0){var o=i/this._step;if(o>=0&&o<this.size)return o}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,i){for(var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,u=0;u!==o&&n(s,i?o-++u:u++,this)!==!1;)s+=i?-a:a;return u},t.prototype.__iterator=function(n,i){var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,u=0;return new Ee(function(){if(u===o)return tt();var d=s;return s+=i?-a:a,je(n,i?o-++u:u++,d)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:ql(this,n)},t})(Nt),wa,Qh="@@__IMMUTABLE_SET__@@";function $o(e){return!!(e&&e[Qh])}var Qi=(function(e){function t(r){return r==null?si():$o(r)&&!qt(r)?r:si().withMutations(function(n){var i=e(r);xt(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ot(n).keySeq())},t.intersect=function(n){return n=Je(n).toArray(),n.length?Ze.intersect.apply(t(n.pop()),n):si()},t.union=function(n){return n=Je(n).toArray(),n.length?Ze.union.apply(t(n.pop()),n):si()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return no(this,this._map.set(n,n))},t.prototype.remove=function(n){return no(this,this._map.remove(n))},t.prototype.clear=function(){return no(this,this._map.clear())},t.prototype.map=function(n,i){var o=this,a=!1,s=no(this,this._map.mapEntries(function(u){var d=u[1],p=n.call(i,d,d,o);return p!==d&&(a=!0),[p,p]},i));return a?s:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(o){return o.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(o){for(var a=0;a<n.length;a++)typeof n[a]=="string"?o.add(n[a]):e(n[a]).forEach(function(s){return o.add(s)})})},t.prototype.intersect=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.every(function(s){return s.includes(a)})||o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.some(function(s){return s.includes(a)})&&o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(n){return yn(dn(this,n))},t.prototype.sortBy=function(n,i){return yn(dn(this,i,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,i){var o=this;return this._map.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){return this._map.__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n);return n?this.__make(i,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=i,this)},t})(vn);Qi.isSet=$o;var Ze=Qi.prototype;Ze[Qh]=!0;Ze[Fi]=Ze.remove;Ze.merge=Ze.concat=Ze.union;Ze.withMutations=Hi;Ze.asImmutable=Ui;Ze["@@transducer/init"]=Ze.asMutable=qi;Ze["@@transducer/step"]=function(e,t){return e.add(t)};Ze["@@transducer/result"]=function(e){return e.asImmutable()};Ze.__empty=si;Ze.__make=Gh;function no(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function Gh(e,t){var r=Object.create(Ze);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var Xu;function si(){return Xu||(Xu=Gh(Ht()))}function Kl(e,t,r){for(var n=Fh(t),i=0;i!==n.length;)if(e=Nl(e,n[i++],Se),e===Se)return r;return e}function Jh(e,t){return Kl(this,e,t)}function Yh(e,t){return Kl(e,t,Se)!==Se}function fw(e){return Yh(this,e)}function Xh(){xt(this.size);var e={};return this.__iterate(function(t,r){Ki(r)||(e[r]=t)}),e}function Co(e){if(!e||typeof e!="object")return e;if(!_t(e)){if(!yr(e))return e;e=rt(e)}if(ke(e)){var t={};return e.__iterate(function(n,i){Ki(i)||(t[i]=Co(n))}),t}var r=[];return e.__iterate(function(n){r.push(Co(n))}),r}function hw(e){if(e.size===1/0)return 0;var t=qt(e),r=ke(e),n=t?1:0;return e.__iterate(r?t?function(i,o){n=31*n+Zu(lt(i),lt(o))|0}:function(i,o){n=n+Zu(lt(i),lt(o))|0}:t?function(i){n=31*n+lt(i)|0}:function(i){n=n+lt(i)|0}),pw(e.size,n)}function pw(e,t){return t=Kn(t,3432918353),t=Kn(t<<15|t>>>-15,461845907),t=Kn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Kn(t^t>>>16,2246822507),t=Kn(t^t>>>13,3266489909),t=Jo(t^t>>>16),t}function Zu(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function Zr(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}Je.Iterator=Ee;Zr(Je,{toArray:function(){xt(this.size);var t=new Array(this.size||0),r=ke(this),n=0;return this.__iterate(function(i,o){t[n++]=r?[o,i]:i}),t},toIndexedSeq:function(){return new wh(this)},toJS:function(){return Co(this)},toKeyedSeq:function(){return new Yo(this,!0)},toMap:function(){return Yr(this.toKeyedSeq())},toObject:Xh,toOrderedMap:function(){return Gt(this.toKeyedSeq())},toOrderedSet:function(){return yn(ke(this)?this.valueSeq():this)},toSet:function(){return Qi(ke(this)?this.valueSeq():this)},toSetSeq:function(){return new Ah(this)},toSeq:function(){return At(this)?this.toIndexedSeq():ke(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Zo(ke(this)?this.valueSeq():this)},toList:function(){return Vi(ke(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,r){return this.size===0?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Pe(this,K0(this,t))},includes:function(t){return this.some(function(r){return Ge(r,t)})},entries:function(){return this.__iterator(Ct)},every:function(t,r){xt(this.size);var n=!0;return this.__iterate(function(i,o,a){if(!t.call(r,i,o,a))return n=!1,!1}),n},filter:function(t,r){return Pe(this,Eh(this,t,r,!0))},partition:function(t,r){return L0(this,t,r)},find:function(t,r,n){var i=this.findEntry(t,r);return i?i[1]:n},forEach:function(t,r){return xt(this.size),this.__iterate(r?t.bind(r):t)},join:function(t){xt(this.size),t=t!==void 0?""+t:",";var r="",n=!0;return this.__iterate(function(i){n?n=!1:r+=t,r+=i!=null?i.toString():""}),r},keys:function(){return this.__iterator(Sn)},map:function(t,r){return Pe(this,Sh(this,t,r))},reduce:function(t,r,n){return Gu(this,t,r,n,arguments.length<2,!1)},reduceRight:function(t,r,n){return Gu(this,t,r,n,arguments.length<2,!0)},reverse:function(){return Pe(this,_l(this,!0))},slice:function(t,r){return Pe(this,vl(this,t,r,!0))},some:function(t,r){xt(this.size);var n=!1;return this.__iterate(function(i,o,a){if(t.call(r,i,o,a))return n=!0,!1}),n},sort:function(t){return Pe(this,dn(this,t))},values:function(){return this.__iterator(Rt)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,r){return un(t?this.toSeq().filter(t,r):this)},countBy:function(t,r){return F0(this,t,r)},equals:function(t){return ql(this,t)},entrySeq:function(){var t=this;if(t._cache)return new cn(t._cache);var r=t.toSeq().map(dw).toIndexedSeq();return r.fromEntrySeq=function(){return t.toSeq()},r},filterNot:function(t,r){return this.filter(ma(t),r)},findEntry:function(t,r,n){var i=n;return this.__iterate(function(o,a,s){if(t.call(r,o,a,s))return i=[a,o],!1}),i},findKey:function(t,r){var n=this.findEntry(t,r);return n&&n[0]},findLast:function(t,r,n){return this.toKeyedSeq().reverse().find(t,r,n)},findLastEntry:function(t,r,n){return this.toKeyedSeq().reverse().findEntry(t,r,n)},findLastKey:function(t,r){return this.toKeyedSeq().reverse().findKey(t,r)},first:function(t){return this.find(fh,null,t)},flatMap:function(t,r){return Pe(this,z0(this,t,r))},flatten:function(t){return Pe(this,Ih(this,t,!0))},fromEntrySeq:function(){return new _h(this)},get:function(t,r){return this.find(function(n,i){return Ge(i,t)},void 0,r)},getIn:Jh,groupBy:function(t,r){return B0(this,t,r)},has:function(t){return this.get(t,Se)!==Se},hasIn:fw,isSubset:function(t){return t=typeof t.includes=="function"?t:Je(t),this.every(function(r){return t.includes(r)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:Je(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(r){return Ge(r,t)})},keySeq:function(){return this.toSeq().map(cw).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return $i(this,t)},maxBy:function(t,r){return $i(this,r,t)},min:function(t){return $i(this,t?Ju(t):Yu)},minBy:function(t,r){return $i(this,r?Ju(r):Yu,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,r){return Pe(this,xh(this,t,r,!0))},skipUntil:function(t,r){return this.skipWhile(ma(t),r)},sortBy:function(t,r){return Pe(this,dn(this,r,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,r){return Pe(this,U0(this,t,r))},takeUntil:function(t,r){return this.takeWhile(ma(t),r)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hw(this))}});var nt=Je.prototype;nt[ch]=!0;nt[Vo]=nt.values;nt.toJSON=nt.toArray;nt.__toStringMapper=Ai;nt.inspect=nt.toSource=function(){return this.toString()};nt.chain=nt.flatMap;nt.contains=nt.includes;Zr(Ot,{flip:function(){return Pe(this,vh(this))},mapEntries:function(t,r){var n=this,i=0;return Pe(this,this.toSeq().map(function(o,a){return t.call(r,[a,o],i++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return Pe(this,this.toSeq().flip().map(function(i,o){return t.call(r,i,o,n)}).flip())}});var Gi=Ot.prototype;Gi[xo]=!0;Gi[Vo]=nt.entries;Gi.toJSON=Xh;Gi.__toStringMapper=function(e,t){return Ai(t)+": "+Ai(e)};Zr(Jr,{toKeyedSeq:function(){return new Yo(this,!1)},filter:function(t,r){return Pe(this,Eh(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return r===void 0?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return r===void 0?-1:r},reverse:function(){return Pe(this,_l(this,!1))},slice:function(t,r){return Pe(this,vl(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),n===0||n===2&&!r)return this;t=En(t,t<0?this.count():this.size);var i=this.slice(0,t);return Pe(this,n===1?i:i.concat(Wt(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Pe(this,Ih(this,t,!1))},get:function(t,r){return t=hr(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?r:this.find(function(n,i){return i===t},void 0,r)},has:function(t){return t=hr(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.find(function(r,n){return n===t},void 0,Se)!==Se)},interpose:function(t){return Pe(this,W0(this,t))},interleave:function(){var t=[this].concat(Wt(arguments)),r=eo(this.toSeq(),Nt.of,t),n=r.flatten(!0);return r.size&&(n.size=r.size*t.length),Pe(this,n)},keySeq:function(){return Vh(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,r){return Pe(this,xh(this,t,r,!1))},zip:function(){var t=[this].concat(Wt(arguments));return Pe(this,eo(this,$u,t))},zipAll:function(){var t=[this].concat(Wt(arguments));return Pe(this,eo(this,$u,t,!0))},zipWith:function(t){var r=Wt(arguments);return r[0]=this,Pe(this,eo(this,t,r))}});var Rn=Jr.prototype;Rn[Eo]=!0;Rn[pr]=!0;Zr(vn,{get:function(t,r){return this.has(t)?t:r},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var pn=vn.prototype;pn.has=nt.includes;pn.contains=pn.includes;pn.keys=pn.values;Zr(Ar,Gi);Zr(Nt,Rn);Zr(In,pn);function $u(){return Wt(arguments)}function zl(e){return $o(e)&&qt(e)}var yn=(function(e){function t(r){return r==null?Ws():zl(r)?r:Ws().withMutations(function(n){var i=vn(r);xt(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Ot(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(Qi);yn.isOrderedSet=zl;var $r=yn.prototype;$r[pr]=!0;$r.zip=Rn.zip;$r.zipWith=Rn.zipWith;$r.zipAll=Rn.zipAll;$r.__empty=Ws;$r.__make=Zh;function Zh(e,t){var r=Object.create($r);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var ec;function Ws(){return ec||(ec=Zh(oi()))}var yw={LeftThenRight:-1,RightThenLeft:1};function gw(e){if(wr(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(jt(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ve=function(t,r){var n;gw(t);var i=function(s){var u=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!n){n=!0;var d=Object.keys(t),p=o._indices={};o._name=r,o._keys=d,o._defaultValues=t;for(var g=0;g<d.length;g++){var v=d[g];p[v]=g,o[v]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+Hl(this)+' with property "'+v+'" since that property name is part of the Record API.'):bw(o,v)}}return this.__ownerID=void 0,this._values=Vi().withMutations(function(I){I.setSize(u._keys.length),Ot(s).forEach(function(C,_){I.set(u._indices[_],C===u._defaultValues[_]?void 0:C)})}),this},o=i.prototype=Object.create(Oe);return o.constructor=i,r&&(i.displayName=r),i};Ve.prototype.toString=function(){for(var t=Hl(this)+" { ",r=this._keys,n,i=0,o=r.length;i!==o;i++)n=r[i],t+=(i?", ":"")+n+": "+Ai(this.get(n));return t+" }"};Ve.prototype.equals=function(t){return this===t||wr(t)&&gn(this).equals(gn(t))};Ve.prototype.hashCode=function(){return gn(this).hashCode()};Ve.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Ve.prototype.get=function(t,r){if(!this.has(t))return r;var n=this._indices[t],i=this._values.get(n);return i===void 0?this._defaultValues[t]:i};Ve.prototype.set=function(t,r){if(this.has(t)){var n=this._values.set(this._indices[t],r===this._defaultValues[t]?void 0:r);if(n!==this._values&&!this.__ownerID)return Wl(this,n)}return this};Ve.prototype.remove=function(t){return this.set(t)};Ve.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:Wl(this,t)};Ve.prototype.wasAltered=function(){return this._values.wasAltered()};Ve.prototype.toSeq=function(){return gn(this)};Ve.prototype.toJS=function(){return Co(this)};Ve.prototype.entries=function(){return this.__iterator(Ct)};Ve.prototype.__iterator=function(t,r){return gn(this).__iterator(t,r)};Ve.prototype.__iterate=function(t,r){return gn(this).__iterate(t,r)};Ve.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._values.__ensureOwner(t);return t?Wl(this,r,t):(this.__ownerID=t,this._values=r,this)};Ve.isRecord=wr;Ve.getDescriptiveName=Hl;var Oe=Ve.prototype;Oe[yh]=!0;Oe[Fi]=Oe.remove;Oe.deleteIn=Oe.removeIn=Fl;Oe.getIn=Jh;Oe.hasIn=nt.hasIn;Oe.merge=Ch;Oe.mergeWith=Mh;Oe.mergeIn=Cl;Oe.mergeDeep=Ph;Oe.mergeDeepWith=Th;Oe.mergeDeepIn=Rl;Oe.setIn=Ml;Oe.update=Dl;Oe.updateIn=Pl;Oe.withMutations=Hi;Oe.asMutable=qi;Oe.asImmutable=Ui;Oe[Vo]=Oe.entries;Oe.toJSON=Oe.toObject=nt.toObject;Oe.inspect=Oe.toSource=function(){return this.toString()};function Wl(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function Hl(e){return e.constructor.displayName||e.constructor.name||"Record"}function gn(e){return ml(e._keys.map(function(t){return[t,e.get(t)]}))}function bw(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(r){hi(this.__ownerID,"Cannot set on an immutable record."),this.set(t,r)}})}catch{}}var mw=(function(e){function t(r,n){if(!(this instanceof t))return new t(r,n);if(this._value=r,this.size=n===void 0?1/0:Math.max(0,n),this.size===0){if(Aa)return Aa;Aa=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},t.prototype.get=function(n,i){return this.has(n)?this._value:i},t.prototype.includes=function(n){return Ge(this._value,n)},t.prototype.slice=function(n,i){var o=this.size;return Bi(n,i,o)?this:new t(this._value,Li(i,o)-En(n,o))},t.prototype.reverse=function(){return this},t.prototype.indexOf=function(n){return this.size!==0&&Ge(this._value,n)?0:-1},t.prototype.lastIndexOf=function(n){return this.size!==0&&Ge(this._value,n)?this.size-1:-1},t.prototype.__iterate=function(n,i){for(var o=this.size,a=0;a!==o&&n(this._value,i?o-++a:a++,this)!==!1;);return a},t.prototype.__iterator=function(n,i){var o=this,a=this.size,s=0;return new Ee(function(){return s===a?tt():je(n,i?a-++s:s++,o._value)})},t.prototype.equals=function(n){return n instanceof t?Ge(this._value,n._value):ql(this,n)},t})(Nt),Aa;function ww(e,t){return $h([],t||Aw,e,"",t&&t.length>2?[]:void 0,{"":e})}function $h(e,t,r,n,i,o){if(typeof r!="string"&&!jt(r)&&(yl(r)||hl(r)||Il(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&n!==""&&i.push(n);var a=t.call(o,n,rt(r).map(function(s,u){return $h(e,t,s,u,i,r)}),i&&i.slice());return e.pop(),i&&i.pop(),a}return r}function Aw(e,t){return At(t)?t.toList():ke(t)?t.toMap():t.toSet()}var _w="5.1.9",vw=Je;const Sw=Object.freeze(Object.defineProperty({__proto__:null,Collection:Je,Iterable:vw,List:Vi,Map:Yr,OrderedMap:Gt,OrderedSet:yn,PairSorting:yw,Range:Vh,Record:Ve,Repeat:mw,Seq:rt,Set:Qi,Stack:Zo,fromJS:ww,get:Nl,getIn:Kl,has:Bh,hasIn:Yh,hash:lt,is:Ge,isAssociative:Ho,isCollection:_t,isImmutable:jt,isIndexed:At,isKeyed:ke,isList:Bl,isMap:Xo,isOrdered:qt,isOrderedMap:Ll,isOrderedSet:zl,isPlainObject:Il,isRecord:wr,isSeq:Go,isSet:$o,isStack:Ro,isValueObject:Ks,merge:V0,mergeDeep:G0,mergeDeepWith:J0,mergeWith:Q0,remove:Lh,removeIn:Kh,set:Uh,setIn:kh,update:xl,updateIn:Xr,version:_w},Symbol.toStringTag,{value:"Module"})),Ew=Kd(Sw);var tc;function ep(){if(tc)return kr;tc=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.ActionContextKey=kr.ActionContext=void 0;const e=Ew;let t=class li{constructor(i={}){this.map=(0,e.Map)(i)}setDefault(i,o){return this.has(i)?this:this.set(i,o)}set(i,o){return this.setRaw(i.name,o)}setRaw(i,o){return new li(this.map.set(i,o))}delete(i){return new li(this.map.delete(i.name))}get(i){return this.getRaw(i.name)}getRaw(i){return this.map.get(i)}getSafe(i){if(!this.has(i))throw new Error(`Context entry ${i.name} is required but not available`);return this.get(i)}has(i){return this.hasRaw(i.name)}hasRaw(i){return this.map.has(i)}merge(...i){let o=this;for(const a of i)for(const s of a.keys())o=o.set(s,a.get(s));return o}keys(){return[...this.map.keys()].map(i=>new r(i))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(i){return i instanceof li?i:new li((0,e.Map)(i??{}))}};kr.ActionContext=t;class r{constructor(i){this.name=i}}return kr.ActionContextKey=r,kr}var zn={},rc;function tp(){if(rc)return zn;rc=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.Bus=void 0;let e=class{constructor(r){this.actors=[],this.observers=[],this.dependencyLinks=new Map,Object.assign(this,r),this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(r){this.actors.push(r),this.reorderForDependencies()}subscribeObserver(r){this.observers.push(r)}unsubscribe(r){const n=this.actors.indexOf(r);return n>=0?(this.actors.splice(n,1),!0):!1}unsubscribeObserver(r){const n=this.observers.indexOf(r);return n>=0?(this.observers.splice(n,1),!0):!1}publish(r){return this.actors.map(n=>({actor:n,reply:n.test(r)}))}onRun(r,n,i){for(const o of this.observers)o.onRun(r,n,i)}addDependencies(r,n){for(const i of n){let o=this.dependencyLinks.get(i);o||(o=[],this.dependencyLinks.set(i,o)),o.push(r)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const r=[];for(const n of this.dependencyLinks.keys()){const i=this.actors.indexOf(n);i>=0&&(this.actors.splice(i,1),r.push(n))}for(;r.length>0;){let n=-1;for(let o=0;o<r.length;o++){let a=!0;for(const s of this.dependencyLinks.get(r[o]))if(!this.actors.includes(s)&&r.includes(s)){a=!1;break}if(a){n=o;break}}if(n<0)throw new Error(`Cyclic dependency links detected in bus ${this.name}`);const i=r.splice(n,1)[0];this.actors.push(i)}}}};return zn.Bus=e,zn}var Wn={},nc;function xw(){if(nc)return Wn;nc=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.BusIndexed=void 0;const e=tp();let t=class extends e.Bus{constructor(n){super(n),this.actorsIndex={}}subscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];for(const o of i){let a=this.actorsIndex[o];a||(a=this.actorsIndex[o]=[]),a.push(n),super.subscribe(n)}}unsubscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];let o=!1;for(const a of i){const s=this.actorsIndex[a];if(s){const u=s.indexOf(n);u>=0&&s.splice(u,1),s.length===0&&delete this.actorsIndex[a]}o=o||super.unsubscribe(n)}return o}publish(n){const i=this.getActionIdentifier(n);return i?[...this.actorsIndex[i]||[],...this.actorsIndex._undefined_||[]].map(a=>({actor:a,reply:a.test(n)})):super.publish(n)}getActorIdentifiers(n){const i=this.actorIdentifierFields.reduce((o,a)=>o[a],n);if(i)return Array.isArray(i)?i:[i]}getActionIdentifier(n){return this.actionIdentifierFields.reduce((i,o)=>i[o],n)}};return Wn.BusIndexed=t,Wn}var Hn={},ic;function rp(){if(ic)return Hn;ic=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.CONTEXT_KEY_LOGGER=void 0;const e=ep();return Hn.CONTEXT_KEY_LOGGER=new e.ActionContextKey("@comunica/core:log"),Hn}var Vn={},oc;function Iw(){if(oc)return Vn;oc=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.ActionObserver=void 0;let e=class{constructor(r){Object.assign(this,r)}};return Vn.ActionObserver=e,Vn}var Qn={},ac;function Rw(){if(ac)return Qn;ac=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.Actor=void 0;const e=rp();let t=class Lr{constructor(n){this.beforeActors=[],Object.assign(this,n),this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),n.busFailMessage&&(this.bus.failMessage=n.busFailMessage)}static getContextLogger(n){return n.get(e.CONTEXT_KEY_LOGGER)}runObservable(n,i){const o=this.run(n,i);return this.bus.onRun(this,n,o),o}getDefaultLogData(n,i){const o=i?i():{};return o.actor=this.name,o}logTrace(n,i,o){const a=Lr.getContextLogger(n);a&&a.trace(i,this.getDefaultLogData(n,o))}logDebug(n,i,o){const a=Lr.getContextLogger(n);a&&a.debug(i,this.getDefaultLogData(n,o))}logInfo(n,i,o){const a=Lr.getContextLogger(n);a&&a.info(i,this.getDefaultLogData(n,o))}logWarn(n,i,o){const a=Lr.getContextLogger(n);a&&a.warn(i,this.getDefaultLogData(n,o))}logError(n,i,o){const a=Lr.getContextLogger(n);a&&a.error(i,this.getDefaultLogData(n,o))}logFatal(n,i,o){const a=Lr.getContextLogger(n);a&&a.fatal(i,this.getDefaultLogData(n,o))}};return Qn.Actor=t,Qn}var Gn={},sc;function Cw(){if(sc)return Gn;sc=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.Mediator=void 0;let e=class Hs{constructor(r){Object.assign(this,r)}publish(r){const n=this.bus.publish(r);if(n.length===0)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return n}async mediateActor(r){return await this.mediateWith(r,this.publish(r))}async mediateTestable(r){return(await this.mediateActor(r)).mapAsync((i,o)=>i.runObservable(r,o))}async mediate(r){return(await this.mediateTestable(r)).getOrThrow()}constructFailureMessage(r,n){const i=`
9
+ `;return`${this.bus.failMessage.replaceAll(/\$\{(.*?)\}/gu,(a,s)=>Hs.getObjectValue({action:r},s.split("."))||a)}
10
+ Error messages of failing actors:${i}${n.join(i)}`}static getObjectValue(r,n){if(n.length===0)return r;if(r)return Hs.getObjectValue(r[n[0]],n.slice(1))}};return Gn.Mediator=e,Gn}var Ye={},lc;function Mw(){if(lc)return Ye;lc=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.TestResultFailed=Ye.TestResultPassed=Ye.failTest=Ye.passTestVoidWithSideData=Ye.passTestWithSideData=Ye.passTestVoid=Ye.passTest=void 0;function e(s){return new o(s,void 0)}Ye.passTest=e;function t(){return new o(!0,void 0)}Ye.passTestVoid=t;function r(s,u){return new o(s,u)}Ye.passTestWithSideData=r;function n(s){return new o(!0,s)}Ye.passTestVoidWithSideData=n;function i(s){return new a(s)}Ye.failTest=i;class o{constructor(u,d){this.value=u,this.sideData=d}isPassed(){return!0}isFailed(){return!1}get(){return this.value}getOrThrow(){return this.value}getSideData(){return this.sideData}getFailMessage(){}map(u){return new o(u(this.value,this.sideData),this.sideData)}async mapAsync(u){return new o(await u(this.value,this.sideData),this.sideData)}}Ye.TestResultPassed=o;class a{constructor(u){this.failMessage=u}isPassed(){return!1}isFailed(){return!0}get(){}getOrThrow(){throw new Error(this.getFailMessage())}getSideData(){throw new Error(this.getFailMessage())}getFailMessage(){return this.failMessage}map(){return this}async mapAsync(){return this}}return Ye.TestResultFailed=a,Ye}var uc;function _r(){return uc||(uc=1,(function(e){var t=Tr&&Tr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Tr&&Tr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(ep(),e),r(tp(),e),r(xw(),e),r(rp(),e),r(Iw(),e),r(Rw(),e),r(Cw(),e),r(Mw(),e)})(Tr)),Tr}var cc;function Dw(){if(cc)return qn;cc=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.ActionObserverHttp=void 0;const e=_r();class t extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}}return qn.ActionObserverHttp=t,qn}var Jn={},Or={},Yn={},jr={},Xn={},dc;function np(){if(dc)return Xn;dc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ActorAbstractMediaTyped=void 0;const e=_r();let t=class extends e.Actor{constructor(n){super(n)}async run(n){if("handle"in n){const i=n;return{handle:await this.runHandle(i.handle,i.handleMediaType,n.context)}}if("mediaTypes"in n)return{mediaTypes:await this.getMediaTypes(n.context)};if("mediaTypeFormats"in n)return{mediaTypeFormats:await this.getMediaTypeFormats(n.context)};throw new Error("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}async test(n){if("handle"in n){const i=n;return(await this.testHandle(i.handle,i.handleMediaType,n.context)).map(o=>({handle:o}))}return"mediaTypes"in n?(await this.testMediaType(n.context)).map(i=>({mediaTypes:i})):"mediaTypeFormats"in n?(await this.testMediaTypeFormats(n.context)).map(i=>({mediaTypeFormats:i})):(0,e.failTest)("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}};return Xn.ActorAbstractMediaTyped=t,Xn}var Zn={},fc;function Pw(){if(fc)return Zn;fc=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.ActorAbstractMediaTypedFixed=void 0;const e=_r(),t=np();let r=class extends t.ActorAbstractMediaTyped{constructor(i){super(i);const o=this.priorityScale||this.priorityScale===0?this.priorityScale:1;if(this.mediaTypePriorities)for(const[a,[s,u]]of Object.entries(this.mediaTypePriorities).entries())this.mediaTypePriorities[s]=o*u;this.mediaTypePriorities=Object.freeze(this.mediaTypePriorities),this.mediaTypeFormats=Object.freeze(this.mediaTypeFormats)}async testHandle(i,o,a){return!o||!(o in this.mediaTypePriorities)?(0,e.failTest)(`Unrecognized media type: ${o}`):await this.testHandleChecked(i,a)}async testMediaType(i){return(0,e.passTestVoid)()}async getMediaTypes(i){return this.mediaTypePriorities}async testMediaTypeFormats(i){return(0,e.passTestVoid)()}async getMediaTypeFormats(i){return this.mediaTypeFormats}};return Zn.ActorAbstractMediaTypedFixed=r,Zn}var hc;function ip(){return hc||(hc=1,(function(e){var t=jr&&jr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=jr&&jr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(np(),e),r(Pw(),e)})(jr)),jr}var pc;function Tw(){if(pc)return Yn;pc=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.ActorQueryResultSerialize=void 0;const e=ip();let t=class extends e.ActorAbstractMediaTyped{constructor(n){super(n)}};return Yn.ActorQueryResultSerialize=t,Yn}var $n={},yc;function kw(){if(yc)return $n;yc=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.ActorQueryResultSerializeFixedMediaTypes=void 0;const e=ip(),t=_r();let r=class extends e.ActorAbstractMediaTypedFixed{constructor(i){super(i)}async testHandleChecked(i,o){return(0,t.passTestVoid)()}};return $n.ActorQueryResultSerializeFixedMediaTypes=r,$n}var gc;function op(){return gc||(gc=1,(function(e){var t=Or&&Or.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Or&&Or.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Tw(),e),r(kw(),e)})(Or)),Or}var Nr={},xe={},bc;function Ow(){if(bc)return xe;bc=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.KeysStatistics=xe.KeysRdfJoin=xe.KeysMergeBindingsContext=xe.KeysRdfUpdateQuads=xe.KeysQuerySourceIdentify=xe.KeysRdfParseHtmlScript=xe.KeysRdfParseJsonLd=xe.KeysQueryOperation=xe.KeysExpressionEvaluator=xe.KeysInitQuery=xe.KeysHttpProxy=xe.KeysHttpMemento=xe.KeysHttpWayback=xe.KeysHttp=xe.KeysCore=void 0;const e=_r();return xe.KeysCore={log:e.CONTEXT_KEY_LOGGER},xe.KeysHttp={includeCredentials:new e.ActionContextKey("@comunica/bus-http:include-credentials"),auth:new e.ActionContextKey("@comunica/bus-http:auth"),fetch:new e.ActionContextKey("@comunica/bus-http:fetch"),httpTimeout:new e.ActionContextKey("@comunica/bus-http:http-timeout"),httpBodyTimeout:new e.ActionContextKey("@comunica/bus-http:http-body-timeout"),httpRetryCount:new e.ActionContextKey("@comunica/bus-http:http-retry-count"),httpRetryDelayFallback:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-fallback"),httpRetryDelayLimit:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-limit"),httpRetryStatusCodes:new e.ActionContextKey("@comunica/bus-http:http-retry-status-codes")},xe.KeysHttpWayback={recoverBrokenLinks:new e.ActionContextKey("@comunica/bus-http:recover-broken-links")},xe.KeysHttpMemento={datetime:new e.ActionContextKey("@comunica/actor-http-memento:datetime")},xe.KeysHttpProxy={httpProxyHandler:new e.ActionContextKey("@comunica/actor-http-proxy:httpProxyHandler")},xe.KeysInitQuery={querySourcesUnidentified:new e.ActionContextKey("@comunica/actor-init-query:querySourcesUnidentified"),initialBindings:new e.ActionContextKey("@comunica/actor-init-query:initialBindings"),queryFormat:new e.ActionContextKey("@comunica/actor-init-query:queryFormat"),graphqlSingularizeVariables:new e.ActionContextKey("@comunica/actor-init-query:singularizeVariables"),lenient:new e.ActionContextKey("@comunica/actor-init-query:lenient"),queryString:new e.ActionContextKey("@comunica/actor-init-query:queryString"),query:new e.ActionContextKey("@comunica/actor-init-query:query"),baseIRI:new e.ActionContextKey("@comunica/actor-init-query:baseIRI"),fileBaseIRI:new e.ActionContextKey("@comunica/actor-init-query:fileBaseIRI"),functionArgumentsCache:new e.ActionContextKey("@comunica/actor-init-query:functionArgumentsCache"),queryTimestamp:new e.ActionContextKey("@comunica/actor-init-query:queryTimestamp"),queryTimestampHighResolution:new e.ActionContextKey("@comunica/actor-init-query:queryTimestampHighResolution"),extensionFunctionCreator:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionCreator"),extensionFunctions:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctions"),extensionFunctionsAlwaysPushdown:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionsAlwaysPushdown"),cliArgsHandlers:new e.ActionContextKey("@comunica/actor-init-query:cliArgsHandlers"),explain:new e.ActionContextKey("@comunica/actor-init-query:explain"),physicalQueryPlanLogger:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanLogger"),physicalQueryPlanNode:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanNode"),jsonLdContext:new e.ActionContextKey("@context"),invalidateCache:new e.ActionContextKey("@comunica/actor-init-query:invalidateCache"),dataFactory:new e.ActionContextKey("@comunica/actor-init-query:dataFactory"),distinctConstruct:new e.ActionContextKey("@comunica/actor-init-query:distinctConstruct")},xe.KeysExpressionEvaluator={extensionFunctionCreator:new e.ActionContextKey("@comunica/utils-expression-evaluator:extensionFunctionCreator"),superTypeProvider:new e.ActionContextKey("@comunica/utils-expression-evaluator:superTypeProvider"),defaultTimeZone:new e.ActionContextKey("@comunica/utils-expression-evaluator:defaultTimeZone"),actionContext:new e.ActionContextKey("@comunica/utils-expression-evaluator:actionContext")},xe.KeysQueryOperation={operation:new e.ActionContextKey("@comunica/bus-query-operation:operation"),joinLeftMetadata:new e.ActionContextKey("@comunica/bus-query-operation:joinLeftMetadata"),joinRightMetadatas:new e.ActionContextKey("@comunica/bus-query-operation:joinRightMetadatas"),joinBindings:new e.ActionContextKey("@comunica/bus-query-operation:joinBindings"),readOnly:new e.ActionContextKey("@comunica/bus-query-operation:readOnly"),isPathArbitraryLengthDistinctKey:new e.ActionContextKey("@comunica/bus-query-operation:isPathArbitraryLengthDistinct"),limitIndicator:new e.ActionContextKey("@comunica/bus-query-operation:limitIndicator"),unionDefaultGraph:new e.ActionContextKey("@comunica/bus-query-operation:unionDefaultGraph"),querySources:new e.ActionContextKey("@comunica/bus-query-operation:querySources")},xe.KeysRdfParseJsonLd={documentLoader:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:documentLoader"),strictValues:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:strictValues"),parserOptions:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:parserOptions")},xe.KeysRdfParseHtmlScript={processingHtmlScript:new e.ActionContextKey("@comunica/actor-rdf-parse-html-script:processingHtmlScript"),extractAllScripts:new e.ActionContextKey("extractAllScripts")},xe.KeysQuerySourceIdentify={sourceIds:new e.ActionContextKey("@comunica/bus-query-source-identify:sourceIds"),hypermediaSourcesAggregatedStores:new e.ActionContextKey("@comunica/bus-query-source-identify:hypermediaSourcesAggregatedStores"),traverse:new e.ActionContextKey("@comunica/bus-query-source-identify:traverse")},xe.KeysRdfUpdateQuads={destination:new e.ActionContextKey("@comunica/bus-rdf-update-quads:destination")},xe.KeysMergeBindingsContext={sourcesBinding:new e.ActionContextKey("@comunica/bus-merge-bindings-context:sourcesBinding")},xe.KeysRdfJoin={lastPhysicalJoin:new e.ActionContextKey("@comunica/bus-rdf-join:lastPhysicalJoin")},xe.KeysStatistics={discoveredLinks:new e.ActionContextKey("@comunica/statistic:discoveredLinks"),dereferencedLinks:new e.ActionContextKey("@comunica/statistic:dereferencedLinks"),intermediateResults:new e.ActionContextKey("@comunica/statistic:intermediateResults")},xe}var mc;function jw(){return mc||(mc=1,(function(e){var t=Nr&&Nr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Nr&&Nr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ow(),e)})(Nr)),Nr}var _a={},ei={},wc;function Nw(){if(wc)return ei;wc=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.LinkedList=void 0;class e{constructor(){this._length=0,this._head=null,this._tail=null}get length(){return this._length}get first(){var r;return(r=this._head)===null||r===void 0?void 0:r.value}get last(){var r;return(r=this._tail)===null||r===void 0?void 0:r.value}get empty(){return this._head===null}push(r){const n={value:r,next:null};this._tail===null?this._head=this._tail=n:this._tail.next=this._tail=n,this._length++}shift(){if(this._head===null)return;const{value:r,next:n}=this._head;return this._head=n,n===null&&(this._tail=null),this._length--,r}clear(){this._length=0,this._head=this._tail=null}}return ei.LinkedList=e,ei}var ti={};let va=1;const Vl=new Map;let Sa=!1,Ql,ap=(e,...t)=>(Vl.set(va,[e,t]),Ql(va),va++),Gl=e=>{Vl.delete(e)};function Jl(e){if(Sa)setTimeout(Jl,0,e);else{const t=Vl.get(e);if(t){Sa=!0;try{t[0](...t[1])}finally{Gl(e),Sa=!1}}}}function Fw(){const e=new MessageChannel;e.port1.onmessage=t=>{Jl(t.data)},Ql=t=>{e.port2.postMessage(t)}}function Bw(){const e=`setImmediate$${Math.random()}$`;window.addEventListener("message",t=>{typeof t.data=="string"&&t.data.startsWith(e)&&Jl(+t.data.slice(e.length))}),Ql=t=>{window.postMessage(e+t,"*")}}const io=typeof self>"u"?typeof global>"u"?void 0:global:self;io.setImmediate?(ap=io.setImmediate,Gl=io.clearImmediate):io.importScripts?Fw():Bw();const Lw=Object.freeze(Object.defineProperty({__proto__:null,get clearImmediate(){return Gl},get setImmediate(){return ap}},Symbol.toStringTag,{value:"Module"})),Uw=Kd(Lw);var Ac;function qw(){if(Ac)return ti;Ac=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.createTaskScheduler=void 0;const e=Uw,t=Promise.resolve(void 0);function r(n=e.setImmediate){const i=typeof queueMicrotask=="function"?queueMicrotask:s=>t.then(s);let o=0,a=null;return s=>{a!==null?a.push(s):++o<100?i(s):(a=[s],n(()=>{for(const u of a)i(u);a=null,o=0}))}}return ti.createTaskScheduler=r,ti}var _c;function sp(){return _c||(_c=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterator=e.isIterable=e.isSourceExpression=e.isPromise=e.isEventEmitter=e.isFunction=e.range=e.union=e.fromIterable=e.fromIterator=e.fromArray=e.single=e.empty=e.wrap=e.WrappingIterator=e.ClonedIterator=e.UnionIterator=e.MultiTransformIterator=e.SimpleTransformIterator=e.TransformIterator=e.BufferedIterator=e.MappingIterator=e.DESTINATION=e.identity=e.IntegerIterator=e.ArrayIterator=e.SingletonIterator=e.EmptyIterator=e.AsyncIterator=e.DESTROYED=e.ENDED=e.CLOSED=e.CLOSING=e.OPEN=e.INIT=e.setTaskScheduler=e.getTaskScheduler=e.scheduleTask=e.LinkedList=void 0;const t=or(),r=Nw();Object.defineProperty(e,"LinkedList",{enumerable:!0,get:function(){return r.LinkedList}});let i=qw().createTaskScheduler();function o(V){i(V)}e.scheduleTask=o;function a(){return i}e.getTaskScheduler=a;function s(V){i=V}e.setTaskScheduler=s,e.INIT=1,e.OPEN=2,e.CLOSING=4,e.CLOSED=8,e.ENDED=16,e.DESTROYED=32;class u extends t.EventEmitter{constructor(l=e.OPEN){super(),this._readable=!1,this._state=l,this.on("newListener",d)}_changeState(l,f=!1){const A=l>this._state&&this._state<e.ENDED;return A&&(this._state=l,l===e.ENDED&&(f?i(()=>this.emit("end")):this.emit("end"))),A}read(){return null}forEach(l,f){this.on("data",ue(l,f))}close(){this._changeState(e.CLOSED)&&this._endAsync()}destroy(l){this.done||this._destroy(l,f=>{l=l||f,l&&this.emit("error",l),this._end(!0)})}_destroy(l,f){f()}_end(l=!1){this._changeState(l?e.DESTROYED:e.ENDED)&&(this._readable=!1,this.removeAllListeners("readable"),this.removeAllListeners("data"),this.removeAllListeners("end"))}_endAsync(){i(()=>this._end())}get readable(){return this._readable}set readable(l){l=!!l&&!this.done,this._readable!==l&&(this._readable=l,l&&i(()=>this.emit("readable")))}get closed(){return this._state>=e.CLOSING}get ended(){return this._state===e.ENDED}get destroyed(){return this._state===e.DESTROYED}get done(){return this._state>=e.ENDED}toString(){const l=this._toStringDetails();return`[${this.constructor.name}${l?` ${l}`:""}]`}_toStringDetails(){return""}toArray(l){const f=[],A=typeof l?.limit=="number"?l.limit:1/0;return this.ended||A<=0?Promise.resolve(f):new Promise((j,B)=>{const K=()=>j(f),m=L=>{f.push(L),f.length>=A&&(this.removeListener("error",B),this.removeListener("data",m),this.removeListener("end",K),j(f))};this.on("error",B),this.on("data",m),this.on("end",K)})}getProperty(l,f){const A=this._properties;if(!f)return A&&A[l];if(A&&l in A)i(()=>f(A[l]));else{let j;(j=this._propertyCallbacks)||(this._propertyCallbacks=j=Object.create(null)),l in j?j[l].push(f):j[l]=[f]}}setProperty(l,f){const A=this._properties||(this._properties=Object.create(null));A[l]=f;const j=this._propertyCallbacks||{},B=j[l];if(B){delete j[l],i(()=>{for(const K of B)K(f)});for(l in j)return;delete this._propertyCallbacks}}getProperties(){const l=this._properties,f={};for(const A in l)f[A]=l[A];return f}setProperties(l){for(const f in l)this.setProperty(f,l[f])}copyProperties(l,f){for(const A of f)l.getProperty(A,j=>this.setProperty(A,j))}transform(l){return new M(this,l)}map(l,f){return new R(this,ue(l,f))}filter(l,f){return this.map(function(A){return l.call(f||this,A)?A:null})}uniq(l=w){const f=new Set;return this.filter(function(A){const j=l.call(this,A);return f.has(j)?!1:(f.add(j),!0)})}prepend(l){return this.transform({prepend:l})}append(l){return this.transform({append:l})}surround(l,f){return this.transform({prepend:l,append:f})}skip(l){return this.map(f=>l-- >0?null:f)}take(l){return this.transform({limit:l})}range(l,f){return this.transform({offset:l,limit:Math.max(f-l+1,0)})}clone(){return new Z(this)}[Symbol.asyncIterator](){const l=this;let f=null,A=null,j=null;l.addListener("readable",B),l.addListener("end",B),l.addListener("error",K);function B(){if(f!==null)if(j!==null)K(j);else if(l.done)f({done:!0,value:void 0}),f=A=null,m();else{const L=l.read();L!==null&&(f({done:!1,value:L}),f=A=null)}}function K(L){A!==null?(A(L),f=A=j=null,m()):j===null&&(j=L)}function m(){l.removeListener("readable",B),l.removeListener("end",B),l.removeListener("error",K)}return{next(){return new Promise((L,X)=>{f=L,A=X,B()})}}}}e.AsyncIterator=u;function d(V){V==="data"&&(this.removeListener("newListener",d),g(this,"readable",p),this.readable&&i(()=>p.call(this)))}function p(){let V;for(;this.listenerCount("data")!==0&&(V=this.read())!==null;)this.emit("data",V);this.listenerCount("data")===0&&!this.done&&(this.removeListener("readable",p),g(this,"newListener",d))}function g(V,l,f){V.listeners(l).includes(f)||V.on(l,f)}class v extends u{constructor(){super(),this._changeState(e.ENDED,!0)}}e.EmptyIterator=v;class I extends u{constructor(l){super(),this._item=l,l===null?this.close():this.readable=!0}read(){const l=this._item;return this._item=null,this.close(),l}_toStringDetails(){return this._item===null?"":`(${this._item})`}}e.SingletonIterator=I;class C extends u{constructor(l=[],{autoStart:f=!0,preserve:A=!0}={}){super();const j=A||!Array.isArray(l)?[...l]:l;this._index=0,this._sourceStarted=f!==!1,this._truncateThreshold=A?-1:64,this._sourceStarted&&j.length===0?this.close():this._buffer=j,this.readable=!0}read(){this._sourceStarted||(this._sourceStarted=!0);let l=null;return this._buffer&&(this._index<this._buffer.length&&(l=this._buffer[this._index++]),this._index===this._buffer.length?(delete this._buffer,this.close()):this._index===this._truncateThreshold&&(this._buffer.splice(0,this._truncateThreshold),this._index=0)),l}_toStringDetails(){return`(${this._buffer?this._buffer.length-this._index:0})`}_destroy(l,f){delete this._buffer,f()}toArray(l={}){if(!this._buffer)return Promise.resolve([]);const{length:f}=this._buffer,A=this._index,j=typeof l.limit!="number"?f:A+l.limit,B=this._buffer.slice(A,j);return this._index=j,j>=f&&this.close(),Promise.resolve(B)}}e.ArrayIterator=C;class _ extends u{constructor({start:l=0,step:f=1,end:A}={}){super(),Number.isFinite(l)&&(l=Math.trunc(l)),this._next=l,Number.isFinite(f)&&(f=Math.trunc(f)),this._step=f;const j=f>=0,B=j?1/0:-1/0;Number.isFinite(A)?A=Math.trunc(A):A!==-B&&(A=B),this._last=A,!Number.isFinite(l)||(j?l>A:l<A)?this.close():this.readable=!0}read(){if(this.closed)return null;const l=this._next,f=this._step,A=this._last,j=this._next+=f;return(f>=0?j>A:j<A)&&this.close(),l}_toStringDetails(){return`(${this._next}...${this._last})`}}e.IntegerIterator=_;function w(V){return V}e.identity=w,e.DESTINATION=Symbol("destination");class R extends u{constructor(l,f=w,A={}){super(),this._map=f,this._source=E(l),this._destroySource=A.destroySource!==!1,l.done?this.close():(this._source[e.DESTINATION]=this,this._source.on("end",G),this._source.on("error",te),this._source.on("readable",Y),this.readable=this._source.readable)}read(){if(!this.done){if(this._source.readable){let l,f;for(;(l=this._source.read())!==null;)if((f=this._map(l))!==null)return f}this.readable=!1,this._source.done&&this.close()}return null}_end(l){this._source.removeListener("end",G),this._source.removeListener("error",te),this._source.removeListener("readable",Y),delete this._source[e.DESTINATION],this._destroySource&&this._source.destroy(),super._end(l)}}e.MappingIterator=R;function E(V,l=!1){if(!V||!le(V.read)||!le(V.on))throw new TypeError(`Invalid source: ${V}`);if(!l&&V[e.DESTINATION])throw new Error("The source already has a destination");return V}class S extends u{constructor({maxBufferSize:l=4,autoStart:f=!0}={}){super(e.INIT),this._buffer=new r.LinkedList,this._maxBufferSize=4,this._reading=!0,this._pushedCount=0,this.maxBufferSize=l,i(()=>this._init(f)),this._sourceStarted=f!==!1}get maxBufferSize(){return this._maxBufferSize}set maxBufferSize(l){l!==1/0&&(l=Number.isFinite(l)?Math.max(Math.trunc(l),1):4),this._maxBufferSize!==l&&(this._maxBufferSize=l,this._state===e.OPEN&&this._fillBuffer())}_init(l){let f=!1;this._reading=!0,this._begin(()=>{if(f)throw new Error("done callback called multiple times");f=!0,this._reading=!1,this._changeState(e.OPEN),l?this._fillBufferAsync():this.readable=!0})}_begin(l){l()}read(){if(this.done)return null;this._sourceStarted||(this._sourceStarted=!0);const l=this._buffer;let f;return l.empty?(f=null,this.readable=!1):f=l.shift(),!this._reading&&l.length<this._maxBufferSize&&(this.closed?l.empty&&this._endAsync():this._fillBufferAsync()),f}_read(l,f){f()}_push(l){this.done||(this._pushedCount++,this._buffer.push(l),this.readable=!0)}_fillBuffer(){let l;this._reading||(this.closed?this._completeClose():(l=Math.min(this._maxBufferSize-this._buffer.length,128))>0&&(this._pushedCount=0,this._reading=!0,this._read(l,()=>{if(!l)throw new Error("done callback called multiple times");l=0,this._reading=!1,this.closed?this._completeClose():this._pushedCount&&(this.readable=!0,this._buffer.length<this._maxBufferSize/2&&this._fillBufferAsync())})))}_fillBufferAsync(){this._reading||(this._reading=!0,i(()=>{this._reading=!1,this._fillBuffer()}))}close(){this._reading?this._changeState(e.CLOSING):this._completeClose()}_completeClose(){this._changeState(e.CLOSED)&&(this._reading=!0,this._flush(()=>{if(!this._reading)throw new Error("done callback called multiple times");this._reading=!1,this._buffer.empty&&this._endAsync()}))}_destroy(l,f){this._buffer.clear(),f()}_flush(l){l()}_toStringDetails(){const l=this._buffer;return`{${l.empty?"":`next: ${l.first}, `}buffer: ${l.length}}`}}e.BufferedIterator=S;class Q extends S{constructor(l,f=l||{}){super(f),this._boundPush=A=>this._push(A),U(l)||(l=f.source),se(l)?this.source=l:l&&(this._createSource=k(l)?()=>l:l,this._sourceStarted&&this._loadSourceAsync()),this._optional=!!f.optional,this._destroySource=f.destroySource!==!1}get source(){return le(this._createSource)&&this._loadSourceAsync(),this._source}set source(l){const f=this._source=this._validateSource(l);f[e.DESTINATION]=this,this.done?this._destroySource&&f.destroy():f.done?this.close():(f.on("end",q),f.on("readable",ce),f.on("error",te))}_loadSourceAsync(){le(this._createSource)&&(Promise.resolve(this._createSource()).then(l=>{delete this._createSource,this.source=l,this._fillBuffer()},l=>this.emit("error",l)),this._createSource=null)}_validateSource(l,f=!1){if(this._source||typeof this._createSource<"u")throw new Error("The source cannot be changed after it has been set");return E(l,f)}_read(l,f){const A=()=>{this._pushedCount<l&&!this.closed?i(()=>this._readAndTransform(A,f)):f()};this._readAndTransform(A,f)}_readAndTransform(l,f){let A;const j=this.source;!j||j.done||(A=j.read())===null?f():this._optional?this._optionalTransform(A,l):this._transform(A,l,this._boundPush)}_optionalTransform(l,f){const A=this._pushedCount;this._transform(l,()=>{A===this._pushedCount&&this._push(l),f()},this._boundPush)}_transform(l,f,A){A(l),f()}_closeWhenDone(){this.close()}_end(l){const f=this._source;f&&(f.removeListener("end",q),f.removeListener("error",te),f.removeListener("readable",ce),delete f[e.DESTINATION],this._destroySource&&f.destroy()),super._end(l)}}e.TransformIterator=Q;function Y(){this[e.DESTINATION].readable=!0}function te(V){this[e.DESTINATION].emit("error",V)}function G(){this[e.DESTINATION].close()}function q(){this[e.DESTINATION]._closeWhenDone()}function ce(){this[e.DESTINATION]._sourceStarted!==!1&&this[e.DESTINATION]._fillBuffer()}class M extends Q{constructor(l,f){if(super(l,f),this._offset=0,this._limit=1/0,this._filter=A=>!0,f=f||(U(l)?null:l),f){const A=le(f)?f:f.transform,{limit:j,offset:B,filter:K,map:m,prepend:L,append:X}=f;B===1/0||j===-1/0?this._limit=0:(Number.isFinite(B)&&(this._offset=Math.max(Math.trunc(B),0)),Number.isFinite(j)&&(this._limit=Math.max(Math.trunc(j),0)),le(K)&&(this._filter=K),le(m)&&(this._map=m),this._transform=le(A)?A:null),L&&(this._prepender=se(L)?L:b(L)),X&&(this._appender=se(X)?X:b(X))}}_read(l,f){const A=()=>this._readAndTransformSimple(l,j,f);this._readAndTransformSimple(l,j,f);function j(){i(A)}}_readAndTransformSimple(l,f,A){let j;const{source:B}=this;if(!B||B.done){A();return}for(this._limit===0&&this.close();!this.closed&&this._pushedCount<l&&(j=B.read())!==null;){if(!this._filter(j)||this._offset!==0&&this._offset--)continue;const K=typeof this._map>"u"?j:this._map(j);if(K===null)this._optional&&this._push(j);else if(!le(this._transform))this._push(K);else{this._optional?this._optionalTransform(K,f):this._transform(K,f,this._boundPush);return}--this._limit===0&&this.close()}A()}_begin(l){this._insert(this._prepender,l),delete this._prepender}_flush(l){this._insert(this._appender,l),delete this._appender}_insert(l,f){const A=B=>this._push(B);!l||l.done?f():(l.on("data",A),l.on("end",j));function j(){l.removeListener("data",A),l.removeListener("end",j),f()}}}e.SimpleTransformIterator=M;class D extends Q{constructor(l,f){if(super(l,f),this._transformerQueue=[],f){const A=le(f)?f:f.multiTransform;A&&(this._createTransformer=A)}}_read(l,f){const A=this._transformerQueue,j=this._optional;let B,K;for(;(B=A[0])&&B.transformer.done;){j&&B.item!==null&&(l--,this._push(B.item)),A.shift();const{transformer:L}=B;L.removeListener("end",ce),L.removeListener("readable",ce),L.removeListener("error",te)}const{source:m}=this;for(;m&&!m.done&&A.length<this.maxBufferSize&&(K=m.read(),K!==null);){const L=this._createTransformer(K)||new v;L[e.DESTINATION]=this,L.on("end",ce),L.on("readable",ce),L.on("error",te),A.push({transformer:L,item:K})}if(B=A[0],B){const{transformer:L}=B;for(;l-- >0&&(K=L.read())!==null;)this._push(K),j&&(B.item=null)}else m&&m.done&&this.close();f()}_createTransformer(l){return new I(l)}_closeWhenDone(){this._transformerQueue.length||this.close()}_end(l){if(super._end(l),this._destroySource)for(const f of this._transformerQueue)f.transformer.destroy()}}e.MultiTransformIterator=D;class z extends S{constructor(l,f={}){super(f),this._sources=[],this._currentSource=-1;const A=f.autoStart!==!1;if(se(l))l.on("error",j=>this.emit("error",j)),this._pending={loading:!1,sources:l},A&&this._loadSources();else if(Array.isArray(l)&&l.length>0)for(const j of l)this._addSource(j);else A&&this.close();this._destroySources=f.destroySources!==!1}_loadSources(){const l=this._pending.sources;this._pending.loading=!0,l.done?(delete this._pending,this.close()):(l.on("data",f=>{this._addSource(f),this._fillBufferAsync()}),l.on("end",()=>{delete this._pending,this._fillBuffer()}))}_addSource(l){k(l)&&(l=he(l)),l.done||(this._sources.push(l),l[e.DESTINATION]=this,l.on("error",te),l.on("readable",ce),l.on("end",x))}_removeEmptySources(){this._sources=this._sources.filter((l,f)=>(l.done&&f<=this._currentSource&&this._currentSource--,!l.done)),this._fillBuffer()}_read(l,f){var A;((A=this._pending)===null||A===void 0?void 0:A.loading)===!1&&this._loadSources();let j=0,B;for(;j!==(j=l);)for(let K=0;K<this._sources.length&&l>0;K++)this._currentSource=(this._currentSource+1)%this._sources.length,(B=this._sources[this._currentSource].read())!==null&&(l--,this._push(B));!this._pending&&this._sources.length===0&&this.close(),f()}_end(l=!1){if(super._end(l),this._destroySources){for(const f of this._sources)f.destroy();this._pending&&(this._pending.sources.destroy(),delete this._pending)}}}e.UnionIterator=z;function x(){this[e.DESTINATION]._removeEmptySources()}class Z extends Q{constructor(l){super(l,{autoStart:!1}),this._readPosition=0,this._reading=!1,l&&(this.readable=!0)}_init(){}close(){u.prototype.close.call(this)}get source(){return super.source}set source(l){const f=this._source=this._validateSource(l),A=f&&f[e.DESTINATION]||(f[e.DESTINATION]=new re(f));this.done?this._destroySource&&f.destroy():A.endsAt(0)?this.close():(A.register(this),(f._sourceStarted===!1||A.readAt(0)!==null)&&(this.readable=!0));const j=this._propertyCallbacks;for(const B in j){const K=j[B];for(const m of K)this._getSourceProperty(B,m)}}_validateSource(l,f=!1){const A=l&&l[e.DESTINATION];return super._validateSource(l,!A||A instanceof re)}getProperty(l,f){const{source:A}=this,j=this._properties,B=j&&l in j;if(!f)return B?j&&j[l]:A&&A.getProperty(l);super.getProperty(l,f),A&&!B&&this._getSourceProperty(l,f)}_getSourceProperty(l,f){this.source.getProperty(l,A=>{(!this._properties||!(l in this._properties))&&f(A)})}getProperties(){const l=this.source?this.source.getProperties():{},f=this._properties;for(const A in f)l[A]=f[A];return l}_toStringDetails(){return`{source: ${this.source?this.source.toString():"none"}}`}read(){this._sourceStarted||(this._sourceStarted=!0);const l=this.source;let f=null;if(!this.done&&l){const A=l[e.DESTINATION];(f=A.readAt(this._readPosition))!==null?this._readPosition++:this.readable=!1,A.endsAt(this._readPosition)&&this.close()}return f}_end(l){const f=this.source,A=f?.[e.DESTINATION];A&&A.unregister(this),S.prototype._end.call(this,l)}}e.ClonedIterator=Z;class re{constructor(l){if(this._history=[],this._trackers=new Set,this._source=l,!l.done){const f=()=>{for(const B of this._trackers)B.readable=!0},A=B=>{for(const K of this._trackers)K.emit("error",B)},j=()=>{for(const B of this._trackers)B._sourceStarted!==!1&&B._readPosition===this._history.length&&B.close();this._trackers.clear(),l.removeListener("end",j),l.removeListener("error",A),l.removeListener("readable",f)};l.on("end",j),l.on("error",A),l.on("readable",f)}}register(l){this._source.done||this._trackers.add(l)}unregister(l){this._trackers.delete(l)}readAt(l){let f=null;return l<this._history.length?f=this._history[l]:!this._source.done&&(f=this._source.read())!==null&&(this._history[l]=f),f}endsAt(l){return this._source.done&&this._history.length===l}}class ie extends u{constructor(l,f){super(),this._source=null,this._destroySource=f?.destroySource!==!1,k(l)?(this._source=new u,l.then(A=>{this._source=null,this.source=A}).catch(A=>this.emit("error",A))):l&&(this.source=l)}set source(l){let f=l;if(this._source!==null)throw new Error("The source cannot be changed after it has been set");if(ne(f)&&(f=f[Symbol.iterator]()),de(f)){let A=f;f=new t.EventEmitter,f.read=()=>{if(A!==null){let j;for(;!(j=A.next()).done;)if(j.value!==null)return j.value;A=null,this.close()}return null}}else f=E(f);if(this.done){this._destroySource&&le(f.destroy)&&f.destroy();return}f[e.DESTINATION]=this,f.on("end",G),f.on("error",te),f.on("readable",Y),this._source=f,this.readable=f.readable!==!1}read(){if(this._source!==null&&this._source.readable!==!1){const l=this._source.read();if(l!==null)return l;this.readable=!1}return null}_end(l=!1){this._source!==null&&(this._source.removeListener("end",G),this._source.removeListener("error",te),this._source.removeListener("readable",Y),delete this._source[e.DESTINATION],this._destroySource&&le(this._source.destroy)&&this._source.destroy(),this._source=null),super._end(l)}}e.WrappingIterator=ie;function he(V,l){if(l&&("autoStart"in l||"optional"in l||"source"in l||"maxBufferSize"in l))return V&&!se(V)&&(V=new ie(V)),new Q(V,l);if(!V)return F();if(k(V))return new ie(V,l);if(V instanceof u)return V;if(Array.isArray(V))return b(V);if(ne(V)||de(V)||se(V))return new ie(V,l);throw new TypeError(`Invalid source: ${V}`)}e.wrap=he;function F(){return new v}e.empty=F;function oe(V){return new I(V)}e.single=oe;function b(V){return new C(V)}e.fromArray=b;function T(V){return new ie(V)}e.fromIterator=T;function $(V){return new ie(V)}e.fromIterable=$;function O(V){return new z(V)}e.union=O;function ae(V,l,f){return new _({start:V,end:l,step:f})}e.range=ae;function ue(V,l){return l?V.bind(l):V}function le(V){return typeof V=="function"}e.isFunction=le;function se(V){return le(V?.on)}e.isEventEmitter=se;function k(V){return le(V?.then)}e.isPromise=k;function U(V){return V&&(se(V)||k(V)||le(V))}e.isSourceExpression=U;function ne(V){return V&&Symbol.iterator in V}e.isIterable=ne;function de(V){return le(V?.next)}e.isIterator=de})(_a)),_a}var Ea={exports:{}},xa={exports:{}},Ia,vc;function Le(){if(vc)return Ia;vc=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
11
+ `;super(n),this.name="AggregateError",this.errors=r}}return Ia={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},Ia}var Ra={exports:{}},Ca,Sc;function lp(){return Sc||(Sc=1,Ca={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),Ca}var Ma,Ec;function ft(){if(Ec)return Ma;Ec=1;const{format:e,inspect:t}=lp(),{AggregateError:r}=Le(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",u={};function d(w,R){if(!w)throw new u.ERR_INTERNAL_ASSERTION(R)}function p(w){let R="",E=w.length;const S=w[0]==="-"?1:0;for(;E>=S+4;E-=3)R=`_${w.slice(E-3,E)}${R}`;return`${w.slice(0,E)}${R}`}function g(w,R,E){if(typeof R=="function")return d(R.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${R.length}).`),R(...E);const S=(R.match(/%[dfijoOs]/g)||[]).length;return d(S===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${S}).`),E.length===0?R:e(R,...E)}function v(w,R,E){E||(E=Error);class S extends E{constructor(...Y){super(g(w,R,Y))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=w,S.prototype[i]=!0,u[w]=S}function I(w){const R=s+w.name;return Object.defineProperty(w,"name",{value:R}),w}function C(w,R){if(w&&R&&w!==R){if(Array.isArray(R.errors))return R.errors.push(w),R;const E=new n([R,w],R.message);return E.code=R.code,E}return w||R}class _ extends Error{constructor(R="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",E);super(R,E),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(w,R,E)=>{d(typeof w=="string","'name' must be a string"),Array.isArray(R)||(R=[R]);let S="The ";w.endsWith(" argument")?S+=`${w} `:S+=`"${w}" ${w.includes(".")?"property":"argument"} `,S+="must be ";const Q=[],Y=[],te=[];for(const q of R)d(typeof q=="string","All expected entries have to be of type string"),o.includes(q)?Q.push(q.toLowerCase()):a.test(q)?Y.push(q):(d(q!=="object",'The value "object" should be written as "Object"'),te.push(q));if(Y.length>0){const q=Q.indexOf("object");q!==-1&&(Q.splice(Q,q,1),Y.push("Object"))}if(Q.length>0){switch(Q.length){case 1:S+=`of type ${Q[0]}`;break;case 2:S+=`one of type ${Q[0]} or ${Q[1]}`;break;default:{const q=Q.pop();S+=`one of type ${Q.join(", ")}, or ${q}`}}(Y.length>0||te.length>0)&&(S+=" or ")}if(Y.length>0){switch(Y.length){case 1:S+=`an instance of ${Y[0]}`;break;case 2:S+=`an instance of ${Y[0]} or ${Y[1]}`;break;default:{const q=Y.pop();S+=`an instance of ${Y.join(", ")}, or ${q}`}}te.length>0&&(S+=" or ")}switch(te.length){case 0:break;case 1:te[0].toLowerCase()!==te[0]&&(S+="an "),S+=`${te[0]}`;break;case 2:S+=`one of ${te[0]} or ${te[1]}`;break;default:{const q=te.pop();S+=`one of ${te.join(", ")}, or ${q}`}}if(E==null)S+=`. Received ${E}`;else if(typeof E=="function"&&E.name)S+=`. Received function ${E.name}`;else if(typeof E=="object"){var G;if((G=E.constructor)!==null&&G!==void 0&&G.name)S+=`. Received an instance of ${E.constructor.name}`;else{const q=t(E,{depth:-1});S+=`. Received ${q}`}}else{let q=t(E,{colors:!1});q.length>25&&(q=`${q.slice(0,25)}...`),S+=`. Received type ${typeof E} (${q})`}return S},TypeError),v("ERR_INVALID_ARG_VALUE",(w,R,E="is invalid")=>{let S=t(R);return S.length>128&&(S=S.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${S}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(w,R,E)=>{var S;const Q=E!=null&&(S=E.constructor)!==null&&S!==void 0&&S.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${R}" function but got ${Q}.`},TypeError),v("ERR_MISSING_ARGS",(...w)=>{d(w.length>0,"At least one arg needs to be specified");let R;const E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(S=>`"${S}"`).join(" or "),E){case 1:R+=`The ${w[0]} argument`;break;case 2:R+=`The ${w[0]} and ${w[1]} arguments`;break;default:{const S=w.pop();R+=`The ${w.join(", ")}, and ${S} arguments`}break}return`${R} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(w,R,E)=>{d(R,'Missing "range" argument');let S;if(Number.isInteger(E)&&Math.abs(E)>2**32)S=p(String(E));else if(typeof E=="bigint"){S=String(E);const Q=BigInt(2)**BigInt(32);(E>Q||E<-Q)&&(S=p(S)),S+="n"}else S=t(E);return`The value of "${w}" is out of range. It must be ${R}. Received ${S}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Ma={AbortError:_,aggregateTwoErrors:I(C),hideStackFrames:I,codes:u},Ma}var xc;function mt(){return xc||(xc=1,(function(e){const t=vt(),{format:r,inspect:n}=lp(),{codes:{ERR_INVALID_ARG_TYPE:i}}=ft(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=Le(),u=globalThis.AbortSignal||Qt().AbortSignal,d=globalThis.AbortController||Qt().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,v=typeof g<"u"?function(w){return w instanceof g}:function(w){return!1},I=(_,w)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new i(w,"AbortSignal",_)},C=(_,w)=>{if(typeof _!="function")throw new i(w,"Function",_)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(_){let w=!1;return function(...R){w||(w=!0,_.apply(this,R))}},createDeferredPromise:function(){let _,w;return{promise:new Promise((E,S)=>{_=E,w=S}),resolve:_,reject:w}},promisify(_){return new Promise((w,R)=>{_((E,...S)=>E?R(E):w(...S))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(_){return _ instanceof p},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:v,deprecate(_,w){return _},addAbortListener:or().addAbortListener||function(w,R){if(w===void 0)throw new i("signal","AbortSignal",w);I(w,"signal"),C(R,"listener");let E;return w.aborted?queueMicrotask(()=>R()):(w.addEventListener("abort",R,{__proto__:null,once:!0,[o]:!0}),E=()=>{w.removeEventListener("abort",R)}),{__proto__:null,[s](){var S;(S=E)===null||S===void 0||S()}}},AbortSignalAny:u.any||function(w){if(w.length===1)return w[0];const R=new d,E=()=>R.abort();return w.forEach(S=>{I(S,"signals"),S.addEventListener("abort",E,{once:!0})}),R.signal.addEventListener("abort",()=>{w.forEach(S=>S.removeEventListener("abort",E))},{once:!0}),R.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ra)),Ra.exports}var oo={},Da,Ic;function Ji(){if(Ic)return Da;Ic=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:v,StringPrototypeTrim:I}=Le(),{hideStackFrames:C,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:S}}=ft(),{normalizeEncoding:Q}=mt(),{isAsyncFunction:Y,isArrayBufferView:te}=mt().types,G={};function q(m){return m===(m|0)}function ce(m){return m===m>>>0}const M=/^[0-7]+$/,D="must be a 32-bit unsigned integer or an octal string";function z(m,L,X){if(typeof m>"u"&&(m=X),typeof m=="string"){if(p(M,m)===null)throw new R(L,m,D);m=u(m,8)}return re(m,L),m}const x=C((m,L,X=s,H=a)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);if(m<X||m>H)throw new E(L,`>= ${X} && <= ${H}`,m)}),Z=C((m,L,X=-2147483648,H=2147483647)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);if(m<X||m>H)throw new E(L,`>= ${X} && <= ${H}`,m)}),re=C((m,L,X=!1)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);const H=X?1:0,fe=4294967295;if(m<H||m>fe)throw new E(L,`>= ${H} && <= ${fe}`,m)});function ie(m,L){if(typeof m!="string")throw new w(L,"string",m)}function he(m,L,X=void 0,H){if(typeof m!="number")throw new w(L,"number",m);if(X!=null&&m<X||H!=null&&m>H||(X!=null||H!=null)&&o(m))throw new E(L,`${X!=null?`>= ${X}`:""}${X!=null&&H!=null?" && ":""}${H!=null?`<= ${H}`:""}`,m)}const F=C((m,L,X)=>{if(!t(X,m)){const fe="must be one of: "+r(n(X,we=>typeof we=="string"?`'${we}'`:g(we)),", ");throw new R(L,m,fe)}});function oe(m,L){if(typeof m!="boolean")throw new w(L,"boolean",m)}function b(m,L,X){return m==null||!d(m,L)?X:m[L]}const T=C((m,L,X=null)=>{const H=b(X,"allowArray",!1),fe=b(X,"allowFunction",!1);if(!b(X,"nullable",!1)&&m===null||!H&&e(m)||typeof m!="object"&&(!fe||typeof m!="function"))throw new w(L,"Object",m)}),$=C((m,L)=>{if(m!=null&&typeof m!="object"&&typeof m!="function")throw new w(L,"a dictionary",m)}),O=C((m,L,X=0)=>{if(!e(m))throw new w(L,"Array",m);if(m.length<X){const H=`must be longer than ${X}`;throw new R(L,m,H)}});function ae(m,L){O(m,L);for(let X=0;X<m.length;X++)ie(m[X],`${L}[${X}]`)}function ue(m,L){O(m,L);for(let X=0;X<m.length;X++)oe(m[X],`${L}[${X}]`)}function le(m,L){O(m,L);for(let X=0;X<m.length;X++){const H=m[X],fe=`${L}[${X}]`;if(H==null)throw new w(fe,"AbortSignal",H);de(H,fe)}}function se(m,L="signal"){if(ie(m,L),G[m]===void 0)throw G[v(m)]!==void 0?new S(m+" (signals must use all capital letters)"):new S(m)}const k=C((m,L="buffer")=>{if(!te(m))throw new w(L,["Buffer","TypedArray","DataView"],m)});function U(m,L){const X=Q(L),H=m.length;if(X==="hex"&&H%2!==0)throw new R("encoding",L,`is invalid for data of length ${H}`)}function ne(m,L="Port",X=!0){if(typeof m!="number"&&typeof m!="string"||typeof m=="string"&&I(m).length===0||+m!==+m>>>0||m>65535||m===0&&!X)throw new _(L,m,X);return m|0}const de=C((m,L)=>{if(m!==void 0&&(m===null||typeof m!="object"||!("aborted"in m)))throw new w(L,"AbortSignal",m)}),V=C((m,L)=>{if(typeof m!="function")throw new w(L,"Function",m)}),l=C((m,L)=>{if(typeof m!="function"||Y(m))throw new w(L,"Function",m)}),f=C((m,L)=>{if(m!==void 0)throw new w(L,"undefined",m)});function A(m,L,X){if(!t(X,m))throw new w(L,`('${r(X,"|")}')`,m)}const j=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(m,L){if(typeof m>"u"||!p(j,m))throw new R(L,m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function K(m){if(typeof m=="string")return B(m,"hints"),m;if(e(m)){const L=m.length;let X="";if(L===0)return X;for(let H=0;H<L;H++){const fe=m[H];B(fe,"hints"),X+=fe,H!==L-1&&(X+=", ")}return X}throw new R("hints",m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Da={isInt32:q,isUint32:ce,parseFileMode:z,validateArray:O,validateStringArray:ae,validateBooleanArray:ue,validateAbortSignalArray:le,validateBoolean:oe,validateBuffer:k,validateDictionary:$,validateEncoding:U,validateFunction:V,validateInt32:Z,validateInteger:x,validateNumber:he,validateObject:T,validateOneOf:F,validatePlainFunction:l,validatePort:ne,validateSignalName:se,validateString:ie,validateUint32:re,validateUndefined:f,validateUnion:A,validateAbortSignal:de,validateLinkHeaderValue:K},Da}var ao={exports:{}},Pa,Rc;function ar(){if(Rc)return Pa;Rc=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=Le(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),u=r("nodejs.webstream.isClosedPromise"),d=r("nodejs.webstream.controllerErrorFunction");function p(b,T=!1){var $;return!!(b&&typeof b.pipe=="function"&&typeof b.on=="function"&&(!T||typeof b.pause=="function"&&typeof b.resume=="function")&&(!b._writableState||(($=b._readableState)===null||$===void 0?void 0:$.readable)!==!1)&&(!b._writableState||b._readableState))}function g(b){var T;return!!(b&&typeof b.write=="function"&&typeof b.on=="function"&&(!b._readableState||((T=b._writableState)===null||T===void 0?void 0:T.writable)!==!1))}function v(b){return!!(b&&typeof b.pipe=="function"&&b._readableState&&typeof b.on=="function"&&typeof b.write=="function")}function I(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function C(b){return!!(b&&!I(b)&&typeof b.pipeThrough=="function"&&typeof b.getReader=="function"&&typeof b.cancel=="function")}function _(b){return!!(b&&!I(b)&&typeof b.getWriter=="function"&&typeof b.abort=="function")}function w(b){return!!(b&&!I(b)&&typeof b.readable=="object"&&typeof b.writable=="object")}function R(b){return C(b)||_(b)||w(b)}function E(b,T){return b==null?!1:T===!0?typeof b[e]=="function":T===!1?typeof b[t]=="function":typeof b[e]=="function"||typeof b[t]=="function"}function S(b){if(!I(b))return null;const T=b._writableState,$=b._readableState,O=T||$;return!!(b.destroyed||b[n]||O!=null&&O.destroyed)}function Q(b){if(!g(b))return null;if(b.writableEnded===!0)return!0;const T=b._writableState;return T!=null&&T.errored?!1:typeof T?.ended!="boolean"?null:T.ended}function Y(b,T){if(!g(b))return null;if(b.writableFinished===!0)return!0;const $=b._writableState;return $!=null&&$.errored?!1:typeof $?.finished!="boolean"?null:!!($.finished||T===!1&&$.ended===!0&&$.length===0)}function te(b){if(!p(b))return null;if(b.readableEnded===!0)return!0;const T=b._readableState;return!T||T.errored?!1:typeof T?.ended!="boolean"?null:T.ended}function G(b,T){if(!p(b))return null;const $=b._readableState;return $!=null&&$.errored?!1:typeof $?.endEmitted!="boolean"?null:!!($.endEmitted||T===!1&&$.ended===!0&&$.length===0)}function q(b){return b&&b[o]!=null?b[o]:typeof b?.readable!="boolean"?null:S(b)?!1:p(b)&&b.readable&&!G(b)}function ce(b){return b&&b[a]!=null?b[a]:typeof b?.writable!="boolean"?null:S(b)?!1:g(b)&&b.writable&&!Q(b)}function M(b,T){return I(b)?S(b)?!0:!(T?.readable!==!1&&q(b)||T?.writable!==!1&&ce(b)):null}function D(b){var T,$;return I(b)?b.writableErrored?b.writableErrored:(T=($=b._writableState)===null||$===void 0?void 0:$.errored)!==null&&T!==void 0?T:null:null}function z(b){var T,$;return I(b)?b.readableErrored?b.readableErrored:(T=($=b._readableState)===null||$===void 0?void 0:$.errored)!==null&&T!==void 0?T:null:null}function x(b){if(!I(b))return null;if(typeof b.closed=="boolean")return b.closed;const T=b._writableState,$=b._readableState;return typeof T?.closed=="boolean"||typeof $?.closed=="boolean"?T?.closed||$?.closed:typeof b._closed=="boolean"&&Z(b)?b._closed:null}function Z(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function re(b){return typeof b._sent100=="boolean"&&Z(b)}function ie(b){var T;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((T=b.req)===null||T===void 0?void 0:T.upgradeOrConnect)===void 0}function he(b){if(!I(b))return null;const T=b._writableState,$=b._readableState,O=T||$;return!O&&re(b)||!!(O&&O.autoDestroy&&O.emitClose&&O.closed===!1)}function F(b){var T;return!!(b&&((T=b[s])!==null&&T!==void 0?T:b.readableDidRead||b.readableAborted))}function oe(b){var T,$,O,ae,ue,le,se,k,U,ne;return!!(b&&((T=($=(O=(ae=(ue=(le=b[i])!==null&&le!==void 0?le:b.readableErrored)!==null&&ue!==void 0?ue:b.writableErrored)!==null&&ae!==void 0?ae:(se=b._readableState)===null||se===void 0?void 0:se.errorEmitted)!==null&&O!==void 0?O:(k=b._writableState)===null||k===void 0?void 0:k.errorEmitted)!==null&&$!==void 0?$:(U=b._readableState)===null||U===void 0?void 0:U.errored)!==null&&T!==void 0?T:!((ne=b._writableState)===null||ne===void 0)&&ne.errored))}return Pa={isDestroyed:S,kIsDestroyed:n,isDisturbed:F,kIsDisturbed:s,isErrored:oe,kIsErrored:i,isReadable:q,kIsReadable:o,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:a,isClosed:x,isDuplexNodeStream:v,isFinished:M,isIterable:E,isReadableNodeStream:p,isReadableStream:C,isReadableEnded:te,isReadableFinished:G,isReadableErrored:z,isNodeStream:I,isWebStream:R,isWritable:ce,isWritableNodeStream:g,isWritableStream:_,isWritableEnded:Q,isWritableFinished:Y,isWritableErrored:D,isServerRequest:ie,isServerResponse:re,willEmitClose:he,isTransformStream:w},Pa}var Cc;function vr(){if(Cc)return ao.exports;Cc=1;const e=St(),{AbortError:t,codes:r}=ft(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=mt(),{validateAbortSignal:s,validateFunction:u,validateObject:d,validateBoolean:p}=Ji(),{Promise:g,PromisePrototypeThen:v,SymbolDispose:I}=Le(),{isClosed:C,isReadable:_,isReadableNodeStream:w,isReadableStream:R,isReadableFinished:E,isReadableErrored:S,isWritable:Q,isWritableNodeStream:Y,isWritableStream:te,isWritableFinished:G,isWritableErrored:q,isNodeStream:ce,willEmitClose:M,kIsClosedPromise:D}=ar();let z;function x(F){return F.setHeader&&typeof F.abort=="function"}const Z=()=>{};function re(F,oe,b){var T,$;if(arguments.length===2?(b=oe,oe=o):oe==null?oe=o:d(oe,"options"),u(b,"callback"),s(oe.signal,"options.signal"),b=a(b),R(F)||te(F))return ie(F,oe,b);if(!ce(F))throw new n("stream",["ReadableStream","WritableStream","Stream"],F);const O=(T=oe.readable)!==null&&T!==void 0?T:w(F),ae=($=oe.writable)!==null&&$!==void 0?$:Y(F),ue=F._writableState,le=F._readableState,se=()=>{F.writable||ne()};let k=M(F)&&w(F)===O&&Y(F)===ae,U=G(F,!1);const ne=()=>{U=!0,F.destroyed&&(k=!1),!(k&&(!F.readable||O))&&(!O||de)&&b.call(F)};let de=E(F,!1);const V=()=>{de=!0,F.destroyed&&(k=!1),!(k&&(!F.writable||ae))&&(!ae||U)&&b.call(F)},l=m=>{b.call(F,m)};let f=C(F);const A=()=>{f=!0;const m=q(F)||S(F);if(m&&typeof m!="boolean")return b.call(F,m);if(O&&!de&&w(F,!0)&&!E(F,!1))return b.call(F,new i);if(ae&&!U&&!G(F,!1))return b.call(F,new i);b.call(F)},j=()=>{f=!0;const m=q(F)||S(F);if(m&&typeof m!="boolean")return b.call(F,m);b.call(F)},B=()=>{F.req.on("finish",ne)};x(F)?(F.on("complete",ne),k||F.on("abort",A),F.req?B():F.on("request",B)):ae&&!ue&&(F.on("end",se),F.on("close",se)),!k&&typeof F.aborted=="boolean"&&F.on("aborted",A),F.on("end",V),F.on("finish",ne),oe.error!==!1&&F.on("error",l),F.on("close",A),f?e.nextTick(A):ue!=null&&ue.errorEmitted||le!=null&&le.errorEmitted?k||e.nextTick(j):(!O&&(!k||_(F))&&(U||Q(F)===!1)||!ae&&(!k||Q(F))&&(de||_(F)===!1)||le&&F.req&&F.aborted)&&e.nextTick(j);const K=()=>{b=Z,F.removeListener("aborted",A),F.removeListener("complete",ne),F.removeListener("abort",A),F.removeListener("request",B),F.req&&F.req.removeListener("finish",ne),F.removeListener("end",se),F.removeListener("close",se),F.removeListener("finish",ne),F.removeListener("end",V),F.removeListener("error",l),F.removeListener("close",A)};if(oe.signal&&!f){const m=()=>{const L=b;K(),L.call(F,new t(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)e.nextTick(m);else{z=z||mt().addAbortListener;const L=z(oe.signal,m),X=b;b=a((...H)=>{L[I](),X.apply(F,H)})}}return K}function ie(F,oe,b){let T=!1,$=Z;if(oe.signal)if($=()=>{T=!0,b.call(F,new t(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)e.nextTick($);else{z=z||mt().addAbortListener;const ae=z(oe.signal,$),ue=b;b=a((...le)=>{ae[I](),ue.apply(F,le)})}const O=(...ae)=>{T||e.nextTick(()=>b.apply(F,ae))};return v(F[D].promise,O,O),Z}function he(F,oe){var b;let T=!1;return oe===null&&(oe=o),(b=oe)!==null&&b!==void 0&&b.cleanup&&(p(oe.cleanup,"cleanup"),T=oe.cleanup),new g(($,O)=>{const ae=re(F,oe,ue=>{T&&ae(),ue?O(ue):$()})})}return ao.exports=re,ao.exports.finished=he,ao.exports}var Ta,Mc;function Cn(){if(Mc)return Ta;Mc=1;const e=St(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=ft(),{Symbol:i}=Le(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:u}=ar(),d=i("kDestroy"),p=i("kConstruct");function g(M,D,z){M&&(M.stack,D&&!D.errored&&(D.errored=M),z&&!z.errored&&(z.errored=M))}function v(M,D){const z=this._readableState,x=this._writableState,Z=x||z;return x!=null&&x.destroyed||z!=null&&z.destroyed?(typeof D=="function"&&D(),this):(g(M,x,z),x&&(x.destroyed=!0),z&&(z.destroyed=!0),Z.constructed?I(this,M,D):this.once(d,function(re){I(this,t(re,M),D)}),this)}function I(M,D,z){let x=!1;function Z(re){if(x)return;x=!0;const ie=M._readableState,he=M._writableState;g(re,he,ie),he&&(he.closed=!0),ie&&(ie.closed=!0),typeof z=="function"&&z(re),re?e.nextTick(C,M,re):e.nextTick(_,M)}try{M._destroy(D||null,Z)}catch(re){Z(re)}}function C(M,D){w(M,D),_(M)}function _(M){const D=M._readableState,z=M._writableState;z&&(z.closeEmitted=!0),D&&(D.closeEmitted=!0),(z!=null&&z.emitClose||D!=null&&D.emitClose)&&M.emit("close")}function w(M,D){const z=M._readableState,x=M._writableState;x!=null&&x.errorEmitted||z!=null&&z.errorEmitted||(x&&(x.errorEmitted=!0),z&&(z.errorEmitted=!0),M.emit("error",D))}function R(){const M=this._readableState,D=this._writableState;M&&(M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1),D&&(D.constructed=!0,D.destroyed=!1,D.closed=!1,D.closeEmitted=!1,D.errored=null,D.errorEmitted=!1,D.finalCalled=!1,D.prefinished=!1,D.ended=D.writable===!1,D.ending=D.writable===!1,D.finished=D.writable===!1)}function E(M,D,z){const x=M._readableState,Z=M._writableState;if(Z!=null&&Z.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||Z!=null&&Z.autoDestroy?M.destroy(D):D&&(D.stack,Z&&!Z.errored&&(Z.errored=D),x&&!x.errored&&(x.errored=D),z?e.nextTick(w,M,D):w(M,D))}function S(M,D){if(typeof M._construct!="function")return;const z=M._readableState,x=M._writableState;z&&(z.constructed=!1),x&&(x.constructed=!1),M.once(p,D),!(M.listenerCount(p)>1)&&e.nextTick(Q,M)}function Q(M){let D=!1;function z(x){if(D){E(M,x??new r);return}D=!0;const Z=M._readableState,re=M._writableState,ie=re||Z;Z&&(Z.constructed=!0),re&&(re.constructed=!0),ie.destroyed?M.emit(d,x):x?E(M,x,!0):e.nextTick(Y,M)}try{M._construct(x=>{e.nextTick(z,x)})}catch(x){e.nextTick(z,x)}}function Y(M){M.emit(p)}function te(M){return M?.setHeader&&typeof M.abort=="function"}function G(M){M.emit("close")}function q(M,D){M.emit("error",D),e.nextTick(G,M)}function ce(M,D){!M||a(M)||(!D&&!s(M)&&(D=new n),u(M)?(M.socket=null,M.destroy(D)):te(M)?M.abort():te(M.req)?M.req.abort():typeof M.destroy=="function"?M.destroy(D):typeof M.close=="function"?M.close():D?e.nextTick(q,M,D):e.nextTick(G,M),M.destroyed||(M[o]=!0))}return Ta={construct:S,destroyer:ce,destroy:v,undestroy:R,errorOrDestroy:E},Ta}var ka,Dc;function Yl(){if(Dc)return ka;Dc=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=Le(),{EventEmitter:r}=or();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function u(_){o.writable&&o.write(_)===!1&&s.pause&&s.pause()}s.on("data",u);function d(){s.readable&&s.resume&&s.resume()}o.on("drain",d),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",v));let p=!1;function g(){p||(p=!0,o.end())}function v(){p||(p=!0,typeof o.destroy=="function"&&o.destroy())}function I(_){C(),r.listenerCount(this,"error")===0&&this.emit("error",_)}i(s,"error",I),i(o,"error",I);function C(){s.removeListener("data",u),o.removeListener("drain",d),s.removeListener("end",g),s.removeListener("close",v),s.removeListener("error",I),o.removeListener("error",I),s.removeListener("end",C),s.removeListener("close",C),o.removeListener("close",C)}return s.on("end",C),s.on("close",C),o.on("close",C),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return ka={Stream:n,prependListener:i},ka}var Oa={exports:{}},Pc;function ea(){return Pc||(Pc=1,(function(e){const{SymbolDispose:t}=Le(),{AbortError:r,codes:n}=ft(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=ar(),s=vr(),{ERR_INVALID_ARG_TYPE:u}=n;let d;const p=(g,v)=>{if(typeof g!="object"||!("aborted"in g))throw new u(v,"AbortSignal",g)};e.exports.addAbortSignal=function(v,I){if(p(v,"signal"),!i(I)&&!o(I))throw new u("stream",["ReadableStream","WritableStream","Stream"],I);return e.exports.addAbortSignalNoValidate(v,I)},e.exports.addAbortSignalNoValidate=function(g,v){if(typeof g!="object"||!("aborted"in g))return v;const I=i(v)?()=>{v.destroy(new r(void 0,{cause:g.reason}))}:()=>{v[a](new r(void 0,{cause:g.reason}))};if(g.aborted)I();else{d=d||mt().addAbortListener;const C=d(g,I);s(v,C[t])}return v}})(Oa)),Oa.exports}var ja,Tc;function Kw(){if(Tc)return ja;Tc=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=Le(),{Buffer:i}=vt(),{inspect:o}=mt();return ja=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const u={data:s,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(s){const u={data:s,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let u=this.head,d=""+u.data;for(;(u=u.next)!==null;)d+=s+u.data;return d}concat(s){if(this.length===0)return i.alloc(0);const u=i.allocUnsafe(s>>>0);let d=this.head,p=0;for(;d;)r(u,d.data,p),p+=d.data.length,d=d.next;return u}consume(s,u){const d=this.head.data;if(s<d.length){const p=d.slice(0,s);return this.head.data=d.slice(s),p}return s===d.length?this.shift():u?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let u="",d=this.head,p=0;do{const g=d.data;if(s>g.length)u+=g,s-=g.length;else{s===g.length?(u+=g,++p,d.next?this.head=d.next:this.head=this.tail=null):(u+=e(g,0,s),this.head=d,d.data=e(g,s));break}++p}while((d=d.next)!==null);return this.length-=p,u}_getBuffer(s){const u=i.allocUnsafe(s),d=s;let p=this.head,g=0;do{const v=p.data;if(s>v.length)r(u,v,d-s),s-=v.length;else{s===v.length?(r(u,v,d-s),++g,p.next?this.head=p.next:this.head=this.tail=null):(r(u,new n(v.buffer,v.byteOffset,s),d-s),this.head=p,p.data=v.slice(s));break}++g}while((p=p.next)!==null);return this.length-=g,u}[Symbol.for("nodejs.util.inspect.custom")](s,u){return o(this,{...u,depth:0,customInspect:!1})}},ja}var Na,kc;function ta(){if(kc)return Na;kc=1;const{MathFloor:e,NumberIsInteger:t}=Le(),{validateInteger:r}=Ji(),{ERR_INVALID_ARG_VALUE:n}=ft().codes;let i=16*1024,o=16;function a(p,g,v){return p.highWaterMark!=null?p.highWaterMark:g?p[v]:null}function s(p){return p?o:i}function u(p,g){r(g,"value",0),p?o=g:i=g}function d(p,g,v,I){const C=a(g,I,v);if(C!=null){if(!t(C)||C<0){const _=I?`options.${v}`:"options.highWaterMark";throw new n(_,C)}return e(C)}return s(p.objectMode)}return Na={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:u},Na}var Fa,Oc;function up(){if(Oc)return Fa;Oc=1;const e=St(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=Le(),{Buffer:i}=vt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=ft().codes;function s(u,d,p){let g;if(typeof d=="string"||d instanceof i)return new u({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let v;if(d&&d[r])v=!0,g=d[r]();else if(d&&d[n])v=!1,g=d[n]();else throw new o("iterable",["Iterable"],d);const I=new u({objectMode:!0,highWaterMark:1,...p});let C=!1;I._read=function(){C||(C=!0,w())},I._destroy=function(R,E){t(_(R),()=>e.nextTick(E,R),S=>e.nextTick(E,S||R))};async function _(R){const E=R!=null,S=typeof g.throw=="function";if(E&&S){const{value:Q,done:Y}=await g.throw(R);if(await Q,Y)return}if(typeof g.return=="function"){const{value:Q}=await g.return();await Q}}async function w(){for(;;){try{const{value:R,done:E}=v?await g.next():g.next();if(E)I.push(null);else{const S=R&&typeof R.then=="function"?await R:R;if(S===null)throw C=!1,new a;if(I.push(S))continue;C=!1}}catch(R){I.destroy(R)}break}}return I}return Fa=s,Fa}var Ba,jc;function ra(){if(jc)return Ba;jc=1;const e=St(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:u,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:v}=Le();Ba=H,H.ReadableState=X;const{EventEmitter:I}=or(),{Stream:C,prependListener:_}=Yl(),{Buffer:w}=vt(),{addAbortSignal:R}=ea(),E=vr();let S=mt().debuglog("stream",c=>{S=c});const Q=Kw(),Y=Cn(),{getHighWaterMark:te,getDefaultHighWaterMark:G}=ta(),{aggregateTwoErrors:q,codes:{ERR_INVALID_ARG_TYPE:ce,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:D,ERR_STREAM_PUSH_AFTER_EOF:z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:Z}=ft(),{validateObject:re}=Ji(),ie=v("kPaused"),{StringDecoder:he}=zd(),F=up();s(H.prototype,C.prototype),s(H,C);const oe=()=>{},{errorOrDestroy:b}=Y,T=1,$=2,O=4,ae=8,ue=16,le=32,se=64,k=128,U=256,ne=512,de=1024,V=2048,l=4096,f=8192,A=16384,j=32768,B=65536,K=1<<17,m=1<<18;function L(c){return{enumerable:!1,get(){return(this.state&c)!==0},set(h){h?this.state|=c:this.state&=~c}}}o(X.prototype,{objectMode:L(T),ended:L($),endEmitted:L(O),reading:L(ae),constructed:L(ue),sync:L(le),needReadable:L(se),emittedReadable:L(k),readableListening:L(U),resumeScheduled:L(ne),errorEmitted:L(de),emitClose:L(V),autoDestroy:L(l),destroyed:L(f),closed:L(A),closeEmitted:L(j),multiAwaitDrain:L(B),readingMore:L(K),dataEmitted:L(m)});function X(c,h,W){typeof W!="boolean"&&(W=h instanceof nr()),this.state=V|l|ue|le,c&&c.objectMode&&(this.state|=T),W&&c&&c.readableObjectMode&&(this.state|=T),this.highWaterMark=c?te(this,c,"readableHighWaterMark",W):G(!1),this.buffer=new Q,this.length=0,this.pipes=[],this.flowing=null,this[ie]=null,c&&c.emitClose===!1&&(this.state&=~V),c&&c.autoDestroy===!1&&(this.state&=~l),this.errored=null,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new he(c.encoding),this.encoding=c.encoding)}function H(c){if(!(this instanceof H))return new H(c);const h=this instanceof nr();this._readableState=new X(c,this,h),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!h&&R(c.signal,this)),C.call(this,c),Y.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}H.prototype.destroy=Y.destroy,H.prototype._undestroy=Y.undestroy,H.prototype._destroy=function(c,h){h(c)},H.prototype[I.captureRejectionSymbol]=function(c){this.destroy(c)},H.prototype[p]=function(){let c;return this.destroyed||(c=this.readableEnded?null:new Z,this.destroy(c)),new u((h,W)=>E(this,N=>N&&N!==c?W(N):h(null)))},H.prototype.push=function(c,h){return fe(this,c,h,!1)},H.prototype.unshift=function(c,h){return fe(this,c,h,!0)};function fe(c,h,W,N){S("readableAddChunk",h);const ee=c._readableState;let ge;if((ee.state&T)===0&&(typeof h=="string"?(W=W||ee.defaultEncoding,ee.encoding!==W&&(N&&ee.encoding?h=w.from(h,W).toString(ee.encoding):(h=w.from(h,W),W=""))):h instanceof w?W="":C._isUint8Array(h)?(h=C._uint8ArrayToBuffer(h),W=""):h!=null&&(ge=new ce("chunk",["string","Buffer","Uint8Array"],h))),ge)b(c,ge);else if(h===null)ee.state&=~ae,Ce(c,ee);else if((ee.state&T)!==0||h&&h.length>0)if(N)if((ee.state&O)!==0)b(c,new x);else{if(ee.destroyed||ee.errored)return!1;we(c,ee,h,!0)}else if(ee.ended)b(c,new z);else{if(ee.destroyed||ee.errored)return!1;ee.state&=~ae,ee.decoder&&!W?(h=ee.decoder.write(h),ee.objectMode||h.length!==0?we(c,ee,h,!1):Me(c,ee)):we(c,ee,h,!1)}else N||(ee.state&=~ae,Me(c,ee));return!ee.ended&&(ee.length<ee.highWaterMark||ee.length===0)}function we(c,h,W,N){h.flowing&&h.length===0&&!h.sync&&c.listenerCount("data")>0?((h.state&B)!==0?h.awaitDrainWriters.clear():h.awaitDrainWriters=null,h.dataEmitted=!0,c.emit("data",W)):(h.length+=h.objectMode?1:W.length,N?h.buffer.unshift(W):h.buffer.push(W),(h.state&se)!==0&&De(c)),Me(c,h)}H.prototype.isPaused=function(){const c=this._readableState;return c[ie]===!0||c.flowing===!1},H.prototype.setEncoding=function(c){const h=new he(c);this._readableState.decoder=h,this._readableState.encoding=this._readableState.decoder.encoding;const W=this._readableState.buffer;let N="";for(const ee of W)N+=h.write(ee);return W.clear(),N!==""&&W.push(N),this._readableState.length=N.length,this};const pe=1073741824;function ve(c){if(c>pe)throw new D("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function Ae(c,h){return c<=0||h.length===0&&h.ended?0:(h.state&T)!==0?1:n(c)?h.flowing&&h.length?h.buffer.first().length:h.length:c<=h.length?c:h.ended?h.length:0}H.prototype.read=function(c){S("read",c),c===void 0?c=NaN:r(c)||(c=i(c,10));const h=this._readableState,W=c;if(c>h.highWaterMark&&(h.highWaterMark=ve(c)),c!==0&&(h.state&=~k),c===0&&h.needReadable&&((h.highWaterMark!==0?h.length>=h.highWaterMark:h.length>0)||h.ended))return S("read: emitReadable",h.length,h.ended),h.length===0&&h.ended?Yt(this):De(this),null;if(c=Ae(c,h),c===0&&h.ended)return h.length===0&&Yt(this),null;let N=(h.state&se)!==0;if(S("need readable",N),(h.length===0||h.length-c<h.highWaterMark)&&(N=!0,S("length less than watermark",N)),h.ended||h.reading||h.destroyed||h.errored||!h.constructed)N=!1,S("reading, ended or constructing",N);else if(N){S("do read"),h.state|=ae|le,h.length===0&&(h.state|=se);try{this._read(h.highWaterMark)}catch(ge){b(this,ge)}h.state&=~le,h.reading||(c=Ae(W,h))}let ee;return c>0?ee=Rr(c,h):ee=null,ee===null?(h.needReadable=h.length<=h.highWaterMark,c=0):(h.length-=c,h.multiAwaitDrain?h.awaitDrainWriters.clear():h.awaitDrainWriters=null),h.length===0&&(h.ended||(h.needReadable=!0),W!==c&&h.ended&&Yt(this)),ee!==null&&!h.errorEmitted&&!h.closeEmitted&&(h.dataEmitted=!0,this.emit("data",ee)),ee};function Ce(c,h){if(S("onEofChunk"),!h.ended){if(h.decoder){const W=h.decoder.end();W&&W.length&&(h.buffer.push(W),h.length+=h.objectMode?1:W.length)}h.ended=!0,h.sync?De(c):(h.needReadable=!1,h.emittedReadable=!0,Ft(c))}}function De(c){const h=c._readableState;S("emitReadable",h.needReadable,h.emittedReadable),h.needReadable=!1,h.emittedReadable||(S("emitReadable",h.flowing),h.emittedReadable=!0,e.nextTick(Ft,c))}function Ft(c){const h=c._readableState;S("emitReadable_",h.destroyed,h.length,h.ended),!h.destroyed&&!h.errored&&(h.length||h.ended)&&(c.emit("readable"),h.emittedReadable=!1),h.needReadable=!h.flowing&&!h.ended&&h.length<=h.highWaterMark,Ir(c)}function Me(c,h){!h.readingMore&&h.constructed&&(h.readingMore=!0,e.nextTick(Dn,c,h))}function Dn(c,h){for(;!h.reading&&!h.ended&&(h.length<h.highWaterMark||h.flowing&&h.length===0);){const W=h.length;if(S("maybeReadMore read 0"),c.read(0),W===h.length)break}h.readingMore=!1}H.prototype._read=function(c){throw new M("_read()")},H.prototype.pipe=function(c,h){const W=this,N=this._readableState;N.pipes.length===1&&(N.multiAwaitDrain||(N.multiAwaitDrain=!0,N.awaitDrainWriters=new d(N.awaitDrainWriters?[N.awaitDrainWriters]:[]))),N.pipes.push(c),S("pipe count=%d opts=%j",N.pipes.length,h);const ge=(!h||h.end!==!1)&&c!==e.stdout&&c!==e.stderr?ze:Bt;N.endEmitted?e.nextTick(ge):W.once("end",ge),c.on("unpipe",be);function be(it,He){S("onunpipe"),it===W&&He&&He.hasUnpiped===!1&&(He.hasUnpiped=!0,Nn())}function ze(){S("onend"),c.end()}let Re,zt=!1;function Nn(){S("cleanup"),c.removeListener("close",Mr),c.removeListener("finish",Dr),Re&&c.removeListener("drain",Re),c.removeListener("error",Cr),c.removeListener("unpipe",be),W.removeListener("end",ze),W.removeListener("end",Bt),W.removeListener("data",Bn),zt=!0,Re&&N.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Re()}function Fn(){zt||(N.pipes.length===1&&N.pipes[0]===c?(S("false write response, pause",0),N.awaitDrainWriters=c,N.multiAwaitDrain=!1):N.pipes.length>1&&N.pipes.includes(c)&&(S("false write response, pause",N.awaitDrainWriters.size),N.awaitDrainWriters.add(c)),W.pause()),Re||(Re=Pn(W,c),c.on("drain",Re))}W.on("data",Bn);function Bn(it){S("ondata");const He=c.write(it);S("dest.write",He),He===!1&&Fn()}function Cr(it){if(S("onerror",it),Bt(),c.removeListener("error",Cr),c.listenerCount("error")===0){const He=c._writableState||c._readableState;He&&!He.errorEmitted?b(c,it):c.emit("error",it)}}_(c,"error",Cr);function Mr(){c.removeListener("finish",Dr),Bt()}c.once("close",Mr);function Dr(){S("onfinish"),c.removeListener("close",Mr),Bt()}c.once("finish",Dr);function Bt(){S("unpipe"),W.unpipe(c)}return c.emit("pipe",W),c.writableNeedDrain===!0?Fn():N.flowing||(S("pipe resume"),W.resume()),c};function Pn(c,h){return function(){const N=c._readableState;N.awaitDrainWriters===h?(S("pipeOnDrain",1),N.awaitDrainWriters=null):N.multiAwaitDrain&&(S("pipeOnDrain",N.awaitDrainWriters.size),N.awaitDrainWriters.delete(h)),(!N.awaitDrainWriters||N.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}H.prototype.unpipe=function(c){const h=this._readableState,W={hasUnpiped:!1};if(h.pipes.length===0)return this;if(!c){const ee=h.pipes;h.pipes=[],this.pause();for(let ge=0;ge<ee.length;ge++)ee[ge].emit("unpipe",this,{hasUnpiped:!1});return this}const N=t(h.pipes,c);return N===-1?this:(h.pipes.splice(N,1),h.pipes.length===0&&this.pause(),c.emit("unpipe",this,W),this)},H.prototype.on=function(c,h){const W=C.prototype.on.call(this,c,h),N=this._readableState;return c==="data"?(N.readableListening=this.listenerCount("readable")>0,N.flowing!==!1&&this.resume()):c==="readable"&&!N.endEmitted&&!N.readableListening&&(N.readableListening=N.needReadable=!0,N.flowing=!1,N.emittedReadable=!1,S("on readable",N.length,N.reading),N.length?De(this):N.reading||e.nextTick(Tn,this)),W},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(c,h){const W=C.prototype.removeListener.call(this,c,h);return c==="readable"&&e.nextTick(Er,this),W},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(c){const h=C.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&e.nextTick(Er,this),h};function Er(c){const h=c._readableState;h.readableListening=c.listenerCount("readable")>0,h.resumeScheduled&&h[ie]===!1?h.flowing=!0:c.listenerCount("data")>0?c.resume():h.readableListening||(h.flowing=null)}function Tn(c){S("readable nexttick read 0"),c.read(0)}H.prototype.resume=function(){const c=this._readableState;return c.flowing||(S("resume"),c.flowing=!c.readableListening,xr(this,c)),c[ie]=!1,this};function xr(c,h){h.resumeScheduled||(h.resumeScheduled=!0,e.nextTick(kn,c,h))}function kn(c,h){S("resume",h.reading),h.reading||c.read(0),h.resumeScheduled=!1,c.emit("resume"),Ir(c),h.flowing&&!h.reading&&c.read(0)}H.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ie]=!0,this};function Ir(c){const h=c._readableState;for(S("flow",h.flowing);h.flowing&&c.read()!==null;);}H.prototype.wrap=function(c){let h=!1;c.on("data",N=>{!this.push(N)&&c.pause&&(h=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",N=>{b(this,N)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{h&&c.resume&&(h=!1,c.resume())};const W=a(c);for(let N=1;N<W.length;N++){const ee=W[N];this[ee]===void 0&&typeof c[ee]=="function"&&(this[ee]=c[ee].bind(c))}return this},H.prototype[g]=function(){return lr(this)},H.prototype.iterator=function(c){return c!==void 0&&re(c,"options"),lr(this,c)};function lr(c,h){typeof c.read!="function"&&(c=H.wrap(c,{objectMode:!0}));const W=en(c,h);return W.stream=c,W}async function*en(c,h){let W=oe;function N(be){this===c?(W(),W=oe):W=be}c.on("readable",N);let ee;const ge=E(c,{writable:!1},be=>{ee=be?q(ee,be):null,W(),W=oe});try{for(;;){const be=c.destroyed?null:c.read();if(be!==null)yield be;else{if(ee)throw ee;if(ee===null)return;await new u(N)}}}catch(be){throw ee=q(ee,be),ee}finally{(ee||h?.destroyOnReturn!==!1)&&(ee===void 0||c._readableState.autoDestroy)?Y.destroyer(c,null):(c.off("readable",N),ge())}}o(H.prototype,{readable:{__proto__:null,get(){const c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(X.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ie]!==!1},set(c){this[ie]=!!c}}}),H._fromList=Rr;function Rr(c,h){if(h.length===0)return null;let W;return h.objectMode?W=h.buffer.shift():!c||c>=h.length?(h.decoder?W=h.buffer.join(""):h.buffer.length===1?W=h.buffer.first():W=h.buffer.concat(h.length),h.buffer.clear()):W=h.buffer.consume(c,h.decoder),W}function Yt(c){const h=c._readableState;S("endReadable",h.endEmitted),h.endEmitted||(h.ended=!0,e.nextTick(On,h,c))}function On(c,h){if(S("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,h.emit("end"),h.writable&&h.allowHalfOpen===!1)e.nextTick(jn,h);else if(c.autoDestroy){const W=h._writableState;(!W||W.autoDestroy&&(W.finished||W.writable===!1))&&h.destroy()}}}function jn(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}H.from=function(c,h){return F(H,c,h)};let Xt;function P(){return Xt===void 0&&(Xt={}),Xt}return H.fromWeb=function(c,h){return P().newStreamReadableFromReadableStream(c,h)},H.toWeb=function(c,h){return P().newReadableStreamFromStreamReadable(c,h)},H.wrap=function(c,h){var W,N;return new H({objectMode:(W=(N=c.readableObjectMode)!==null&&N!==void 0?N:c.objectMode)!==null&&W!==void 0?W:!0,...h,destroy(ee,ge){Y.destroyer(c,ee),ge(ee)}}).wrap(c)},Ba}var La,Nc;function Xl(){if(Nc)return La;Nc=1;const e=St(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:u,SymbolHasInstance:d}=Le();La=re,re.WritableState=x;const{EventEmitter:p}=or(),g=Yl().Stream,{Buffer:v}=vt(),I=Cn(),{addAbortSignal:C}=ea(),{getHighWaterMark:_,getDefaultHighWaterMark:w}=ta(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:Q,ERR_STREAM_DESTROYED:Y,ERR_STREAM_ALREADY_FINISHED:te,ERR_STREAM_NULL_VALUES:G,ERR_STREAM_WRITE_AFTER_END:q,ERR_UNKNOWN_ENCODING:ce}=ft().codes,{errorOrDestroy:M}=I;a(re.prototype,g.prototype),a(re,g);function D(){}const z=u("kOnFinished");function x(l,f,A){typeof A!="boolean"&&(A=f instanceof nr()),this.objectMode=!!(l&&l.objectMode),A&&(this.objectMode=this.objectMode||!!(l&&l.writableObjectMode)),this.highWaterMark=l?_(this,l,"writableHighWaterMark",A):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const j=!!(l&&l.decodeStrings===!1);this.decodeStrings=!j,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=b.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Z(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!l||l.emitClose!==!1,this.autoDestroy=!l||l.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[z]=[]}function Z(l){l.buffered=[],l.bufferedIndex=0,l.allBuffers=!0,l.allNoop=!0}x.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(l){const f=this instanceof nr();if(!f&&!n(re,this))return new re(l);this._writableState=new x(l,this,f),l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&C(l.signal,this)),g.call(this,l),I.construct(this,()=>{const A=this._writableState;A.writing||ae(this,A),k(this,A)})}i(re,d,{__proto__:null,value:function(l){return n(this,l)?!0:this!==re?!1:l&&l._writableState instanceof x}}),re.prototype.pipe=function(){M(this,new Q)};function ie(l,f,A,j){const B=l._writableState;if(typeof A=="function")j=A,A=B.defaultEncoding;else{if(!A)A=B.defaultEncoding;else if(A!=="buffer"&&!v.isEncoding(A))throw new ce(A);typeof j!="function"&&(j=D)}if(f===null)throw new G;if(!B.objectMode)if(typeof f=="string")B.decodeStrings!==!1&&(f=v.from(f,A),A="buffer");else if(f instanceof v)A="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),A="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],f);let K;return B.ending?K=new q:B.destroyed&&(K=new Y("write")),K?(e.nextTick(j,K),M(l,K,!0),K):(B.pendingcb++,he(l,B,f,A,j))}re.prototype.write=function(l,f,A){return ie(this,l,f,A)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){const l=this._writableState;l.corked&&(l.corked--,l.writing||ae(this,l))},re.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!v.isEncoding(f))throw new ce(f);return this._writableState.defaultEncoding=f,this};function he(l,f,A,j,B){const K=f.objectMode?1:A.length;f.length+=K;const m=f.length<f.highWaterMark;return m||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:A,encoding:j,callback:B}),f.allBuffers&&j!=="buffer"&&(f.allBuffers=!1),f.allNoop&&B!==D&&(f.allNoop=!1)):(f.writelen=K,f.writecb=B,f.writing=!0,f.sync=!0,l._write(A,j,f.onwrite),f.sync=!1),m&&!f.errored&&!f.destroyed}function F(l,f,A,j,B,K,m){f.writelen=j,f.writecb=m,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new Y("write")):A?l._writev(B,f.onwrite):l._write(B,K,f.onwrite),f.sync=!1}function oe(l,f,A,j){--f.pendingcb,j(A),O(f),M(l,A)}function b(l,f){const A=l._writableState,j=A.sync,B=A.writecb;if(typeof B!="function"){M(l,new S);return}A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0,f?(f.stack,A.errored||(A.errored=f),l._readableState&&!l._readableState.errored&&(l._readableState.errored=f),j?e.nextTick(oe,l,A,f,B):oe(l,A,f,B)):(A.buffered.length>A.bufferedIndex&&ae(l,A),j?A.afterWriteTickInfo!==null&&A.afterWriteTickInfo.cb===B?A.afterWriteTickInfo.count++:(A.afterWriteTickInfo={count:1,cb:B,stream:l,state:A},e.nextTick(T,A.afterWriteTickInfo)):$(l,A,1,B))}function T({stream:l,state:f,count:A,cb:j}){return f.afterWriteTickInfo=null,$(l,f,A,j)}function $(l,f,A,j){for(!f.ending&&!l.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,l.emit("drain"));A-- >0;)f.pendingcb--,j();f.destroyed&&O(f),k(l,f)}function O(l){if(l.writing)return;for(let B=l.bufferedIndex;B<l.buffered.length;++B){var f;const{chunk:K,callback:m}=l.buffered[B],L=l.objectMode?1:K.length;l.length-=L,m((f=l.errored)!==null&&f!==void 0?f:new Y("write"))}const A=l[z].splice(0);for(let B=0;B<A.length;B++){var j;A[B]((j=l.errored)!==null&&j!==void 0?j:new Y("end"))}Z(l)}function ae(l,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:A,bufferedIndex:j,objectMode:B}=f,K=A.length-j;if(!K)return;let m=j;if(f.bufferProcessing=!0,K>1&&l._writev){f.pendingcb-=K-1;const L=f.allNoop?D:H=>{for(let fe=m;fe<A.length;++fe)A[fe].callback(H)},X=f.allNoop&&m===0?A:t(A,m);X.allBuffers=f.allBuffers,F(l,f,!0,f.length,X,"",L),Z(f)}else{do{const{chunk:L,encoding:X,callback:H}=A[m];A[m++]=null;const fe=B?1:L.length;F(l,f,!1,fe,L,X,H)}while(m<A.length&&!f.writing);m===A.length?Z(f):m>256?(A.splice(0,m),f.bufferedIndex=0):f.bufferedIndex=m}f.bufferProcessing=!1}re.prototype._write=function(l,f,A){if(this._writev)this._writev([{chunk:l,encoding:f}],A);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(l,f,A){const j=this._writableState;typeof l=="function"?(A=l,l=null,f=null):typeof f=="function"&&(A=f,f=null);let B;if(l!=null){const K=ie(this,l,f);K instanceof r&&(B=K)}return j.corked&&(j.corked=1,this.uncork()),B||(!j.errored&&!j.ending?(j.ending=!0,k(this,j,!0),j.ended=!0):j.finished?B=new te("end"):j.destroyed&&(B=new Y("end"))),typeof A=="function"&&(B||j.finished?e.nextTick(A,B):j[z].push(A)),this};function ue(l){return l.ending&&!l.destroyed&&l.constructed&&l.length===0&&!l.errored&&l.buffered.length===0&&!l.finished&&!l.writing&&!l.errorEmitted&&!l.closeEmitted}function le(l,f){let A=!1;function j(B){if(A){M(l,B??S());return}if(A=!0,f.pendingcb--,B){const K=f[z].splice(0);for(let m=0;m<K.length;m++)K[m](B);M(l,B,f.sync)}else ue(f)&&(f.prefinished=!0,l.emit("prefinish"),f.pendingcb++,e.nextTick(U,l,f))}f.sync=!0,f.pendingcb++;try{l._final(j)}catch(B){j(B)}f.sync=!1}function se(l,f){!f.prefinished&&!f.finalCalled&&(typeof l._final=="function"&&!f.destroyed?(f.finalCalled=!0,le(l,f)):(f.prefinished=!0,l.emit("prefinish")))}function k(l,f,A){ue(f)&&(se(l,f),f.pendingcb===0&&(A?(f.pendingcb++,e.nextTick((j,B)=>{ue(B)?U(j,B):B.pendingcb--},l,f)):ue(f)&&(f.pendingcb++,U(l,f))))}function U(l,f){f.pendingcb--,f.finished=!0;const A=f[z].splice(0);for(let j=0;j<A.length;j++)A[j]();if(l.emit("finish"),f.autoDestroy){const j=l._readableState;(!j||j.autoDestroy&&(j.endEmitted||j.readable===!1))&&l.destroy()}}o(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(l){this._writableState&&(this._writableState.destroyed=l)}},writable:{__proto__:null,get(){const l=this._writableState;return!!l&&l.writable!==!1&&!l.destroyed&&!l.errored&&!l.ending&&!l.ended},set(l){this._writableState&&(this._writableState.writable=!!l)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const l=this._writableState;return l?!l.destroyed&&!l.ending&&l.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ne=I.destroy;re.prototype.destroy=function(l,f){const A=this._writableState;return!A.destroyed&&(A.bufferedIndex<A.buffered.length||A[z].length)&&e.nextTick(O,A),ne.call(this,l,f),this},re.prototype._undestroy=I.undestroy,re.prototype._destroy=function(l,f){f(l)},re.prototype[p.captureRejectionSymbol]=function(l){this.destroy(l)};let de;function V(){return de===void 0&&(de={}),de}return re.fromWeb=function(l,f){return V().newStreamWritableFromWritableStream(l,f)},re.toWeb=function(l){return V().newWritableStreamFromStreamWritable(l)},La}var Ua,Fc;function zw(){if(Fc)return Ua;Fc=1;const e=St(),t=vt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:p}=ar(),g=vr(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:C}}=ft(),{destroyer:_}=Cn(),w=nr(),R=ra(),E=Xl(),{createDeferredPromise:S}=mt(),Q=up(),Y=globalThis.Blob||t.Blob,te=typeof Y<"u"?function(x){return x instanceof Y}:function(x){return!1},G=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:q}=Le();class ce extends w{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ua=function z(x,Z){if(u(x))return x;if(a(x))return D({readable:x});if(s(x))return D({writable:x});if(o(x))return D({writable:!1,readable:!1});if(d(x))return D({readable:R.fromWeb(x)});if(p(x))return D({writable:E.fromWeb(x)});if(typeof x=="function"){const{value:ie,write:he,final:F,destroy:oe}=M(x);if(i(ie))return Q(ce,ie,{objectMode:!0,write:he,final:F,destroy:oe});const b=ie?.then;if(typeof b=="function"){let T;const $=q(b,ie,O=>{if(O!=null)throw new C("nully","body",O)},O=>{_(T,O)});return T=new ce({objectMode:!0,readable:!1,write:he,final(O){F(async()=>{try{await $,e.nextTick(O,null)}catch(ae){e.nextTick(O,ae)}})},destroy:oe})}throw new C("Iterable, AsyncIterable or AsyncFunction",Z,ie)}if(te(x))return z(x.arrayBuffer());if(i(x))return Q(ce,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&p(x?.writable))return ce.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const ie=x!=null&&x.readable?a(x?.readable)?x?.readable:z(x.readable):void 0,he=x!=null&&x.writable?s(x?.writable)?x?.writable:z(x.writable):void 0;return D({readable:ie,writable:he})}const re=x?.then;if(typeof re=="function"){let ie;return q(re,x,he=>{he!=null&&ie.push(he),ie.push(null)},he=>{_(ie,he)}),ie=new ce({objectMode:!0,writable:!1,read(){}})}throw new I(Z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function M(z){let{promise:x,resolve:Z}=S();const re=new G,ie=re.signal;return{value:z((async function*(){for(;;){const F=x;x=null;const{chunk:oe,done:b,cb:T}=await F;if(e.nextTick(T),b)return;if(ie.aborted)throw new v(void 0,{cause:ie.reason});({promise:x,resolve:Z}=S()),yield oe}})(),{signal:ie}),write(F,oe,b){const T=Z;Z=null,T({chunk:F,done:!1,cb:b})},final(F){const oe=Z;Z=null,oe({done:!0,cb:F})},destroy(F,oe){re.abort(),oe(F)}}}function D(z){const x=z.readable&&typeof z.readable.read!="function"?R.wrap(z.readable):z.readable,Z=z.writable;let re=!!r(x),ie=!!n(Z),he,F,oe,b,T;function $(O){const ae=b;b=null,ae?ae(O):O&&T.destroy(O)}return T=new ce({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!(Z!=null&&Z.writableObjectMode),readable:re,writable:ie}),ie&&(g(Z,O=>{ie=!1,O&&_(x,O),$(O)}),T._write=function(O,ae,ue){Z.write(O,ae)?ue():he=ue},T._final=function(O){Z.end(),F=O},Z.on("drain",function(){if(he){const O=he;he=null,O()}}),Z.on("finish",function(){if(F){const O=F;F=null,O()}})),re&&(g(x,O=>{re=!1,O&&_(x,O),$(O)}),x.on("readable",function(){if(oe){const O=oe;oe=null,O()}}),x.on("end",function(){T.push(null)}),T._read=function(){for(;;){const O=x.read();if(O===null){oe=T._read;return}if(!T.push(O))return}}),T._destroy=function(O,ae){!O&&b!==null&&(O=new v),oe=null,he=null,F=null,b===null?ae(O):(b=ae,_(Z,O),_(x,O))},T}return Ua}var qa,Bc;function nr(){if(Bc)return qa;Bc=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=Le();qa=a;const i=ra(),o=Xl();n(a.prototype,i.prototype),n(a,i);{const p=r(o.prototype);for(let g=0;g<p.length;g++){const v=p[g];a.prototype[v]||(a.prototype[v]=o.prototype[v])}}function a(p){if(!(this instanceof a))return new a(p);i.call(this,p),o.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});let s;function u(){return s===void 0&&(s={}),s}a.fromWeb=function(p,g){return u().newStreamDuplexFromReadableWritablePair(p,g)},a.toWeb=function(p){return u().newReadableWritablePairFromDuplex(p)};let d;return a.from=function(p){return d||(d=zw()),d(p,"body")},qa}var Ka,Lc;function cp(){if(Lc)return Ka;Lc=1;const{ObjectSetPrototypeOf:e,Symbol:t}=Le();Ka=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=ft().codes,n=nr(),{getHighWaterMark:i}=ta();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(d){if(!(this instanceof a))return new a(d);const p=d?i(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),n.call(this,d),this._readableState.sync=!1,this[o]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",u)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,g)=>{if(p){d?d(p):this.destroy(p);return}g!=null&&this.push(g),this.push(null),d&&d()}):(this.push(null),d&&d())}function u(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(d,p,g){throw new r("_transform()")},a.prototype._write=function(d,p,g){const v=this._readableState,I=this._writableState,C=v.length;this._transform(d,p,(_,w)=>{if(_){g(_);return}w!=null&&this.push(w),I.ended||C===v.length||v.length<v.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const d=this[o];this[o]=null,d()}},Ka}var za,Uc;function dp(){if(Uc)return za;Uc=1;const{ObjectSetPrototypeOf:e}=Le();za=r;const t=cp();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},za}var Wa,qc;function Zl(){if(qc)return Wa;qc=1;const e=St(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=Le(),o=vr(),{once:a}=mt(),s=Cn(),u=nr(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:C},AbortError:_}=ft(),{validateFunction:w,validateAbortSignal:R}=Ji(),{isIterable:E,isReadable:S,isReadableNodeStream:Q,isNodeStream:Y,isTransformStream:te,isWebStream:G,isReadableStream:q,isReadableFinished:ce}=ar(),M=globalThis.AbortController||Qt().AbortController;let D,z,x;function Z(O,ae,ue){let le=!1;O.on("close",()=>{le=!0});const se=o(O,{readable:ae,writable:ue},k=>{le=!k});return{destroy:k=>{le||(le=!0,s.destroyer(O,k||new I("pipe")))},cleanup:se}}function re(O){return w(O[O.length-1],"streams[stream.length - 1]"),O.pop()}function ie(O){if(E(O))return O;if(Q(O))return he(O);throw new p("val",["Readable","Iterable","AsyncIterable"],O)}async function*he(O){z||(z=ra()),yield*z.prototype[n].call(O)}async function F(O,ae,ue,{end:le}){let se,k=null;const U=V=>{if(V&&(se=V),k){const l=k;k=null,l()}},ne=()=>new r((V,l)=>{se?l(se):k=()=>{se?l(se):V()}});ae.on("drain",U);const de=o(ae,{readable:!1},U);try{ae.writableNeedDrain&&await ne();for await(const V of O)ae.write(V)||await ne();le&&(ae.end(),await ne()),ue()}catch(V){ue(se!==V?d(se,V):V)}finally{de(),ae.off("drain",U)}}async function oe(O,ae,ue,{end:le}){te(ae)&&(ae=ae.writable);const se=ae.getWriter();try{for await(const k of O)await se.ready,se.write(k).catch(()=>{});await se.ready,le&&await se.close(),ue()}catch(k){try{await se.abort(k),ue(k)}catch(U){ue(U)}}}function b(...O){return T(O,a(re(O)))}function T(O,ae,ue){if(O.length===1&&t(O[0])&&(O=O[0]),O.length<2)throw new v("streams");const le=new M,se=le.signal,k=ue?.signal,U=[];R(k,"options.signal");function ne(){B(new _)}x=x||mt().addAbortListener;let de;k&&(de=x(k,ne));let V,l;const f=[];let A=0;function j(X){B(X,--A===0)}function B(X,H){var fe;if(X&&(!V||V.code==="ERR_STREAM_PREMATURE_CLOSE")&&(V=X),!(!V&&!H)){for(;f.length;)f.shift()(V);(fe=de)===null||fe===void 0||fe[i](),le.abort(),H&&(V||U.forEach(we=>we()),e.nextTick(ae,V,l))}}let K;for(let X=0;X<O.length;X++){const H=O[X],fe=X<O.length-1,we=X>0,pe=fe||ue?.end!==!1,ve=X===O.length-1;if(Y(H)){let Ae=function(Ce){Ce&&Ce.name!=="AbortError"&&Ce.code!=="ERR_STREAM_PREMATURE_CLOSE"&&j(Ce)};if(pe){const{destroy:Ce,cleanup:De}=Z(H,fe,we);f.push(Ce),S(H)&&ve&&U.push(De)}H.on("error",Ae),S(H)&&ve&&U.push(()=>{H.removeListener("error",Ae)})}if(X===0)if(typeof H=="function"){if(K=H({signal:se}),!E(K))throw new g("Iterable, AsyncIterable or Stream","source",K)}else E(H)||Q(H)||te(H)?K=H:K=u.from(H);else if(typeof H=="function"){if(te(K)){var m;K=ie((m=K)===null||m===void 0?void 0:m.readable)}else K=ie(K);if(K=H(K,{signal:se}),fe){if(!E(K,!0))throw new g("AsyncIterable",`transform[${X-1}]`,K)}else{var L;D||(D=dp());const Ae=new D({objectMode:!0}),Ce=(L=K)===null||L===void 0?void 0:L.then;if(typeof Ce=="function")A++,Ce.call(K,Me=>{l=Me,Me!=null&&Ae.write(Me),pe&&Ae.end(),e.nextTick(j)},Me=>{Ae.destroy(Me),e.nextTick(j,Me)});else if(E(K,!0))A++,F(K,Ae,j,{end:pe});else if(q(K)||te(K)){const Me=K.readable||K;A++,F(Me,Ae,j,{end:pe})}else throw new g("AsyncIterable or Promise","destination",K);K=Ae;const{destroy:De,cleanup:Ft}=Z(K,!1,!0);f.push(De),ve&&U.push(Ft)}}else if(Y(H)){if(Q(K)){A+=2;const Ae=$(K,H,j,{end:pe});S(H)&&ve&&U.push(Ae)}else if(te(K)||q(K)){const Ae=K.readable||K;A++,F(Ae,H,j,{end:pe})}else if(E(K))A++,F(K,H,j,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],K);K=H}else if(G(H)){if(Q(K))A++,oe(ie(K),H,j,{end:pe});else if(q(K)||E(K))A++,oe(K,H,j,{end:pe});else if(te(K))A++,oe(K.readable,H,j,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],K);K=H}else K=u.from(H)}return(se!=null&&se.aborted||k!=null&&k.aborted)&&e.nextTick(ne),K}function $(O,ae,ue,{end:le}){let se=!1;if(ae.on("close",()=>{se||ue(new C)}),O.pipe(ae,{end:!1}),le){let k=function(){se=!0,ae.end()};ce(O)?e.nextTick(k):O.once("end",k)}else ue();return o(O,{readable:!0,writable:!1},k=>{const U=O._readableState;k&&k.code==="ERR_STREAM_PREMATURE_CLOSE"&&U&&U.ended&&!U.errored&&!U.errorEmitted?O.once("end",ue).once("error",ue):ue(k)}),o(ae,{readable:!1,writable:!0},ue)}return Wa={pipelineImpl:T,pipeline:b},Wa}var Ha,Kc;function fp(){if(Kc)return Ha;Kc=1;const{pipeline:e}=Zl(),t=nr(),{destroyer:r}=Cn(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:u,isReadableStream:d}=ar(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:v}}=ft(),I=vr();return Ha=function(..._){if(_.length===0)throw new v("streams");if(_.length===1)return t.from(_[0]);const w=[..._];if(typeof _[0]=="function"&&(_[0]=t.from(_[0])),typeof _[_.length-1]=="function"){const D=_.length-1;_[D]=t.from(_[D])}for(let D=0;D<_.length;++D)if(!(!n(_[D])&&!a(_[D]))){if(D<_.length-1&&!(i(_[D])||d(_[D])||s(_[D])))throw new g(`streams[${D}]`,w[D],"must be readable");if(D>0&&!(o(_[D])||u(_[D])||s(_[D])))throw new g(`streams[${D}]`,w[D],"must be writable")}let R,E,S,Q,Y;function te(D){const z=Q;Q=null,z?z(D):D?Y.destroy(D):!M&&!ce&&Y.destroy()}const G=_[0],q=e(_,te),ce=!!(o(G)||u(G)||s(G)),M=!!(i(q)||d(q)||s(q));if(Y=new t({writableObjectMode:!!(G!=null&&G.writableObjectMode),readableObjectMode:!!(q!=null&&q.readableObjectMode),writable:ce,readable:M}),ce){if(n(G))Y._write=function(z,x,Z){G.write(z,x)?Z():R=Z},Y._final=function(z){G.end(),E=z},G.on("drain",function(){if(R){const z=R;R=null,z()}});else if(a(G)){const x=(s(G)?G.writable:G).getWriter();Y._write=async function(Z,re,ie){try{await x.ready,x.write(Z).catch(()=>{}),ie()}catch(he){ie(he)}},Y._final=async function(Z){try{await x.ready,x.close().catch(()=>{}),E=Z}catch(re){Z(re)}}}const D=s(q)?q.readable:q;I(D,()=>{if(E){const z=E;E=null,z()}})}if(M){if(n(q))q.on("readable",function(){if(S){const D=S;S=null,D()}}),q.on("end",function(){Y.push(null)}),Y._read=function(){for(;;){const D=q.read();if(D===null){S=Y._read;return}if(!Y.push(D))return}};else if(a(q)){const z=(s(q)?q.readable:q).getReader();Y._read=async function(){for(;;)try{const{value:x,done:Z}=await z.read();if(!Y.push(x))return;if(Z){Y.push(null);return}}catch{return}}}}return Y._destroy=function(D,z){!D&&Q!==null&&(D=new p),S=null,R=null,E=null,Q===null?z(D):(Q=z,n(q)&&r(q,D))},Y},Ha}var zc;function Ww(){if(zc)return oo;zc=1;const e=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=ft(),{validateAbortSignal:a,validateInteger:s,validateObject:u}=Ji(),d=Le().Symbol("kWeak"),p=Le().Symbol("kResistStopPropagation"),{finished:g}=vr(),v=fp(),{addAbortSignalNoValidate:I}=ea(),{isWritable:C,isNodeStream:_}=ar(),{deprecate:w}=mt(),{ArrayPrototypePush:R,Boolean:E,MathFloor:S,Number:Q,NumberIsNaN:Y,Promise:te,PromiseReject:G,PromiseResolve:q,PromisePrototypeThen:ce,Symbol:M}=Le(),D=M("kEmpty"),z=M("kEof");function x(k,U){if(U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),_(k)&&!C(k))throw new t("stream",k,"must be writable");const ne=v(this,k);return U!=null&&U.signal&&I(U.signal,ne),ne}function Z(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal");let ne=1;U?.concurrency!=null&&(ne=S(U.concurrency));let de=ne-1;return U?.highWaterMark!=null&&(de=S(U.highWaterMark)),s(ne,"options.concurrency",1),s(de,"options.highWaterMark",0),de+=ne,(async function*(){const l=mt().AbortSignalAny([U?.signal].filter(E)),f=this,A=[],j={signal:l};let B,K,m=!1,L=0;function X(){m=!0,H()}function H(){L-=1,fe()}function fe(){K&&!m&&L<ne&&A.length<de&&(K(),K=null)}async function we(){try{for await(let pe of f){if(m)return;if(l.aborted)throw new o;try{if(pe=k(pe,j),pe===D)continue;pe=q(pe)}catch(ve){pe=G(ve)}L+=1,ce(pe,H,X),A.push(pe),B&&(B(),B=null),!m&&(A.length>=de||L>=ne)&&await new te(ve=>{K=ve})}A.push(z)}catch(pe){const ve=G(pe);ce(ve,H,X),A.push(ve)}finally{m=!0,B&&(B(),B=null)}}we();try{for(;;){for(;A.length>0;){const pe=await A[0];if(pe===z)return;if(l.aborted)throw new o;pe!==D&&(yield pe),A.shift(),fe()}await new te(pe=>{B=pe})}}finally{m=!0,K&&(K(),K=null)}}).call(this)}function re(k=void 0){return k!=null&&u(k,"options"),k?.signal!=null&&a(k.signal,"options.signal"),(async function*(){let ne=0;for await(const V of this){var de;if(k!=null&&(de=k.signal)!==null&&de!==void 0&&de.aborted)throw new o({cause:k.signal.reason});yield[ne++,V]}}).call(this)}async function ie(k,U=void 0){for await(const ne of b.call(this,k,U))return!0;return!1}async function he(k,U=void 0){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);return!await ie.call(this,async(...ne)=>!await k(...ne),U)}async function F(k,U){for await(const ne of b.call(this,k,U))return ne}async function oe(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);async function ne(de,V){return await k(de,V),D}for await(const de of Z.call(this,ne,U));}function b(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);async function ne(de,V){return await k(de,V)?de:D}return Z.call(this,ne,U)}class T extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function $(k,U,ne){var de;if(typeof k!="function")throw new r("reducer",["Function","AsyncFunction"],k);ne!=null&&u(ne,"options"),ne?.signal!=null&&a(ne.signal,"options.signal");let V=arguments.length>1;if(ne!=null&&(de=ne.signal)!==null&&de!==void 0&&de.aborted){const B=new o(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(B)),B}const l=new e,f=l.signal;if(ne!=null&&ne.signal){const B={once:!0,[d]:this,[p]:!0};ne.signal.addEventListener("abort",()=>l.abort(),B)}let A=!1;try{for await(const B of this){var j;if(A=!0,ne!=null&&(j=ne.signal)!==null&&j!==void 0&&j.aborted)throw new o;V?U=await k(U,B,{signal:f}):(U=B,V=!0)}if(!A&&!V)throw new T}finally{l.abort()}return U}async function O(k){k!=null&&u(k,"options"),k?.signal!=null&&a(k.signal,"options.signal");const U=[];for await(const de of this){var ne;if(k!=null&&(ne=k.signal)!==null&&ne!==void 0&&ne.aborted)throw new o(void 0,{cause:k.signal.reason});R(U,de)}return U}function ae(k,U){const ne=Z.call(this,k,U);return(async function*(){for await(const V of ne)yield*V}).call(this)}function ue(k){if(k=Q(k),Y(k))return 0;if(k<0)throw new i("number",">= 0",k);return k}function le(k,U=void 0){return U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),k=ue(k),(async function*(){var de;if(U!=null&&(de=U.signal)!==null&&de!==void 0&&de.aborted)throw new o;for await(const l of this){var V;if(U!=null&&(V=U.signal)!==null&&V!==void 0&&V.aborted)throw new o;k--<=0&&(yield l)}}).call(this)}function se(k,U=void 0){return U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),k=ue(k),(async function*(){var de;if(U!=null&&(de=U.signal)!==null&&de!==void 0&&de.aborted)throw new o;for await(const l of this){var V;if(U!=null&&(V=U.signal)!==null&&V!==void 0&&V.aborted)throw new o;if(k-- >0&&(yield l),k<=0)return}}).call(this)}return oo.streamReturningOperators={asIndexedPairs:w(re,"readable.asIndexedPairs will be removed in a future version."),drop:le,filter:b,flatMap:ae,map:Z,take:se,compose:x},oo.promiseReturningOperators={every:he,forEach:oe,reduce:$,toArray:O,some:ie,find:F},oo}var Va,Wc;function hp(){if(Wc)return Va;Wc=1;const{ArrayPrototypePop:e,Promise:t}=Le(),{isIterable:r,isNodeStream:n,isWebStream:i}=ar(),{pipelineImpl:o}=Zl(),{finished:a}=vr();pp();function s(...u){return new t((d,p)=>{let g,v;const I=u[u.length-1];if(I&&typeof I=="object"&&!n(I)&&!r(I)&&!i(I)){const C=e(u);g=C.signal,v=C.end}o(u,(C,_)=>{C?p(C):d(_)},{signal:g,end:v})})}return Va={finished:a,pipeline:s},Va}var Hc;function pp(){if(Hc)return xa.exports;Hc=1;const{Buffer:e}=vt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=Le(),{promisify:{custom:i}}=mt(),{streamReturningOperators:o,promiseReturningOperators:a}=Ww(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ft(),u=fp(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=ta(),{pipeline:g}=Zl(),{destroyer:v}=Cn(),I=vr(),C=hp(),_=ar(),w=xa.exports=Yl().Stream;w.isDestroyed=_.isDestroyed,w.isDisturbed=_.isDisturbed,w.isErrored=_.isErrored,w.isReadable=_.isReadable,w.isWritable=_.isWritable,w.Readable=ra();for(const E of r(o)){let Q=function(...Y){if(new.target)throw s();return w.Readable.from(n(S,this,Y))};const S=o[E];t(Q,"name",{__proto__:null,value:S.name}),t(Q,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:Q,enumerable:!1,configurable:!0,writable:!0})}for(const E of r(a)){let Q=function(...Y){if(new.target)throw s();return n(S,this,Y)};const S=a[E];t(Q,"name",{__proto__:null,value:S.name}),t(Q,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:Q,enumerable:!1,configurable:!0,writable:!0})}w.Writable=Xl(),w.Duplex=nr(),w.Transform=cp(),w.PassThrough=dp(),w.pipeline=g;const{addAbortSignal:R}=ea();return w.addAbortSignal=R,w.finished=I,w.destroy=v,w.compose=u,w.setDefaultHighWaterMark=d,w.getDefaultHighWaterMark=p,t(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return C}}),t(g,i,{__proto__:null,enumerable:!0,get(){return C.pipeline}}),t(I,i,{__proto__:null,enumerable:!0,get(){return C.finished}}),w.Stream=w,w._isUint8Array=function(S){return S instanceof Uint8Array},w._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},xa.exports}var Vc;function Hw(){return Vc||(Vc=1,(function(e){const t=pp(),r=hp(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Ea)),Ea.exports}var Qc;function Vw(){if(Qc)return Jn;Qc=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.ActorQueryResultSerializeStats=void 0;const e=op(),t=jw(),r=_r(),n=sp(),i=Hw();let o=class extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(s){super(s)}async testHandleChecked(s,u){return["bindings","quads"].includes(s.type)?(0,r.passTestVoid)():(0,r.failTest)("This actor can only handle bindings streams or quad streams.")}pushHeader(s){const u=["Result","Delay (ms)","HTTP requests"].join(",");s.push(`${u}
12
+ `)}createStat(s,u){return`${[u,this.delay(s),this.httpObserver.requests].join(",")}
13
+ `}createSpecialLine(s,u){return`${[s,this.delay(u),this.httpObserver.requests].join(",")}
14
+ `}async runHandle(s,u,d){const p=new i.Readable,g=s.type==="bindings"?s.bindingsStream:s.quadStream,v=s.context.getSafe(t.KeysInitQuery.queryTimestampHighResolution);let I=1;function*C(w){yield w()}const _=(0,n.wrap)(g).map(()=>this.createStat(v,I++)).prepend([this.createSpecialLine("PLANNING",v)]).append((0,n.wrap)(C(()=>this.createSpecialLine("TOTAL",v))));return this.pushHeader(p),p.wrap(_),{data:p}}now(){return performance.now()}delay(s){return this.now()-s}};return Jn.ActorQueryResultSerializeStats=o,Jn}var Gc;function Qw(){return Gc||(Gc=1,(function(e){var t=Pr&&Pr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Pr&&Pr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Dw(),e),r(Vw(),e)})(Pr)),Pr}var Gw=Qw(),Fr={},ri={},Jc;function Jw(){if(Jc)return ri;Jc=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.ActionObserverHttp=void 0;const e=_r();let t=class extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}};return ri.ActionObserverHttp=t,ri}var ni={},Qa={exports:{}},Ga={exports:{}},Ja,Yc;function Ue(){if(Yc)return Ja;Yc=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
15
+ `;super(n),this.name="AggregateError",this.errors=r}}return Ja={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},Ja}var Ya={exports:{}},Xa,Xc;function yp(){return Xc||(Xc=1,Xa={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),Xa}var Za,Zc;function ht(){if(Zc)return Za;Zc=1;const{format:e,inspect:t}=yp(),{AggregateError:r}=Ue(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",u={};function d(w,R){if(!w)throw new u.ERR_INTERNAL_ASSERTION(R)}function p(w){let R="",E=w.length;const S=w[0]==="-"?1:0;for(;E>=S+4;E-=3)R=`_${w.slice(E-3,E)}${R}`;return`${w.slice(0,E)}${R}`}function g(w,R,E){if(typeof R=="function")return d(R.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${R.length}).`),R(...E);const S=(R.match(/%[dfijoOs]/g)||[]).length;return d(S===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${S}).`),E.length===0?R:e(R,...E)}function v(w,R,E){E||(E=Error);class S extends E{constructor(...Y){super(g(w,R,Y))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=w,S.prototype[i]=!0,u[w]=S}function I(w){const R=s+w.name;return Object.defineProperty(w,"name",{value:R}),w}function C(w,R){if(w&&R&&w!==R){if(Array.isArray(R.errors))return R.errors.push(w),R;const E=new n([R,w],R.message);return E.code=R.code,E}return w||R}class _ extends Error{constructor(R="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",E);super(R,E),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(w,R,E)=>{d(typeof w=="string","'name' must be a string"),Array.isArray(R)||(R=[R]);let S="The ";w.endsWith(" argument")?S+=`${w} `:S+=`"${w}" ${w.includes(".")?"property":"argument"} `,S+="must be ";const Q=[],Y=[],te=[];for(const q of R)d(typeof q=="string","All expected entries have to be of type string"),o.includes(q)?Q.push(q.toLowerCase()):a.test(q)?Y.push(q):(d(q!=="object",'The value "object" should be written as "Object"'),te.push(q));if(Y.length>0){const q=Q.indexOf("object");q!==-1&&(Q.splice(Q,q,1),Y.push("Object"))}if(Q.length>0){switch(Q.length){case 1:S+=`of type ${Q[0]}`;break;case 2:S+=`one of type ${Q[0]} or ${Q[1]}`;break;default:{const q=Q.pop();S+=`one of type ${Q.join(", ")}, or ${q}`}}(Y.length>0||te.length>0)&&(S+=" or ")}if(Y.length>0){switch(Y.length){case 1:S+=`an instance of ${Y[0]}`;break;case 2:S+=`an instance of ${Y[0]} or ${Y[1]}`;break;default:{const q=Y.pop();S+=`an instance of ${Y.join(", ")}, or ${q}`}}te.length>0&&(S+=" or ")}switch(te.length){case 0:break;case 1:te[0].toLowerCase()!==te[0]&&(S+="an "),S+=`${te[0]}`;break;case 2:S+=`one of ${te[0]} or ${te[1]}`;break;default:{const q=te.pop();S+=`one of ${te.join(", ")}, or ${q}`}}if(E==null)S+=`. Received ${E}`;else if(typeof E=="function"&&E.name)S+=`. Received function ${E.name}`;else if(typeof E=="object"){var G;if((G=E.constructor)!==null&&G!==void 0&&G.name)S+=`. Received an instance of ${E.constructor.name}`;else{const q=t(E,{depth:-1});S+=`. Received ${q}`}}else{let q=t(E,{colors:!1});q.length>25&&(q=`${q.slice(0,25)}...`),S+=`. Received type ${typeof E} (${q})`}return S},TypeError),v("ERR_INVALID_ARG_VALUE",(w,R,E="is invalid")=>{let S=t(R);return S.length>128&&(S=S.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${S}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(w,R,E)=>{var S;const Q=E!=null&&(S=E.constructor)!==null&&S!==void 0&&S.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${R}" function but got ${Q}.`},TypeError),v("ERR_MISSING_ARGS",(...w)=>{d(w.length>0,"At least one arg needs to be specified");let R;const E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(S=>`"${S}"`).join(" or "),E){case 1:R+=`The ${w[0]} argument`;break;case 2:R+=`The ${w[0]} and ${w[1]} arguments`;break;default:{const S=w.pop();R+=`The ${w.join(", ")}, and ${S} arguments`}break}return`${R} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(w,R,E)=>{d(R,'Missing "range" argument');let S;if(Number.isInteger(E)&&Math.abs(E)>2**32)S=p(String(E));else if(typeof E=="bigint"){S=String(E);const Q=BigInt(2)**BigInt(32);(E>Q||E<-Q)&&(S=p(S)),S+="n"}else S=t(E);return`The value of "${w}" is out of range. It must be ${R}. Received ${S}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Za={AbortError:_,aggregateTwoErrors:I(C),hideStackFrames:I,codes:u},Za}var $c;function wt(){return $c||($c=1,(function(e){const t=vt(),{format:r,inspect:n}=yp(),{codes:{ERR_INVALID_ARG_TYPE:i}}=ht(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=Ue(),u=globalThis.AbortSignal||Qt().AbortSignal,d=globalThis.AbortController||Qt().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,v=typeof g<"u"?function(w){return w instanceof g}:function(w){return!1},I=(_,w)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new i(w,"AbortSignal",_)},C=(_,w)=>{if(typeof _!="function")throw new i(w,"Function",_)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(_){let w=!1;return function(...R){w||(w=!0,_.apply(this,R))}},createDeferredPromise:function(){let _,w;return{promise:new Promise((E,S)=>{_=E,w=S}),resolve:_,reject:w}},promisify(_){return new Promise((w,R)=>{_((E,...S)=>E?R(E):w(...S))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(_){return _ instanceof p},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:v,deprecate(_,w){return _},addAbortListener:or().addAbortListener||function(w,R){if(w===void 0)throw new i("signal","AbortSignal",w);I(w,"signal"),C(R,"listener");let E;return w.aborted?queueMicrotask(()=>R()):(w.addEventListener("abort",R,{__proto__:null,once:!0,[o]:!0}),E=()=>{w.removeEventListener("abort",R)}),{__proto__:null,[s](){var S;(S=E)===null||S===void 0||S()}}},AbortSignalAny:u.any||function(w){if(w.length===1)return w[0];const R=new d,E=()=>R.abort();return w.forEach(S=>{I(S,"signals"),S.addEventListener("abort",E,{once:!0})}),R.signal.addEventListener("abort",()=>{w.forEach(S=>S.removeEventListener("abort",E))},{once:!0}),R.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ya)),Ya.exports}var so={},$a,ed;function Yi(){if(ed)return $a;ed=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:v,StringPrototypeTrim:I}=Ue(),{hideStackFrames:C,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:S}}=ht(),{normalizeEncoding:Q}=wt(),{isAsyncFunction:Y,isArrayBufferView:te}=wt().types,G={};function q(m){return m===(m|0)}function ce(m){return m===m>>>0}const M=/^[0-7]+$/,D="must be a 32-bit unsigned integer or an octal string";function z(m,L,X){if(typeof m>"u"&&(m=X),typeof m=="string"){if(p(M,m)===null)throw new R(L,m,D);m=u(m,8)}return re(m,L),m}const x=C((m,L,X=s,H=a)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);if(m<X||m>H)throw new E(L,`>= ${X} && <= ${H}`,m)}),Z=C((m,L,X=-2147483648,H=2147483647)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);if(m<X||m>H)throw new E(L,`>= ${X} && <= ${H}`,m)}),re=C((m,L,X=!1)=>{if(typeof m!="number")throw new w(L,"number",m);if(!i(m))throw new E(L,"an integer",m);const H=X?1:0,fe=4294967295;if(m<H||m>fe)throw new E(L,`>= ${H} && <= ${fe}`,m)});function ie(m,L){if(typeof m!="string")throw new w(L,"string",m)}function he(m,L,X=void 0,H){if(typeof m!="number")throw new w(L,"number",m);if(X!=null&&m<X||H!=null&&m>H||(X!=null||H!=null)&&o(m))throw new E(L,`${X!=null?`>= ${X}`:""}${X!=null&&H!=null?" && ":""}${H!=null?`<= ${H}`:""}`,m)}const F=C((m,L,X)=>{if(!t(X,m)){const fe="must be one of: "+r(n(X,we=>typeof we=="string"?`'${we}'`:g(we)),", ");throw new R(L,m,fe)}});function oe(m,L){if(typeof m!="boolean")throw new w(L,"boolean",m)}function b(m,L,X){return m==null||!d(m,L)?X:m[L]}const T=C((m,L,X=null)=>{const H=b(X,"allowArray",!1),fe=b(X,"allowFunction",!1);if(!b(X,"nullable",!1)&&m===null||!H&&e(m)||typeof m!="object"&&(!fe||typeof m!="function"))throw new w(L,"Object",m)}),$=C((m,L)=>{if(m!=null&&typeof m!="object"&&typeof m!="function")throw new w(L,"a dictionary",m)}),O=C((m,L,X=0)=>{if(!e(m))throw new w(L,"Array",m);if(m.length<X){const H=`must be longer than ${X}`;throw new R(L,m,H)}});function ae(m,L){O(m,L);for(let X=0;X<m.length;X++)ie(m[X],`${L}[${X}]`)}function ue(m,L){O(m,L);for(let X=0;X<m.length;X++)oe(m[X],`${L}[${X}]`)}function le(m,L){O(m,L);for(let X=0;X<m.length;X++){const H=m[X],fe=`${L}[${X}]`;if(H==null)throw new w(fe,"AbortSignal",H);de(H,fe)}}function se(m,L="signal"){if(ie(m,L),G[m]===void 0)throw G[v(m)]!==void 0?new S(m+" (signals must use all capital letters)"):new S(m)}const k=C((m,L="buffer")=>{if(!te(m))throw new w(L,["Buffer","TypedArray","DataView"],m)});function U(m,L){const X=Q(L),H=m.length;if(X==="hex"&&H%2!==0)throw new R("encoding",L,`is invalid for data of length ${H}`)}function ne(m,L="Port",X=!0){if(typeof m!="number"&&typeof m!="string"||typeof m=="string"&&I(m).length===0||+m!==+m>>>0||m>65535||m===0&&!X)throw new _(L,m,X);return m|0}const de=C((m,L)=>{if(m!==void 0&&(m===null||typeof m!="object"||!("aborted"in m)))throw new w(L,"AbortSignal",m)}),V=C((m,L)=>{if(typeof m!="function")throw new w(L,"Function",m)}),l=C((m,L)=>{if(typeof m!="function"||Y(m))throw new w(L,"Function",m)}),f=C((m,L)=>{if(m!==void 0)throw new w(L,"undefined",m)});function A(m,L,X){if(!t(X,m))throw new w(L,`('${r(X,"|")}')`,m)}const j=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function B(m,L){if(typeof m>"u"||!p(j,m))throw new R(L,m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function K(m){if(typeof m=="string")return B(m,"hints"),m;if(e(m)){const L=m.length;let X="";if(L===0)return X;for(let H=0;H<L;H++){const fe=m[H];B(fe,"hints"),X+=fe,H!==L-1&&(X+=", ")}return X}throw new R("hints",m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return $a={isInt32:q,isUint32:ce,parseFileMode:z,validateArray:O,validateStringArray:ae,validateBooleanArray:ue,validateAbortSignalArray:le,validateBoolean:oe,validateBuffer:k,validateDictionary:$,validateEncoding:U,validateFunction:V,validateInt32:Z,validateInteger:x,validateNumber:he,validateObject:T,validateOneOf:F,validatePlainFunction:l,validatePort:ne,validateSignalName:se,validateString:ie,validateUint32:re,validateUndefined:f,validateUnion:A,validateAbortSignal:de,validateLinkHeaderValue:K},$a}var lo={exports:{}},es,td;function sr(){if(td)return es;td=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=Ue(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),u=r("nodejs.webstream.isClosedPromise"),d=r("nodejs.webstream.controllerErrorFunction");function p(b,T=!1){var $;return!!(b&&typeof b.pipe=="function"&&typeof b.on=="function"&&(!T||typeof b.pause=="function"&&typeof b.resume=="function")&&(!b._writableState||(($=b._readableState)===null||$===void 0?void 0:$.readable)!==!1)&&(!b._writableState||b._readableState))}function g(b){var T;return!!(b&&typeof b.write=="function"&&typeof b.on=="function"&&(!b._readableState||((T=b._writableState)===null||T===void 0?void 0:T.writable)!==!1))}function v(b){return!!(b&&typeof b.pipe=="function"&&b._readableState&&typeof b.on=="function"&&typeof b.write=="function")}function I(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function C(b){return!!(b&&!I(b)&&typeof b.pipeThrough=="function"&&typeof b.getReader=="function"&&typeof b.cancel=="function")}function _(b){return!!(b&&!I(b)&&typeof b.getWriter=="function"&&typeof b.abort=="function")}function w(b){return!!(b&&!I(b)&&typeof b.readable=="object"&&typeof b.writable=="object")}function R(b){return C(b)||_(b)||w(b)}function E(b,T){return b==null?!1:T===!0?typeof b[e]=="function":T===!1?typeof b[t]=="function":typeof b[e]=="function"||typeof b[t]=="function"}function S(b){if(!I(b))return null;const T=b._writableState,$=b._readableState,O=T||$;return!!(b.destroyed||b[n]||O!=null&&O.destroyed)}function Q(b){if(!g(b))return null;if(b.writableEnded===!0)return!0;const T=b._writableState;return T!=null&&T.errored?!1:typeof T?.ended!="boolean"?null:T.ended}function Y(b,T){if(!g(b))return null;if(b.writableFinished===!0)return!0;const $=b._writableState;return $!=null&&$.errored?!1:typeof $?.finished!="boolean"?null:!!($.finished||T===!1&&$.ended===!0&&$.length===0)}function te(b){if(!p(b))return null;if(b.readableEnded===!0)return!0;const T=b._readableState;return!T||T.errored?!1:typeof T?.ended!="boolean"?null:T.ended}function G(b,T){if(!p(b))return null;const $=b._readableState;return $!=null&&$.errored?!1:typeof $?.endEmitted!="boolean"?null:!!($.endEmitted||T===!1&&$.ended===!0&&$.length===0)}function q(b){return b&&b[o]!=null?b[o]:typeof b?.readable!="boolean"?null:S(b)?!1:p(b)&&b.readable&&!G(b)}function ce(b){return b&&b[a]!=null?b[a]:typeof b?.writable!="boolean"?null:S(b)?!1:g(b)&&b.writable&&!Q(b)}function M(b,T){return I(b)?S(b)?!0:!(T?.readable!==!1&&q(b)||T?.writable!==!1&&ce(b)):null}function D(b){var T,$;return I(b)?b.writableErrored?b.writableErrored:(T=($=b._writableState)===null||$===void 0?void 0:$.errored)!==null&&T!==void 0?T:null:null}function z(b){var T,$;return I(b)?b.readableErrored?b.readableErrored:(T=($=b._readableState)===null||$===void 0?void 0:$.errored)!==null&&T!==void 0?T:null:null}function x(b){if(!I(b))return null;if(typeof b.closed=="boolean")return b.closed;const T=b._writableState,$=b._readableState;return typeof T?.closed=="boolean"||typeof $?.closed=="boolean"?T?.closed||$?.closed:typeof b._closed=="boolean"&&Z(b)?b._closed:null}function Z(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function re(b){return typeof b._sent100=="boolean"&&Z(b)}function ie(b){var T;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((T=b.req)===null||T===void 0?void 0:T.upgradeOrConnect)===void 0}function he(b){if(!I(b))return null;const T=b._writableState,$=b._readableState,O=T||$;return!O&&re(b)||!!(O&&O.autoDestroy&&O.emitClose&&O.closed===!1)}function F(b){var T;return!!(b&&((T=b[s])!==null&&T!==void 0?T:b.readableDidRead||b.readableAborted))}function oe(b){var T,$,O,ae,ue,le,se,k,U,ne;return!!(b&&((T=($=(O=(ae=(ue=(le=b[i])!==null&&le!==void 0?le:b.readableErrored)!==null&&ue!==void 0?ue:b.writableErrored)!==null&&ae!==void 0?ae:(se=b._readableState)===null||se===void 0?void 0:se.errorEmitted)!==null&&O!==void 0?O:(k=b._writableState)===null||k===void 0?void 0:k.errorEmitted)!==null&&$!==void 0?$:(U=b._readableState)===null||U===void 0?void 0:U.errored)!==null&&T!==void 0?T:!((ne=b._writableState)===null||ne===void 0)&&ne.errored))}return es={isDestroyed:S,kIsDestroyed:n,isDisturbed:F,kIsDisturbed:s,isErrored:oe,kIsErrored:i,isReadable:q,kIsReadable:o,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:a,isClosed:x,isDuplexNodeStream:v,isFinished:M,isIterable:E,isReadableNodeStream:p,isReadableStream:C,isReadableEnded:te,isReadableFinished:G,isReadableErrored:z,isNodeStream:I,isWebStream:R,isWritable:ce,isWritableNodeStream:g,isWritableStream:_,isWritableEnded:Q,isWritableFinished:Y,isWritableErrored:D,isServerRequest:ie,isServerResponse:re,willEmitClose:he,isTransformStream:w},es}var rd;function Sr(){if(rd)return lo.exports;rd=1;const e=St(),{AbortError:t,codes:r}=ht(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=wt(),{validateAbortSignal:s,validateFunction:u,validateObject:d,validateBoolean:p}=Yi(),{Promise:g,PromisePrototypeThen:v,SymbolDispose:I}=Ue(),{isClosed:C,isReadable:_,isReadableNodeStream:w,isReadableStream:R,isReadableFinished:E,isReadableErrored:S,isWritable:Q,isWritableNodeStream:Y,isWritableStream:te,isWritableFinished:G,isWritableErrored:q,isNodeStream:ce,willEmitClose:M,kIsClosedPromise:D}=sr();let z;function x(F){return F.setHeader&&typeof F.abort=="function"}const Z=()=>{};function re(F,oe,b){var T,$;if(arguments.length===2?(b=oe,oe=o):oe==null?oe=o:d(oe,"options"),u(b,"callback"),s(oe.signal,"options.signal"),b=a(b),R(F)||te(F))return ie(F,oe,b);if(!ce(F))throw new n("stream",["ReadableStream","WritableStream","Stream"],F);const O=(T=oe.readable)!==null&&T!==void 0?T:w(F),ae=($=oe.writable)!==null&&$!==void 0?$:Y(F),ue=F._writableState,le=F._readableState,se=()=>{F.writable||ne()};let k=M(F)&&w(F)===O&&Y(F)===ae,U=G(F,!1);const ne=()=>{U=!0,F.destroyed&&(k=!1),!(k&&(!F.readable||O))&&(!O||de)&&b.call(F)};let de=E(F,!1);const V=()=>{de=!0,F.destroyed&&(k=!1),!(k&&(!F.writable||ae))&&(!ae||U)&&b.call(F)},l=m=>{b.call(F,m)};let f=C(F);const A=()=>{f=!0;const m=q(F)||S(F);if(m&&typeof m!="boolean")return b.call(F,m);if(O&&!de&&w(F,!0)&&!E(F,!1))return b.call(F,new i);if(ae&&!U&&!G(F,!1))return b.call(F,new i);b.call(F)},j=()=>{f=!0;const m=q(F)||S(F);if(m&&typeof m!="boolean")return b.call(F,m);b.call(F)},B=()=>{F.req.on("finish",ne)};x(F)?(F.on("complete",ne),k||F.on("abort",A),F.req?B():F.on("request",B)):ae&&!ue&&(F.on("end",se),F.on("close",se)),!k&&typeof F.aborted=="boolean"&&F.on("aborted",A),F.on("end",V),F.on("finish",ne),oe.error!==!1&&F.on("error",l),F.on("close",A),f?e.nextTick(A):ue!=null&&ue.errorEmitted||le!=null&&le.errorEmitted?k||e.nextTick(j):(!O&&(!k||_(F))&&(U||Q(F)===!1)||!ae&&(!k||Q(F))&&(de||_(F)===!1)||le&&F.req&&F.aborted)&&e.nextTick(j);const K=()=>{b=Z,F.removeListener("aborted",A),F.removeListener("complete",ne),F.removeListener("abort",A),F.removeListener("request",B),F.req&&F.req.removeListener("finish",ne),F.removeListener("end",se),F.removeListener("close",se),F.removeListener("finish",ne),F.removeListener("end",V),F.removeListener("error",l),F.removeListener("close",A)};if(oe.signal&&!f){const m=()=>{const L=b;K(),L.call(F,new t(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)e.nextTick(m);else{z=z||wt().addAbortListener;const L=z(oe.signal,m),X=b;b=a((...H)=>{L[I](),X.apply(F,H)})}}return K}function ie(F,oe,b){let T=!1,$=Z;if(oe.signal)if($=()=>{T=!0,b.call(F,new t(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)e.nextTick($);else{z=z||wt().addAbortListener;const ae=z(oe.signal,$),ue=b;b=a((...le)=>{ae[I](),ue.apply(F,le)})}const O=(...ae)=>{T||e.nextTick(()=>b.apply(F,ae))};return v(F[D].promise,O,O),Z}function he(F,oe){var b;let T=!1;return oe===null&&(oe=o),(b=oe)!==null&&b!==void 0&&b.cleanup&&(p(oe.cleanup,"cleanup"),T=oe.cleanup),new g(($,O)=>{const ae=re(F,oe,ue=>{T&&ae(),ue?O(ue):$()})})}return lo.exports=re,lo.exports.finished=he,lo.exports}var ts,nd;function Mn(){if(nd)return ts;nd=1;const e=St(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=ht(),{Symbol:i}=Ue(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:u}=sr(),d=i("kDestroy"),p=i("kConstruct");function g(M,D,z){M&&(M.stack,D&&!D.errored&&(D.errored=M),z&&!z.errored&&(z.errored=M))}function v(M,D){const z=this._readableState,x=this._writableState,Z=x||z;return x!=null&&x.destroyed||z!=null&&z.destroyed?(typeof D=="function"&&D(),this):(g(M,x,z),x&&(x.destroyed=!0),z&&(z.destroyed=!0),Z.constructed?I(this,M,D):this.once(d,function(re){I(this,t(re,M),D)}),this)}function I(M,D,z){let x=!1;function Z(re){if(x)return;x=!0;const ie=M._readableState,he=M._writableState;g(re,he,ie),he&&(he.closed=!0),ie&&(ie.closed=!0),typeof z=="function"&&z(re),re?e.nextTick(C,M,re):e.nextTick(_,M)}try{M._destroy(D||null,Z)}catch(re){Z(re)}}function C(M,D){w(M,D),_(M)}function _(M){const D=M._readableState,z=M._writableState;z&&(z.closeEmitted=!0),D&&(D.closeEmitted=!0),(z!=null&&z.emitClose||D!=null&&D.emitClose)&&M.emit("close")}function w(M,D){const z=M._readableState,x=M._writableState;x!=null&&x.errorEmitted||z!=null&&z.errorEmitted||(x&&(x.errorEmitted=!0),z&&(z.errorEmitted=!0),M.emit("error",D))}function R(){const M=this._readableState,D=this._writableState;M&&(M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1),D&&(D.constructed=!0,D.destroyed=!1,D.closed=!1,D.closeEmitted=!1,D.errored=null,D.errorEmitted=!1,D.finalCalled=!1,D.prefinished=!1,D.ended=D.writable===!1,D.ending=D.writable===!1,D.finished=D.writable===!1)}function E(M,D,z){const x=M._readableState,Z=M._writableState;if(Z!=null&&Z.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||Z!=null&&Z.autoDestroy?M.destroy(D):D&&(D.stack,Z&&!Z.errored&&(Z.errored=D),x&&!x.errored&&(x.errored=D),z?e.nextTick(w,M,D):w(M,D))}function S(M,D){if(typeof M._construct!="function")return;const z=M._readableState,x=M._writableState;z&&(z.constructed=!1),x&&(x.constructed=!1),M.once(p,D),!(M.listenerCount(p)>1)&&e.nextTick(Q,M)}function Q(M){let D=!1;function z(x){if(D){E(M,x??new r);return}D=!0;const Z=M._readableState,re=M._writableState,ie=re||Z;Z&&(Z.constructed=!0),re&&(re.constructed=!0),ie.destroyed?M.emit(d,x):x?E(M,x,!0):e.nextTick(Y,M)}try{M._construct(x=>{e.nextTick(z,x)})}catch(x){e.nextTick(z,x)}}function Y(M){M.emit(p)}function te(M){return M?.setHeader&&typeof M.abort=="function"}function G(M){M.emit("close")}function q(M,D){M.emit("error",D),e.nextTick(G,M)}function ce(M,D){!M||a(M)||(!D&&!s(M)&&(D=new n),u(M)?(M.socket=null,M.destroy(D)):te(M)?M.abort():te(M.req)?M.req.abort():typeof M.destroy=="function"?M.destroy(D):typeof M.close=="function"?M.close():D?e.nextTick(q,M,D):e.nextTick(G,M),M.destroyed||(M[o]=!0))}return ts={construct:S,destroyer:ce,destroy:v,undestroy:R,errorOrDestroy:E},ts}var rs,id;function $l(){if(id)return rs;id=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=Ue(),{EventEmitter:r}=or();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function u(_){o.writable&&o.write(_)===!1&&s.pause&&s.pause()}s.on("data",u);function d(){s.readable&&s.resume&&s.resume()}o.on("drain",d),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",v));let p=!1;function g(){p||(p=!0,o.end())}function v(){p||(p=!0,typeof o.destroy=="function"&&o.destroy())}function I(_){C(),r.listenerCount(this,"error")===0&&this.emit("error",_)}i(s,"error",I),i(o,"error",I);function C(){s.removeListener("data",u),o.removeListener("drain",d),s.removeListener("end",g),s.removeListener("close",v),s.removeListener("error",I),o.removeListener("error",I),s.removeListener("end",C),s.removeListener("close",C),o.removeListener("close",C)}return s.on("end",C),s.on("close",C),o.on("close",C),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return rs={Stream:n,prependListener:i},rs}var ns={exports:{}},od;function na(){return od||(od=1,(function(e){const{SymbolDispose:t}=Ue(),{AbortError:r,codes:n}=ht(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=sr(),s=Sr(),{ERR_INVALID_ARG_TYPE:u}=n;let d;const p=(g,v)=>{if(typeof g!="object"||!("aborted"in g))throw new u(v,"AbortSignal",g)};e.exports.addAbortSignal=function(v,I){if(p(v,"signal"),!i(I)&&!o(I))throw new u("stream",["ReadableStream","WritableStream","Stream"],I);return e.exports.addAbortSignalNoValidate(v,I)},e.exports.addAbortSignalNoValidate=function(g,v){if(typeof g!="object"||!("aborted"in g))return v;const I=i(v)?()=>{v.destroy(new r(void 0,{cause:g.reason}))}:()=>{v[a](new r(void 0,{cause:g.reason}))};if(g.aborted)I();else{d=d||wt().addAbortListener;const C=d(g,I);s(v,C[t])}return v}})(ns)),ns.exports}var is,ad;function Yw(){if(ad)return is;ad=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=Ue(),{Buffer:i}=vt(),{inspect:o}=wt();return is=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const u={data:s,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(s){const u={data:s,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let u=this.head,d=""+u.data;for(;(u=u.next)!==null;)d+=s+u.data;return d}concat(s){if(this.length===0)return i.alloc(0);const u=i.allocUnsafe(s>>>0);let d=this.head,p=0;for(;d;)r(u,d.data,p),p+=d.data.length,d=d.next;return u}consume(s,u){const d=this.head.data;if(s<d.length){const p=d.slice(0,s);return this.head.data=d.slice(s),p}return s===d.length?this.shift():u?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let u="",d=this.head,p=0;do{const g=d.data;if(s>g.length)u+=g,s-=g.length;else{s===g.length?(u+=g,++p,d.next?this.head=d.next:this.head=this.tail=null):(u+=e(g,0,s),this.head=d,d.data=e(g,s));break}++p}while((d=d.next)!==null);return this.length-=p,u}_getBuffer(s){const u=i.allocUnsafe(s),d=s;let p=this.head,g=0;do{const v=p.data;if(s>v.length)r(u,v,d-s),s-=v.length;else{s===v.length?(r(u,v,d-s),++g,p.next?this.head=p.next:this.head=this.tail=null):(r(u,new n(v.buffer,v.byteOffset,s),d-s),this.head=p,p.data=v.slice(s));break}++g}while((p=p.next)!==null);return this.length-=g,u}[Symbol.for("nodejs.util.inspect.custom")](s,u){return o(this,{...u,depth:0,customInspect:!1})}},is}var os,sd;function ia(){if(sd)return os;sd=1;const{MathFloor:e,NumberIsInteger:t}=Ue(),{validateInteger:r}=Yi(),{ERR_INVALID_ARG_VALUE:n}=ht().codes;let i=16*1024,o=16;function a(p,g,v){return p.highWaterMark!=null?p.highWaterMark:g?p[v]:null}function s(p){return p?o:i}function u(p,g){r(g,"value",0),p?o=g:i=g}function d(p,g,v,I){const C=a(g,I,v);if(C!=null){if(!t(C)||C<0){const _=I?`options.${v}`:"options.highWaterMark";throw new n(_,C)}return e(C)}return s(p.objectMode)}return os={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:u},os}var as,ld;function gp(){if(ld)return as;ld=1;const e=St(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=Ue(),{Buffer:i}=vt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=ht().codes;function s(u,d,p){let g;if(typeof d=="string"||d instanceof i)return new u({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let v;if(d&&d[r])v=!0,g=d[r]();else if(d&&d[n])v=!1,g=d[n]();else throw new o("iterable",["Iterable"],d);const I=new u({objectMode:!0,highWaterMark:1,...p});let C=!1;I._read=function(){C||(C=!0,w())},I._destroy=function(R,E){t(_(R),()=>e.nextTick(E,R),S=>e.nextTick(E,S||R))};async function _(R){const E=R!=null,S=typeof g.throw=="function";if(E&&S){const{value:Q,done:Y}=await g.throw(R);if(await Q,Y)return}if(typeof g.return=="function"){const{value:Q}=await g.return();await Q}}async function w(){for(;;){try{const{value:R,done:E}=v?await g.next():g.next();if(E)I.push(null);else{const S=R&&typeof R.then=="function"?await R:R;if(S===null)throw C=!1,new a;if(I.push(S))continue;C=!1}}catch(R){I.destroy(R)}break}}return I}return as=s,as}var ss,ud;function oa(){if(ud)return ss;ud=1;const e=St(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:u,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:v}=Ue();ss=H,H.ReadableState=X;const{EventEmitter:I}=or(),{Stream:C,prependListener:_}=$l(),{Buffer:w}=vt(),{addAbortSignal:R}=na(),E=Sr();let S=wt().debuglog("stream",c=>{S=c});const Q=Yw(),Y=Mn(),{getHighWaterMark:te,getDefaultHighWaterMark:G}=ia(),{aggregateTwoErrors:q,codes:{ERR_INVALID_ARG_TYPE:ce,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:D,ERR_STREAM_PUSH_AFTER_EOF:z,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:Z}=ht(),{validateObject:re}=Yi(),ie=v("kPaused"),{StringDecoder:he}=zd(),F=gp();s(H.prototype,C.prototype),s(H,C);const oe=()=>{},{errorOrDestroy:b}=Y,T=1,$=2,O=4,ae=8,ue=16,le=32,se=64,k=128,U=256,ne=512,de=1024,V=2048,l=4096,f=8192,A=16384,j=32768,B=65536,K=1<<17,m=1<<18;function L(c){return{enumerable:!1,get(){return(this.state&c)!==0},set(h){h?this.state|=c:this.state&=~c}}}o(X.prototype,{objectMode:L(T),ended:L($),endEmitted:L(O),reading:L(ae),constructed:L(ue),sync:L(le),needReadable:L(se),emittedReadable:L(k),readableListening:L(U),resumeScheduled:L(ne),errorEmitted:L(de),emitClose:L(V),autoDestroy:L(l),destroyed:L(f),closed:L(A),closeEmitted:L(j),multiAwaitDrain:L(B),readingMore:L(K),dataEmitted:L(m)});function X(c,h,W){typeof W!="boolean"&&(W=h instanceof ir()),this.state=V|l|ue|le,c&&c.objectMode&&(this.state|=T),W&&c&&c.readableObjectMode&&(this.state|=T),this.highWaterMark=c?te(this,c,"readableHighWaterMark",W):G(!1),this.buffer=new Q,this.length=0,this.pipes=[],this.flowing=null,this[ie]=null,c&&c.emitClose===!1&&(this.state&=~V),c&&c.autoDestroy===!1&&(this.state&=~l),this.errored=null,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new he(c.encoding),this.encoding=c.encoding)}function H(c){if(!(this instanceof H))return new H(c);const h=this instanceof ir();this._readableState=new X(c,this,h),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!h&&R(c.signal,this)),C.call(this,c),Y.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}H.prototype.destroy=Y.destroy,H.prototype._undestroy=Y.undestroy,H.prototype._destroy=function(c,h){h(c)},H.prototype[I.captureRejectionSymbol]=function(c){this.destroy(c)},H.prototype[p]=function(){let c;return this.destroyed||(c=this.readableEnded?null:new Z,this.destroy(c)),new u((h,W)=>E(this,N=>N&&N!==c?W(N):h(null)))},H.prototype.push=function(c,h){return fe(this,c,h,!1)},H.prototype.unshift=function(c,h){return fe(this,c,h,!0)};function fe(c,h,W,N){S("readableAddChunk",h);const ee=c._readableState;let ge;if((ee.state&T)===0&&(typeof h=="string"?(W=W||ee.defaultEncoding,ee.encoding!==W&&(N&&ee.encoding?h=w.from(h,W).toString(ee.encoding):(h=w.from(h,W),W=""))):h instanceof w?W="":C._isUint8Array(h)?(h=C._uint8ArrayToBuffer(h),W=""):h!=null&&(ge=new ce("chunk",["string","Buffer","Uint8Array"],h))),ge)b(c,ge);else if(h===null)ee.state&=~ae,Ce(c,ee);else if((ee.state&T)!==0||h&&h.length>0)if(N)if((ee.state&O)!==0)b(c,new x);else{if(ee.destroyed||ee.errored)return!1;we(c,ee,h,!0)}else if(ee.ended)b(c,new z);else{if(ee.destroyed||ee.errored)return!1;ee.state&=~ae,ee.decoder&&!W?(h=ee.decoder.write(h),ee.objectMode||h.length!==0?we(c,ee,h,!1):Me(c,ee)):we(c,ee,h,!1)}else N||(ee.state&=~ae,Me(c,ee));return!ee.ended&&(ee.length<ee.highWaterMark||ee.length===0)}function we(c,h,W,N){h.flowing&&h.length===0&&!h.sync&&c.listenerCount("data")>0?((h.state&B)!==0?h.awaitDrainWriters.clear():h.awaitDrainWriters=null,h.dataEmitted=!0,c.emit("data",W)):(h.length+=h.objectMode?1:W.length,N?h.buffer.unshift(W):h.buffer.push(W),(h.state&se)!==0&&De(c)),Me(c,h)}H.prototype.isPaused=function(){const c=this._readableState;return c[ie]===!0||c.flowing===!1},H.prototype.setEncoding=function(c){const h=new he(c);this._readableState.decoder=h,this._readableState.encoding=this._readableState.decoder.encoding;const W=this._readableState.buffer;let N="";for(const ee of W)N+=h.write(ee);return W.clear(),N!==""&&W.push(N),this._readableState.length=N.length,this};const pe=1073741824;function ve(c){if(c>pe)throw new D("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function Ae(c,h){return c<=0||h.length===0&&h.ended?0:(h.state&T)!==0?1:n(c)?h.flowing&&h.length?h.buffer.first().length:h.length:c<=h.length?c:h.ended?h.length:0}H.prototype.read=function(c){S("read",c),c===void 0?c=NaN:r(c)||(c=i(c,10));const h=this._readableState,W=c;if(c>h.highWaterMark&&(h.highWaterMark=ve(c)),c!==0&&(h.state&=~k),c===0&&h.needReadable&&((h.highWaterMark!==0?h.length>=h.highWaterMark:h.length>0)||h.ended))return S("read: emitReadable",h.length,h.ended),h.length===0&&h.ended?Yt(this):De(this),null;if(c=Ae(c,h),c===0&&h.ended)return h.length===0&&Yt(this),null;let N=(h.state&se)!==0;if(S("need readable",N),(h.length===0||h.length-c<h.highWaterMark)&&(N=!0,S("length less than watermark",N)),h.ended||h.reading||h.destroyed||h.errored||!h.constructed)N=!1,S("reading, ended or constructing",N);else if(N){S("do read"),h.state|=ae|le,h.length===0&&(h.state|=se);try{this._read(h.highWaterMark)}catch(ge){b(this,ge)}h.state&=~le,h.reading||(c=Ae(W,h))}let ee;return c>0?ee=Rr(c,h):ee=null,ee===null?(h.needReadable=h.length<=h.highWaterMark,c=0):(h.length-=c,h.multiAwaitDrain?h.awaitDrainWriters.clear():h.awaitDrainWriters=null),h.length===0&&(h.ended||(h.needReadable=!0),W!==c&&h.ended&&Yt(this)),ee!==null&&!h.errorEmitted&&!h.closeEmitted&&(h.dataEmitted=!0,this.emit("data",ee)),ee};function Ce(c,h){if(S("onEofChunk"),!h.ended){if(h.decoder){const W=h.decoder.end();W&&W.length&&(h.buffer.push(W),h.length+=h.objectMode?1:W.length)}h.ended=!0,h.sync?De(c):(h.needReadable=!1,h.emittedReadable=!0,Ft(c))}}function De(c){const h=c._readableState;S("emitReadable",h.needReadable,h.emittedReadable),h.needReadable=!1,h.emittedReadable||(S("emitReadable",h.flowing),h.emittedReadable=!0,e.nextTick(Ft,c))}function Ft(c){const h=c._readableState;S("emitReadable_",h.destroyed,h.length,h.ended),!h.destroyed&&!h.errored&&(h.length||h.ended)&&(c.emit("readable"),h.emittedReadable=!1),h.needReadable=!h.flowing&&!h.ended&&h.length<=h.highWaterMark,Ir(c)}function Me(c,h){!h.readingMore&&h.constructed&&(h.readingMore=!0,e.nextTick(Dn,c,h))}function Dn(c,h){for(;!h.reading&&!h.ended&&(h.length<h.highWaterMark||h.flowing&&h.length===0);){const W=h.length;if(S("maybeReadMore read 0"),c.read(0),W===h.length)break}h.readingMore=!1}H.prototype._read=function(c){throw new M("_read()")},H.prototype.pipe=function(c,h){const W=this,N=this._readableState;N.pipes.length===1&&(N.multiAwaitDrain||(N.multiAwaitDrain=!0,N.awaitDrainWriters=new d(N.awaitDrainWriters?[N.awaitDrainWriters]:[]))),N.pipes.push(c),S("pipe count=%d opts=%j",N.pipes.length,h);const ge=(!h||h.end!==!1)&&c!==e.stdout&&c!==e.stderr?ze:Bt;N.endEmitted?e.nextTick(ge):W.once("end",ge),c.on("unpipe",be);function be(it,He){S("onunpipe"),it===W&&He&&He.hasUnpiped===!1&&(He.hasUnpiped=!0,Nn())}function ze(){S("onend"),c.end()}let Re,zt=!1;function Nn(){S("cleanup"),c.removeListener("close",Mr),c.removeListener("finish",Dr),Re&&c.removeListener("drain",Re),c.removeListener("error",Cr),c.removeListener("unpipe",be),W.removeListener("end",ze),W.removeListener("end",Bt),W.removeListener("data",Bn),zt=!0,Re&&N.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Re()}function Fn(){zt||(N.pipes.length===1&&N.pipes[0]===c?(S("false write response, pause",0),N.awaitDrainWriters=c,N.multiAwaitDrain=!1):N.pipes.length>1&&N.pipes.includes(c)&&(S("false write response, pause",N.awaitDrainWriters.size),N.awaitDrainWriters.add(c)),W.pause()),Re||(Re=Pn(W,c),c.on("drain",Re))}W.on("data",Bn);function Bn(it){S("ondata");const He=c.write(it);S("dest.write",He),He===!1&&Fn()}function Cr(it){if(S("onerror",it),Bt(),c.removeListener("error",Cr),c.listenerCount("error")===0){const He=c._writableState||c._readableState;He&&!He.errorEmitted?b(c,it):c.emit("error",it)}}_(c,"error",Cr);function Mr(){c.removeListener("finish",Dr),Bt()}c.once("close",Mr);function Dr(){S("onfinish"),c.removeListener("close",Mr),Bt()}c.once("finish",Dr);function Bt(){S("unpipe"),W.unpipe(c)}return c.emit("pipe",W),c.writableNeedDrain===!0?Fn():N.flowing||(S("pipe resume"),W.resume()),c};function Pn(c,h){return function(){const N=c._readableState;N.awaitDrainWriters===h?(S("pipeOnDrain",1),N.awaitDrainWriters=null):N.multiAwaitDrain&&(S("pipeOnDrain",N.awaitDrainWriters.size),N.awaitDrainWriters.delete(h)),(!N.awaitDrainWriters||N.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}H.prototype.unpipe=function(c){const h=this._readableState,W={hasUnpiped:!1};if(h.pipes.length===0)return this;if(!c){const ee=h.pipes;h.pipes=[],this.pause();for(let ge=0;ge<ee.length;ge++)ee[ge].emit("unpipe",this,{hasUnpiped:!1});return this}const N=t(h.pipes,c);return N===-1?this:(h.pipes.splice(N,1),h.pipes.length===0&&this.pause(),c.emit("unpipe",this,W),this)},H.prototype.on=function(c,h){const W=C.prototype.on.call(this,c,h),N=this._readableState;return c==="data"?(N.readableListening=this.listenerCount("readable")>0,N.flowing!==!1&&this.resume()):c==="readable"&&!N.endEmitted&&!N.readableListening&&(N.readableListening=N.needReadable=!0,N.flowing=!1,N.emittedReadable=!1,S("on readable",N.length,N.reading),N.length?De(this):N.reading||e.nextTick(Tn,this)),W},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(c,h){const W=C.prototype.removeListener.call(this,c,h);return c==="readable"&&e.nextTick(Er,this),W},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(c){const h=C.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&e.nextTick(Er,this),h};function Er(c){const h=c._readableState;h.readableListening=c.listenerCount("readable")>0,h.resumeScheduled&&h[ie]===!1?h.flowing=!0:c.listenerCount("data")>0?c.resume():h.readableListening||(h.flowing=null)}function Tn(c){S("readable nexttick read 0"),c.read(0)}H.prototype.resume=function(){const c=this._readableState;return c.flowing||(S("resume"),c.flowing=!c.readableListening,xr(this,c)),c[ie]=!1,this};function xr(c,h){h.resumeScheduled||(h.resumeScheduled=!0,e.nextTick(kn,c,h))}function kn(c,h){S("resume",h.reading),h.reading||c.read(0),h.resumeScheduled=!1,c.emit("resume"),Ir(c),h.flowing&&!h.reading&&c.read(0)}H.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ie]=!0,this};function Ir(c){const h=c._readableState;for(S("flow",h.flowing);h.flowing&&c.read()!==null;);}H.prototype.wrap=function(c){let h=!1;c.on("data",N=>{!this.push(N)&&c.pause&&(h=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",N=>{b(this,N)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{h&&c.resume&&(h=!1,c.resume())};const W=a(c);for(let N=1;N<W.length;N++){const ee=W[N];this[ee]===void 0&&typeof c[ee]=="function"&&(this[ee]=c[ee].bind(c))}return this},H.prototype[g]=function(){return lr(this)},H.prototype.iterator=function(c){return c!==void 0&&re(c,"options"),lr(this,c)};function lr(c,h){typeof c.read!="function"&&(c=H.wrap(c,{objectMode:!0}));const W=en(c,h);return W.stream=c,W}async function*en(c,h){let W=oe;function N(be){this===c?(W(),W=oe):W=be}c.on("readable",N);let ee;const ge=E(c,{writable:!1},be=>{ee=be?q(ee,be):null,W(),W=oe});try{for(;;){const be=c.destroyed?null:c.read();if(be!==null)yield be;else{if(ee)throw ee;if(ee===null)return;await new u(N)}}}catch(be){throw ee=q(ee,be),ee}finally{(ee||h?.destroyOnReturn!==!1)&&(ee===void 0||c._readableState.autoDestroy)?Y.destroyer(c,null):(c.off("readable",N),ge())}}o(H.prototype,{readable:{__proto__:null,get(){const c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(X.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ie]!==!1},set(c){this[ie]=!!c}}}),H._fromList=Rr;function Rr(c,h){if(h.length===0)return null;let W;return h.objectMode?W=h.buffer.shift():!c||c>=h.length?(h.decoder?W=h.buffer.join(""):h.buffer.length===1?W=h.buffer.first():W=h.buffer.concat(h.length),h.buffer.clear()):W=h.buffer.consume(c,h.decoder),W}function Yt(c){const h=c._readableState;S("endReadable",h.endEmitted),h.endEmitted||(h.ended=!0,e.nextTick(On,h,c))}function On(c,h){if(S("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,h.emit("end"),h.writable&&h.allowHalfOpen===!1)e.nextTick(jn,h);else if(c.autoDestroy){const W=h._writableState;(!W||W.autoDestroy&&(W.finished||W.writable===!1))&&h.destroy()}}}function jn(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}H.from=function(c,h){return F(H,c,h)};let Xt;function P(){return Xt===void 0&&(Xt={}),Xt}return H.fromWeb=function(c,h){return P().newStreamReadableFromReadableStream(c,h)},H.toWeb=function(c,h){return P().newReadableStreamFromStreamReadable(c,h)},H.wrap=function(c,h){var W,N;return new H({objectMode:(W=(N=c.readableObjectMode)!==null&&N!==void 0?N:c.objectMode)!==null&&W!==void 0?W:!0,...h,destroy(ee,ge){Y.destroyer(c,ee),ge(ee)}}).wrap(c)},ss}var ls,cd;function eu(){if(cd)return ls;cd=1;const e=St(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:u,SymbolHasInstance:d}=Ue();ls=re,re.WritableState=x;const{EventEmitter:p}=or(),g=$l().Stream,{Buffer:v}=vt(),I=Mn(),{addAbortSignal:C}=na(),{getHighWaterMark:_,getDefaultHighWaterMark:w}=ia(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:Q,ERR_STREAM_DESTROYED:Y,ERR_STREAM_ALREADY_FINISHED:te,ERR_STREAM_NULL_VALUES:G,ERR_STREAM_WRITE_AFTER_END:q,ERR_UNKNOWN_ENCODING:ce}=ht().codes,{errorOrDestroy:M}=I;a(re.prototype,g.prototype),a(re,g);function D(){}const z=u("kOnFinished");function x(l,f,A){typeof A!="boolean"&&(A=f instanceof ir()),this.objectMode=!!(l&&l.objectMode),A&&(this.objectMode=this.objectMode||!!(l&&l.writableObjectMode)),this.highWaterMark=l?_(this,l,"writableHighWaterMark",A):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const j=!!(l&&l.decodeStrings===!1);this.decodeStrings=!j,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=b.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Z(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!l||l.emitClose!==!1,this.autoDestroy=!l||l.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[z]=[]}function Z(l){l.buffered=[],l.bufferedIndex=0,l.allBuffers=!0,l.allNoop=!0}x.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(l){const f=this instanceof ir();if(!f&&!n(re,this))return new re(l);this._writableState=new x(l,this,f),l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&C(l.signal,this)),g.call(this,l),I.construct(this,()=>{const A=this._writableState;A.writing||ae(this,A),k(this,A)})}i(re,d,{__proto__:null,value:function(l){return n(this,l)?!0:this!==re?!1:l&&l._writableState instanceof x}}),re.prototype.pipe=function(){M(this,new Q)};function ie(l,f,A,j){const B=l._writableState;if(typeof A=="function")j=A,A=B.defaultEncoding;else{if(!A)A=B.defaultEncoding;else if(A!=="buffer"&&!v.isEncoding(A))throw new ce(A);typeof j!="function"&&(j=D)}if(f===null)throw new G;if(!B.objectMode)if(typeof f=="string")B.decodeStrings!==!1&&(f=v.from(f,A),A="buffer");else if(f instanceof v)A="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),A="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],f);let K;return B.ending?K=new q:B.destroyed&&(K=new Y("write")),K?(e.nextTick(j,K),M(l,K,!0),K):(B.pendingcb++,he(l,B,f,A,j))}re.prototype.write=function(l,f,A){return ie(this,l,f,A)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){const l=this._writableState;l.corked&&(l.corked--,l.writing||ae(this,l))},re.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!v.isEncoding(f))throw new ce(f);return this._writableState.defaultEncoding=f,this};function he(l,f,A,j,B){const K=f.objectMode?1:A.length;f.length+=K;const m=f.length<f.highWaterMark;return m||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:A,encoding:j,callback:B}),f.allBuffers&&j!=="buffer"&&(f.allBuffers=!1),f.allNoop&&B!==D&&(f.allNoop=!1)):(f.writelen=K,f.writecb=B,f.writing=!0,f.sync=!0,l._write(A,j,f.onwrite),f.sync=!1),m&&!f.errored&&!f.destroyed}function F(l,f,A,j,B,K,m){f.writelen=j,f.writecb=m,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new Y("write")):A?l._writev(B,f.onwrite):l._write(B,K,f.onwrite),f.sync=!1}function oe(l,f,A,j){--f.pendingcb,j(A),O(f),M(l,A)}function b(l,f){const A=l._writableState,j=A.sync,B=A.writecb;if(typeof B!="function"){M(l,new S);return}A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0,f?(f.stack,A.errored||(A.errored=f),l._readableState&&!l._readableState.errored&&(l._readableState.errored=f),j?e.nextTick(oe,l,A,f,B):oe(l,A,f,B)):(A.buffered.length>A.bufferedIndex&&ae(l,A),j?A.afterWriteTickInfo!==null&&A.afterWriteTickInfo.cb===B?A.afterWriteTickInfo.count++:(A.afterWriteTickInfo={count:1,cb:B,stream:l,state:A},e.nextTick(T,A.afterWriteTickInfo)):$(l,A,1,B))}function T({stream:l,state:f,count:A,cb:j}){return f.afterWriteTickInfo=null,$(l,f,A,j)}function $(l,f,A,j){for(!f.ending&&!l.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,l.emit("drain"));A-- >0;)f.pendingcb--,j();f.destroyed&&O(f),k(l,f)}function O(l){if(l.writing)return;for(let B=l.bufferedIndex;B<l.buffered.length;++B){var f;const{chunk:K,callback:m}=l.buffered[B],L=l.objectMode?1:K.length;l.length-=L,m((f=l.errored)!==null&&f!==void 0?f:new Y("write"))}const A=l[z].splice(0);for(let B=0;B<A.length;B++){var j;A[B]((j=l.errored)!==null&&j!==void 0?j:new Y("end"))}Z(l)}function ae(l,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:A,bufferedIndex:j,objectMode:B}=f,K=A.length-j;if(!K)return;let m=j;if(f.bufferProcessing=!0,K>1&&l._writev){f.pendingcb-=K-1;const L=f.allNoop?D:H=>{for(let fe=m;fe<A.length;++fe)A[fe].callback(H)},X=f.allNoop&&m===0?A:t(A,m);X.allBuffers=f.allBuffers,F(l,f,!0,f.length,X,"",L),Z(f)}else{do{const{chunk:L,encoding:X,callback:H}=A[m];A[m++]=null;const fe=B?1:L.length;F(l,f,!1,fe,L,X,H)}while(m<A.length&&!f.writing);m===A.length?Z(f):m>256?(A.splice(0,m),f.bufferedIndex=0):f.bufferedIndex=m}f.bufferProcessing=!1}re.prototype._write=function(l,f,A){if(this._writev)this._writev([{chunk:l,encoding:f}],A);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(l,f,A){const j=this._writableState;typeof l=="function"?(A=l,l=null,f=null):typeof f=="function"&&(A=f,f=null);let B;if(l!=null){const K=ie(this,l,f);K instanceof r&&(B=K)}return j.corked&&(j.corked=1,this.uncork()),B||(!j.errored&&!j.ending?(j.ending=!0,k(this,j,!0),j.ended=!0):j.finished?B=new te("end"):j.destroyed&&(B=new Y("end"))),typeof A=="function"&&(B||j.finished?e.nextTick(A,B):j[z].push(A)),this};function ue(l){return l.ending&&!l.destroyed&&l.constructed&&l.length===0&&!l.errored&&l.buffered.length===0&&!l.finished&&!l.writing&&!l.errorEmitted&&!l.closeEmitted}function le(l,f){let A=!1;function j(B){if(A){M(l,B??S());return}if(A=!0,f.pendingcb--,B){const K=f[z].splice(0);for(let m=0;m<K.length;m++)K[m](B);M(l,B,f.sync)}else ue(f)&&(f.prefinished=!0,l.emit("prefinish"),f.pendingcb++,e.nextTick(U,l,f))}f.sync=!0,f.pendingcb++;try{l._final(j)}catch(B){j(B)}f.sync=!1}function se(l,f){!f.prefinished&&!f.finalCalled&&(typeof l._final=="function"&&!f.destroyed?(f.finalCalled=!0,le(l,f)):(f.prefinished=!0,l.emit("prefinish")))}function k(l,f,A){ue(f)&&(se(l,f),f.pendingcb===0&&(A?(f.pendingcb++,e.nextTick((j,B)=>{ue(B)?U(j,B):B.pendingcb--},l,f)):ue(f)&&(f.pendingcb++,U(l,f))))}function U(l,f){f.pendingcb--,f.finished=!0;const A=f[z].splice(0);for(let j=0;j<A.length;j++)A[j]();if(l.emit("finish"),f.autoDestroy){const j=l._readableState;(!j||j.autoDestroy&&(j.endEmitted||j.readable===!1))&&l.destroy()}}o(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(l){this._writableState&&(this._writableState.destroyed=l)}},writable:{__proto__:null,get(){const l=this._writableState;return!!l&&l.writable!==!1&&!l.destroyed&&!l.errored&&!l.ending&&!l.ended},set(l){this._writableState&&(this._writableState.writable=!!l)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const l=this._writableState;return l?!l.destroyed&&!l.ending&&l.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ne=I.destroy;re.prototype.destroy=function(l,f){const A=this._writableState;return!A.destroyed&&(A.bufferedIndex<A.buffered.length||A[z].length)&&e.nextTick(O,A),ne.call(this,l,f),this},re.prototype._undestroy=I.undestroy,re.prototype._destroy=function(l,f){f(l)},re.prototype[p.captureRejectionSymbol]=function(l){this.destroy(l)};let de;function V(){return de===void 0&&(de={}),de}return re.fromWeb=function(l,f){return V().newStreamWritableFromWritableStream(l,f)},re.toWeb=function(l){return V().newWritableStreamFromStreamWritable(l)},ls}var us,dd;function Xw(){if(dd)return us;dd=1;const e=St(),t=vt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:p}=sr(),g=Sr(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:C}}=ht(),{destroyer:_}=Mn(),w=ir(),R=oa(),E=eu(),{createDeferredPromise:S}=wt(),Q=gp(),Y=globalThis.Blob||t.Blob,te=typeof Y<"u"?function(x){return x instanceof Y}:function(x){return!1},G=globalThis.AbortController||Qt().AbortController,{FunctionPrototypeCall:q}=Ue();class ce extends w{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}us=function z(x,Z){if(u(x))return x;if(a(x))return D({readable:x});if(s(x))return D({writable:x});if(o(x))return D({writable:!1,readable:!1});if(d(x))return D({readable:R.fromWeb(x)});if(p(x))return D({writable:E.fromWeb(x)});if(typeof x=="function"){const{value:ie,write:he,final:F,destroy:oe}=M(x);if(i(ie))return Q(ce,ie,{objectMode:!0,write:he,final:F,destroy:oe});const b=ie?.then;if(typeof b=="function"){let T;const $=q(b,ie,O=>{if(O!=null)throw new C("nully","body",O)},O=>{_(T,O)});return T=new ce({objectMode:!0,readable:!1,write:he,final(O){F(async()=>{try{await $,e.nextTick(O,null)}catch(ae){e.nextTick(O,ae)}})},destroy:oe})}throw new C("Iterable, AsyncIterable or AsyncFunction",Z,ie)}if(te(x))return z(x.arrayBuffer());if(i(x))return Q(ce,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&p(x?.writable))return ce.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const ie=x!=null&&x.readable?a(x?.readable)?x?.readable:z(x.readable):void 0,he=x!=null&&x.writable?s(x?.writable)?x?.writable:z(x.writable):void 0;return D({readable:ie,writable:he})}const re=x?.then;if(typeof re=="function"){let ie;return q(re,x,he=>{he!=null&&ie.push(he),ie.push(null)},he=>{_(ie,he)}),ie=new ce({objectMode:!0,writable:!1,read(){}})}throw new I(Z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function M(z){let{promise:x,resolve:Z}=S();const re=new G,ie=re.signal;return{value:z((async function*(){for(;;){const F=x;x=null;const{chunk:oe,done:b,cb:T}=await F;if(e.nextTick(T),b)return;if(ie.aborted)throw new v(void 0,{cause:ie.reason});({promise:x,resolve:Z}=S()),yield oe}})(),{signal:ie}),write(F,oe,b){const T=Z;Z=null,T({chunk:F,done:!1,cb:b})},final(F){const oe=Z;Z=null,oe({done:!0,cb:F})},destroy(F,oe){re.abort(),oe(F)}}}function D(z){const x=z.readable&&typeof z.readable.read!="function"?R.wrap(z.readable):z.readable,Z=z.writable;let re=!!r(x),ie=!!n(Z),he,F,oe,b,T;function $(O){const ae=b;b=null,ae?ae(O):O&&T.destroy(O)}return T=new ce({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!(Z!=null&&Z.writableObjectMode),readable:re,writable:ie}),ie&&(g(Z,O=>{ie=!1,O&&_(x,O),$(O)}),T._write=function(O,ae,ue){Z.write(O,ae)?ue():he=ue},T._final=function(O){Z.end(),F=O},Z.on("drain",function(){if(he){const O=he;he=null,O()}}),Z.on("finish",function(){if(F){const O=F;F=null,O()}})),re&&(g(x,O=>{re=!1,O&&_(x,O),$(O)}),x.on("readable",function(){if(oe){const O=oe;oe=null,O()}}),x.on("end",function(){T.push(null)}),T._read=function(){for(;;){const O=x.read();if(O===null){oe=T._read;return}if(!T.push(O))return}}),T._destroy=function(O,ae){!O&&b!==null&&(O=new v),oe=null,he=null,F=null,b===null?ae(O):(b=ae,_(Z,O),_(x,O))},T}return us}var cs,fd;function ir(){if(fd)return cs;fd=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=Ue();cs=a;const i=oa(),o=eu();n(a.prototype,i.prototype),n(a,i);{const p=r(o.prototype);for(let g=0;g<p.length;g++){const v=p[g];a.prototype[v]||(a.prototype[v]=o.prototype[v])}}function a(p){if(!(this instanceof a))return new a(p);i.call(this,p),o.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});let s;function u(){return s===void 0&&(s={}),s}a.fromWeb=function(p,g){return u().newStreamDuplexFromReadableWritablePair(p,g)},a.toWeb=function(p){return u().newReadableWritablePairFromDuplex(p)};let d;return a.from=function(p){return d||(d=Xw()),d(p,"body")},cs}var ds,hd;function bp(){if(hd)return ds;hd=1;const{ObjectSetPrototypeOf:e,Symbol:t}=Ue();ds=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=ht().codes,n=ir(),{getHighWaterMark:i}=ia();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(d){if(!(this instanceof a))return new a(d);const p=d?i(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),n.call(this,d),this._readableState.sync=!1,this[o]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",u)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,g)=>{if(p){d?d(p):this.destroy(p);return}g!=null&&this.push(g),this.push(null),d&&d()}):(this.push(null),d&&d())}function u(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(d,p,g){throw new r("_transform()")},a.prototype._write=function(d,p,g){const v=this._readableState,I=this._writableState,C=v.length;this._transform(d,p,(_,w)=>{if(_){g(_);return}w!=null&&this.push(w),I.ended||C===v.length||v.length<v.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const d=this[o];this[o]=null,d()}},ds}var fs,pd;function mp(){if(pd)return fs;pd=1;const{ObjectSetPrototypeOf:e}=Ue();fs=r;const t=bp();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},fs}var hs,yd;function tu(){if(yd)return hs;yd=1;const e=St(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=Ue(),o=Sr(),{once:a}=wt(),s=Mn(),u=ir(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:C},AbortError:_}=ht(),{validateFunction:w,validateAbortSignal:R}=Yi(),{isIterable:E,isReadable:S,isReadableNodeStream:Q,isNodeStream:Y,isTransformStream:te,isWebStream:G,isReadableStream:q,isReadableFinished:ce}=sr(),M=globalThis.AbortController||Qt().AbortController;let D,z,x;function Z(O,ae,ue){let le=!1;O.on("close",()=>{le=!0});const se=o(O,{readable:ae,writable:ue},k=>{le=!k});return{destroy:k=>{le||(le=!0,s.destroyer(O,k||new I("pipe")))},cleanup:se}}function re(O){return w(O[O.length-1],"streams[stream.length - 1]"),O.pop()}function ie(O){if(E(O))return O;if(Q(O))return he(O);throw new p("val",["Readable","Iterable","AsyncIterable"],O)}async function*he(O){z||(z=oa()),yield*z.prototype[n].call(O)}async function F(O,ae,ue,{end:le}){let se,k=null;const U=V=>{if(V&&(se=V),k){const l=k;k=null,l()}},ne=()=>new r((V,l)=>{se?l(se):k=()=>{se?l(se):V()}});ae.on("drain",U);const de=o(ae,{readable:!1},U);try{ae.writableNeedDrain&&await ne();for await(const V of O)ae.write(V)||await ne();le&&(ae.end(),await ne()),ue()}catch(V){ue(se!==V?d(se,V):V)}finally{de(),ae.off("drain",U)}}async function oe(O,ae,ue,{end:le}){te(ae)&&(ae=ae.writable);const se=ae.getWriter();try{for await(const k of O)await se.ready,se.write(k).catch(()=>{});await se.ready,le&&await se.close(),ue()}catch(k){try{await se.abort(k),ue(k)}catch(U){ue(U)}}}function b(...O){return T(O,a(re(O)))}function T(O,ae,ue){if(O.length===1&&t(O[0])&&(O=O[0]),O.length<2)throw new v("streams");const le=new M,se=le.signal,k=ue?.signal,U=[];R(k,"options.signal");function ne(){B(new _)}x=x||wt().addAbortListener;let de;k&&(de=x(k,ne));let V,l;const f=[];let A=0;function j(X){B(X,--A===0)}function B(X,H){var fe;if(X&&(!V||V.code==="ERR_STREAM_PREMATURE_CLOSE")&&(V=X),!(!V&&!H)){for(;f.length;)f.shift()(V);(fe=de)===null||fe===void 0||fe[i](),le.abort(),H&&(V||U.forEach(we=>we()),e.nextTick(ae,V,l))}}let K;for(let X=0;X<O.length;X++){const H=O[X],fe=X<O.length-1,we=X>0,pe=fe||ue?.end!==!1,ve=X===O.length-1;if(Y(H)){let Ae=function(Ce){Ce&&Ce.name!=="AbortError"&&Ce.code!=="ERR_STREAM_PREMATURE_CLOSE"&&j(Ce)};if(pe){const{destroy:Ce,cleanup:De}=Z(H,fe,we);f.push(Ce),S(H)&&ve&&U.push(De)}H.on("error",Ae),S(H)&&ve&&U.push(()=>{H.removeListener("error",Ae)})}if(X===0)if(typeof H=="function"){if(K=H({signal:se}),!E(K))throw new g("Iterable, AsyncIterable or Stream","source",K)}else E(H)||Q(H)||te(H)?K=H:K=u.from(H);else if(typeof H=="function"){if(te(K)){var m;K=ie((m=K)===null||m===void 0?void 0:m.readable)}else K=ie(K);if(K=H(K,{signal:se}),fe){if(!E(K,!0))throw new g("AsyncIterable",`transform[${X-1}]`,K)}else{var L;D||(D=mp());const Ae=new D({objectMode:!0}),Ce=(L=K)===null||L===void 0?void 0:L.then;if(typeof Ce=="function")A++,Ce.call(K,Me=>{l=Me,Me!=null&&Ae.write(Me),pe&&Ae.end(),e.nextTick(j)},Me=>{Ae.destroy(Me),e.nextTick(j,Me)});else if(E(K,!0))A++,F(K,Ae,j,{end:pe});else if(q(K)||te(K)){const Me=K.readable||K;A++,F(Me,Ae,j,{end:pe})}else throw new g("AsyncIterable or Promise","destination",K);K=Ae;const{destroy:De,cleanup:Ft}=Z(K,!1,!0);f.push(De),ve&&U.push(Ft)}}else if(Y(H)){if(Q(K)){A+=2;const Ae=$(K,H,j,{end:pe});S(H)&&ve&&U.push(Ae)}else if(te(K)||q(K)){const Ae=K.readable||K;A++,F(Ae,H,j,{end:pe})}else if(E(K))A++,F(K,H,j,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],K);K=H}else if(G(H)){if(Q(K))A++,oe(ie(K),H,j,{end:pe});else if(q(K)||E(K))A++,oe(K,H,j,{end:pe});else if(te(K))A++,oe(K.readable,H,j,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],K);K=H}else K=u.from(H)}return(se!=null&&se.aborted||k!=null&&k.aborted)&&e.nextTick(ne),K}function $(O,ae,ue,{end:le}){let se=!1;if(ae.on("close",()=>{se||ue(new C)}),O.pipe(ae,{end:!1}),le){let k=function(){se=!0,ae.end()};ce(O)?e.nextTick(k):O.once("end",k)}else ue();return o(O,{readable:!0,writable:!1},k=>{const U=O._readableState;k&&k.code==="ERR_STREAM_PREMATURE_CLOSE"&&U&&U.ended&&!U.errored&&!U.errorEmitted?O.once("end",ue).once("error",ue):ue(k)}),o(ae,{readable:!1,writable:!0},ue)}return hs={pipelineImpl:T,pipeline:b},hs}var ps,gd;function wp(){if(gd)return ps;gd=1;const{pipeline:e}=tu(),t=ir(),{destroyer:r}=Mn(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:u,isReadableStream:d}=sr(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:v}}=ht(),I=Sr();return ps=function(..._){if(_.length===0)throw new v("streams");if(_.length===1)return t.from(_[0]);const w=[..._];if(typeof _[0]=="function"&&(_[0]=t.from(_[0])),typeof _[_.length-1]=="function"){const D=_.length-1;_[D]=t.from(_[D])}for(let D=0;D<_.length;++D)if(!(!n(_[D])&&!a(_[D]))){if(D<_.length-1&&!(i(_[D])||d(_[D])||s(_[D])))throw new g(`streams[${D}]`,w[D],"must be readable");if(D>0&&!(o(_[D])||u(_[D])||s(_[D])))throw new g(`streams[${D}]`,w[D],"must be writable")}let R,E,S,Q,Y;function te(D){const z=Q;Q=null,z?z(D):D?Y.destroy(D):!M&&!ce&&Y.destroy()}const G=_[0],q=e(_,te),ce=!!(o(G)||u(G)||s(G)),M=!!(i(q)||d(q)||s(q));if(Y=new t({writableObjectMode:!!(G!=null&&G.writableObjectMode),readableObjectMode:!!(q!=null&&q.readableObjectMode),writable:ce,readable:M}),ce){if(n(G))Y._write=function(z,x,Z){G.write(z,x)?Z():R=Z},Y._final=function(z){G.end(),E=z},G.on("drain",function(){if(R){const z=R;R=null,z()}});else if(a(G)){const x=(s(G)?G.writable:G).getWriter();Y._write=async function(Z,re,ie){try{await x.ready,x.write(Z).catch(()=>{}),ie()}catch(he){ie(he)}},Y._final=async function(Z){try{await x.ready,x.close().catch(()=>{}),E=Z}catch(re){Z(re)}}}const D=s(q)?q.readable:q;I(D,()=>{if(E){const z=E;E=null,z()}})}if(M){if(n(q))q.on("readable",function(){if(S){const D=S;S=null,D()}}),q.on("end",function(){Y.push(null)}),Y._read=function(){for(;;){const D=q.read();if(D===null){S=Y._read;return}if(!Y.push(D))return}};else if(a(q)){const z=(s(q)?q.readable:q).getReader();Y._read=async function(){for(;;)try{const{value:x,done:Z}=await z.read();if(!Y.push(x))return;if(Z){Y.push(null);return}}catch{return}}}}return Y._destroy=function(D,z){!D&&Q!==null&&(D=new p),S=null,R=null,E=null,Q===null?z(D):(Q=z,n(q)&&r(q,D))},Y},ps}var bd;function Zw(){if(bd)return so;bd=1;const e=globalThis.AbortController||Qt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=ht(),{validateAbortSignal:a,validateInteger:s,validateObject:u}=Yi(),d=Ue().Symbol("kWeak"),p=Ue().Symbol("kResistStopPropagation"),{finished:g}=Sr(),v=wp(),{addAbortSignalNoValidate:I}=na(),{isWritable:C,isNodeStream:_}=sr(),{deprecate:w}=wt(),{ArrayPrototypePush:R,Boolean:E,MathFloor:S,Number:Q,NumberIsNaN:Y,Promise:te,PromiseReject:G,PromiseResolve:q,PromisePrototypeThen:ce,Symbol:M}=Ue(),D=M("kEmpty"),z=M("kEof");function x(k,U){if(U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),_(k)&&!C(k))throw new t("stream",k,"must be writable");const ne=v(this,k);return U!=null&&U.signal&&I(U.signal,ne),ne}function Z(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal");let ne=1;U?.concurrency!=null&&(ne=S(U.concurrency));let de=ne-1;return U?.highWaterMark!=null&&(de=S(U.highWaterMark)),s(ne,"options.concurrency",1),s(de,"options.highWaterMark",0),de+=ne,(async function*(){const l=wt().AbortSignalAny([U?.signal].filter(E)),f=this,A=[],j={signal:l};let B,K,m=!1,L=0;function X(){m=!0,H()}function H(){L-=1,fe()}function fe(){K&&!m&&L<ne&&A.length<de&&(K(),K=null)}async function we(){try{for await(let pe of f){if(m)return;if(l.aborted)throw new o;try{if(pe=k(pe,j),pe===D)continue;pe=q(pe)}catch(ve){pe=G(ve)}L+=1,ce(pe,H,X),A.push(pe),B&&(B(),B=null),!m&&(A.length>=de||L>=ne)&&await new te(ve=>{K=ve})}A.push(z)}catch(pe){const ve=G(pe);ce(ve,H,X),A.push(ve)}finally{m=!0,B&&(B(),B=null)}}we();try{for(;;){for(;A.length>0;){const pe=await A[0];if(pe===z)return;if(l.aborted)throw new o;pe!==D&&(yield pe),A.shift(),fe()}await new te(pe=>{B=pe})}}finally{m=!0,K&&(K(),K=null)}}).call(this)}function re(k=void 0){return k!=null&&u(k,"options"),k?.signal!=null&&a(k.signal,"options.signal"),(async function*(){let ne=0;for await(const V of this){var de;if(k!=null&&(de=k.signal)!==null&&de!==void 0&&de.aborted)throw new o({cause:k.signal.reason});yield[ne++,V]}}).call(this)}async function ie(k,U=void 0){for await(const ne of b.call(this,k,U))return!0;return!1}async function he(k,U=void 0){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);return!await ie.call(this,async(...ne)=>!await k(...ne),U)}async function F(k,U){for await(const ne of b.call(this,k,U))return ne}async function oe(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);async function ne(de,V){return await k(de,V),D}for await(const de of Z.call(this,ne,U));}function b(k,U){if(typeof k!="function")throw new r("fn",["Function","AsyncFunction"],k);async function ne(de,V){return await k(de,V)?de:D}return Z.call(this,ne,U)}class T extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function $(k,U,ne){var de;if(typeof k!="function")throw new r("reducer",["Function","AsyncFunction"],k);ne!=null&&u(ne,"options"),ne?.signal!=null&&a(ne.signal,"options.signal");let V=arguments.length>1;if(ne!=null&&(de=ne.signal)!==null&&de!==void 0&&de.aborted){const B=new o(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(B)),B}const l=new e,f=l.signal;if(ne!=null&&ne.signal){const B={once:!0,[d]:this,[p]:!0};ne.signal.addEventListener("abort",()=>l.abort(),B)}let A=!1;try{for await(const B of this){var j;if(A=!0,ne!=null&&(j=ne.signal)!==null&&j!==void 0&&j.aborted)throw new o;V?U=await k(U,B,{signal:f}):(U=B,V=!0)}if(!A&&!V)throw new T}finally{l.abort()}return U}async function O(k){k!=null&&u(k,"options"),k?.signal!=null&&a(k.signal,"options.signal");const U=[];for await(const de of this){var ne;if(k!=null&&(ne=k.signal)!==null&&ne!==void 0&&ne.aborted)throw new o(void 0,{cause:k.signal.reason});R(U,de)}return U}function ae(k,U){const ne=Z.call(this,k,U);return(async function*(){for await(const V of ne)yield*V}).call(this)}function ue(k){if(k=Q(k),Y(k))return 0;if(k<0)throw new i("number",">= 0",k);return k}function le(k,U=void 0){return U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),k=ue(k),(async function*(){var de;if(U!=null&&(de=U.signal)!==null&&de!==void 0&&de.aborted)throw new o;for await(const l of this){var V;if(U!=null&&(V=U.signal)!==null&&V!==void 0&&V.aborted)throw new o;k--<=0&&(yield l)}}).call(this)}function se(k,U=void 0){return U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),k=ue(k),(async function*(){var de;if(U!=null&&(de=U.signal)!==null&&de!==void 0&&de.aborted)throw new o;for await(const l of this){var V;if(U!=null&&(V=U.signal)!==null&&V!==void 0&&V.aborted)throw new o;if(k-- >0&&(yield l),k<=0)return}}).call(this)}return so.streamReturningOperators={asIndexedPairs:w(re,"readable.asIndexedPairs will be removed in a future version."),drop:le,filter:b,flatMap:ae,map:Z,take:se,compose:x},so.promiseReturningOperators={every:he,forEach:oe,reduce:$,toArray:O,some:ie,find:F},so}var ys,md;function Ap(){if(md)return ys;md=1;const{ArrayPrototypePop:e,Promise:t}=Ue(),{isIterable:r,isNodeStream:n,isWebStream:i}=sr(),{pipelineImpl:o}=tu(),{finished:a}=Sr();_p();function s(...u){return new t((d,p)=>{let g,v;const I=u[u.length-1];if(I&&typeof I=="object"&&!n(I)&&!r(I)&&!i(I)){const C=e(u);g=C.signal,v=C.end}o(u,(C,_)=>{C?p(C):d(_)},{signal:g,end:v})})}return ys={finished:a,pipeline:s},ys}var wd;function _p(){if(wd)return Ga.exports;wd=1;const{Buffer:e}=vt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=Ue(),{promisify:{custom:i}}=wt(),{streamReturningOperators:o,promiseReturningOperators:a}=Zw(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ht(),u=wp(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=ia(),{pipeline:g}=tu(),{destroyer:v}=Mn(),I=Sr(),C=Ap(),_=sr(),w=Ga.exports=$l().Stream;w.isDestroyed=_.isDestroyed,w.isDisturbed=_.isDisturbed,w.isErrored=_.isErrored,w.isReadable=_.isReadable,w.isWritable=_.isWritable,w.Readable=oa();for(const E of r(o)){let Q=function(...Y){if(new.target)throw s();return w.Readable.from(n(S,this,Y))};const S=o[E];t(Q,"name",{__proto__:null,value:S.name}),t(Q,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:Q,enumerable:!1,configurable:!0,writable:!0})}for(const E of r(a)){let Q=function(...Y){if(new.target)throw s();return n(S,this,Y)};const S=a[E];t(Q,"name",{__proto__:null,value:S.name}),t(Q,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:Q,enumerable:!1,configurable:!0,writable:!0})}w.Writable=eu(),w.Duplex=ir(),w.Transform=bp(),w.PassThrough=mp(),w.pipeline=g;const{addAbortSignal:R}=na();return w.addAbortSignal=R,w.finished=I,w.destroy=v,w.compose=u,w.setDefaultHighWaterMark=d,w.getDefaultHighWaterMark=p,t(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return C}}),t(g,i,{__proto__:null,enumerable:!0,get(){return C.pipeline}}),t(I,i,{__proto__:null,enumerable:!0,get(){return C.finished}}),w.Stream=w,w._isUint8Array=function(S){return S instanceof Uint8Array},w._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},Ga.exports}var Ad;function $w(){return Ad||(Ad=1,(function(e){const t=_p(),r=Ap(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Qa)),Qa.exports}var _d;function eA(){if(_d)return ni;_d=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.ActorQueryResultSerializeSparqlJson=void 0;const e=op(),t=_r(),r=sp(),n=$w();let i=class ui extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(a){super(a)}static bindingToJsonBindings(a){if(a.termType==="Literal"){const s=a,u={value:s.value,type:"literal"},{language:d,datatype:p}=s;return d?u["xml:lang"]=d:p&&p.value!=="http://www.w3.org/2001/XMLSchema#string"&&(u.datatype=p.value),u}return a.termType==="BlankNode"?{value:a.value,type:"bnode"}:a.termType==="Quad"?{value:{subject:ui.bindingToJsonBindings(a.subject),predicate:ui.bindingToJsonBindings(a.predicate),object:ui.bindingToJsonBindings(a.object)},type:"triple"}:{value:a.value,type:"uri"}}async testHandleChecked(a,s){return["bindings","boolean"].includes(a.type)?(0,t.passTestVoid)():(0,t.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(a,s,u){const d=new n.Readable,p={};if(a.type==="bindings"){const g=await a.metadata();g.variables.length>0&&(p.vars=g.variables.map(v=>v.variable.value))}if(d.push(`{"head": ${JSON.stringify(p)},
16
+ `),a.type==="bindings"){const g=a.bindingsStream;d.push(`"results": { "bindings": [
17
+ `);let v=!0;function*I(C){yield C()}d.wrap((0,r.wrap)(g).map(C=>{const _=`${v?"":`,
18
+ `}${JSON.stringify(Object.fromEntries([...C].map(([w,R])=>[w.value,ui.bindingToJsonBindings(R)])))}`;return v=!1,_}).append((0,r.wrap)(I(()=>`
19
+ ]}${this.emitMetadata?`,
20
+ "metadata": { "httpRequests": ${this.httpObserver.requests} }`:""}}
21
+ `))))}else d.wrap((0,r.wrap)(a.execute().then(g=>[`"boolean":${g}
22
+ }
23
+ `])));return{data:d}}};return ni.ActorQueryResultSerializeSparqlJson=i,ni}var vd;function tA(){return vd||(vd=1,(function(e){var t=Fr&&Fr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Fr&&Fr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Jw(),e),r(eA(),e)})(Fr)),Fr}var rA=tA();const nA=[{id:"api-platform",label:"API Platform",kind:"api-platform",lifecycle:"active",authModes:["apiKey"]}],uo=[{id:"openai-compatible",label:"OpenAI Compatible",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],runtimeProviderIds:["custom"],consoleUrl:"https://undefineds.co",subscriptionUrl:"https://undefineds.co",endpoints:[{protocol:"chatCompletions",baseUrl:"https://example.invalid/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"unsupported",url:"https://undefineds.co"}},{id:"anthropic-compatible",label:"Anthropic Compatible",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],runtimeProviderIds:["custom"],consoleUrl:"https://undefineds.co",subscriptionUrl:"https://undefineds.co",endpoints:[{protocol:"anthropic",baseUrl:"https://example.invalid/v1"}],modelDiscovery:{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"unsupported",url:"https://undefineds.co"}}],gs="https://www.kimi.com/code",iA="https://www.kimi.com/user/agreement",oA="https://api.kimi.com/coding/v1",aA="https://api.kimi.com/coding/",sA="https://platform.moonshot.cn/console/api-keys",Sd="https://platform.moonshot.cn/console/account",lA="https://platform.moonshot.cn/docs/intro",uA="https://api.moonshot.ai/v1",co="https://bailian.console.aliyun.com/",fo="https://help.aliyun.com/zh/model-studio/",Ed="https://open.bigmodel.cn/usercenter/apikeys",xd="https://open.bigmodel.cn/",cA="https://open.bigmodel.cn/api/paas/v4",dA="https://open.bigmodel.cn/api/coding/paas/v4",fA={openai:[{id:"official-subscription",label:"OpenAI Subscription",kind:"oauth-subscription",lifecycle:"unavailable",authModes:["oauth","local"],productLabel:"OpenAI",runtimeProviderIds:["openai"],credentialPrefixHints:[],consoleUrl:"https://chatgpt.com/codex",subscriptionUrl:"https://chatgpt.com/codex",endpoints:[{protocol:"responses",baseUrl:"https://chatgpt.com/backend-api/codex"}],modelDiscovery:{strategy:"unsupported",path:"/models",endpointProtocol:"responses"},quota:{strategy:"subscription",url:"https://chatgpt.com/codex"},usagePolicyUrl:"https://openai.com/policies/usage-policies/",region:"global"},{id:"api-platform",label:"API Platform",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"OpenAI",runtimeProviderIds:["openai"],credentialPrefixHints:["sk-"],consoleUrl:"https://platform.openai.com/api-keys",subscriptionUrl:"https://platform.openai.com/settings/organization/billing/overview",endpoints:[{protocol:"responses",baseUrl:"https://api.openai.com/v1"},{protocol:"chatCompletions",baseUrl:"https://api.openai.com/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"responses"},quota:{strategy:"providerApi",url:"https://platform.openai.com/usage"},usagePolicyUrl:"https://openai.com/policies/usage-policies/",region:"global"}],anthropic:[{id:"official-subscription",label:"Claude Code Subscription",kind:"oauth-subscription",lifecycle:"unavailable",authModes:["oauth"],productLabel:"Anthropic",runtimeProviderIds:["anthropic"],credentialPrefixHints:[],consoleUrl:"https://claude.ai/",subscriptionUrl:"https://claude.ai/settings/billing",endpoints:[],modelDiscovery:{strategy:"unsupported",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"subscription",url:"https://claude.ai/settings/usage"},usagePolicyUrl:"https://www.anthropic.com/legal/aup",region:"global"},{id:"api-platform",label:"API Platform",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"Anthropic",runtimeProviderIds:["anthropic"],credentialPrefixHints:["sk-ant-"],consoleUrl:"https://console.anthropic.com/settings/keys",subscriptionUrl:"https://console.anthropic.com/settings/plans",endpoints:[{protocol:"anthropic",baseUrl:"https://api.anthropic.com/v1"}],modelDiscovery:{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"console",url:"https://console.anthropic.com/settings/limits"},usagePolicyUrl:"https://www.anthropic.com/legal/aup",region:"global"}],kimi:[Id({id:"subscription-key",label:"Token Plan",kind:"token-plan",authModes:["apiKey"],productLabel:"Kimi Coding",runtimeProviderIds:["kimi"],credentialPrefixHints:["sk-kimi-"],baseUrl:oA,anthropicBaseUrl:aA,quotaStrategy:"subscription",quotaUrl:gs,consoleUrl:gs,subscriptionUrl:gs,usagePolicyUrl:iA,supportsDeveloperMessages:!1}),Id({id:"api-platform",label:"API Platform",kind:"api-platform",authModes:["apiKey"],productLabel:"Moonshot AI",runtimeProviderIds:["kimi"],credentialPrefixHints:["sk-"],baseUrl:uA,quotaStrategy:"console",quotaUrl:Sd,consoleUrl:sA,subscriptionUrl:Sd,usagePolicyUrl:lA})],bailian:[ho({id:"pay-as-you-go",label:"Pay as You Go",kind:"api-platform",runtimeProviderIds:["bailian"],credentialPrefixHints:["sk-"],region:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://dashscope.aliyuncs.com/apps/anthropic",quotaStrategy:"console",consoleUrl:co,usagePolicyUrl:fo}),ho({id:"token-plan",label:"Token Plan Personal",kind:"token-plan",runtimeProviderIds:["bailian-token-plan"],credentialPrefixHints:["sk-"],region:"cn-beijing",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:co,usagePolicyUrl:fo}),ho({id:"token-plan-team",label:"Token Plan Team",kind:"token-plan",runtimeProviderIds:["bailian-token-plan"],credentialPrefixHints:["sk-"],region:"cn-beijing",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:co,usagePolicyUrl:fo}),ho({id:"coding-plan",label:"Coding Plan Pro",kind:"token-plan",runtimeProviderIds:["bailian-coding-plan"],credentialPrefixHints:["sk-sp-"],region:"cn",baseUrl:"https://coding.dashscope.aliyuncs.com/v1",anthropicBaseUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:co,usagePolicyUrl:fo})],deepseek:[{id:"api-platform",label:"API Platform",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"DeepSeek",runtimeProviderIds:["deepseek"],credentialPrefixHints:["sk-"],consoleUrl:"https://platform.deepseek.com/api_keys",subscriptionUrl:"https://platform.deepseek.com/usage",endpoints:[{protocol:"chatCompletions",baseUrl:"https://api.deepseek.com/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"console",url:"https://platform.deepseek.com/usage"},usagePolicyUrl:"https://cdn.deepseek.com/policies/en-US/deepseek-open-platform-terms-of-use.html",region:"global"}],ollama:[{id:"local",label:"Local Ollama",kind:"local",lifecycle:"active",authModes:["local"],productLabel:"Ollama",runtimeProviderIds:["ollama"],credentialPrefixHints:[],consoleUrl:"https://ollama.com",subscriptionUrl:"https://ollama.com",endpoints:[{protocol:"chatCompletions",baseUrl:"http://localhost:11434/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"unsupported",url:"https://ollama.com"},usagePolicyUrl:"https://ollama.com",region:"local"}],zhipu:[{id:"api-platform",label:"API Platform",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"智谱 AI",runtimeProviderIds:["zhipu"],credentialPrefixHints:["id."],consoleUrl:Ed,subscriptionUrl:"https://open.bigmodel.cn/finance-center/expense-manage",endpoints:[{protocol:"chatCompletions",baseUrl:cA,region:"cn"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"console",url:"https://open.bigmodel.cn/finance-center/expense-manage"},usagePolicyUrl:xd,region:"cn"},{id:"coding-plan",label:"GLM Coding Plan",kind:"token-plan",lifecycle:"active",authModes:["apiKey"],productLabel:"智谱 AI",runtimeProviderIds:["zhipu"],credentialPrefixHints:["id."],consoleUrl:Ed,subscriptionUrl:"https://bigmodel.cn/glm-coding",endpoints:[{protocol:"chatCompletions",baseUrl:dA,region:"cn"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"subscription",url:"https://bigmodel.cn/glm-coding"},usagePolicyUrl:xd,region:"cn"}]};function Id(e){return{id:e.id,label:e.label,kind:e.kind,lifecycle:"active",authModes:e.authModes,productLabel:e.productLabel,runtimeProviderIds:e.runtimeProviderIds,credentialPrefixHints:e.credentialPrefixHints,consoleUrl:e.consoleUrl,subscriptionUrl:e.subscriptionUrl,endpoints:vp(e.baseUrl,e.anthropicBaseUrl,"cn",e.supportsDeveloperMessages),modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:e.quotaStrategy,url:e.quotaUrl},usagePolicyUrl:e.usagePolicyUrl,region:"cn"}}function ho(e){return{id:e.id,label:e.label,lifecycle:"active",productLabel:"Alibaba Bailian",kind:e.kind,authModes:["apiKey"],runtimeProviderIds:e.runtimeProviderIds,credentialPrefixHints:e.credentialPrefixHints,consoleUrl:e.consoleUrl,subscriptionUrl:e.consoleUrl,endpoints:vp(e.baseUrl,e.anthropicBaseUrl,e.region),modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:e.quotaStrategy,url:e.consoleUrl},usagePolicyUrl:e.usagePolicyUrl,region:e.region}}function vp(e,t,r,n){return[{protocol:"chatCompletions",baseUrl:e,region:r,...n===void 0?{}:{supportsDeveloperMessages:n}},...t?[{protocol:"anthropic",baseUrl:t,region:r}]:[]]}function Sp(e,t=!1){return(fA[e]??nA).map(r=>e==="openai"&&r.id==="official-subscription"&&t?{...r,lifecycle:"active",authModes:Array.from(new Set([...r.authModes??[],"local"])),authorizationMethods:[{id:"device-code",authMode:"deviceCode",connectMode:"deviceCodeOAuth",label:"设备码登录",lifecycle:"active"},{id:"local-session-import",authMode:"local",label:"已有登录态",lifecycle:"active"}]}:{...r})}function hA(e,t){return e==="anthropic"||t==="anthropic-compatible"?"anthropic":"openai"}function Mo(e){switch(e){case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"kimi":return"Kimi";case"bailian":return"百炼";case"deepseek":return"DeepSeek";case"zhipu":return"智谱 AI";case"ollama":return"Ollama";case"custom":return"Custom"}}function rn(e,t){return e==="openai"&&(t==="local"||t==="oauth"||t==="deviceCode")?"official-subscription":e==="kimi"&&(t==="oauth"||t==="deviceCode")?"subscription-key":e==="bailian"?"pay-as-you-go":e==="ollama"?"local":e==="custom"?"openai-compatible":"api-platform"}function Rd(e,t){const r=Sp(e).find(i=>i.id===(t??rn(e,"apiKey")));if(!r)return;const n=r.modelDiscovery?.endpointProtocol;return r.endpoints?.find(i=>i.protocol===n)?.baseUrl??r.endpoints?.[0]?.baseUrl}const Si=Array.from(new Set([...Wd,"zhipu","ollama","custom"])),Cd=new WeakMap;function pA(e){bA(),qp({createQueryEngine:async()=>new sy});const t=new URL("settings/-/sparql",e.podUrl).toString();return Ie.setSparqlEndpoint(t),Be.setSparqlEndpoint(t),yt.setSparqlEndpoint(t),{async listModels(){return await e.database.init?.(yt),(await e.database.select().from(yt).execute()).map(SA).filter(ln)},async listProviders(){await e.database.init?.(Ie,Be,yt);const r=await e.database.select().from(Ie).execute(),n=await e.database.select().from(Be).execute(),i=await e.database.select().from(yt).execute();return mA(e,r,n,i)},async createApiKeyCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be);const o=Ie.buildId({id:`${i}-${crypto.randomUUID()}`}),a=1,s=n.offeringId??rn(i,"apiKey"),u=n.baseUrl??Rd(i,s),d=ws(n.proxyUrl),p={id:o,provider:i==="custom"?xA(o):ms(i,s),service:"ai",authMode:"apiKey",status:"active",accountLabel:n.label,label:n.label,baseUrl:u,proxyUrl:d,keyVersion:String(a),reauthRequired:!1,encryptedSecret:po(e,i,o,{type:"apiKey",apiKey:n.apiKey}),encryptionAlgorithm:"PLAINTEXT",metadata:{offeringId:s,priority:n.priority??100,enabled:!0,health:"unknown",baseUrl:u,...n.compatibility?{compatibility:n.compatibility}:{}}};return await e.database.insert(Ie).values(p).execute(),ot(e,i,p)},async createLocalCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be);const o=Ie.buildId({id:`${i}-local-${crypto.randomUUID()}`}),a=n.offeringId??rn(i,"local"),s=n.baseUrl??Rd(i,a),u={id:o,provider:ms(i,a),service:"ai",authMode:"local",status:"active",accountLabel:n.label??"Local",label:n.label??"Local",baseUrl:s,keyVersion:"1",reauthRequired:!1,encryptedSecret:po(e,i,o,{type:"local"}),encryptionAlgorithm:"PLAINTEXT",metadata:{offeringId:a,priority:n.priority??100,enabled:!0,health:"unknown",baseUrl:s}};return await e.database.insert(Ie).values(u).execute(),ot(e,i,u)},async saveOAuthCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");const a=(Cd.get(e.database)??Promise.resolve()).then(async()=>{await e.database.init?.(Ie,Be);const s=Ei(i,n.offeringId??rn(i,"deviceCode"))??rn(i,"deviceCode"),d=(await e.database.select().from(Ie).execute()).find(E=>{const S=ot(e,i,E);if(!S||S.authMode!=="deviceCode"&&S.authMode!=="oauth"||Ei(i,S.offeringId)!==s||E.status!=="active"&&E.status!=="disabled")return!1;const Q=ci(e,i,S.id,E.encryptedSecret);return AA(n,gt(E.metadata),Q)}),p=d&&ot(e,i,d),g=gt(d?.metadata),v=p&&ci(e,i,p.id,d?.encryptedSecret),I=p?.id??Ie.buildId({id:`${i}-oauth-${crypto.randomUUID()}`}),C=n.accountLabel??"OAuth",_=n.accountId??ye(g?.accountId)??ye(v?.accountId),w=n.accountSubject??ye(g?.authoritativeSubject)??ye(v?.accountSubject)??ye(v?.authoritativeSubject),R={...d,id:I,provider:ms(i,s),service:"ai",authMode:"deviceCodeOAuth",status:p?.enabled===!1?"disabled":"active",accountLabel:d?.accountLabel??C,label:d?.label??C,expiresAt:n.expiresAt,scopes:n.scope?n.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String((p?.version??0)+1),reauthRequired:!1,encryptedSecret:po(e,i,I,{type:"deviceCodeOAuth",accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt,scope:n.scope,idToken:n.idToken,accountId:_,accountSubject:w,accountLabel:n.accountLabel,offeringId:s,authorizationMethodId:n.authorizationMethodId}),encryptionAlgorithm:"PLAINTEXT",metadata:{...g,offeringId:s,priority:p?.priority??100,enabled:p?.enabled??!0,health:"healthy",authoritativeSubject:w,accountId:_,authorizationMethodId:n.authorizationMethodId}};if(d){const E={...R};if(delete E.id,!await e.database.updateById(Ie,I,E))throw new Error("credential_version_conflict")}else await e.database.insert(Ie).values(R).execute();return ot(e,i,R)});return Cd.set(e.database,a.then(()=>{},()=>{})),a},async updateOAuthCredential(r,n,i,o){const a=Pt(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be);const s=await e.database.findById(Ie,n),u=s&&ot(e,a,s);if(!s||!u||u.authMode!=="deviceCode")throw new Error("oauth_credential_not_found");if(u.version!==i)throw new Error("credential_version_conflict");const d=ci(e,a,n,s.encryptedSecret),p=o.accountId??ye(gt(s.metadata)?.accountId)??ye(d?.accountId),g=o.accountSubject??ye(gt(s.metadata)?.authoritativeSubject)??ye(d?.accountSubject)??ye(d?.authoritativeSubject),v={expiresAt:o.expiresAt,scopes:o.scope?o.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String(i+1),reauthRequired:!1,status:"active",encryptedSecret:po(e,a,n,{type:"deviceCodeOAuth",accessToken:o.accessToken,refreshToken:o.refreshToken,expiresAt:o.expiresAt,scope:o.scope,idToken:o.idToken,accountId:p,accountSubject:g,accountLabel:o.accountLabel??ye(s.accountLabel),offeringId:o.offeringId??u.offeringId,authorizationMethodId:o.authorizationMethodId??ye(gt(s.metadata)?.authorizationMethodId)}),accountLabel:o.accountLabel??ye(s.accountLabel),label:o.accountLabel??ye(s.label),metadata:{...gt(s.metadata),offeringId:o.offeringId??u.offeringId,enabled:!0,health:"healthy",authoritativeSubject:g,accountId:p,authorizationMethodId:o.authorizationMethodId??ye(gt(s.metadata)?.authorizationMethodId)}},I=await e.database.updateById(Ie,n,v);if(!I)throw new Error("credential_version_conflict");return ot(e,a,I)},async updateProviderCredential(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be);const a=await e.database.findById(Ie,n),s=a&&ot(e,o,a);if(!a||!s)throw new Error("credential_not_found");if(s.version!==i.expectedVersion)throw new Error("credential_version_conflict");const u={...gt(a.metadata),...i.priority===void 0?{}:{priority:i.priority},...i.enabled===void 0?{}:{enabled:i.enabled},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:ws(i.proxyUrl)}},d={...i.label===void 0?{}:{accountLabel:i.label,label:i.label},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:ws(i.proxyUrl)},...i.enabled===void 0?{}:{status:i.enabled?"active":"disabled"},keyVersion:String(s.version+1),metadata:u},p=await e.database.updateById(Ie,n,d);if(!p)throw new Error("credential_update_failed");const g=ot(e,o,p);if(!g)throw new Error("credential_update_failed");return g},async markCredentialHealth(r,n,i,o){const a=Pt(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(Ie);const s=await e.database.findById(Ie,n),u=s&&ot(e,a,s);if(!s||!u)throw new Error("credential_not_found");if(u.version!==o)throw new Error("credential_version_conflict");const d=await e.database.updateById(Ie,n,{keyVersion:String(u.version+1),metadata:{...gt(s.metadata),health:i}});if(!d)throw new Error("credential_update_failed");const p=ot(e,a,d);if(!p)throw new Error("credential_update_failed");return p},async deleteProviderCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be);const o=await e.database.findById(Ie,n),a=o&&ot(e,i,o);if(a)return await e.database.deleteById(Ie,n),a},async readCredentialSecret(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");const o=await e.database.findById(Ie,n);if(!o||!ot(e,i,o))throw new Error("credential_not_found");const a=ci(e,i,n,o.encryptedSecret);if(!a)throw new Error("credential_secret_unavailable");return a},async saveDiscoveredModels(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(Ie,Be,yt);const a=await Md(e,n),s=Pd(o,a);await Td(e.database,s,Mo(o));const u=await e.database.select().from(yt).execute(),d=new Set(u.map(v=>ye(v.id)).filter(ln)),p=i.map(EA).filter(ln),g=new Set(p.map(v=>v.id));for(const v of u.filter(I=>Wr(ye(I.isProvidedBy),s))){const I=Hr(ye(v.id),s);I&&!g.has(I)&&ye(v.status)!=="unavailable"&&await e.database.updateById(yt,String(v.id),{status:"unavailable"})}for(const v of p)await RA(e.database,s,v,d)},async saveModelSelection(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(Be,yt);const a=o==="custom"&&i?await Md(e,i):null;if(o==="custom"&&i&&!a)throw new Error("credential_not_found");const s=a?Pd(o,a):Be.buildId({id:o});await Td(e.database,s,Mo(o));const d=(await e.database.select().from(Be).execute()).find(_=>Wr(ye(_.id),s)),p=ye(d?.id)??s,g=Ip(d?.hasModel),v=await e.database.select().from(yt).execute(),I=[...new Set(n.map(_=>CA(o,_,v,a?s:void 0)))];if(!await e.database.updateById(Be,p,{hasModel:I}))throw new Error("provider_model_selection_update_failed");e.authenticatedFetch&&await gA(e,p,g,I)}}}const yA="https://undefineds.co/ns#hasModel";async function gA(e,t,r,n){const i=bs(Be,e.podUrl,t),o=r.map(p=>bs(yt,e.podUrl,p)),a=n.map(p=>bs(yt,e.podUrl,p)),s=p=>p.map(g=>`<${i}> <${yA}> <${g}> .`).join(`
24
+ `),u=[o.length>0?`DELETE DATA { ${s(o)} }`:void 0,a.length>0?`INSERT DATA { ${s(a)} }`:void 0].filter(p=>!!p);if(u.length===0)return;const d=await e.authenticatedFetch(i.split("#",1)[0],{method:"PATCH",headers:{"content-type":"application/sparql-update"},body:u.join(`;
25
+ `)});if(!d.ok)throw new Error(`provider_model_selection_persist_failed:${d.status}`)}function bs(e,t,r){return/^https?:\/\//u.test(r)?r:e.buildIri(t,{id:r})}async function Md(e,t){const r=await e.database.findById(Ie,t);return r||((await e.database.select().from(Ie).execute()).find(i=>{const o=ye(i.id);return o===t||(o?Ie.buildIri(e.podUrl,{id:o})===t:!1)})??null)}function bA(){Dd(Gw.ActionObserverHttp.prototype),Dd(rA.ActionObserverHttp.prototype)}function Dd(e){const t=e;if(t.__xpodObservedActorsPatch)return;const r=t.onRun;t.onRun=function(n,i,o){return Array.isArray(this.observedActors)||(this.observedActors=[]),r.call(this,n,i,o)},t.__xpodObservedActorsPatch=!0}function mA(e,t,r,n){const i=t.filter(o=>ye(o.service)==="ai").filter(o=>ye(o.status)!=="revoked");return Si.map(o=>{const a=i.map(p=>ot(e,o,p)).filter(ln).sort((p,g)=>p.priority-g.priority||p.id.localeCompare(g.id)),s=r.find(p=>Qr(ye(p.id))===o),d=Ip(s?.hasModel).map(p=>vA(o,p,n));return{id:o,name:o==="custom"?a.find(p=>p.label)?.label??Mo(o):Mo(o),offerings:o==="custom"?MA(i.filter(p=>ot(e,o,p))):Sp(o,e.openAiSubscriptionImportAvailable===!0),credentials:a,selectedModels:d,status:DA(a)}})}function po(e,t,r,n){return JSON.stringify({algorithm:"PLAINTEXT",encoding:"base64",ciphertext:wA(n),webId:e.webId,credentialIri:Ie.buildIri(e.podUrl,{id:r}),provider:t})}function wA(e){const t=new TextEncoder().encode(JSON.stringify(e));let r="";for(const n of t)r+=String.fromCharCode(n);return btoa(r)}function AA(e,t,r){let n=!1;for(const[i,o]of[[e.accountId,[t?.accountId,r?.accountId]],[e.accountSubject,[t?.authoritativeSubject,r?.accountSubject,r?.authoritativeSubject]]]){const a=[...new Set(o.map(ye).filter(ln).filter(s=>s.trim()))];if(a.length>1)return!1;if(!(!i?.trim()||!a.length)){if(a[0]!==i)return!1;n=!0}}return n}function ot(e,t,r){const n=ye(r.id);if(!n)return;const i=ru(ye(r.provider))??kA(n);if(i!==t)return;const o=gt(r.metadata),a=jA(r.authMode);if(a)return{id:n,provider:i,offeringId:ye(o?.offeringId)??nu(ye(r.provider))??rn(i,a),authMode:a,label:ye(r.accountLabel)??ye(r.label),enabled:Od(o?.enabled)??ye(r.status)==="active",priority:kd(o?.priority)??100,health:NA(o?.health)??(Od(r.reauthRequired)?"expired":"healthy"),maskedHint:PA(e,i,n,r.encryptedSecret),baseUrl:ye(r.baseUrl),proxyUrl:OA(ye(r.proxyUrl)??ye(o?.proxyUrl)),compatibility:_A(o?.compatibility),expiresAt:FA(r.expiresAt),version:kd(r.keyVersion)??0}}function _A(e){return e==="auto"||e==="openai"||e==="anthropic"?e:void 0}function vA(e,t,r){const n=r.find(s=>br(ye(s.id))===br(t)),i=ye(n?.isProvidedBy),o=n?Hr(t,i??e)??t:Hr(t,e)??t,a=n??r.find(s=>{const u=ye(s.id),d=ye(s.isProvidedBy);return u===t||Hr(u,e)===o||ru(d)===e&&Hr(u,d??e)===o});return{id:o,provider:e,offeringId:nu(ye(a?.isProvidedBy)),credentialId:Ep(i),resourceId:ye(a?.id)??t,displayName:ye(a?.displayName),availability:ye(a?.status)==="unavailable"||!a?"unavailable":"available"}}function SA(e){const t=ye(e.isProvidedBy),r=ru(t),n=r&&Hr(ye(e.id),t??r);if(!(!r||!n))return{id:n,provider:r,offeringId:nu(t),credentialId:Ep(t),resourceId:ye(e.id),displayName:ye(e.displayName),availability:ye(e.status)==="unavailable"?"unavailable":"available"}}function EA(e){const t=gt(e),r=ye(t?.id);if(r)return{id:r,displayName:ye(t?.displayName)}}function Pd(e,t){const r=ye(t?.provider),n=br(r),i=Qr(r);if(n&&i&&i!==e&&n.includes("#"))return Be.buildId({id:n});const o=ye(gt(t?.metadata)?.offeringId),a=Ei(e,o??IA(e,i));return a?Be.buildId({id:`${e}-${a}.ttl#this`}):Be.buildId({id:e})}function ms(e,t){const r=Ei(e,t)??t;return Be.buildId({id:`${e}-${r}.ttl#this`})}function xA(e){return Be.buildId({id:`custom-instance-${encodeURIComponent(e)}.ttl#this`})}function Ep(e){const t=Qr(e),r=t?.startsWith("custom-instance-")?t.slice(16):void 0;if(r)try{return decodeURIComponent(r)}catch{return}}function Ei(e,t){if(!t)return;const r=t.trim().toLowerCase();if(e==="bailian"){if(r==="token-plan")return"token-plan-personal";if(r==="coding-plan")return"coding-plan-pro";if(r==="payg")return"pay-as-you-go"}return r}function IA(e,t){if(!(!t||t===e)&&e==="bailian"){if(t==="bailian-token-plan")return"token-plan-personal";if(t==="bailian-coding-plan")return"coding-plan-pro"}}function Wr(e,t){const r=br(e),n=br(t);return r!==void 0&&r===n}async function Td(e,t,r){(await e.select().from(Be).execute()).some(i=>Wr(ye(i.id),t))||await e.insert(Be).values({id:t,displayName:r}).execute()}async function RA(e,t,r,n){const i=xp(t,r.id),o={displayName:r.displayName??r.id,isProvidedBy:t,status:"active"};if(n.has(i)){await e.updateById(yt,i,o);return}await e.insert(yt).values({id:i,...o}).execute(),n.add(i)}function xp(e,t){const r=br(e)??`${e}.ttl`;return`${r.split("#",1)[0]??r}#${encodeURIComponent(t)}`}function CA(e,t,r,n){const i=ye(t.resourceId),o=Ei(e,ye(t.offeringId)),a=n??(o?Be.buildId({id:`${e}-${o}.ttl#this`}):Be.buildId({id:e})),s=ye(t.id),u=s?r.filter(p=>{const g=ye(p.isProvidedBy),v=Qr(g);return(n?Wr(g,n):v===e||v?.startsWith(`${e}-`)===!0)&&Hr(ye(p.id),g??a)===s}):[],d=n?u[0]:o?u.find(p=>Wr(ye(p.isProvidedBy),a)):u.length===1?u[0]:void 0;if(i){const p=r.find(_=>ye(_.id)===i);if(!p&&d)return String(d.id);const g=ye(p?.isProvidedBy),v=Qr(g),I=n?Wr(g,n):v===e||v?.startsWith(`${e}-`)===!0,C=!!n||!o||Wr(g,a);if(!p||!I||!C)throw new Error("invalid_model_selection_resource");return i}if(!s)throw new Error("invalid_model_selection_resource");return ye(d?.id)??xp(a,s)}function Hr(e,t){if(!e)return;const n=br(t)?.split("#",1)[0]??t,i=n.endsWith(".ttl")?`${n}#`:`${n}.ttl#`,o=e.lastIndexOf(i);if(!(o<0))try{return decodeURIComponent(e.slice(o+i.length))}catch{return e.slice(o+i.length)}}function Ip(e){if(Array.isArray(e))return e.map(ye).filter(ln);const t=ye(e);return t?[t]:[]}function MA(e){const t=new Map;for(const r of e){const n=gt(r.metadata),i=ye(n?.offeringId)??"openai-compatible",o=hA(n?.compatibility,i),a=ye(r.baseUrl)??ye(n?.baseUrl),s=uo.find(u=>u.id===i)??uo.find(u=>u.id===`${o}-compatible`)??uo[0];t.set(i,{...s,id:i,endpoints:a?[{protocol:o==="anthropic"?"anthropic":"chatCompletions",baseUrl:a}]:s.endpoints,modelDiscovery:o==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}})}return t.size>0?[...t.values()]:uo}function DA(e){return e.some(t=>t.health==="expired"||t.health==="invalid")?"attention":e.some(t=>t.enabled)?"available":e.length>0?"configured":"unconfigured"}function PA(e,t,r,n){const i=ci(e,t,r,n),o=ye(i?.apiKey);if(o)return o.length<=8?`${o.slice(0,2)}…`:`${o.slice(0,3)}...${o.slice(-4)}`}function ci(e,t,r,n){if(!(typeof n!="string"||!n.trim()))try{const i=JSON.parse(n);if(i.algorithm!=="PLAINTEXT"||i.webId!==e.webId||i.provider!==t)return;const o=Ie.buildIri(e.podUrl,{id:r});if(i.credentialIri!==o)return;const a=i.encoding==="base64"?TA(String(i.ciphertext)):JSON.parse(String(i.ciphertext));return gt(a)}catch{return}}function TA(e){const t=atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return JSON.parse(new TextDecoder().decode(r))}function ru(e){const t=Qr(e),r=Pt(t);return r||Si.find(n=>t?.startsWith(`${n}-`))}function nu(e){const t=Qr(e);if(t&&!t.startsWith("custom-instance-")){if(t==="bailian-token-plan-personal")return"token-plan";if(t==="bailian-token-plan-team")return"token-plan-team";if(t==="bailian-coding-plan-pro")return"coding-plan";if(t==="bailian-pay-as-you-go")return"pay-as-you-go";for(const r of Si)if(t.startsWith(`${r}-`))return t.slice(r.length+1)}}function kA(e){const t=/\/([^/#]+)\.ttl#/u.exec(e);return Pt(t?.[1])}function Pt(e){if(typeof e!="string"||!e.trim())return;const t=e.trim().toLowerCase();if(t==="zhipu"||t.startsWith("zhipu-"))return"zhipu";if(Si.includes(t))return t;for(const r of Si)if(t.startsWith(`${r}-`)||r==="bailian"&&(t==="bailian-token-plan"||t==="bailian-coding-plan"))return r}function ws(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{throw new Error("invalid_proxy_url")}if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||!t.hostname)throw new Error("invalid_proxy_url");return t.toString().replace(/\/$/u,"")}function OA(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{return}if(!(!["http:","https:"].includes(t.protocol)||!t.hostname))return t.username="",t.password="",t.search="",t.hash="",t.toString().replace(/\/$/u,"")}function br(e){if(!e)return;const t=e.split("#",1)[0]??e,r=t.split("/").filter(Boolean).at(-1)??t;if(!r)return;const n=r.endsWith(".ttl")?r:`${r}.ttl`,i=e.indexOf("#");return i<0?n:`${n}${e.slice(i)}`}function Qr(e){const t=br(e);if(t)return(t.split("#",1)[0]??t).replace(/\.ttl$/u,"")}function jA(e){if(e==="oauth"||e==="deviceCode"||e==="apiKey"||e==="local")return e;if(e==="deviceCodeOAuth")return"deviceCode"}function NA(e){if(e==="healthy"||e==="expired"||e==="invalid"||e==="unknown")return e;if(e==="reauthRequired")return"expired";if(e==="disabled")return"unknown"}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ye(e){return typeof e=="string"&&e.trim()?e:void 0}function kd(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function Od(e){if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function FA(e){return e instanceof Date?e.toISOString():ye(e)}function ln(e){return e!==void 0}const Rp=_0({renderToaster:!1}),jd=Rp.manifest.contributes.applets[0]?.appId,Cp=jd?Rp.applets[jd]:void 0;if(!Cp)throw new Error("AI Connection extension did not contribute an applet");const BA=Cp;function LA(e,t){const r=zp({runtime:e}),n=e.currentPod?.podUrl??e.selectedStorage?.storageUrl??e.podUrl,i=e.currentPod?{status:"ready",current:e.currentPod}:e.podError?{status:"error",error:e.podError.error}:e.state.status==="authenticated"?{status:"opening"}:e.state.status==="error"?{status:"error",error:e.state.error}:{status:"unavailable"},o=window.fetch.bind(window);return{solid:{session:{getSnapshot:()=>e.session.getSnapshot(),subscribe:a=>e.session.subscribe(a),fetch:e.fetch},pod:i,permissions:{...Mb({fetch:e.fetch})},requireLogin:async()=>{await r.startLogin()}},navigation:{openExternal:async a=>{window.open(a,"_blank","noopener,noreferrer")}},capabilities:{aiClientCredentials:t?.controls?.account?.clientCredentials&&t.bindAccountCapability?v0({collection:t.controls.account.clientCredentials,assertCurrent:t.bindAccountCapability(),accountIndex:t.idpIndex,fetch:o}):void 0,aiConnectionsPodStore:e.currentPod?pA({database:e.currentPod.database,authenticatedFetch:e.fetch,podUrl:e.currentPod.podUrl,webId:e.currentPod.webId}):void 0,aiClientConfiguration:n&&(globalThis.xpodDesktop!==void 0||e.aiClientConfiguration?.available===!0&&e.aiClientConfiguration.authority==="local-filesystem")?Gp({podUrl:n,controlPlaneOrigin:window.location.origin,authenticatedFetch:e.fetch,invocationFetch:o}):void 0}}}function UA(e){const t=J.useContext(Kp),r=J.useMemo(()=>LA(e,t),[e,t]);return J.useMemo(()=>{const n=jb(BA,r);if(n.layout!=="two-pane")throw new Error("AI Connection applet must use a two-pane layout");return n},[r])}function s_(){const e=Wp(),t=UA(e);return y.jsx(Yp,{listHeader:t.slots.listHeader,list:t.slots.list,mainHeader:t.slots.mainHeader,main:t.slots.main,mode:"auto"})}export{s_ as default};