decocms 4.184.0 → 4.185.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/client/assets/{AlertCircle-B3JS1Ogr.js → AlertCircle-V085S0Pa.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BMS62HNl.js → AreaChart-Dk805qn_.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-D9KeZg3z.js → ArrowUp-C9UWPdVM.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-C7vjzlfR.js → ArrowUpRight-C8ZO6yTj.js} +1 -1
  5. package/dist/client/assets/{Check-C-LauNEP.js → Check-Cqu1sm5i.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-BAtVWz02.js → CheckCircle-58nsPrz3.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BR_rY5I7.js → ChevronDown-CWZ3qf02.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-DNaF9GmC.js → ChevronRight-ClixI25K.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DYqaZocr.js → ChevronUp-BCfyXEAY.js} +1 -1
  10. package/dist/client/assets/{Copy01-b-czDxAP.js → Copy01-89aQXb7e.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-CzTGabjK.js → CpuChip01-DvaYOhxd.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DHT3Rv6c.js → CreditCard01--RHiUbi0.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-SHbBfUyY.js → DotsVertical-baaFmJMo.js} +1 -1
  14. package/dist/client/assets/{Eye-CWQ6QYQ_.js → Eye-DxFQatat.js} +1 -1
  15. package/dist/client/assets/{FilterLines-FKt18eu-.js → FilterLines-Dc-pqizf.js} +1 -1
  16. package/dist/client/assets/{HardDrive--Ca3_i9z.js → HardDrive-C0i1Llub.js} +1 -1
  17. package/dist/client/assets/{Key01-Cxb_dTY9.js → Key01-oNriuSfC.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-619VnLrS.js → LayoutLeft-DqZQYyx2.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-B7fSoBl7.js → LinkExternal01-Bgj6Xen5.js} +1 -1
  20. package/dist/client/assets/{LogOut01-8nsv1Zrx.js → LogOut01-CFBzaCRF.js} +1 -1
  21. package/dist/client/assets/{Monitor01-Ddtu0GLO.js → Monitor01-WABvYToh.js} +1 -1
  22. package/dist/client/assets/{Palette-BjvX1ruC.js → Palette-CkTgNE83.js} +1 -1
  23. package/dist/client/assets/{Play-B6BIJve0.js → Play-BsgE30l1.js} +1 -1
  24. package/dist/client/assets/{Plus-BQ3wCu8K.js → Plus-B4ad1Xzu.js} +1 -1
  25. package/dist/client/assets/{SearchLg-Bf0OE8pv.js → SearchLg-C-KlruU1.js} +1 -1
  26. package/dist/client/assets/{SearchMd-DDYxMG_A.js → SearchMd-rT38ISix.js} +1 -1
  27. package/dist/client/assets/{Settings02-C8JbwZnu.js → Settings02-DB25sFsF.js} +1 -1
  28. package/dist/client/assets/{Shield01-n9H7rn2N.js → Shield01-BylB6rER.js} +1 -1
  29. package/dist/client/assets/{Star01-B_crwKS8.js → Star01--sqF6mpt.js} +1 -1
  30. package/dist/client/assets/{Stars01-C1ltyRgO.js → Stars01-NIErpwdy.js} +1 -1
  31. package/dist/client/assets/{Stars02-CrM-SKfV.js → Stars02-CcT6UTOD.js} +1 -1
  32. package/dist/client/assets/{Sun-EctD6SlF.js → Sun-C95T18Lj.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-LVXImEqS.js → SwitchHorizontal01-CZ_I6szQ.js} +1 -1
  34. package/dist/client/assets/{Tool01-C13i3FWq.js → Tool01-CS7usoIz.js} +1 -1
  35. package/dist/client/assets/{Tool02-DUySVGxt.js → Tool02-CTuV70QB.js} +1 -1
  36. package/dist/client/assets/{Trash01-C_efCdAs.js → Trash01-CG7LoM8O.js} +1 -1
  37. package/dist/client/assets/{TrendUp01-BgnnhLXr.js → TrendUp01-CIsNY6CN.js} +1 -1
  38. package/dist/client/assets/{Upload01-sXK5QJkl.js → Upload01-DcmkD5kc.js} +1 -1
  39. package/dist/client/assets/{User01-DQ1vt8a0.js → User01-DZkrYOhm.js} +1 -1
  40. package/dist/client/assets/{Users01-Do4gmbPq.js → Users01-C7ex4BR1.js} +1 -1
  41. package/dist/client/assets/{Users03-BcYjhwHT.js → Users03-C4Ud2US3.js} +1 -1
  42. package/dist/client/assets/{X-ypK_5s2v.js → X-DpuJ_Jz0.js} +1 -1
  43. package/dist/client/assets/{XCircle-CVncmwo8.js → XCircle-DI1tEi91.js} +1 -1
  44. package/dist/client/assets/{XClose-BewBCx_H.js → XClose-Cr7wdfRL.js} +1 -1
  45. package/dist/client/assets/{Zap-BVnrXYPx.js → Zap-BQVen7xN.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-CK2EnhlO.js → ZapSquare-FefSSr5u.js} +1 -1
  47. package/dist/client/assets/{access-gate-gdInAd9D.js → access-gate-BZKafDXH.js} +1 -1
  48. package/dist/client/assets/{add-section-modal-Dsb07QT9.js → add-section-modal-C8cUIbZA.js} +1 -1
  49. package/dist/client/assets/{agent-icon-CG09iBgJ.js → agent-icon-D7Gh_Q1A.js} +1 -1
  50. package/dist/client/assets/{agents-list-CxTuXJiz.js → agents-list-BkE_0HIA.js} +1 -1
  51. package/dist/client/assets/{ai-providers-50eDPRO_.js → ai-providers-XwtrfgWc.js} +1 -1
  52. package/dist/client/assets/{alert-cYzFjVuf.js → alert-BXi4BHby.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-CquqUuRD.js → alert-dialog-BoFINk0L.js} +1 -1
  54. package/dist/client/assets/{app-editor-BIp-SPOE.js → app-editor-DIjcRLYw.js} +1 -1
  55. package/dist/client/assets/{auth-xxR7y6tl.js → auth-VOng5GIV.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-Y9gjp8x5.js → auth-catchall-Bp3q4MsQ.js} +1 -1
  57. package/dist/client/assets/{auth-entry-D_uyCSIa.js → auth-entry-D8k5tpw8.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-BFduyX9Q.js → auth-split-layout-CiU5Qi4j.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-k5Z-pOOh.js → authenticate-and-persist-oauth-DcejIP47.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-CHCVO6NE.js → automation-list-row-CIceR1Sb.js} +1 -1
  61. package/dist/client/assets/{automation-runs-iQ7GyF0U.js → automation-runs-CpA2veTM.js} +1 -1
  62. package/dist/client/assets/{automations-DeMGyuP4.js → automations-B0Pw0_ty.js} +1 -1
  63. package/dist/client/assets/{avatar-D2tOztUd.js → avatar-BROFoyC0.js} +1 -1
  64. package/dist/client/assets/{badge-D8pOsxKV.js → badge-BLjTnm5D.js} +1 -1
  65. package/dist/client/assets/{billing-CeHAuexv.js → billing-BKX1yKrV.js} +1 -1
  66. package/dist/client/assets/{block-document-0akRZYsC.js → block-document-CYGqdKWr.js} +1 -1
  67. package/dist/client/assets/{brand-context-DLuDCZRi.js → brand-context-C35BgeXD.js} +1 -1
  68. package/dist/client/assets/{buckets-Bfd_j2Km.js → buckets-Bj3iG8Wr.js} +1 -1
  69. package/dist/client/assets/{bulk-category-panel-Bzoc6rdI.js → bulk-category-panel-CIxpzp-a.js} +1 -1
  70. package/dist/client/assets/{calendar-VVAQUXnL.js → calendar-BF2oF791.js} +1 -1
  71. package/dist/client/assets/{capability-load-error-CQdkThFQ.js → capability-load-error-Dp1Om1oX.js} +1 -1
  72. package/dist/client/assets/{card-DYTU8rq7.js → card-Coa4wNbO.js} +1 -1
  73. package/dist/client/assets/{category-editor-Bhcsodv9.js → category-editor-Cu6zGcng.js} +1 -1
  74. package/dist/client/assets/{chat-context-GCEjbEBj.js → chat-context-CXkstrYM.js} +1 -1
  75. package/dist/client/assets/{checkbox-CXTjTXUs.js → checkbox-DIpcufAb.js} +1 -1
  76. package/dist/client/assets/{cli-auth-success-VQyjBBAB.js → cli-auth-success-CJm98zHz.js} +1 -1
  77. package/dist/client/assets/{collection-detail-C26eu1Jv.js → collection-detail-DJUynLOP.js} +1 -1
  78. package/dist/client/assets/{collection-display-button-CX7FxCDx.js → collection-display-button-uBI2AIT5.js} +1 -1
  79. package/dist/client/assets/{collection-search-Dw7EfxX-.js → collection-search-B3KKPIB9.js} +1 -1
  80. package/dist/client/assets/{collection-table-wrapper-BrLnTwVA.js → collection-table-wrapper-k41FK7S4.js} +1 -1
  81. package/dist/client/assets/{collection-tabs-B3WFfHWI.js → collection-tabs-Bi0FlI8a.js} +1 -1
  82. package/dist/client/assets/{command-AYLm7ZwQ.js → command-WpgNBnc2.js} +1 -1
  83. package/dist/client/assets/{commerce-onboarding-DlJhSB6g.js → commerce-onboarding-D8AQ4VKB.js} +1 -1
  84. package/dist/client/assets/{companions-core-BRC46RL7.js → companions-core-CFVll6Bf.js} +1 -1
  85. package/dist/client/assets/{connect-D39aX-bO.js → connect-CTqNL_Ym.js} +1 -1
  86. package/dist/client/assets/{connection-card-DHCHpIgN.js → connection-card-nLj5nbVg.js} +1 -1
  87. package/dist/client/assets/{connection-detail-C7ifYQvZ.js → connection-detail-sPst4s2S.js} +1 -1
  88. package/dist/client/assets/{connection-BWmmybbw.js → connection-ei83FdSP.js} +1 -1
  89. package/dist/client/assets/{connection-form-helpers-YtamX_oI.js → connection-form-helpers-CeQpx7MT.js} +1 -1
  90. package/dist/client/assets/{connections-DRXr97Ow.js → connections-dBFZBurH.js} +1 -1
  91. package/dist/client/assets/{decopilot-sse-pool-BuDEKE2B.js → decopilot-sse-pool-BmtYuZmd.js} +1 -1
  92. package/dist/client/assets/{dialog-DSJ_GZJt.js → dialog-2nTD6kuI.js} +1 -1
  93. package/dist/client/assets/{domain-settings-QXVJq8E8.js → domain-settings-L3LeYceQ.js} +1 -1
  94. package/dist/client/assets/{drawer-BoNzql-k.js → drawer-rbQfHOO1.js} +1 -1
  95. package/dist/client/assets/{dropdown-menu-Dl-K6r1z.js → dropdown-menu-DmdPtTwS.js} +1 -1
  96. package/dist/client/assets/{empty-state-DU0gJX7R.js → empty-state-DjFwkp1m.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-C8kYmTwA.js → extract-connection-data-Cq8QzV7f.js} +1 -1
  98. package/dist/client/assets/{file-explorer-Dd_UXfQe.js → file-explorer-DTi7XMfy.js} +1 -1
  99. package/dist/client/assets/{form-CfXwbDnQ.js → form-8wzS9l69.js} +1 -1
  100. package/dist/client/assets/{general-cjioWpU5.js → general-BRDNqzE0.js} +1 -1
  101. package/dist/client/assets/{github-repo-picker-BX2_UCL9.js → github-repo-picker-sR97GYma.js} +1 -1
  102. package/dist/client/assets/{hooks-BnzTub3t.js → hooks-EUE8Lqb7.js} +1 -1
  103. package/dist/client/assets/{index-CzkBTHyl.js → index-B-iEqSLP.js} +1 -1
  104. package/dist/client/assets/{index-UhwFQSWG.js → index-BEICz9lN.js} +1 -1
  105. package/dist/client/assets/{index-CZI3aMGz.js → index-BRNCnKUf.js} +5 -5
  106. package/dist/client/assets/index-BYFv2F-Q.js +77 -0
  107. package/dist/client/assets/{index-DTdwBEkE.js → index-CM8cE8Rw.js} +1 -1
  108. package/dist/client/assets/{index-C7Jqgqec.js → index-CNqUH5Px.js} +1 -1
  109. package/dist/client/assets/{index-BiL1coyY.js → index-CUymriQl.js} +1 -1
  110. package/dist/client/assets/{index-D5s7iB_G.js → index-D0MtYpa_.js} +5 -5
  111. package/dist/client/assets/{index-BU4e8BQP.js → index-DLFzQzyI.js} +1 -1
  112. package/dist/client/assets/{index-D8679f_U.js → index-DklqYEeT.js} +1 -1
  113. package/dist/client/assets/{index-DEa1H475.js → index-WiMeebBR.js} +1 -1
  114. package/dist/client/assets/{index-BOOmt4KH.js → index-YhlrNQ24.js} +1 -1
  115. package/dist/client/assets/{index-redirect-ISnwOhy2.js → index-redirect-BZjy7s0n.js} +1 -1
  116. package/dist/client/assets/{input-BLW13qDV.js → input-DkIop2Qy.js} +1 -1
  117. package/dist/client/assets/{integration-icon-DiC7PYLo.js → integration-icon-347yAb5X.js} +1 -1
  118. package/dist/client/assets/{invite-member-dialog-DknO-g5T.js → invite-member-dialog-Da5GRBtU.js} +1 -1
  119. package/dist/client/assets/{label-CdAnELsh.js → label-BDEnqf7j.js} +1 -1
  120. package/dist/client/assets/{layout-Chy4pfib.js → layout-CJDpvFEC.js} +1 -1
  121. package/dist/client/assets/{login-DTpypykn.js → login-BlaoThly.js} +1 -1
  122. package/dist/client/assets/{mcp-oauth-D1xsqTbw.js → mcp-oauth-CchZWCXC.js} +1 -1
  123. package/dist/client/assets/{members-445MstFS.js → members-DIppIc_X.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-d6E7Zvd9.js → monaco-editor-aCXlVkJM.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-DKN2Z1_i.js → monitoring-stats-row-Ddg7lG23.js} +1 -1
  126. package/dist/client/assets/{multi-select-CfCRhmSe.js → multi-select-Bigh7FnP.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-DJvOMDUI.js → oauth-callback-XIZAeINW.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BdhWesBZ.js → oauth-callback-ai-provider-B4KVa6hX.js} +1 -1
  129. package/dist/client/assets/{onboarding-CS8UTzzK.js → onboarding-C0WCY2Zg.js} +1 -1
  130. package/dist/client/assets/{org-layout-_EcLoVko.js → org-layout-BksITo3b.js} +1 -1
  131. package/dist/client/assets/{organization-choice-BxSBJQGA.js → organization-choice-BQDOUzaG.js} +1 -1
  132. package/dist/client/assets/{orgs-GuS4oucW.js → orgs-D9h9ceC8.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-B9po7fEi.js → page-seo-form-BgMtyEyw.js} +1 -1
  134. package/dist/client/assets/{popover-D2qLkEGb.js → popover-p3i6fRNM.js} +1 -1
  135. package/dist/client/assets/{post-editor-Deu2F14G.js → post-editor-Dy7IbbFs.js} +1 -1
  136. package/dist/client/assets/{primitives-pV6A0yki.js → primitives-CzyRHqXD.js} +1 -1
  137. package/dist/client/assets/{profile-c2z8X6Kq.js → profile-Dml9wk8T.js} +1 -1
  138. package/dist/client/assets/project-app-view-b2xvSZO9.js +1 -0
  139. package/dist/client/assets/record-editor-CqsDr4v5.js +1 -0
  140. package/dist/client/assets/{redirect-editor-BibKbBqp.js → redirect-editor-B58bSaJ8.js} +1 -1
  141. package/dist/client/assets/registry-DHbVpAxH.js +2 -0
  142. package/dist/client/assets/{registry-layout-C3zb9sDp.js → registry-layout-DcMavOwC.js} +1 -1
  143. package/dist/client/assets/{reports-EmI1mHpW.js → reports-B6b2CIl_.js} +1 -1
  144. package/dist/client/assets/{require-capability-CaR1pXbU.js → require-capability-CBHqSknu.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-CUZmEaxs.js → required-auth-layout-D09Ls--w.js} +1 -1
  146. package/dist/client/assets/{reset-password-CBXAvhH9.js → reset-password-CZdEUJIF.js} +1 -1
  147. package/dist/client/assets/{roles-mZf8kH6y.js → roles-C0Fyj9ow.js} +1 -1
  148. package/dist/client/assets/{search-input-DDVxkABf.js → search-input-DEvkqrly.js} +1 -1
  149. package/dist/client/assets/{secrets-B_9IMoe1.js → secrets-DvtLuM9q.js} +1 -1
  150. package/dist/client/assets/{sections-editor-DB_QzUbA.js → sections-editor-QPK36tiU.js} +1 -1
  151. package/dist/client/assets/{select-CWnB_uQx.js → select-7vCEMiqL.js} +1 -1
  152. package/dist/client/assets/{select-model-LJrrvVPW.js → select-model-B0Rtytw1.js} +1 -1
  153. package/dist/client/assets/{self-tool-result-Bz21E3aZ.js → self-tool-result-za_4Yvt1.js} +1 -1
  154. package/dist/client/assets/{seo-editor-Cp7502yh.js → seo-editor-CUXrkmLA.js} +1 -1
  155. package/dist/client/assets/{settings-layout-GF-G0wjF.js → settings-layout-DjnNOc9x.js} +1 -1
  156. package/dist/client/assets/{settings-section-ZIpqpn6u.js → settings-section-DldCtl7r.js} +1 -1
  157. package/dist/client/assets/{shell-controls-Bng45Su0.js → shell-controls-Dn1bzliw.js} +1 -1
  158. package/dist/client/assets/{shell-layout-DnVpUUuI.js → shell-layout-BOoDcQ7s.js} +1 -1
  159. package/dist/client/assets/{sidebar-BghCVHZt.js → sidebar-DRvWK2Ea.js} +1 -1
  160. package/dist/client/assets/{skeleton-lc9kh8qd.js → skeleton-BYbzmvXZ.js} +1 -1
  161. package/dist/client/assets/{spinner-D1VHlCPg.js → spinner-bMuJIZjw.js} +1 -1
  162. package/dist/client/assets/{sso-BR_j0lud.js → sso-D7KugfpW.js} +1 -1
  163. package/dist/client/assets/{store-DL3KLkjK.js → store-CO6cAkyl.js} +1 -1
  164. package/dist/client/assets/store-registry-DKSW3dHB.js +2 -0
  165. package/dist/client/assets/{studio-tools-Dnhai2E2.js → studio-tools-BkYUkkXB.js} +1 -1
  166. package/dist/client/assets/{switch-5ORj8iPy.js → switch-ZAofmEnR.js} +1 -1
  167. package/dist/client/assets/{tab-id-BkkhJopj.js → tab-id-D5rI6vVb.js} +1 -1
  168. package/dist/client/assets/{table-dGsHWyfu.js → table-Dno7EMp1.js} +1 -1
  169. package/dist/client/assets/{tabs-BLQN3Bzj.js → tabs-BOIXOLYE.js} +1 -1
  170. package/dist/client/assets/{textarea-89LUuJW5.js → textarea-CRxE7M7J.js} +1 -1
  171. package/dist/client/assets/{toggle-group-1VbMPded.js → toggle-group-DeAKEpbg.js} +1 -1
  172. package/dist/client/assets/{toolbar-Dx6B96vS.js → toolbar-CXgOn6y9.js} +1 -1
  173. package/dist/client/assets/{tooltip-aoWInzoh.js → tooltip-fl1xzViS.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-CFfUlF1f.js → use-ai-providers-Bb64oFKS.js} +1 -1
  175. package/dist/client/assets/{use-automations-B8-RtV1z.js → use-automations-Bhs4wNxc.js} +1 -1
  176. package/dist/client/assets/{use-autosave-CXpoagL6.js → use-autosave-CEdct9dQ.js} +1 -1
  177. package/dist/client/assets/{use-capability-DiPv8Zb8.js → use-capability-BnycW9CT.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-ClPZ6D9Y.js → use-clock-tick-DLykrXFL.js} +1 -1
  179. package/dist/client/assets/{use-connection-DvPLUiIA.js → use-connection-Df3y6AO1.js} +1 -1
  180. package/dist/client/assets/{use-copy-DIay_-Je.js → use-copy-aVHJtjAw.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-BZXqo_pO.js → use-create-virtual-mcp-C_CY0w7m.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-CvLLnMGe.js → use-debounced-autosave-Bb6h4dQ2.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-bthpDZiE.js → use-debounced-value-jnidUBIv.js} +1 -1
  184. package/dist/client/assets/{use-deco-credits-D1TNghK4.js → use-deco-credits-B2dXM2_l.js} +1 -1
  185. package/dist/client/assets/{use-decopilot-events-CEnoV83H.js → use-decopilot-events--g_MduAT.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-9f3obKAs.js → use-delete-connection-Crs7O1-T.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-C59HdwZf.js → use-deployment-admin-2H23kJxF.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-ClgScKvu.js → use-file-configs-qKumaJ2B.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-C32yKpeT.js → use-infinite-scroll-B4ZgI6uy.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-CzXf25FI.js → use-join-requests-dcYN8JB8.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-DrSHoCVl.js → use-mcp-client-D9UGONLu.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-BN79MGPB.js → use-mcp-tools-FBmzZbPl.js} +1 -1
  193. package/dist/client/assets/{use-members-0dOk8VV6.js → use-members-D_nOcmS_.js} +1 -1
  194. package/dist/client/assets/{use-mobile-CGdxblv_.js → use-mobile-DknLG6Ru.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-BeeZom_X.js → use-navigate-to-agent-CcrKawbg.js} +1 -1
  196. package/dist/client/assets/{use-open-billing-url-mk1x37uU.js → use-open-billing-url-DyN8EUU-.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-BgXvHZ3n.js → use-org-auth-client-BPaqoCNz.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-CFX6XDqX.js → use-org-sso-CbObV4Jy.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-DtGn2caD.js → use-organization-roles-a6_ShiPq.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-CRDxfnxm.js → use-organization-settings-CgndneJg.js} +1 -1
  201. package/dist/client/assets/{use-registry-connections-BUfxuowY.js → use-registry-connections-D14lN-e9.js} +1 -1
  202. package/dist/client/assets/{use-secrets-D8ds-9XA.js → use-secrets-Db3rlvJY.js} +1 -1
  203. package/dist/client/assets/{use-status-sounds-DZ5Z_g91.js → use-status-sounds-CvdfxQWf.js} +1 -1
  204. package/dist/client/assets/{use-tags-D1HbmIof.js → use-tags-DNCqx0kn.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-mhODNaJU.js → use-view-mode-C7Za1ElL.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-BfqTkZTV.js → use-virtual-mcp-BoBOLkTK.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-UZ4MS_PK.js +1 -0
  208. package/dist/client/assets/{useRouterState-ivpTEnE_.js → useRouterState-BxqnPUql.js} +1 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-D0yeSOC6.js +1 -0
  210. package/dist/client/assets/{users-vab4Zr9W.js → users-Y8Lfdd61.js} +1 -1
  211. package/dist/client/assets/{variant-calendar-CvDCuacg.js → variant-calendar-zeyNWlli.js} +1 -1
  212. package/dist/client/assets/{view-mode-toggle-BEe5tOOR.js → view-mode-toggle-OLN4pw9l.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +1 -1
  215. package/dist/server/server.js +1 -1
  216. package/package.json +1 -1
  217. package/dist/client/assets/index-BnjU2dTw.js +0 -77
  218. package/dist/client/assets/project-app-view-CcHtyOQQ.js +0 -1
  219. package/dist/client/assets/record-editor-BA-UmwkJ.js +0 -1
  220. package/dist/client/assets/registry-C3cqMqjN.js +0 -2
  221. package/dist/client/assets/store-registry-YLkbINDi.js +0 -2
  222. package/dist/client/assets/useInfiniteQuery-DiQjMEo-.js +0 -1
  223. package/dist/client/assets/useSuspenseInfiniteQuery-tRLMDsN2.js +0 -1
@@ -1,77 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CZI3aMGz.js","assets/index-D5s7iB_G.js","assets/index-CUIiLem4.css","assets/ArrowUp-D9KeZg3z.js","assets/chat-context-GCEjbEBj.js","assets/tab-id-BkkhJopj.js","assets/dialog-DSJ_GZJt.js","assets/X-ypK_5s2v.js","assets/Check-C-LauNEP.js","assets/Copy01-b-czDxAP.js","assets/hooks-BnzTub3t.js","assets/use-mcp-client-DrSHoCVl.js","assets/auth-xxR7y6tl.js","assets/decopilot-sse-pool-BuDEKE2B.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-virtual-mcp-BfqTkZTV.js","assets/use-ai-providers-CFfUlF1f.js","assets/studio-tools-Dnhai2E2.js","assets/use-decopilot-events-CEnoV83H.js","assets/use-organization-settings-CRDxfnxm.js","assets/automation-runs-iQ7GyF0U.js","assets/select-CWnB_uQx.js","assets/tooltip-aoWInzoh.js","assets/ChevronDown-BR_rY5I7.js","assets/ChevronUp-DYqaZocr.js","assets/useInfiniteQuery-DiQjMEo-.js","assets/use-infinite-scroll-C32yKpeT.js","assets/use-connection-DvPLUiIA.js","assets/card-DYTU8rq7.js","assets/sidebar-BghCVHZt.js","assets/LayoutLeft-619VnLrS.js","assets/use-mobile-CGdxblv_.js","assets/table-dGsHWyfu.js","assets/empty-state-DU0gJX7R.js","assets/use-members-0dOk8VV6.js","assets/use-org-auth-client-BgXvHZ3n.js","assets/use-clock-tick-ClPZ6D9Y.js","assets/AlertCircle-B3JS1Ogr.js","assets/CheckCircle-BAtVWz02.js","assets/DotsVertical-SHbBfUyY.js","assets/agent-icon-CG09iBgJ.js","assets/Tool01-C13i3FWq.js","assets/Settings02-C8JbwZnu.js","assets/Tool02-DUySVGxt.js","assets/XCircle-CVncmwo8.js","assets/ArrowUpRight-C7vjzlfR.js","assets/TrendUp01-BgnnhLXr.js","assets/ZapSquare-CK2EnhlO.js","assets/Users03-BcYjhwHT.js","assets/ChevronRight-DNaF9GmC.js","assets/Stars02-CrM-SKfV.js","assets/CpuChip01-CzTGabjK.js","assets/CreditCard01-DHT3Rv6c.js","assets/Eye-CWQ6QYQ_.js","assets/FilterLines-FKt18eu-.js","assets/Star01-B_crwKS8.js","assets/Palette-BjvX1ruC.js","assets/SwitchHorizontal01-LVXImEqS.js","assets/HardDrive--Ca3_i9z.js","assets/Key01-Cxb_dTY9.js","assets/LinkExternal01-B7fSoBl7.js","assets/LogOut01-8nsv1Zrx.js","assets/Monitor01-Ddtu0GLO.js","assets/Sun-EctD6SlF.js","assets/Play-B6BIJve0.js","assets/Plus-BQ3wCu8K.js","assets/SearchLg-Bf0OE8pv.js","assets/SearchMd-DDYxMG_A.js","assets/Shield01-n9H7rn2N.js","assets/Stars01-C1ltyRgO.js","assets/Trash01-C_efCdAs.js","assets/Upload01-sXK5QJkl.js","assets/User01-DQ1vt8a0.js","assets/Users01-Do4gmbPq.js","assets/XClose-BewBCx_H.js","assets/Zap-BVnrXYPx.js","assets/use-automations-B8-RtV1z.js","assets/useSuspenseInfiniteQuery-tRLMDsN2.js","assets/avatar-D2tOztUd.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-DIay_-Je.js","assets/calendar-VVAQUXnL.js","assets/monaco-editor-d6E7Zvd9.js","assets/spinner-D1VHlCPg.js","assets/index-BU4e8BQP.js","assets/shell-layout-DnVpUUuI.js","assets/required-auth-layout-CUZmEaxs.js","assets/use-org-sso-CFX6XDqX.js","assets/integration-icon-DiC7PYLo.js","assets/use-navigate-to-agent-BeeZom_X.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-BMS62HNl.js","assets/form-CfXwbDnQ.js","assets/label-CdAnELsh.js","assets/input-BLW13qDV.js","assets/drawer-BoNzql-k.js","assets/collection-search-Dw7EfxX-.js","assets/tabs-BLQN3Bzj.js","assets/toggle-group-1VbMPded.js","assets/use-deco-credits-D1TNghK4.js","assets/popover-D2qLkEGb.js","assets/alert-dialog-CquqUuRD.js","assets/toolbar-Dx6B96vS.js","assets/skeleton-lc9kh8qd.js","assets/github-repo-picker-BX2_UCL9.js","assets/use-debounced-value-bthpDZiE.js","assets/authenticate-and-persist-oauth-k5Z-pOOh.js","assets/mcp-oauth-D1xsqTbw.js","assets/use-mcp-tools-BN79MGPB.js","assets/extract-connection-data-C8kYmTwA.js","assets/metadata-dUsYcpuu.js","assets/provision-repo-scoped-github-connection-B2s3ApVy.js","assets/agent-capabilities-cXfbMfjV.js","assets/connection-card-DHCHpIgN.js","assets/use-registry-connections-BUfxuowY.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-89LUuJW5.js","assets/connection-form-helpers-YtamX_oI.js","assets/collection-tabs-B3WFfHWI.js","assets/badge-D8pOsxKV.js","assets/use-open-billing-url-mk1x37uU.js","assets/select-model-LJrrvVPW.js","assets/checkbox-CXTjTXUs.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-ZIpqpn6u.js","assets/dropdown-menu-Dl-K6r1z.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-DZ5Z_g91.js","assets/deco-site-production-url-CaKZ7xBn.js","assets/use-capability-DiPv8Zb8.js","assets/pt-BR-CLy76QW2.js","assets/switch-5ORj8iPy.js","assets/use-debounced-autosave-CvLLnMGe.js","assets/index-D8679f_U.js","assets/search-input-DDVxkABf.js","assets/index-BOOmt4KH.js","assets/use-secrets-D8ds-9XA.js","assets/command-AYLm7ZwQ.js","assets/index-DEa1H475.js","assets/self-tool-result-Bz21E3aZ.js","assets/companions-core-BRC46RL7.js","assets/use-file-configs-ClgScKvu.js","assets/automation-list-row-CHCVO6NE.js","assets/get-initials-D-f_fDFw.js","assets/index-CiP0VfIv.css"])))=>i.map(i=>d[i]);
2
- import{G as Sa,r as w,c as F,x as Ca,K as ge,F as $e,o as gn,e as Ge,n as Xe,aw as De,ae as sn,a as Do,t as St,ar as ja,m as ee,j as c,b as le,aW as Ro,aX as Eo,aY as Io,aZ as _o,a_ as Ao,a$ as Bo,b0 as Oo,b1 as $o,b2 as Mo,B as _e,y as Ta,av as zo,E as Na,d as Lo,p as $i,k as Ts,u as Da,aF as Ra}from"./index-D5s7iB_G.js";import{g as _t}from"./get-initials-D-f_fDFw.js";import{A as At}from"./avatar-D2tOztUd.js";import{aC as Ns,ae as Ea,af as Ia,ah as _a,a5 as Aa,aD as Ba,y as Oa,n as $a,aE as Zr,aF as Ma,W as Jr,d as Po,ad as za,g as Fo,k as ur,aG as La,aA as Tr,ar as ei,Z as Yn,aH as Pa,ay as Fa}from"./agent-icon-CG09iBgJ.js";import{i as Uo}from"./SwitchHorizontal01-LVXImEqS.js";import{s as ws}from"./Plus-BQ3wCu8K.js";import{i as dn}from"./X-ypK_5s2v.js";import{a as Xn,b as xs,P as bs}from"./popover-D2qLkEGb.js";import{a as Ct,i as qo,D as un,b as fn,c as hn,d as ls,e as as,f as cs}from"./dropdown-menu-Dl-K6r1z.js";import{W as Ua,m as Mi,S as Ko,C as Ho,g as qa,u as Ka,h as Ha,Q as Wa,j as Va,a as Qa}from"./use-mcp-client-DrSHoCVl.js";import{u as Ga,G as $r,a as Xa}from"./github-repo-picker-BX2_UCL9.js";import{e as Jn,d as es,b as ts,h as ti,a as ni,c as si}from"./dialog-DSJ_GZJt.js";import{b as Ya,u as Za}from"./use-connection-DvPLUiIA.js";import{b as Ja}from"./provision-repo-scoped-github-connection-B2s3ApVy.js";import{a as ec}from"./authenticate-and-persist-oauth-k5Z-pOOh.js";import{e as tc}from"./extract-connection-data-C8kYmTwA.js";import{u as Wo}from"./use-members-0dOk8VV6.js";import{u as mn}from"./studio-tools-Dnhai2E2.js";import{t as nc,T as sc,a as rc,S as ze,i as Vo,b as zi}from"./decopilot-sse-pool-BuDEKE2B.js";import{u as ic}from"./use-decopilot-events-CEnoV83H.js";import{a as ri}from"./format-time-BnbuEtat.js";import{i as fr}from"./AlertCircle-B3JS1Ogr.js";import{i as xn}from"./CheckCircle-BAtVWz02.js";import{i as oc}from"./DotsVertical-SHbBfUyY.js";import{s as lc}from"./Eye-CWQ6QYQ_.js";import{u as Qo,a as ac,b as cc}from"./use-tags-D1HbmIof.js";import{o as dc,P as rn,a as ii,D as uc,p as fc,q as hc,S as Qt,r as pc,T as Go,F as Nr,s as ps,v as gc,w as mc,x as Xo,N as xc,k as oi,y as bc,z as yc,d as Yo,n as kc,A as Xt,B as vc,G as ds,H as wc,I as Zo,R as Jo,m as el,J as tl,K as Sc,L as Cc,Q as jc,e as Tc,u as Nc,f as Dc,j as Rc,C as nl,c as Ec}from"./calendar-VVAQUXnL.js";import{S as Vn}from"./skeleton-lc9kh8qd.js";import{u as Ic}from"./use-copy-DIay_-Je.js";import{i as Ds}from"./Check-C-LauNEP.js";import{i as sl}from"./ChevronRight-DNaF9GmC.js";import{a as _c}from"./Copy01-b-czDxAP.js";import{n as Ac,i as rl}from"./Tool02-DUySVGxt.js";import{n as Gs}from"./LinkExternal01-B7fSoBl7.js";import{b as il,i as ol}from"./XCircle-CVncmwo8.js";import{s as ll}from"./Trash01-C_efCdAs.js";import{u as Li,a as Bc}from"./use-organization-settings-CRDxfnxm.js";import{d as li,a as ai,c as Jt,b as ns,C as ci,e as di}from"./command-AYLm7ZwQ.js";import{s as Mr}from"./User01-DQ1vt8a0.js";import{i as Oc}from"./ArrowUp-D9KeZg3z.js";import{i as $c}from"./Tool01-C13i3FWq.js";import{u as Mc}from"./use-open-billing-url-mk1x37uU.js";import{f as zc}from"./tab-id-BkkhJopj.js";import{u as zr}from"./companions-core-BRC46RL7.js";import{d as Lc,b as Pc,f as Fc,g as Uc,a as qc,D as Kc}from"./drawer-BoNzql-k.js";import{t as ui}from"./ChevronDown-BR_rY5I7.js";import{i as al}from"./FilterLines-FKt18eu-.js";import{s as Hc}from"./TrendUp01-BgnnhLXr.js";import{u as Wc}from"./shell-layout-DnVpUUuI.js";import{b as Vc}from"./hooks-BnzTub3t.js";const Qc="[SUBSCRIPTION_REQUIRED]";function Gc(t){return t?.message.startsWith(Qc)?t.message.includes("used its free task executions")?"trial_exhausted":t.message.includes("used its monthly task executions")?"monthly_exhausted":t.message.includes("reached its execution limit")?"runs_exhausted":null:null}function Xc(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const Km="__home__";function fi(t,e){return Sa.chatDraft(t,e)}function Yc(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function Zc(t,e,n,r,s){const i=fi(e,n);if(Xc(r)){t.removeItem(i);return}const o={tiptapDoc:r,updatedAt:Date.now()},l=JSON.stringify(o);try{t.setItem(i,l)}catch(a){if(Jc(a)){const d=new TextEncoder().encode(l).byteLength;s?.onQuotaExceeded?.({docSizeBytes:d});return}throw a}}function Hm(t,e,n){const r=fi(e,n),s=t.getItem(r),i=Yc(s);return s!==null&&i===null&&t.removeItem(r),i}function Wm(t,e,n){t.removeItem(fi(e,n))}function Jc(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}var ed=dc;function td(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=t,a=r&&!s,d=hc(n),u=new RegExp(`\\s${d}$`),f=o?"^":"",p=s?"":d,h=a?new RegExp(`${f}${d}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${p}]*`,"gm"),m=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!m)return null;const y=l.pos-m.length,b=Array.from(m.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const g=b.input.slice(Math.max(0,b.index-1),b.index),x=new RegExp(`^[${i?.join("")}\0]?$`).test(g);if(i!==null&&!x)return null;const k=y+b.index;let v=k+b[0].length;return a&&u.test(m.slice(v-1,v+1))&&(b[0]+=" ",v+=1),k<l.pos&&v>=l.pos?{range:{from:k,to:v},query:b[0].slice(n.length),text:b[0]}:null}var nd=new rn("suggestion");function sd({pluginKey:t=nd,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:a="suggestion",decorationContent:d="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:p=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=td,shouldShow:b}){let g;const x=h?.(),k=()=>{const C=e.state.selection.$anchor.pos,j=e.view.coordsAtPos(C),{top:D,right:R,bottom:N,left:I}=j;try{return new DOMRect(I,D,R-I,N-D)}catch{return null}},v=(C,j)=>j?()=>{const D=t.getState(e.state),R=D?.decorationId,N=C.dom.querySelector(`[data-decoration-id="${R}"]`);return N?.getBoundingClientRect()||null}:k;function S(C,j){var D;try{const N=t.getState(C.state),I=N?.decorationId?C.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`):null,A={editor:e,range:N?.range||{from:0,to:0},query:N?.query||null,text:N?.text||null,items:[],command:_=>f({editor:e,range:N?.range||{from:0,to:0},props:_}),decorationNode:I,clientRect:v(C,I)};(D=x?.onExit)==null||D.call(x,A)}catch{}const R=C.state.tr.setMeta(j,{exit:!0});C.dispatch(R)}const T=new ii({key:t,view(){return{update:async(C,j)=>{var D,R,N,I,A,_,M;const E=(D=this.key)==null?void 0:D.getState(j),O=(R=this.key)==null?void 0:R.getState(C.state),z=E.active&&O.active&&E.range.from!==O.range.from,B=!E.active&&O.active,P=E.active&&!O.active,L=!B&&!P&&E.query!==O.query,U=B||z&&L,H=L||z,W=P||z&&L;if(!U&&!H&&!W)return;const V=W&&!U?E:O,Z=C.dom.querySelector(`[data-decoration-id="${V.decorationId}"]`);g={editor:e,range:V.range,query:V.query,text:V.text,items:[],command:te=>f({editor:e,range:V.range,props:te}),decorationNode:Z,clientRect:v(C,Z)},U&&((N=x?.onBeforeStart)==null||N.call(x,g)),H&&((I=x?.onBeforeUpdate)==null||I.call(x,g)),(H||U)&&(g.items=await p({editor:e,query:V.query})),W&&((A=x?.onExit)==null||A.call(x,g)),H&&((_=x?.onUpdate)==null||_.call(x,g)),U&&((M=x?.onStart)==null||M.call(x,g))},destroy:()=>{var C;g&&((C=x?.onExit)==null||C.call(x,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,j,D,R){const{isEditable:N}=e,{composing:I}=e.view,{selection:A}=C,{empty:_,from:M}=A,E={...j},O=C.getMeta(t);if(O&&O.exit)return E.active=!1,E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null,E;if(E.composing=I,N&&(_||e.view.composing)){(M<j.range.from||M>j.range.to)&&!I&&!j.composing&&(E.active=!1);const z=y({char:n,allowSpaces:r,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:A.$from}),B=`id_${Math.floor(Math.random()*4294967295)}`;z&&m({editor:e,state:R,range:z.range,isActive:j.active})&&(!b||b({editor:e,range:z.range,query:z.query,text:z.text,transaction:C}))?(E.active=!0,E.decorationId=j.decorationId?j.decorationId:B,E.range=z.range,E.query=z.query,E.text=z.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(C,j){var D,R,N,I;const{active:A,range:_}=T.getState(C.state);if(!A)return!1;if(j.key==="Escape"||j.key==="Esc"){const E=T.getState(C.state),O=(D=g?.decorationNode)!=null?D:null,z=O??(E?.decorationId?C.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`):null);if(((R=x?.onKeyDown)==null?void 0:R.call(x,{view:C,event:j,range:E.range}))||!1)return!0;const P={editor:e,range:E.range,query:E.query,text:E.text,items:[],command:L=>f({editor:e,range:E.range,props:L}),decorationNode:z,clientRect:z?()=>z.getBoundingClientRect()||null:null};return(N=x?.onExit)==null||N.call(x,P),S(C,t),!0}return((I=x?.onKeyDown)==null?void 0:I.call(x,{view:C,event:j,range:_}))||!1},decorations(C){const{active:j,range:D,decorationId:R,query:N}=T.getState(C);if(!j)return null;const I=!N?.length,A=[a];return I&&A.push(u),uc.create(C.doc,[fc.inline(D.from,D.to,{nodeName:l,class:A.join(" "),"data-decoration-id":R,"data-decoration-content":d})])}}});return T}function rd(t){const e=F.c(24),{editor:n,query:r,items:s,onSelect:i,onClose:o}=t,[l,a]=w.useState(0),d=w.useRef(s),u=w.useRef(l),f=w.useRef(i),p=w.useRef(o),h=w.useDeferredValue(r);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{a(0)},e[0]=m):m=e[0];let y;e[1]!==h?(y=[h],e[1]=h,e[2]=y):y=e[2],w.useEffect(m,y);let b,g;e[3]!==s.length||e[4]!==l?(b=()=>{l>=s.length&&s.length>0&&a(0)},g=[s.length,l],e[3]=s.length,e[4]=l,e[5]=b,e[6]=g):(b=e[5],g=e[6]),w.useEffect(b,g);let x,k;e[7]!==s?(x=()=>{d.current=s},k=[s],e[7]=s,e[8]=x,e[9]=k):(x=e[8],k=e[9]),w.useEffect(x,k);let v,S;e[10]!==l?(v=()=>{u.current=l},S=[l],e[10]=l,e[11]=v,e[12]=S):(v=e[11],S=e[12]),w.useEffect(v,S);let T,C;e[13]!==i?(C=()=>{f.current=i},T=[i],e[13]=i,e[14]=T,e[15]=C):(T=e[14],C=e[15]),w.useEffect(C,T);let j,D;e[16]!==o?(j=()=>{p.current=o},D=[o],e[16]=o,e[17]=j,e[18]=D):(j=e[17],D=e[18]),w.useEffect(j,D);let R,N;e[19]!==n?(R=()=>{if(n?.isDestroyed)return;let _;try{_=n.view.dom}catch{return}if(!_)return;const M=O=>{const z=d.current;if(!z.length)return!1;const B=()=>a(L=>(L+1)%z.length),P=()=>a(L=>(L-1+z.length)%z.length);switch(O.key){case"ArrowUp":return O.preventDefault(),P(),!0;case"ArrowDown":return O.preventDefault(),B(),!0;case"Tab":return O.preventDefault(),O.shiftKey?P():B(),!0;case"Home":return O.preventDefault(),a(0),!0;case"End":return O.preventDefault(),a(z.length-1),!0;case"Enter":{if(O.isComposing)return!1;O.preventDefault();const L=u.current;return L!==-1&&z[L]&&f.current?.(z[L],L),!0}case"Escape":return O.preventDefault(),p.current?.(),!0;default:return!1}},E=O=>{M(O)};return _.addEventListener("keydown",E,!0),()=>{_?.removeEventListener("keydown",E,!0)}},N=[n],e[19]=n,e[20]=R,e[21]=N):(R=e[20],N=e[21]),w.useEffect(R,N);const I=s.length?l:void 0;let A;return e[22]!==I?(A={selectedIndex:I,setSelectedIndex:a},e[22]=I,e[23]=A):A=e[23],A}function id(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const od=w.createContext(void 0);function ld(){const t=w.useContext(od);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Vm(t){const e=F.c(16),{editor:n,char:r,pluginKey:s,allow:i,onOpenChange:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={open:!1,element:null,query:"",range:null,selectedItem:null},e[0]=l):l=e[0];const[a,d]=w.useReducer(id,l);let u;e[1]!==o?(u=y=>{o?.(y)},e[1]=o,e[2]=u):u=e[2];const f=w.useEffectEvent(u);let p;e[3]!==r||e[4]!==i||e[5]!==n||e[6]!==f||e[7]!==s?(p=()=>{if(n?.isDestroyed)return;const y=s instanceof rn?s:new rn(s);n.state.plugins.find(x=>x.spec.key===y)&&n.unregisterPlugin(y);const g=sd({pluginKey:y,editor:n,char:r,allow(x){const k=n.state.doc.resolve(x.range.from);for(let v=k.depth;v>0;v--)if(k.node(v).type.name==="image")return!1;return!(i&&!i(x))},command(){},render:()=>({onStart:x=>{d({type:"ON_START",payload:{element:x.decorationNode??null,query:x.query,range:x.range}}),f(!0)},onUpdate:x=>{d({type:"ON_UPDATE",payload:{element:x.decorationNode??null,query:x.query,range:x.range}})},onKeyDown:x=>x.event.key==="Escape"?(d({type:"ON_EXIT"}),!0):!1,onExit:()=>{d({type:"ON_EXIT"}),f(!1)}}),items:ad});return n.registerPlugin(g),()=>{n?.isDestroyed||n.unregisterPlugin(y)}},e[3]=r,e[4]=i,e[5]=n,e[6]=f,e[7]=s,e[8]=p):p=e[8];let h;e[9]!==r||e[10]!==i||e[11]!==n||e[12]!==s?(h=[n,s,r,d,i],e[9]=r,e[10]=i,e[11]=n,e[12]=s,e[13]=h):h=e[13],w.useEffect(p,h);let m;return e[14]!==a?(m={state:a,dispatch:d},e[14]=a,e[15]=m):m=e[15],m}function ad(){return[]}function Qm({editor:t,queryKey:e,queryFn:n,onSelect:r}){const{state:s,dispatch:i}=ld(),o=w.useDeferredValue(s.query),{data:l}=Ca({queryKey:ge.suggestionItems(e,s.open,o),queryFn:()=>s.open?n({query:o}):[]}),a=()=>{i({type:"ON_EXIT"})},d=async(f,p)=>{if(!(s.selectedItem!==null||!s.range)){i({type:"SET_SELECTED_ITEM",payload:f});try{const{view:h}=t,y=h.state.selection.$to.nodeAfter?.text?.startsWith(" "),b=s.range?{...s.range}:{from:0,to:0};y&&s.range&&(b.to+=1),await r({range:b,item:f})===!1?i({type:"SET_SELECTED_ITEM",payload:null}):a()}catch{a()}}},{selectedIndex:u}=rd({editor:t,query:o,items:l,onSelect:d,onClose:a});return{selectedItem:s.selectedItem,items:l,selectedIndex:u,close:a,onSelect:d}}function Gm(t){return t.contentHash??`${t.size}-${t.updatedAt}`}function jt(t,e,n,r){const s=new URLSearchParams(r).toString();return`/api/${encodeURIComponent(t)}/fs/${encodeURIComponent(e)}/${n}${s?`?${s}`:""}`}async function Ye(t,e,n){const r=await fetch(t,e);if(r.ok||n?.allow404&&r.status===404)return r;let s="";try{s=(await r.json()).error??""}catch{}throw new Error(s||`HTTP ${r.status}`)}function Xm(t,e){const n=F.c(15),{org:r}=$e();let s;n[0]!==r.id||n[1]!==e||n[2]!==t?(s=ge.orgFsList(r.id,t,e),n[0]=r.id,n[1]=e,n[2]=t,n[3]=s):s=n[3];let i;n[4]!==r.id||n[5]!==t?(i=(a,d)=>d?.queryKey[1]===r.id&&d.queryKey[2]===t?a:void 0,n[4]=r.id,n[5]=t,n[6]=i):i=n[6];let o;n[7]!==r.slug||n[8]!==e||n[9]!==t?(o=async()=>(await(await Ye(jt(r.slug,t,"list",{path:e}))).json()).entries.toSorted(cd),n[7]=r.slug,n[8]=e,n[9]=t,n[10]=o):o=n[10];let l;return n[11]!==s||n[12]!==i||n[13]!==o?(l={queryKey:s,placeholderData:i,queryFn:o},n[11]=s,n[12]=i,n[13]=o,n[14]=l):l=n[14],Xe(l)}function cd(t,e){return t.kind!==e.kind?t.kind==="dir"?-1:1:t.path.localeCompare(e.path)}function Ym(t,e,n){const r=F.c(15),{org:s}=$e();let i;r[0]!==s.id||r[1]!==e||r[2]!==t?(i=ge.orgFsStat(s.id,t??"",e),r[0]=s.id,r[1]=e,r[2]=t,r[3]=i):i=r[3];const o=t!==null;let l;r[4]!==n?(l=n?.refetchIntervalWhenAbsent?u=>u.state.data?!1:n.refetchIntervalWhenAbsent??!1:void 0,r[4]=n,r[5]=l):l=r[5];let a;r[6]!==s.slug||r[7]!==e||r[8]!==t?(a=async()=>{const u=await Ye(jt(s.slug,t??"","stat",{path:e}),void 0,{allow404:!0});return u.status===404?null:(await u.json()).entry},r[6]=s.slug,r[7]=e,r[8]=t,r[9]=a):a=r[9];let d;return r[10]!==i||r[11]!==o||r[12]!==l||r[13]!==a?(d={queryKey:i,enabled:o,refetchInterval:l,queryFn:a},r[10]=i,r[11]=o,r[12]=l,r[13]=a,r[14]=d):d=r[14],Xe(d)}function Zm(t){const e=F.c(9),{org:n}=$e();let r;e[0]!==n.id||e[1]!==t?(r=ge.orgFsUsage(n.id,t),e[0]=n.id,e[1]=t,e[2]=r):r=e[2];let s;e[3]!==n.slug||e[4]!==t?(s=async()=>await(await Ye(jt(n.slug,t,"usage"))).json(),e[3]=n.slug,e[4]=t,e[5]=s):s=e[5];let i;return e[6]!==r||e[7]!==s?(i={queryKey:r,queryFn:s},e[6]=r,e[7]=s,e[8]=i):i=e[8],Xe(i)}function Jm(t,e){const n=F.c(9),r=t===void 0?60:t,{org:s}=$e();let i;n[0]!==s.id?(i=ge.orgFsRecent(s.id),n[0]=s.id,n[1]=i):i=n[1];const o=e?.enabled;let l;n[2]!==r||n[3]!==s.slug?(l=async()=>(await(await Ye(`/api/${encodeURIComponent(s.slug)}/fs/recent?limit=${r}`)).json()).entries,n[2]=r,n[3]=s.slug,n[4]=l):l=n[4];let a;return n[5]!==i||n[6]!==o||n[7]!==l?(a={queryKey:i,enabled:o,queryFn:l},n[5]=i,n[6]=o,n[7]=l,n[8]=a):a=n[8],Xe(a)}const dd=50;function e1(t,e){const n=F.c(16),{org:r}=$e();let s;n[0]!==r.id||n[1]!==t||n[2]!==e?.prefix||n[3]!==e?.volume?(s=ge.orgFsSearch(r.id,t,e?.volume??"",e?.prefix??""),n[0]=r.id,n[1]=t,n[2]=e?.prefix,n[3]=e?.volume,n[4]=s):s=n[4];const i=t.length>0;let o;n[5]!==r.id?(o=(d,u)=>u?.queryKey[1]===r.id?d:void 0,n[5]=r.id,n[6]=o):o=n[6];let l;n[7]!==r.slug||n[8]!==t||n[9]!==e?(l=async()=>{const d=new URLSearchParams({q:t,limit:String(dd)});return e&&(d.set("volume",e.volume),e.prefix&&d.set("prefix",e.prefix)),(await(await Ye(`/api/${encodeURIComponent(r.slug)}/fs/search?${d}`)).json()).entries},n[7]=r.slug,n[8]=t,n[9]=e,n[10]=l):l=n[10];let a;return n[11]!==s||n[12]!==i||n[13]!==o||n[14]!==l?(a={queryKey:s,enabled:i,placeholderData:o,queryFn:l},n[11]=s,n[12]=i,n[13]=o,n[14]=l,n[15]=a):a=n[15],Xe(a)}function t1(t){const e=F.c(8),{org:n}=$e();let r;e[0]!==n.id?(r=ge.orgFsSkills(n.id),e[0]=n.id,e[1]=r):r=e[1];const s=t?.enabled;let i;e[2]!==n.slug?(i=async()=>{const l=await Ye(`/api/${encodeURIComponent(n.slug)}/fs/skills`),{skills:a}=await l.json();return a.map(ud)},e[2]=n.slug,e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s||e[6]!==i?(o={queryKey:r,enabled:s,queryFn:i},e[4]=r,e[5]=s,e[6]=i,e[7]=o):o=e[7],Xe(o)}function ud(t){return{volume:t.volume,path:t.path}}async function n1(t){const e=await Ye(`/api/${encodeURIComponent(t)}/fs/skills`),{skills:n}=await e.json();return n}async function fd(t,e,n){return(await Ye(jt(t,e,"read",{path:n}))).text()}function s1(t,e){const n=F.c(8);let r;n[0]!==t?(r=ge.fileText(t),n[0]=t,n[1]=r):r=n[1];const s=e?.enabled!==!1&&t!=="";let i;n[2]!==t?(i=async()=>{const l=await fetch(t,{credentials:"include"});return l.ok?await l.text():null},n[2]=t,n[3]=i):i=n[3];let o;return n[4]!==r||n[5]!==s||n[6]!==i?(o={queryKey:r,enabled:s,staleTime:6e4,retry:!1,queryFn:i},n[4]=r,n[5]=s,n[6]=i,n[7]=o):o=n[7],Xe(o)}const hd=new Set(["md","mdx","markdown","txt","text"]),pd=25,gd=64*1024,md=256*1024,xd=4;function bd(t){const e=t.lastIndexOf(".");return e===-1?!1:hd.has(t.slice(e+1).toLowerCase())}async function r1(t,e,n){const r=n?`${n}/`:"",s=f=>f.startsWith(r)?f.slice(r.length):f,i=[],o=[],l=[{path:n,depth:0}];for(;l.length>0;){const f=l.shift();if(!f)break;let p;try{p=(await(await Ye(jt(t,e,"list",{path:f.path}))).json()).entries}catch{continue}for(const h of[...p].sort((m,y)=>m.path.localeCompare(y.path))){if(h.kind==="dir"){f.depth<xd&&l.push({path:h.path,depth:f.depth+1});continue}bd(h.path)&&h.size<=gd&&i.length<pd?i.push(h.path):o.push(s(h.path))}}const a=await Promise.all(i.map(f=>fd(t,e,f).catch(()=>null))),d=[];let u=0;return i.forEach((f,p)=>{const h=a[p];if(h==null||u+h.length>md){o.push(s(f));return}u+=h.length,d.push({relPath:s(f),content:h})}),d.sort((f,p)=>f.relPath==="SKILL.md"?-1:p.relPath==="SKILL.md"?1:f.relPath.localeCompare(p.relPath)),o.sort(),{files:d,omittedPaths:o}}function i1(){const t=F.c(7),{org:e}=$e();let n;t[0]!==e.id?(n=ge.orgFsPublicSets(e.id),t[0]=e.id,t[1]=n):n=t[1];let r;t[2]!==e.slug?(r=async()=>(await(await Ye(`/api/${encodeURIComponent(e.slug)}/fs/public-sets`)).json()).sets,t[2]=e.slug,t[3]=r):r=t[3];let s;return t[4]!==n||t[5]!==r?(s={queryKey:n,staleTime:3e5,queryFn:r},t[4]=n,t[5]=r,t[6]=s):s=t[6],Xe(s)}function yd(t){const e=F.c(3),{org:n}=$e();let r;return e[0]!==n.slug||e[1]!==t?(r=s=>jt(n.slug,t,"read",{path:s}),e[0]=n.slug,e[1]=t,e[2]=r):r=e[2],r}function o1(){const t=F.c(2),{org:e}=$e();let n;return t[0]!==e.slug?(n=(r,s)=>jt(e.slug,r,"read",{path:s}),t[0]=e.slug,t[1]=n):n=t[1],n}function l1(t){const e=F.c(3),{org:n}=$e();let r;return e[0]!==n||e[1]!==t?(r={mutationFn:async s=>(await(await Ye(jt(n.slug,t,"file",{path:s.path}),{method:"PUT",headers:{"content-type":s.contentType??"text/html; charset=utf-8"},body:s.body})).json()).entry},e[0]=n,e[1]=t,e[2]=r):r=e[2],Ge(r)}function a1(t){const e=F.c(18),{org:n}=$e(),r=gn();let s;e[0]!==n||e[1]!==t?(s=async d=>(await(await Ye(jt(n.slug,t,"public",{path:d.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:d.mode,password:d.password})})).json()).entry,e[0]=n,e[1]=t,e[2]=s):s=e[2];let i;e[3]!==n||e[4]!==r||e[5]!==t?(i=async d=>{const u=ge.orgFsStat(n.id,t,d.path);await r.cancelQueries({queryKey:u});const f=r.getQueryData(u),p=d.mode!=="private";return r.setQueryData(u,h=>h&&{...h,readPublic:p,effectivePublic:p,shareMode:d.mode}),{key:u,previous:f}},e[3]=n,e[4]=r,e[5]=t,e[6]=i):i=e[6];let o;e[7]!==r?(o=(d,u,f)=>{f&&r.setQueryData(f.key,f.previous)},e[7]=r,e[8]=o):o=e[8];let l;e[9]!==n||e[10]!==r||e[11]!==t?(l=(d,u,f)=>{r.invalidateQueries({queryKey:ge.orgFsStat(n.id,t,f.path)}),r.invalidateQueries({queryKey:ge.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ge.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ge.orgFsSearchRoot(n.id)})},e[9]=n,e[10]=r,e[11]=t,e[12]=l):l=e[12];let a;return e[13]!==s||e[14]!==i||e[15]!==o||e[16]!==l?(a={mutationFn:s,onMutate:i,onError:o,onSettled:l},e[13]=s,e[14]=i,e[15]=o,e[16]=l,e[17]=a):a=e[17],Ge(a)}function kd(t){const e=F.c(33),{org:n}=$e(),r=gn();let s;e[0]!==n||e[1]!==r||e[2]!==t?(s=()=>{r.invalidateQueries({queryKey:ge.orgFsVolume(n.id,t)}),r.invalidateQueries({queryKey:ge.orgFsRecent(n.id)}),r.invalidateQueries({queryKey:ge.orgFsSearchRoot(n.id)})},e[0]=n,e[1]=r,e[2]=t,e[3]=s):s=e[3];const i=s;let o;e[4]!==n||e[5]!==t?(o=async k=>{const S=(await Promise.allSettled(k.files.map(T=>{const C=k.dir?`${k.dir}/${T.name}`:T.name;return Ye(jt(n.slug,t,"file",{path:C}),{method:"PUT",headers:{"content-type":T.type||"application/octet-stream"},body:T})}))).find(vd);if(S)throw S.reason},e[4]=n,e[5]=t,e[6]=o):o=e[6];let l;e[7]!==i||e[8]!==o?(l={mutationFn:o,onSettled:i},e[7]=i,e[8]=o,e[9]=l):l=e[9];const a=Ge(l);let d;e[10]!==n||e[11]!==t?(d=async k=>{await Ye(jt(n.slug,t,"dir",{path:k}),{method:"POST"})},e[10]=n,e[11]=t,e[12]=d):d=e[12];let u;e[13]!==i||e[14]!==d?(u={mutationFn:d,onSuccess:i},e[13]=i,e[14]=d,e[15]=u):u=e[15];const f=Ge(u);let p;e[16]!==n||e[17]!==t?(p=async k=>{await Ye(jt(n.slug,t,"file",{path:k}),{method:"DELETE"})},e[16]=n,e[17]=t,e[18]=p):p=e[18];let h;e[19]!==i||e[20]!==p?(h={mutationFn:p,onSuccess:i},e[19]=i,e[20]=p,e[21]=h):h=e[21];const m=Ge(h);let y;e[22]!==n||e[23]!==t?(y=async k=>{await Ye(jt(n.slug,t,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(k)})},e[22]=n,e[23]=t,e[24]=y):y=e[24];let b;e[25]!==i||e[26]!==y?(b={mutationFn:y,onSuccess:i},e[25]=i,e[26]=y,e[27]=b):b=e[27];const g=Ge(b);let x;return e[28]!==f||e[29]!==g||e[30]!==m||e[31]!==a?(x={upload:a,mkdir:f,remove:m,move:g},e[28]=f,e[29]=g,e[30]=m,e[31]=a,e[32]=x):x=e[32],x}function vd(t){return t.status==="rejected"}function wd(t){return t?t.run_in_progress?"generating":t.scanned_at?"ready":"none":"none"}const Sd=2e4;function Cd(t){if(typeof t!="string"||!t)return null;try{return new URL(t).hostname||null}catch{return null}}function jd(){const t=F.c(17),{org:e}=$e(),n=Ua.COMMERCE_DISCOVERY(e.id);let r;t[0]!==e.id||t[1]!==e.slug?(r=Mi({connectionId:Ko,orgId:e.id,orgSlug:e.slug}),t[0]=e.id,t[1]=e.slug,t[2]=r):r=t[2];const{data:s}=Xe(r),o=Xe({queryKey:ge.commerceDiscoveryConnection(e.id,n),enabled:!!s,retry:!1,staleTime:6e4,queryFn:async()=>{if(!s)throw new Error("selfClient not ready");const k=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}});return zr(k)}}).data?.item??null,{data:l}=Xe({...Mi({connectionId:n,orgId:e.id,orgSlug:e.slug}),enabled:!!o}),a=ge.commerceDiscoveryDiagnostic(e.id,n),d=!!l;let u;t[3]!==l?(u=async()=>{if(!l)throw new Error("cdClient not ready");const k=await l.callTool({name:Ho,arguments:{}});return zr(k).diagnostic??null},t[3]=l,t[4]=u):u=t[4];let f;t[5]!==a||t[6]!==d||t[7]!==u?(f={queryKey:a,enabled:d,retry:1,refetchInterval:Td,queryFn:u},t[5]=a,t[6]=d,t[7]=u,t[8]=f):f=t[8];const p=Xe(f),h=p.data??null,m=p.isSuccess,y=o?.metadata?.siteUrl;let b;t[9]!==y?(b=Cd(y),t[9]=y,t[10]=b):b=t[10];const g=l??null;let x;return t[11]!==n||t[12]!==p.isSuccess||t[13]!==h||t[14]!==b||t[15]!==g?(x={diagnostic:h,isSuccess:m,host:b,connectionId:n,cdClient:g},t[11]=n,t[12]=p.isSuccess,t[13]=h,t[14]=b,t[15]=g,t[16]=x):x=t[16],x}function Td(t){return t.state.status!=="error"&&wd(t.state.data)==="generating"?Sd:!1}function Nd(t,e){return{to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:qa(t.id),main:zc(e,Ho)}}}function Dd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const hr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ss(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function hi(t){return"nodeType"in t}function rt(t){var e,n;return t?ss(t)?t:hi(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function pi(t){const{Document:e}=rt(t);return t instanceof e}function Rs(t){return ss(t)?!1:t instanceof rt(t).HTMLElement}function cl(t){return t instanceof rt(t).SVGElement}function rs(t){return t?ss(t)?t.document:hi(t)?pi(t)?t:Rs(t)||cl(t)?t.ownerDocument:document:document:document}const Pt=hr?w.useLayoutEffect:w.useEffect;function pr(t){const e=w.useRef(t);return Pt(()=>{e.current=t}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function Rd(){const t=w.useRef(null),e=w.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Ss(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return Pt(()=>{n.current!==t&&(n.current=t)},e),n}function Es(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Zs(t){const e=pr(t),n=w.useRef(null),r=w.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function Js(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let Dr={};function Is(t,e){return w.useMemo(()=>{if(e)return e;const n=Dr[t]==null?0:Dr[t]+1;return Dr[t]=n,t+"-"+n},[t,e])}function dl(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const l=Object.entries(o);for(const[a,d]of l){const u=i[a];u!=null&&(i[a]=u+t*d)}return i},{...e})}}const Zn=dl(1),Cs=dl(-1);function Ed(t){return"clientX"in t&&"clientY"in t}function gr(t){if(!t)return!1;const{KeyboardEvent:e}=rt(t.target);return e&&t instanceof e}function Id(t){if(!t)return!1;const{TouchEvent:e}=rt(t.target);return e&&t instanceof e}function er(t){if(Id(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Ed(t)?{x:t.clientX,y:t.clientY}:null}const on=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[on.Translate.toString(t),on.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),Pi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _d(t){return t.matches(Pi)?t:t.querySelector(Pi)}const Ad={display:"none"};function Bd(t){let{id:e,value:n}=t;return De.createElement("div",{id:e,style:Ad},n)}function Od(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return De.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function $d(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const ul=w.createContext(null);function Md(t){const e=w.useContext(ul);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function zd(){const[t]=w.useState(()=>new Set),e=w.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[w.useCallback(r=>{let{type:s,event:i}=r;t.forEach(o=>{var l;return(l=o[s])==null?void 0:l.call(o,i)})},[t]),e]}const Ld={draggable:`
3
- To pick up a draggable item, press the space bar.
4
- While dragging, use the arrow keys to move the item.
5
- Press space again to drop the item in its new position, or press escape to cancel.
6
- `},Pd={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function Fd(t){let{announcements:e=Pd,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Ld}=t;const{announce:i,announcement:o}=$d(),l=Is("DndLiveRegion"),[a,d]=w.useState(!1);if(w.useEffect(()=>{d(!0)},[]),Md(w.useMemo(()=>({onDragStart(f){let{active:p}=f;i(e.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;e.onDragMove&&i(e.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;i(e.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;i(e.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;i(e.onDragCancel({active:p,over:h}))}}),[i,e])),!a)return null;const u=De.createElement(De.Fragment,null,De.createElement(Bd,{id:r,value:s.draggable}),De.createElement(Od,{id:l,announcement:o}));return n?sn.createPortal(u,n):u}var qe;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(qe||(qe={}));function tr(){}function Fi(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Ud(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const Ft=Object.freeze({x:0,y:0});function fl(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function qd(t,e){const n=er(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function hl(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function Kd(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function Ui(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function pl(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function qi(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const c1=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=qi(e,e.left,e.top),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=fl(qi(a),s);i.push({id:l,data:{droppableContainer:o,value:d}})}}return i.sort(hl)},gl=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=Ui(e),i=[];for(const o of r){const{id:l}=o,a=n.get(l);if(a){const d=Ui(a),u=s.reduce((p,h,m)=>p+fl(d[m],h),0),f=Number((u/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:f}})}}return i.sort(hl)};function Hd(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),o=s-r,l=i-n;if(r<s&&n<i){const a=e.width*e.height,d=t.width*t.height,u=o*l,f=u/(a+d-u);return Number(f.toFixed(4))}return 0}const Wd=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const a=Hd(l,e);a>0&&s.push({id:o,data:{droppableContainer:i,value:a}})}}return s.sort(Kd)};function Vd(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function ml(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ft}function Qd(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+t*l.y,bottom:o.bottom+t*l.y,left:o.left+t*l.x,right:o.right+t*l.x}),{...n})}}const Gd=Qd(1);function xl(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function Xd(t,e,n){const r=xl(e);if(!r)return t;const{scaleX:s,scaleY:i,x:o,y:l}=r,a=t.left-o-(1-s)*parseFloat(n),d=t.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=s?t.width/s:t.width,f=i?t.height/i:t.height;return{width:u,height:f,top:d,right:a+u,bottom:d+f,left:a}}const Yd={ignoreTransform:!1};function is(t,e){e===void 0&&(e=Yd);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:u}=rt(t).getComputedStyle(t);d&&(n=Xd(n,d,u))}const{top:r,left:s,width:i,height:o,bottom:l,right:a}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:a}}function Ki(t){return is(t,{ignoreTransform:!0})}function Zd(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Jd(t,e){return e===void 0&&(e=rt(t).getComputedStyle(t)),e.position==="fixed"}function eu(t,e){e===void 0&&(e=rt(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function mr(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(pi(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Rs(s)||cl(s)||n.includes(s))return n;const i=rt(t).getComputedStyle(s);return s!==t&&eu(s,i)&&n.push(s),Jd(s,i)?n:r(s.parentNode)}return t?r(t):n}function bl(t){const[e]=mr(t,1);return e??null}function Rr(t){return!hr||!t?null:ss(t)?t:hi(t)?pi(t)||t===rs(t).scrollingElement?window:Rs(t)?t:null:null}function yl(t){return ss(t)?t.scrollX:t.scrollLeft}function kl(t){return ss(t)?t.scrollY:t.scrollTop}function Lr(t){return{x:yl(t),y:kl(t)}}var Ve;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Ve||(Ve={}));function vl(t){return!hr||!t?!1:t===document.scrollingElement}function wl(t){const e={x:0,y:0},n=vl(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,o=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:e}}const tu={x:.2,y:.2};function nu(t,e,n,r,s){let{top:i,left:o,right:l,bottom:a}=n;r===void 0&&(r=10),s===void 0&&(s=tu);const{isTop:d,isBottom:u,isLeft:f,isRight:p}=wl(t),h={x:0,y:0},m={x:0,y:0},y={height:e.height*s.y,width:e.width*s.x};return!d&&i<=e.top+y.height?(h.y=Ve.Backward,m.y=r*Math.abs((e.top+y.height-i)/y.height)):!u&&a>=e.bottom-y.height&&(h.y=Ve.Forward,m.y=r*Math.abs((e.bottom-y.height-a)/y.height)),!p&&l>=e.right-y.width?(h.x=Ve.Forward,m.x=r*Math.abs((e.right-y.width-l)/y.width)):!f&&o<=e.left+y.width&&(h.x=Ve.Backward,m.x=r*Math.abs((e.left+y.width-o)/y.width)),{direction:h,speed:m}}function su(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Sl(t){return t.reduce((e,n)=>Zn(e,Lr(n)),Ft)}function ru(t){return t.reduce((e,n)=>e+yl(n),0)}function iu(t){return t.reduce((e,n)=>e+kl(n),0)}function Cl(t,e){if(e===void 0&&(e=is),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);bl(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const ou=[["x",["left","right"],ru],["y",["top","bottom"],iu]];class gi{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=mr(n),s=Sl(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,o,l]of ou)for(const a of o)Object.defineProperty(this,a,{get:()=>{const d=l(r),u=s[i]-d;return this.rect[a]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ys{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function lu(t){const{EventTarget:e}=rt(t);return t instanceof e?t:rs(t)}function Er(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Rt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Rt||(Rt={}));function Hi(t){t.preventDefault()}function au(t){t.stopPropagation()}var de;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(de||(de={}));const jl={start:[de.Space,de.Enter],cancel:[de.Esc],end:[de.Space,de.Enter,de.Tab]},cu=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case de.Right:return{...n,x:n.x+25};case de.Left:return{...n,x:n.x-25};case de.Down:return{...n,y:n.y+25};case de.Up:return{...n,y:n.y-25}}};class mi{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new ys(rs(n)),this.windowListeners=new ys(rt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Rt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Cl(r),n(Ft)}handleKeyDown(e){if(gr(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=jl,coordinateGetter:o=cu,scrollBehavior:l="smooth"}=s,{code:a}=e;if(i.end.includes(a)){this.handleEnd(e);return}if(i.cancel.includes(a)){this.handleCancel(e);return}const{collisionRect:d}=r.current,u=d?{x:d.left,y:d.top}:Ft;this.referenceCoordinates||(this.referenceCoordinates=u);const f=o(e,{active:n,context:r.current,currentCoordinates:u});if(f){const p=Cs(f,u),h={x:0,y:0},{scrollableAncestors:m}=r.current;for(const y of m){const b=e.code,{isTop:g,isRight:x,isLeft:k,isBottom:v,maxScroll:S,minScroll:T}=wl(y),C=su(y),j={x:Math.min(b===de.Right?C.right-C.width/2:C.right,Math.max(b===de.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(b===de.Down?C.bottom-C.height/2:C.bottom,Math.max(b===de.Down?C.top:C.top+C.height/2,f.y))},D=b===de.Right&&!x||b===de.Left&&!k,R=b===de.Down&&!v||b===de.Up&&!g;if(D&&j.x!==f.x){const N=y.scrollLeft+p.x,I=b===de.Right&&N<=S.x||b===de.Left&&N>=T.x;if(I&&!p.y){y.scrollTo({left:N,behavior:l});return}I?h.x=y.scrollLeft-N:h.x=b===de.Right?y.scrollLeft-S.x:y.scrollLeft-T.x,h.x&&y.scrollBy({left:-h.x,behavior:l});break}else if(R&&j.y!==f.y){const N=y.scrollTop+p.y,I=b===de.Down&&N<=S.y||b===de.Up&&N>=T.y;if(I&&!p.x){y.scrollTo({top:N,behavior:l});return}I?h.y=y.scrollTop-N:h.y=b===de.Down?y.scrollTop-S.y:y.scrollTop-T.y,h.y&&y.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(e,Zn(Cs(f,this.referenceCoordinates),h))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}mi.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=jl,onActivation:s}=e,{active:i}=n;const{code:o}=t.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Wi(t){return!!(t&&"distance"in t)}function Vi(t){return!!(t&&"delay"in t)}class xi{constructor(e,n,r){var s;r===void 0&&(r=lu(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:o}=i;this.props=e,this.events=n,this.document=rs(o),this.documentListeners=new ys(this.document),this.listeners=new ys(r),this.windowListeners=new ys(rt(o)),this.initialCoordinates=(s=er(i))!=null?s:Ft,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Rt.Resize,this.handleCancel),this.windowListeners.add(Rt.DragStart,Hi),this.windowListeners.add(Rt.VisibilityChange,this.handleCancel),this.windowListeners.add(Rt.ContextMenu,Hi),this.documentListeners.add(Rt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Vi(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Wi(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Rt.Click,au,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Rt.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const a=(n=er(e))!=null?n:Ft,d=Cs(s,a);if(!r&&l){if(Wi(l)){if(l.tolerance!=null&&Er(d,l.tolerance))return this.handleCancel();if(Er(d,l.distance))return this.handleStart()}if(Vi(l)&&Er(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),o(a)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===de.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const du={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bi extends xi{constructor(e){const{event:n}=e,r=rs(n.target);super(e,du,r)}}bi.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const uu={move:{name:"mousemove"},end:{name:"mouseup"}};var Pr;(function(t){t[t.RightClick=2]="RightClick"})(Pr||(Pr={}));class fu extends xi{constructor(e){super(e,uu,rs(e.event.target))}}fu.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Pr.RightClick?!1:(r?.({event:n}),!0)}}];const Ir={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hu extends xi{constructor(e){super(e,Ir)}static setup(){return window.addEventListener(Ir.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Ir.move.name,e)};function e(){}}}hu.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var ks;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ks||(ks={}));var nr;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(nr||(nr={}));function pu(t){let{acceleration:e,activator:n=ks.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=nr.TreeOrder,pointerCoordinates:a,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:p}=t;const h=mu({delta:f,disabled:!i}),[m,y]=Rd(),b=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),x=w.useMemo(()=>{switch(n){case ks.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case ks.DraggableRect:return s}},[n,s,a]),k=w.useRef(null),v=w.useCallback(()=>{const T=k.current;if(!T)return;const C=b.current.x*g.current.x,j=b.current.y*g.current.y;T.scrollBy(C,j)},[]),S=w.useMemo(()=>l===nr.TreeOrder?[...d].reverse():d,[l,d]);w.useEffect(()=>{if(!i||!d.length||!x){y();return}for(const T of S){if(r?.(T)===!1)continue;const C=d.indexOf(T),j=u[C];if(!j)continue;const{direction:D,speed:R}=nu(T,j,x,e,p);for(const N of["x","y"])h[N][D[N]]||(R[N]=0,D[N]=0);if(R.x>0||R.y>0){y(),k.current=T,m(v,o),b.current=R,g.current=D;return}}b.current={x:0,y:0},g.current={x:0,y:0},y()},[e,v,r,y,i,o,JSON.stringify(x),JSON.stringify(h),m,d,S,u,JSON.stringify(p)])}const gu={x:{[Ve.Backward]:!1,[Ve.Forward]:!1},y:{[Ve.Backward]:!1,[Ve.Forward]:!1}};function mu(t){let{delta:e,disabled:n}=t;const r=Js(e);return Es(s=>{if(n||!r||!s)return gu;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Ve.Backward]:s.x[Ve.Backward]||i.x===-1,[Ve.Forward]:s.x[Ve.Forward]||i.x===1},y:{[Ve.Backward]:s.y[Ve.Backward]||i.y===-1,[Ve.Forward]:s.y[Ve.Forward]||i.y===1}}},[n,e,r])}function xu(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Es(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function bu(t,e){return w.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:e(o.handler,r)}));return[...n,...i]},[]),[t,e])}var js;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(js||(js={}));var Fr;(function(t){t.Optimized="optimized"})(Fr||(Fr={}));const Qi=new Map;function yu(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,o]=w.useState(null),{frequency:l,measure:a,strategy:d}=s,u=w.useRef(t),f=b(),p=Ss(f),h=w.useCallback(function(g){g===void 0&&(g=[]),!p.current&&o(x=>x===null?g:x.concat(g.filter(k=>!x.includes(k))))},[p]),m=w.useRef(null),y=Es(g=>{if(f&&!n)return Qi;if(!g||g===Qi||u.current!==t||i!=null){const x=new Map;for(let k of t){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){x.set(k.id,k.rect.current);continue}const v=k.node.current,S=v?new gi(a(v),v):null;k.rect.current=S,S&&x.set(k.id,S)}return x}return g},[t,i,n,f,a]);return w.useEffect(()=>{u.current=t},[t]),w.useEffect(()=>{f||h()},[n,f]),w.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),w.useEffect(()=>{f||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{h(),m.current=null},l))},[l,f,h,...r]),{droppableRects:y,measureDroppableContainers:h,measuringScheduled:i!=null};function b(){switch(d){case js.Always:return!1;case js.BeforeDragging:return n;default:return!n}}}function yi(t,e){return Es(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function ku(t,e){return yi(t,e)}function vu(t){let{callback:e,disabled:n}=t;const r=pr(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function xr(t){let{callback:e,disabled:n}=t;const r=pr(e),s=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return w.useEffect(()=>()=>s?.disconnect(),[s]),s}function wu(t){return new gi(is(t),t)}function Gi(t,e,n){e===void 0&&(e=wu);const[r,s]=w.useState(null);function i(){s(a=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=a??n)!=null?d:null}const u=e(t);return JSON.stringify(a)===JSON.stringify(u)?a:u})}const o=vu({callback(a){if(t)for(const d of a){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(t)){i();break}}}}),l=xr({callback:i});return Pt(()=>{i(),t?(l?.observe(t),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[t]),r}function Su(t){const e=yi(t);return ml(t,e)}const Xi=[];function Cu(t){const e=w.useRef(t),n=Es(r=>t?r&&r!==Xi&&t&&e.current&&t.parentNode===e.current.parentNode?r:mr(t):Xi,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function ju(t){const[e,n]=w.useState(null),r=w.useRef(t),s=w.useCallback(i=>{const o=Rr(i.target);o&&n(l=>l?(l.set(o,Lr(o)),new Map(l)):null)},[]);return w.useEffect(()=>{const i=r.current;if(t!==i){o(i);const l=t.map(a=>{const d=Rr(a);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Lr(d)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=t}return()=>{o(t),o(i)};function o(l){l.forEach(a=>{const d=Rr(a);d?.removeEventListener("scroll",s)})}},[s,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,o)=>Zn(i,o),Ft):Sl(t):Ft,[t,e])}function Yi(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==Ft;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Cs(t,n.current):Ft}function Tu(t){w.useEffect(()=>{if(!hr)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function Nu(t,e){return w.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,e)},n},{}),[t,e])}function Tl(t){return w.useMemo(()=>t?Zd(t):null,[t])}const Zi=[];function Du(t,e){e===void 0&&(e=is);const[n]=t,r=Tl(n?rt(n):null),[s,i]=w.useState(Zi);function o(){i(()=>t.length?t.map(a=>vl(a)?r:new gi(e(a),a)):Zi)}const l=xr({callback:o});return Pt(()=>{l?.disconnect(),o(),t.forEach(a=>l?.observe(a))},[t]),s}function Nl(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Rs(e)?e:t}function Ru(t){let{measure:e}=t;const[n,r]=w.useState(null),s=w.useCallback(d=>{for(const{target:u}of d)if(Rs(u)){r(f=>{const p=e(u);return f?{...f,width:p.width,height:p.height}:p});break}},[e]),i=xr({callback:s}),o=w.useCallback(d=>{const u=Nl(d);i?.disconnect(),u&&i?.observe(u),r(u?e(u):null)},[e,i]),[l,a]=Zs(o);return w.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Eu=[{sensor:bi,options:{}},{sensor:mi,options:{}}],Iu={current:{}},Xs={draggable:{measure:Ki},droppable:{measure:Ki,strategy:js.WhileDragging,frequency:Fr.Optimized},dragOverlay:{measure:is}};class vs extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const _u={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tr},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xs,measureDroppableContainers:tr,windowRect:null,measuringScheduled:!1},Dl={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tr,draggableNodes:new Map,over:null,measureDroppableContainers:tr},_s=w.createContext(Dl),Rl=w.createContext(_u);function Au(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vs}}}function Bu(t,e){switch(e.type){case qe.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case qe.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case qe.DragEnd:case qe.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qe.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new vs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case qe.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const o=new vs(t.droppable.containers);return o.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:o}}}case qe.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new vs(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function Ou(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=w.useContext(_s),i=Js(r),o=Js(n?.id);return w.useEffect(()=>{if(!e&&!r&&i&&o!=null){if(!gr(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:a,node:d}=l;if(!a.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[a.current,d.current]){if(!u)continue;const f=_d(u);if(f){f.focus();break}}})}},[r,e,s,o,i]),null}function El(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function $u(t){return w.useMemo(()=>({draggable:{...Xs.draggable,...t?.draggable},droppable:{...Xs.droppable,...t?.droppable},dragOverlay:{...Xs.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function Mu(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=w.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Pt(()=>{if(!o&&!l||!e){i.current=!1;return}if(i.current||!r)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const u=n(d),f=ml(u,r);if(o||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=bl(d);p&&p.scrollBy({top:f.y,left:f.x})}},[e,o,l,r,n])}const br=w.createContext({...Ft,scaleX:1,scaleY:1});var nn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(nn||(nn={}));const zu=w.memo(function(e){var n,r,s,i;let{id:o,accessibility:l,autoScroll:a=!0,children:d,sensors:u=Eu,collisionDetection:f=Wd,measuring:p,modifiers:h,...m}=e;const y=w.useReducer(Bu,void 0,Au),[b,g]=y,[x,k]=zd(),[v,S]=w.useState(nn.Uninitialized),T=v===nn.Initialized,{draggable:{active:C,nodes:j,translate:D},droppable:{containers:R}}=b,N=C!=null?j.get(C):null,I=w.useRef({initial:null,translated:null}),A=w.useMemo(()=>{var ke;return C!=null?{id:C,data:(ke=N?.data)!=null?ke:Iu,rect:I}:null},[C,N]),_=w.useRef(null),[M,E]=w.useState(null),[O,z]=w.useState(null),B=Ss(m,Object.values(m)),P=Is("DndDescribedBy",o),L=w.useMemo(()=>R.getEnabled(),[R]),U=$u(p),{droppableRects:H,measureDroppableContainers:W,measuringScheduled:V}=yu(L,{dragging:T,dependencies:[D.x,D.y],config:U.droppable}),Z=xu(j,C),te=w.useMemo(()=>O?er(O):null,[O]),ie=nt(),ne=ku(Z,U.draggable.measure);Mu({activeNode:C!=null?j.get(C):null,config:ie.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const q=Gi(Z,U.draggable.measure,ne),X=Gi(Z?Z.parentElement:null),J=w.useRef({activatorEvent:null,active:null,activeNode:Z,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),oe=R.getNodeFor((n=J.current.over)==null?void 0:n.id),G=Ru({measure:U.dragOverlay.measure}),K=(r=G.nodeRef.current)!=null?r:Z,Y=T?(s=G.rect)!=null?s:q:null,ae=!!(G.nodeRef.current&&G.rect),he=Su(ae?null:q),xe=Tl(K?rt(K):null),ye=Cu(T?oe??Z:null),Ce=Du(ye),Me=El(h,{transform:{x:D.x-he.x,y:D.y-he.y,scaleX:1,scaleY:1},activatorEvent:O,active:A,activeNodeRect:q,containerNodeRect:X,draggingNodeRect:Y,over:J.current.over,overlayNodeRect:G.rect,scrollableAncestors:ye,scrollableAncestorRects:Ce,windowRect:xe}),Ze=te?Zn(te,D):null,ct=ju(ye),Tt=Yi(ct),Bt=Yi(ct,[q]),ce=Zn(Me,Tt),dt=Y?Gd(Y,Me):null,je=A&&dt?f({active:A,collisionRect:dt,droppableRects:H,droppableContainers:L,pointerCoordinates:Ze}):null,ln=pl(je,"id"),[Ke,it]=w.useState(null),se=ae?Me:Zn(Me,Bt),ut=Vd(se,(i=Ke?.rect)!=null?i:null,q),Je=w.useRef(null),pe=w.useCallback((ke,ve)=>{let{sensor:we,options:Ae}=ve;if(_.current==null)return;const Ee=j.get(_.current);if(!Ee)return;const Te=ke.nativeEvent,Se=new we({active:_.current,activeNode:Ee,event:Te,options:Ae,context:J,onAbort(fe){if(!j.get(fe))return;const{onDragAbort:Re}=B.current,Ie={id:fe};Re?.(Ie),x({type:"onDragAbort",event:Ie})},onPending(fe,Oe,Re,Ie){if(!j.get(fe))return;const{onDragPending:Pe}=B.current,Fe={id:fe,constraint:Oe,initialCoordinates:Re,offset:Ie};Pe?.(Fe),x({type:"onDragPending",event:Fe})},onStart(fe){const Oe=_.current;if(Oe==null)return;const Re=j.get(Oe);if(!Re)return;const{onDragStart:Ie}=B.current,Le={activatorEvent:Te,active:{id:Oe,data:Re.data,rect:I}};sn.unstable_batchedUpdates(()=>{Ie?.(Le),S(nn.Initializing),g({type:qe.DragStart,initialCoordinates:fe,active:Oe}),x({type:"onDragStart",event:Le}),E(Je.current),z(Te)})},onMove(fe){g({type:qe.DragMove,coordinates:fe})},onEnd:Be(qe.DragEnd),onCancel:Be(qe.DragCancel)});Je.current=Se;function Be(fe){return async function(){const{active:Re,collisions:Ie,over:Le,scrollAdjustedTranslate:Pe}=J.current;let Fe=null;if(Re&&Pe){const{cancelDrop:Qe}=B.current;Fe={activatorEvent:Te,active:Re,collisions:Ie,delta:Pe,over:Le},fe===qe.DragEnd&&typeof Qe=="function"&&await Promise.resolve(Qe(Fe))&&(fe=qe.DragCancel)}_.current=null,sn.unstable_batchedUpdates(()=>{g({type:fe}),S(nn.Uninitialized),it(null),E(null),z(null),Je.current=null;const Qe=fe===qe.DragEnd?"onDragEnd":"onDragCancel";if(Fe){const ot=B.current[Qe];ot?.(Fe),x({type:Qe,event:Fe})}})}}},[j]),Ut=w.useCallback((ke,ve)=>(we,Ae)=>{const Ee=we.nativeEvent,Te=j.get(Ae);if(_.current!==null||!Te||Ee.dndKit||Ee.defaultPrevented)return;const Se={active:Te};ke(we,ve.options,Se)===!0&&(Ee.dndKit={capturedBy:ve.sensor},_.current=Ae,pe(we,ve))},[j,pe]),He=bu(u,Ut);Tu(u),Pt(()=>{q&&v===nn.Initializing&&S(nn.Initialized)},[q,v]),w.useEffect(()=>{const{onDragMove:ke}=B.current,{active:ve,activatorEvent:we,collisions:Ae,over:Ee}=J.current;if(!ve||!we)return;const Te={active:ve,activatorEvent:we,collisions:Ae,delta:{x:ce.x,y:ce.y},over:Ee};sn.unstable_batchedUpdates(()=>{ke?.(Te),x({type:"onDragMove",event:Te})})},[ce.x,ce.y]),w.useEffect(()=>{const{active:ke,activatorEvent:ve,collisions:we,droppableContainers:Ae,scrollAdjustedTranslate:Ee}=J.current;if(!ke||_.current==null||!ve||!Ee)return;const{onDragOver:Te}=B.current,Se=Ae.get(ln),Be=Se&&Se.rect.current?{id:Se.id,rect:Se.rect.current,data:Se.data,disabled:Se.disabled}:null,fe={active:ke,activatorEvent:ve,collisions:we,delta:{x:Ee.x,y:Ee.y},over:Be};sn.unstable_batchedUpdates(()=>{it(Be),Te?.(fe),x({type:"onDragOver",event:fe})})},[ln]),Pt(()=>{J.current={activatorEvent:O,active:A,activeNode:Z,collisionRect:dt,collisions:je,droppableRects:H,draggableNodes:j,draggingNode:K,draggingNodeRect:Y,droppableContainers:R,over:Ke,scrollableAncestors:ye,scrollAdjustedTranslate:ce},I.current={initial:Y,translated:dt}},[A,Z,je,dt,j,K,Y,H,R,Ke,ye,ce]),pu({...ie,delta:D,draggingRect:dt,pointerCoordinates:Ze,scrollableAncestors:ye,scrollableAncestorRects:Ce});const et=w.useMemo(()=>({active:A,activeNode:Z,activeNodeRect:q,activatorEvent:O,collisions:je,containerNodeRect:X,dragOverlay:G,draggableNodes:j,droppableContainers:R,droppableRects:H,over:Ke,measureDroppableContainers:W,scrollableAncestors:ye,scrollableAncestorRects:Ce,measuringConfiguration:U,measuringScheduled:V,windowRect:xe}),[A,Z,q,O,je,X,G,j,R,H,Ke,W,ye,Ce,U,V,xe]),tt=w.useMemo(()=>({activatorEvent:O,activators:He,active:A,activeNodeRect:q,ariaDescribedById:{draggable:P},dispatch:g,draggableNodes:j,over:Ke,measureDroppableContainers:W}),[O,He,A,q,g,P,j,Ke,W]);return De.createElement(ul.Provider,{value:k},De.createElement(_s.Provider,{value:tt},De.createElement(Rl.Provider,{value:et},De.createElement(br.Provider,{value:ut},d)),De.createElement(Ou,{disabled:l?.restoreFocus===!1})),De.createElement(Fd,{...l,hiddenTextDescribedById:P}));function nt(){const ke=M?.autoScrollEnabled===!1,ve=typeof a=="object"?a.enabled===!1:a===!1,we=T&&!ke&&!ve;return typeof a=="object"?{...a,enabled:we}:{enabled:we}}}),Lu=w.createContext(null),Ji="button",Pu="Draggable";function Fu(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=Is(Pu),{activators:o,activatorEvent:l,active:a,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:p}=w.useContext(_s),{role:h=Ji,roleDescription:m="draggable",tabIndex:y=0}=s??{},b=a?.id===e,g=w.useContext(b?br:Lu),[x,k]=Zs(),[v,S]=Zs(),T=Nu(o,e),C=Ss(n);Pt(()=>(f.set(e,{id:e,key:i,node:x,activatorNode:v,data:C}),()=>{const D=f.get(e);D&&D.key===i&&f.delete(e)}),[f,e]);const j=w.useMemo(()=>({role:h,tabIndex:y,"aria-disabled":r,"aria-pressed":b&&h===Ji?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,h,y,b,m,u.draggable]);return{active:a,activatorEvent:l,activeNodeRect:d,attributes:j,isDragging:b,listeners:r?void 0:T,node:x,over:p,setNodeRef:k,setActivatorNodeRef:S,transform:g}}function Il(){return w.useContext(Rl)}const Uu="Droppable",qu={timeout:25};function _l(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=Is(Uu),{active:o,dispatch:l,over:a,measureDroppableContainers:d}=w.useContext(_s),u=w.useRef({disabled:n}),f=w.useRef(!1),p=w.useRef(null),h=w.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:b}={...qu,...s},g=Ss(y??r),x=w.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{d(Array.isArray(g.current)?g.current:[g.current]),h.current=null},b)},[b]),k=xr({callback:x,disabled:m||!o}),v=w.useCallback((j,D)=>{k&&(D&&(k.unobserve(D),f.current=!1),j&&k.observe(j))},[k]),[S,T]=Zs(v),C=Ss(e);return w.useEffect(()=>{!k||!S.current||(k.disconnect(),f.current=!1,k.observe(S.current))},[S,k]),w.useEffect(()=>(l({type:qe.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:p,data:C}}),()=>l({type:qe.UnregisterDroppable,key:i,id:r})),[r]),w.useEffect(()=>{n!==u.current.disabled&&(l({type:qe.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,l]),{active:o,rect:p,isOver:a?.id===r,node:S,over:a,setNodeRef:T}}function Ku(t){let{animation:e,children:n}=t;const[r,s]=w.useState(null),[i,o]=w.useState(null),l=Js(n);return!n&&!r&&l&&s(l),Pt(()=>{if(!i)return;const a=r?.key,d=r?.props.id;if(a==null||d==null){s(null);return}Promise.resolve(e(d,i)).then(()=>{s(null)})},[e,r,i]),De.createElement(De.Fragment,null,n,r?w.cloneElement(r,{ref:o}):null)}const Hu={x:0,y:0,scaleX:1,scaleY:1};function Wu(t){let{children:e}=t;return De.createElement(_s.Provider,{value:Dl},De.createElement(br.Provider,{value:Hu},e))}const Vu={position:"fixed",touchAction:"none"},Qu=t=>gr(t)?"transform 250ms ease":void 0,Gu=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:a,transform:d,transition:u=Qu}=t;if(!l)return null;const f=s?d:{...d,scaleX:1,scaleY:1},p={...Vu,width:l.width,height:l.height,top:l.top,left:l.left,transform:on.Transform.toString(f),transformOrigin:s&&r?qd(r,l):void 0,transition:typeof u=="function"?u(r):u,...a};return De.createElement(n,{className:o,style:p,ref:e},i)}),Xu=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:o}=t;if(i!=null&&i.active)for(const[l,a]of Object.entries(i.active))a!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,a));if(i!=null&&i.dragOverlay)for(const[l,a]of Object.entries(i.dragOverlay))a!==void 0&&r.node.style.setProperty(l,a);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[a,d]of Object.entries(s))n.node.style.setProperty(a,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},Yu=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:on.Transform.toString(e)},{transform:on.Transform.toString(n)}]},Zu={duration:250,easing:"ease",keyframes:Yu,sideEffects:Xu({styles:{active:{opacity:"0"}}})};function Ju(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return pr((i,o)=>{if(e===null)return;const l=n.get(i);if(!l)return;const a=l.node.current;if(!a)return;const d=Nl(o);if(!d)return;const{transform:u}=rt(o).getComputedStyle(o),f=xl(u);if(!f)return;const p=typeof e=="function"?e:ef(e);return Cl(a,s.draggable.measure),p({active:{id:i,data:l.data,node:a,rect:s.draggable.measure(a)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function ef(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...Zu,...t};return i=>{let{active:o,dragOverlay:l,transform:a,...d}=i;if(!e)return;const u={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},f={scaleX:a.scaleX!==1?o.rect.width*a.scaleX/l.rect.width:1,scaleY:a.scaleY!==1?o.rect.height*a.scaleY/l.rect.height:1},p={x:a.x-u.x,y:a.y-u.y,...f},h=s({...d,active:o,dragOverlay:l,transform:{initial:a,final:p}}),[m]=h,y=h[h.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const b=r?.({active:o,dragOverlay:l,...d}),g=l.node.animate(h,{duration:e,easing:n,fill:"forwards"});return new Promise(x=>{g.onfinish=()=>{b?.(),x()}})}}let eo=0;function tf(t){return w.useMemo(()=>{if(t!=null)return eo++,eo},[t])}const nf=De.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:a,zIndex:d=999}=t;const{activatorEvent:u,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:m,droppableContainers:y,dragOverlay:b,over:g,measuringConfiguration:x,scrollableAncestors:k,scrollableAncestorRects:v,windowRect:S}=Il(),T=w.useContext(br),C=tf(f?.id),j=El(o,{activatorEvent:u,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:b.rect,over:g,overlayNodeRect:b.rect,scrollableAncestors:k,scrollableAncestorRects:v,transform:T,windowRect:S}),D=yi(p),R=Ju({config:r,draggableNodes:m,droppableContainers:y,measuringConfiguration:x}),N=D?b.setRef:void 0;return De.createElement(Wu,null,De.createElement(Ku,{animation:R},f&&C?De.createElement(Gu,{key:C,id:f.id,ref:N,as:l,activatorEvent:u,adjustScale:e,className:a,transition:i,rect:D,style:{zIndex:d,...s},transform:j},n):null))});function sf(t){const{org:e}=$e(),{data:n}=Do.useSession(),r=Ya(),s=gn(),i=Ka({connectionId:Ko,orgId:e.id,orgSlug:e.slug}),[o,l]=w.useState(!1),a=Ga(t,{enabled:!1});return{connect:async()=>{if(!(o||!n?.user?.id||!e)){l(!0);try{const u=a.data??(await a.refetch()).data;if(!u){St.error("Could not find this integration in the registry");return}const f=tc(u,e.id,n.user.id,{remoteIndex:0});if(!f.connection_url){St.error("This integration has no connection method available");return}const p=f.app_name?await rf(i,f.app_name):null,h=!p,m=p?.id??(await r.create.mutateAsync(f)).id,y=await ec({connectionId:m,orgId:e.id,orgSlug:e.slug,persistFallback:b=>r.update.mutateAsync({id:m,data:{connection_token:b}}).then(()=>{})});if(y.ran&&!y.ok){if(h)try{await r.delete.mutateAsync(m)}catch{}St.error(`Authentication failed: ${y.error??"no token"}`);return}ja(s,e.id),St.success(h?"Connected successfully":"Already connected")}catch(u){St.error(`Failed to connect: ${u instanceof Error?u.message:String(u)}`)}finally{l(!1)}}},isConnecting:o}}async function rf(t,e){return(await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_name"],operator:"eq",value:e},limit:1}})).structuredContent?.items?.[0]??null}function ki(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function of(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function Fs(t){return t!==null&&t>=0}function lf(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function af(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Al=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=ki(e,r,n),o=e[s],l=i[s];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},Us={scaleX:1,scaleY:1},cf=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=t;const l=(e=i[n])!=null?e:r;if(!l)return null;if(s===n){const d=i[o];return d?{x:0,y:n<o?d.top+d.height-(l.top+l.height):d.top-l.top,...Us}:null}const a=df(i,s,n);return s>n&&s<=o?{x:0,y:-l.height-a,...Us}:s<n&&s>=o?{x:0,y:l.height+a,...Us}:{x:0,y:0,...Us}};function df(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?n<e?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Bl="Sortable",Ol=De.createContext({activeIndex:-1,containerId:Bl,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Al,disabled:{draggable:!1,droppable:!1}});function uf(t){let{children:e,id:n,items:r,strategy:s=Al,disabled:i=!1}=t;const{active:o,dragOverlay:l,droppableRects:a,over:d,measureDroppableContainers:u}=Il(),f=Is(Bl,n),p=l.rect!==null,h=w.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=o!=null,y=o?h.indexOf(o.id):-1,b=d?h.indexOf(d.id):-1,g=w.useRef(h),x=!lf(h,g.current),k=b!==-1&&y===-1||x,v=af(i);Pt(()=>{x&&m&&u(h)},[x,h,m,u]),w.useEffect(()=>{g.current=h},[h]);const S=w.useMemo(()=>({activeIndex:y,containerId:f,disabled:v,disableTransforms:k,items:h,overIndex:b,useDragOverlay:p,sortedRects:of(h,a),strategy:s}),[y,f,v.draggable,v.droppable,k,h,b,a,p,s]);return De.createElement(Ol.Provider,{value:S},e)}const ff=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return ki(n,r,s).indexOf(e)},hf=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:l,previousContainerId:a,transition:d}=t;return!d||!r||l!==i&&s===o?!1:n?!0:o!==s&&e===a},pf={duration:200,easing:"ease"},$l="transform",gf=on.Transition.toString({property:$l,duration:0,easing:"linear"}),mf={roleDescription:"sortable"};function xf(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,o]=w.useState(null),l=w.useRef(n);return Pt(()=>{if(!e&&n!==l.current&&r.current){const a=s.current;if(a){const d=is(r.current,{ignoreTransform:!0}),u={x:a.left-d.left,y:a.top-d.top,scaleX:a.width/d.width,scaleY:a.height/d.height};(u.x||u.y)&&o(u)}}n!==l.current&&(l.current=n)},[e,n,r,s]),w.useEffect(()=>{i&&o(null)},[i]),i}function bf(t){let{animateLayoutChanges:e=hf,attributes:n,disabled:r,data:s,getNewIndex:i=ff,id:o,strategy:l,resizeObserverConfig:a,transition:d=pf}=t;const{items:u,containerId:f,activeIndex:p,disabled:h,disableTransforms:m,sortedRects:y,overIndex:b,useDragOverlay:g,strategy:x}=w.useContext(Ol),k=yf(r,h),v=u.indexOf(o),S=w.useMemo(()=>({sortable:{containerId:f,index:v,items:u},...s}),[f,s,v,u]),T=w.useMemo(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:j,isOver:D,setNodeRef:R}=_l({id:o,data:S,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...a}}),{active:N,activatorEvent:I,activeNodeRect:A,attributes:_,setNodeRef:M,listeners:E,isDragging:O,over:z,setActivatorNodeRef:B,transform:P}=Fu({id:o,data:S,attributes:{...mf,...n},disabled:k.draggable}),L=Dd(R,M),U=!!N,H=U&&!m&&Fs(p)&&Fs(b),W=!g&&O,V=W&&H?P:null,te=H?V??(l??x)({rects:y,activeNodeRect:A,activeIndex:p,overIndex:b,index:v}):null,ie=Fs(p)&&Fs(b)?i({id:o,items:u,activeIndex:p,overIndex:b}):v,ne=N?.id,q=w.useRef({activeId:ne,items:u,newIndex:ie,containerId:f}),X=u!==q.current.items,J=e({active:N,containerId:f,isDragging:O,isSorting:U,id:o,index:v,items:u,newIndex:q.current.newIndex,previousItems:q.current.items,previousContainerId:q.current.containerId,transition:d,wasDragging:q.current.activeId!=null}),oe=xf({disabled:!J,index:v,node:j,rect:C});return w.useEffect(()=>{U&&q.current.newIndex!==ie&&(q.current.newIndex=ie),f!==q.current.containerId&&(q.current.containerId=f),u!==q.current.items&&(q.current.items=u)},[U,ie,f,u]),w.useEffect(()=>{if(ne===q.current.activeId)return;if(ne!=null&&q.current.activeId==null){q.current.activeId=ne;return}const K=setTimeout(()=>{q.current.activeId=ne},50);return()=>clearTimeout(K)},[ne]),{active:N,activeIndex:p,attributes:_,data:S,rect:C,index:v,newIndex:ie,items:u,isOver:D,isSorting:U,isDragging:O,listeners:E,node:j,overIndex:b,over:z,setNodeRef:L,setActivatorNodeRef:B,setDroppableNodeRef:R,setDraggableNodeRef:M,transform:oe??te,transition:G()};function G(){if(oe||X&&q.current.newIndex===v)return gf;if(!(W&&!gr(I)||!d)&&(U||J))return on.Transition.toString({...d,property:$l})}}function yf(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function sr(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const kf=[de.Down,de.Right,de.Up,de.Left],vf=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:l}}=e;if(kf.includes(t.code)){if(t.preventDefault(),!n||!r)return;const a=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=s.get(f.id);if(p)switch(t.code){case de.Down:r.top<p.top&&a.push(f);break;case de.Up:r.top>p.top&&a.push(f);break;case de.Left:r.left>p.left&&a.push(f);break;case de.Right:r.left<p.left&&a.push(f);break}});const d=gl({collisionRect:r,droppableRects:s,droppableContainers:a});let u=pl(d,"id");if(u===o?.id&&d.length>1&&(u=d[1].id),u!=null){const f=i.get(n.id),p=i.get(u),h=p?s.get(p.id):null,m=p?.node.current;if(m&&h&&f&&p){const b=mr(m).some((T,C)=>l[C]!==T),g=Ml(f,p),x=wf(f,p),k=b||!g?{x:0,y:0}:{x:x?r.width-h.width:0,y:x?r.height-h.height:0},v={x:h.left,y:h.top};return k.x&&k.y?v:Cs(v,k)}}}};function Ml(t,e){return!sr(t)||!sr(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function wf(t,e){return!sr(t)||!sr(e)||!Ml(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}function Lt(t){const e=F.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=ee("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:Ha,alt:"Super Agent",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}const to=()=>0;function Sf(t){const{orgSlug:e,enabled:n=!0,onUpdate:r,onDelete:s}=t,i=w.useRef(r);i.current=r;const o=w.useRef(s);o.current=s;const l=w.useRef(null),a=w.useRef(n),d=w.useRef(e);(!l.current||a.current!==n||d.current!==e)&&(a.current=n,d.current=e,l.current=f=>{if(!n||!e)return()=>{};const p=h=>{let m;try{m=JSON.parse(h.data)}catch{return}m.data&&(h.type===sc?o.current?.(m.data.id):i.current(m.data)),f()};return nc.subscribe(e,p)}),w.useSyncExternalStore(l.current,to,to)}function Cf(){const t=F.c(30),{org:e,locator:n}=$e(),r=mn(),s=gn();let i;t[0]!==n?(i=ge.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const o=i;let l;t[2]!==r?(l=async()=>(await r.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=r,t[3]=l):l=t[3];let a;t[4]!==o||t[5]!==l?(a={queryKey:o,queryFn:l},t[4]=o,t[5]=l,t[6]=a):a=t[6];const d=Xe(a);let u;t[7]!==n||t[8]!==s||t[9]!==o?(u=g=>{s.setQueryData(o,x=>{const k=x??[];return k.some(v=>v.id===g.id)?k.map(v=>v.id===g.id?g:v):[g,...k]}),s.invalidateQueries({queryKey:ge.taskBoardActivity(n,g.id)})},t[7]=n,t[8]=s,t[9]=o,t[10]=u):u=t[10];let f;t[11]!==s||t[12]!==o?(f=g=>{s.setQueryData(o,x=>x?.filter(k=>k.id!==g))},t[11]=s,t[12]=o,t[13]=f):f=t[13];let p;t[14]!==e.slug||t[15]!==u||t[16]!==f?(p={orgSlug:e.slug,onUpdate:u,onDelete:f},t[14]=e.slug,t[15]=u,t[16]=f,t[17]=p):p=t[17],Sf(p);let h;t[18]!==s||t[19]!==o?(h=g=>{const x=g.subject,k=g.data.status;s.setQueryData(o,v=>v?.map(S=>S.threads.some(T=>T.threadId===x)?{...S,threads:S.threads.map(T=>T.threadId===x?{...T,status:k}:T)}:S))},t[18]=s,t[19]=o,t[20]=h):h=t[20];let m;t[21]!==e.slug||t[22]!==h?(m={orgSlug:e.slug,onTaskStatus:h},t[21]=e.slug,t[22]=h,t[23]=m):m=t[23],ic(m);let y;t[24]!==d.data?(y=d.data??[],t[24]=d.data,t[25]=y):y=t[25];let b;return t[26]!==d.error||t[27]!==d.isLoading||t[28]!==y?(b={items:y,isLoading:d.isLoading,error:d.error},t[26]=d.error,t[27]=d.isLoading,t[28]=y,t[29]=b):b=t[29],b}function jf(){const t=F.c(65),{locator:e}=$e(),n=mn(),r=gn(),s=le();let i;t[0]!==e?(i=ge.taskBoardItems(e),t[0]=e,t[1]=i):i=t[1];const o=i;let l;t[2]!==r||t[3]!==o?(l=()=>r.invalidateQueries({queryKey:o}),t[2]=r,t[3]=o,t[4]=l):l=t[4];const a=l;let d;t[5]!==n?(d=B=>n.call("TASK_BOARD_ITEM_CREATE",B),t[5]=n,t[6]=d):d=t[6];let u;t[7]!==a||t[8]!==d?(u={mutationFn:d,onSuccess:a},t[7]=a,t[8]=d,t[9]=u):u=t[9];const f=Ge(u);let p;t[10]!==n?(p=B=>n.call("TASK_BOARD_ITEM_UPDATE",B),t[10]=n,t[11]=p):p=t[11];let h,m;t[12]!==r||t[13]!==o?(h=async B=>{await r.cancelQueries({queryKey:o});const P=r.getQueryData(o);return r.setQueryData(o,L=>L?.map(U=>U.id===B.id?{...U,...B}:U)),{previous:P}},m=(B,P,L)=>{L?.previous&&r.setQueryData(o,L.previous)},t[12]=r,t[13]=o,t[14]=h,t[15]=m):(h=t[14],m=t[15]);let y;t[16]!==a||t[17]!==e||t[18]!==r?(y=(B,P,L)=>{a(),r.invalidateQueries({queryKey:ge.taskBoardActivity(e,L.id)})},t[16]=a,t[17]=e,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==p||t[21]!==h||t[22]!==m||t[23]!==y?(b={mutationFn:p,onMutate:h,onError:m,onSettled:y},t[20]=p,t[21]=h,t[22]=m,t[23]=y,t[24]=b):b=t[24];const g=Ge(b);let x;t[25]!==n?(x=B=>n.call("TASK_BOARD_ITEM_DELETE",{id:B}),t[25]=n,t[26]=x):x=t[26];let k;t[27]!==a||t[28]!==s?(k=B=>{St.error(B instanceof Error&&B.message?B.message:s("taskBoard.taskBoard.deleteError")),a()},t[27]=a,t[28]=s,t[29]=k):k=t[29];let v;t[30]!==a||t[31]!==k||t[32]!==x?(v={mutationFn:x,onSuccess:a,onError:k},t[30]=a,t[31]=k,t[32]=x,t[33]=v):v=t[33];const S=Ge(v);let T;t[34]!==n?(T=async B=>{const P=await Promise.allSettled(B.map(L=>n.call("TASK_BOARD_ITEM_DELETE",{id:L})));return{total:B.length,failed:P.filter(Tf).length}},t[34]=n,t[35]=T):T=t[35];let C,j;t[36]!==s?(C=B=>{const{total:P,failed:L}=B;L!==0&&St.error(s("taskBoard.taskBoard.deleteBulkError",{failed:String(L),total:String(P)}))},j=()=>St.error(s("taskBoard.taskBoard.deleteError")),t[36]=s,t[37]=C,t[38]=j):(C=t[37],j=t[38]);let D;t[39]!==a||t[40]!==T||t[41]!==C||t[42]!==j?(D={mutationFn:T,onSuccess:C,onError:j,onSettled:a},t[39]=a,t[40]=T,t[41]=C,t[42]=j,t[43]=D):D=t[43];const R=Ge(D);let N;t[44]!==n?(N=B=>n.call("TASK_BOARD_ITEM_UPDATE",B),t[44]=n,t[45]=N):N=t[45];let I;t[46]!==a||t[47]!==N?(I={mutationFn:N,onSuccess:a},t[46]=a,t[47]=N,t[48]=I):I=t[48];const A=Ge(I);let _;t[49]!==n?(_=B=>n.call("TASK_BOARD_ITEM_RERUN",B),t[49]=n,t[50]=_):_=t[50];let M;t[51]!==a||t[52]!==e||t[53]!==r?(M=(B,P,L)=>{a(),r.invalidateQueries({queryKey:ge.taskBoardActivity(e,L.id)})},t[51]=a,t[52]=e,t[53]=r,t[54]=M):M=t[54];let E;t[55]!==_||t[56]!==M?(E={mutationFn:_,onSettled:M},t[55]=_,t[56]=M,t[57]=E):E=t[57];const O=Ge(E);let z;return t[58]!==f||t[59]!==A||t[60]!==S||t[61]!==R||t[62]!==O||t[63]!==g?(z={create:f,update:g,remove:S,removeMany:R,link:A,rerun:O},t[58]=f,t[59]=A,t[60]=S,t[61]=R,t[62]=O,t[63]=g,t[64]=z):z=t[64],z}function Tf(t){return t.status==="rejected"}function rr(t){return t.threads.some(e=>e.status==="requires_action")}function vi(t){return t.status==="in_progress"&&rr(t)?"text-warning animate-pulse":Et[t.status].iconClassName}function Nf(t){return t.threads[0]}function no(t,e,n){const r=t.findIndex(u=>u.id===n),s=e===n?t[r+1]?.id??null:e,i=t.filter(u=>u.id!==n),o=s?i.findIndex(u=>u.id===s):-1,l=o===-1?i.length:o,a=i[l-1],d=i[l];return a&&d?(a.sortOrder+d.sortOrder)/2:a?a.sortOrder+1:d?d.sortOrder-1:0}function zl(t,e){return Array.from({length:e},(n,r)=>t-(e-1-r)*1e-4)}const ir=["triage","todo","in_progress","in_review","done"],Et={triage:{labelKey:"taskBoard.config.statusBacklog",icon:fr,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:oc,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:Ns,iconClassName:"text-primary animate-spin"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:lc,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:xn,iconClassName:"text-success"}},wi=["none","low","medium","high","urgent"],It={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}},Ur=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],Ll=Ur[0];function As(t){return t??Ll}function Df(t){return Ur[t%Ur.length]??Ll}function Pl(t){const e=F.c(11),{size:n,className:r}=t,s=n===void 0?16:n,i=le();let o;e[0]!==i?(o=i("taskBoard.taskDialog.qaAgentLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==s?(l={width:s,height:s},e[2]=s,e[3]=l):l=e[3];let a;e[4]!==r?(a=ee("shrink-0 rounded-full object-cover",r),e[4]=r,e[5]=a):a=e[5];let d;return e[6]!==s||e[7]!==o||e[8]!==l||e[9]!==a?(d=c.jsx("img",{src:Wa,alt:o,width:s,height:s,style:l,className:a}),e[6]=s,e[7]=o,e[8]=l,e[9]=a,e[10]=d):d=e[10],d}function Fl(t){const e=F.c(8),{size:n,className:r}=t,s=n===void 0?16:n;let i;e[0]!==s?(i={width:s,height:s},e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=ee("shrink-0 rounded-full object-cover",r),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==s||e[5]!==i||e[6]!==o?(l=c.jsx("img",{src:Va,alt:"Code Reviewer",width:s,height:s,style:i,className:o}),e[4]=s,e[5]=i,e[6]=o,e[7]=l):l=e[7],l}let qr,Kr;if(typeof WeakMap<"u"){let t=new WeakMap;qr=e=>t.get(e),Kr=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;qr=r=>{for(let s=0;s<t.length;s+=2)if(t[s]==r)return t[s+1]},Kr=(r,s)=>(n==10&&(n=0),t[n++]=r,t[n++]=s)}var Zt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,s=e/this.width|0;let i=r+1,o=s+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;o<this.height&&this.map[e+this.width*l]==n;l++)o++;return{left:r,top:s,right:i,bottom:o}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:s,top:i,bottom:o}=this.findCell(t);return e=="horiz"?(n<0?r==0:s==this.width)?null:this.map[i*this.width+(n<0?r-1:s)]:(n<0?i==0:o==this.height)?null:this.map[r+this.width*(n<0?i-1:o)]}rectBetween(t,e){const{left:n,right:r,top:s,bottom:i}=this.findCell(t),{left:o,right:l,top:a,bottom:d}=this.findCell(e);return{left:Math.min(n,o),top:Math.min(s,a),right:Math.max(r,l),bottom:Math.max(i,d)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let s=t.left;s<t.right;s++){const i=r*this.width+s,o=this.map[i];n[o]||(n[o]=!0,!(s==t.left&&s&&this.map[i-1]==o||r==t.top&&r&&this.map[i-this.width]==o)&&e.push(o))}return e}positionAt(t,e,n){for(let r=0,s=0;;r++){const i=s+n.child(r).nodeSize;if(r==t){let o=e+t*this.width;const l=(t+1)*this.width;for(;o<l&&this.map[o]<s;)o++;return o==l?i-1:this.map[o]}s=i}}static get(t){return qr(t)||Kr(t,Rf(t))}};function Rf(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Ef(t),n=t.childCount,r=[];let s=0,i=null;const o=[];for(let d=0,u=e*n;d<u;d++)r[d]=0;for(let d=0,u=0;d<n;d++){const f=t.child(d);u++;for(let m=0;;m++){for(;s<r.length&&r[s]!=0;)s++;if(m==f.childCount)break;const y=f.child(m),{colspan:b,rowspan:g,colwidth:x}=y.attrs;for(let k=0;k<g;k++){if(k+d>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:g-k});break}const v=s+k*e;for(let S=0;S<b;S++){r[v+S]==0?r[v+S]=u:(i||(i=[])).push({type:"collision",row:d,pos:u,n:b-S});const T=x&&x[S];if(T){const C=(v+S)%e*2,j=o[C];j==null||j!=T&&o[C+1]==1?(o[C]=T,o[C+1]=1):j==T&&o[C+1]++}}}s+=b,u+=y.nodeSize}const p=(d+1)*e;let h=0;for(;s<p;)r[s++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:d,n:h}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const l=new Zt(e,n,r,i);let a=!1;for(let d=0;!a&&d<o.length;d+=2)o[d]!=null&&o[d+1]<n&&(a=!0);return a&&If(l,o,t),l}function Ef(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const s=t.child(r);let i=0;if(n)for(let o=0;o<r;o++){const l=t.child(o);for(let a=0;a<l.childCount;a++){const d=l.child(a);o+d.attrs.rowspan>r&&(i+=d.attrs.colspan)}}for(let o=0;o<s.childCount;o++){const l=s.child(o);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function If(t,e,n){t.problems||(t.problems=[]);const r={};for(let s=0;s<t.map.length;s++){const i=t.map[s];if(r[i])continue;r[i]=!0;const o=n.nodeAt(i);if(!o)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=o.attrs;for(let d=0;d<a.colspan;d++){const u=e[(s+d)%t.width*2];u!=null&&(!a.colwidth||a.colwidth[d]!=u)&&((l||(l=_f(a)))[d]=u)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function _f(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Si(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],s=r.spec.tableRole;s&&(e[s]=r)}}return e}new rn("selectingCells");function Af(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Ul(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Bf(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Af(e.$head)||Of(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Of(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function so(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function ql(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Kl(t,e,n){const r=t.node(-1),s=Zt.get(r),i=t.start(-1),o=s.nextCell(t.pos-i,e,n);return o==null?null:t.node(0).resolve(i+o)}function ro(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(s=>s>0)||(r.colwidth=null)),r}var Gt=class Yt extends Qt{constructor(e,n=e){const r=e.node(-1),s=Zt.get(r),i=e.start(-1),o=s.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=s.cellsInRect(o).filter(u=>u!=n.pos-i);a.unshift(n.pos-i);const d=a.map(u=>{const f=r.nodeAt(u);if(!f)throw new RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new pc(l.resolve(p),l.resolve(p+f.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),s=e.resolve(n.map(this.$headCell.pos));if(so(r)&&so(s)&&ql(r,s)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Yt.rowSelection(r,s):i&&this.isColSelection()?Yt.colSelection(r,s):new Yt(r,s)}return Go.between(r,s)}content(){const e=this.$anchorCell.node(-1),n=Zt.get(e),r=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},o=[];for(let a=s.top;a<s.bottom;a++){const d=[];for(let u=a*n.width+s.left,f=s.left;f<s.right;f++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const h=n.findCell(p);let m=e.nodeAt(p);if(!m)throw new RangeError(`No cell with offset ${p} found`);const y=s.left-h.left,b=h.right-s.right;if(y>0||b>0){let g=m.attrs;if(y>0&&(g=ro(g,0,y)),b>0&&(g=ro(g,g.colspan-b,b)),h.left<s.left){if(m=m.type.createAndFill(g),!m)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else m=m.type.create(g,m.content)}if(h.top<s.top||h.bottom>s.bottom){const g={...m.attrs,rowspan:Math.min(h.bottom,s.bottom)-Math.max(h.top,s.top)};h.top<s.top?m=m.type.createAndFill(g):m=m.type.create(g,m.content)}d.push(m)}o.push(e.child(a).copy(Nr.from(d)))}const l=this.isColSelection()&&this.isRowSelection()?e:o;return new ps(Nr.from(l),1,1)}replace(e,n=ps.empty){const r=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){const{$from:l,$to:a}=s[o],d=e.mapping.slice(r);e.replace(d.map(l.pos),d.map(a.pos),o?ps.empty:n)}const i=Qt.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ps(Nr.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Zt.get(n),s=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-s,this.$headCell.pos-s));for(let o=0;o<i.length;o++)e(n.nodeAt(i[o]),s+i[o])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,s=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,s)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),s=Zt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.top<=l.top?(o.top>0&&(e=a.resolve(i+s.map[o.left])),l.bottom<s.height&&(n=a.resolve(i+s.map[s.width*(s.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+s.map[l.left])),o.bottom<s.height&&(e=a.resolve(i+s.map[s.width*(s.height-1)+o.right-1]))),new Yt(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Zt.get(e),r=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(s,i)>0)return!1;const o=s+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(e){return e instanceof Yt&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),s=Zt.get(r),i=e.start(-1),o=s.findCell(e.pos-i),l=s.findCell(n.pos-i),a=e.node(0);return o.left<=l.left?(o.left>0&&(e=a.resolve(i+s.map[o.top*s.width])),l.right<s.width&&(n=a.resolve(i+s.map[s.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+s.map[l.top*s.width])),o.right<s.width&&(e=a.resolve(i+s.map[s.width*(o.top+1)-1]))),new Yt(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Yt(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Yt(e.resolve(n),e.resolve(r))}getBookmark(){return new $f(this.$anchorCell.pos,this.$headCell.pos)}};Gt.prototype.visible=!1;Qt.jsonID("cell",Gt);var $f=class Hl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Hl(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&ql(n,r)?new Gt(n,r):Qt.near(r,1)}};new rn("fix-tables");function Wl(t){const e=t.selection,n=Bf(t),r=n.node(-1),s=n.start(-1),i=Zt.get(r);return{...e instanceof Gt?i.rectBetween(e.$anchorCell.pos-s,e.$headCell.pos-s):i.findCell(n.pos-s),tableStart:s,map:i,table:r}}function Mf(t){return function(e,n){if(!Ul(e))return!1;if(n){const r=Si(e.schema),s=Wl(e),i=e.tr,o=s.map.cellsInRect(t=="column"?{left:s.left,top:0,right:s.right,bottom:s.map.height}:t=="row"?{left:0,top:s.top,right:s.map.width,bottom:s.bottom}:s),l=o.map(a=>s.table.nodeAt(a));for(let a=0;a<o.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(s.tableStart+o[a],r.cell,l[a].attrs);if(i.steps.length===0)for(let a=0;a<o.length;a++)i.setNodeMarkup(s.tableStart+o[a],r.header_cell,l[a].attrs);n(i)}return!0}}function io(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let s=0;s<r.length;s++){const i=e.table.nodeAt(r[s]);if(i&&i.type!==n.header_cell)return!1}return!0}function Ci(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Mf(t):function(n,r){if(!Ul(n))return!1;if(r){const s=Si(n.schema),i=Wl(n),o=n.tr,l=io("row",i,s),a=io("column",i,s),d=(t==="column"?l:t==="row"&&a)?1:0,u=t=="column"?{left:0,top:d,right:1,bottom:i.map.height}:t=="row"?{left:d,top:0,right:i.map.width,bottom:1}:i,f=t=="column"?a?s.cell:s.header_cell:t=="row"?l?s.cell:s.header_cell:s.cell;i.map.cellsInRect(u).forEach(p=>{const h=p+i.tableStart,m=o.doc.nodeAt(h);m&&o.setNodeMarkup(h,f,m.attrs)}),r(o)}return!0}}Ci("row",{useDeprecatedLogic:!0});Ci("column",{useDeprecatedLogic:!0});Ci("cell",{useDeprecatedLogic:!0});function qs(t,e){const n=t.selection;if(!(n instanceof Gt))return!1;if(e){const r=t.tr,s=Si(t.schema).cell.createAndFill().content;n.forEachCell((i,o)=>{i.content.eq(s)||r.replace(r.mapping.map(o+1),r.mapping.map(o+i.nodeSize-1),new ps(s,0,0))}),r.docChanged&&e(r)}return!0}gc({ArrowLeft:Ks("horiz",-1),ArrowRight:Ks("horiz",1),ArrowUp:Ks("vert",-1),ArrowDown:Ks("vert",1),"Shift-ArrowLeft":Hs("horiz",-1),"Shift-ArrowRight":Hs("horiz",1),"Shift-ArrowUp":Hs("vert",-1),"Shift-ArrowDown":Hs("vert",1),Backspace:qs,"Mod-Backspace":qs,Delete:qs,"Mod-Delete":qs});function Ys(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ks(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;if(i instanceof Gt)return Ys(n,r,Qt.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const o=Vl(s,t,e);if(o==null)return!1;if(t=="horiz")return Ys(n,r,Qt.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(o),a=Kl(l,t,e);let d;return a?d=Qt.near(a,1):e<0?d=Qt.near(n.doc.resolve(l.before(-1)),-1):d=Qt.near(n.doc.resolve(l.after(-1)),1),Ys(n,r,d)}}}function Hs(t,e){return(n,r,s)=>{if(!s)return!1;const i=n.selection;let o;if(i instanceof Gt)o=i;else{const a=Vl(s,t,e);if(a==null)return!1;o=new Gt(n.doc.resolve(a))}const l=Kl(o.$headCell,t,e);return l?Ys(n,r,new Gt(o.$anchorCell,l)):!1}}function Vl(t,e,n){if(!(t.state.selection instanceof Go))return null;const{$head:r}=t.state.selection;for(let s=r.depth-1;s>=0;s--){const i=r.node(s);if((n<0?r.index(s):r.indexAfter(s))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const o=r.before(s),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?o:null}}return null}new rn("tableColumnResizing");function zf(t,e){const n=Math.min(t.top,e.top),r=Math.max(t.bottom,e.bottom),s=Math.min(t.left,e.left),o=Math.max(t.right,e.right)-s,l=r-n,a=s,d=n;return new DOMRect(a,d,o,l)}var Lf=class{constructor({editor:t,element:e,view:n,pluginKey:r="bubbleMenu",updateDelay:s=250,resizeDelay:i=60,shouldShow:o,appendTo:l,getReferencedVirtualElement:a,options:d}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:f,state:p,from:h,to:m})=>{const{doc:y,selection:b}=p,{empty:g}=b,x=!y.textBetween(h,m).length&&mc(p.selection),k=this.element.contains(document.activeElement);return!(!(f.hasFocus()||k)||g||x||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:f})=>{var p;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}f?.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(f.relatedTarget))||f?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(f,p)=>{const h=!p?.selection.eq(f.state.selection),m=!p?.doc.eq(f.state.doc);!h&&!m||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(f,h,m,p)},this.updateDelay))},this.updateHandler=(f,p,h,m)=>{const{composing:y}=f;if(y||!p&&!h)return;if(!this.getShouldShow(m)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:f})=>{const p=f.getMeta(this.pluginKey);p==="updatePosition"?this.updatePosition():p&&typeof p=="object"&&p.type==="updateOptions"?this.updateOptions(p.options):p==="hide"?this.hide():p==="show"&&(this.updatePosition(),this.show())};var u;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(u=d?.scrollTarget)!=null?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Ro(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Eo(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Io(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(_o(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Ao(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Bo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Oo(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push($o(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}get virtualElement(){var t,e,n;const{selection:r}=this.editor.state,s=(t=this.getReferencedVirtualElement)==null?void 0:t.call(this);if(s)return s;if(!((n=(e=this.view)==null?void 0:e.dom)!=null&&n.parentNode))return;const i=Xo(this.view,r.from,r.to);let o={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(r instanceof xc){let l=this.view.nodeDOM(r.from);const a=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");a&&(l=a),l&&(o={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(r instanceof Gt){const{$anchorCell:l,$headCell:a}=r,d=l?l.pos:a.pos,u=a?a.pos:l.pos,f=this.view.nodeDOM(d),p=this.view.nodeDOM(u);if(!f||!p)return;const h=f===p?f.getBoundingClientRect():zf(f.getBoundingClientRect(),p.getBoundingClientRect());o={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return o}updatePosition(){if(!this.isVisible)return;const t=this.virtualElement;t&&Mo(t,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:n,strategy:r,middlewareData:s})=>{var i,o;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((i=s.hide)!=null&&i.referenceHidden||(o=s.hide)!=null&&o.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=r,this.element.style.left=`${e}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(t,e){const{state:n}=t,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(t,e);return}const s=!e?.selection.eq(t.state.selection),i=!e?.doc.eq(t.state.doc);this.updateHandler(t,s,i,e)}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:t,from:i,to:o}))||!1}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=t.getReferencedVirtualElement),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Ql=t=>new ii({key:typeof t.pluginKey=="string"?new rn(t.pluginKey):t.pluginKey,view:e=>new Lf({view:e,...t})});oi.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Ql({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Pf=class{constructor({editor:t,element:e,view:n,pluginKey:r="floatingMenu",updateDelay:s=250,resizeDelay:i=60,options:o,appendTo:l,shouldShow:a}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:f})=>{const{selection:p}=f,{$anchor:h,empty:m}=p,y=h.depth===1,b=h.parent.isTextblock&&!h.parent.type.spec.code&&!h.parent.textContent&&h.parent.childCount===0&&!this.getTextContent(h.parent);return!(!u.hasFocus()||!m||!y||!b||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,f,p,h)=>{const{composing:m}=u;if(m||!f&&!p)return;if(!this.getShouldShow(h)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var f;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&((f=this.element.parentNode)!=null&&f.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const f=u.getMeta(this.pluginKey);f==="updatePosition"?this.updatePosition():f&&typeof f=="object"&&f.type==="updateOptions"?this.updateOptions(f.options):f==="hide"?this.hide():f==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var d;this.editor=t,this.element=e,this.view=n,this.pluginKey=r,this.updateDelay=s,this.resizeDelay=i,this.appendTo=l,this.scrollTarget=(d=o?.scrollTarget)!=null?d:window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(t){return bc(t,{textSerializers:yc(this.editor.schema)})}get middlewares(){const t=[];return this.floatingUIOptions.flip&&t.push(Ro(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&t.push(Eo(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&t.push(Io(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&t.push(_o(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&t.push(Ao(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&t.push(Bo(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&t.push(Oo(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&t.push($o(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),t}getShouldShow(t){var e;const{state:n}=this.view,{selection:r}=n,{ranges:s}=r,i=Math.min(...s.map(a=>a.$from.pos)),o=Math.max(...s.map(a=>a.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:n,oldState:t,from:i,to:o})}updateOptions(t){var e;if(t.updateDelay!==void 0&&(this.updateDelay=t.updateDelay),t.resizeDelay!==void 0&&(this.resizeDelay=t.resizeDelay),t.appendTo!==void 0&&(this.appendTo=t.appendTo),t.shouldShow!==void 0&&t.shouldShow&&(this.shouldShow=t.shouldShow),t.options!==void 0){const n=(e=t.options.scrollTarget)!=null?e:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...t.options}}}updatePosition(){const{selection:t}=this.editor.state,e=Xo(this.view,t.from,t.to);Mo({getBoundingClientRect:()=>e,getClientRects:()=>[e]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:r,y:s,strategy:i,middlewareData:o})=>{var l,a;if((l=o.hide)!=null&&l.referenceHidden||(a=o.hide)!=null&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${r}px`,this.element.style.top=`${s}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(t,e){const n=!e?.selection.eq(t.state.selection),r=!e?.doc.eq(t.state.doc);this.updateHandler(t,n,r,e)}show(){var t;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(t=e??this.view.dom.parentElement)==null||t.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},Gl=t=>new ii({key:typeof t.pluginKey=="string"?new rn(t.pluginKey):t.pluginKey,view:e=>new Pf({view:e,...t})});oi.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:t,dispatch:e})=>(e&&t.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Gl({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var Ff=De.forwardRef(({pluginKey:t="bubbleMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,getReferencedVirtualElement:o,options:l,children:a,...d},u)=>{const f=w.useRef(document.createElement("div"));typeof u=="function"?u(f.current):u&&(u.current=f.current);const{editor:p}=Yo(),h=e||p,m={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,getReferencedVirtualElement:o,options:l},y=w.useRef(m);y.current=m;const[b,g]=w.useState(!1),x=w.useRef(!0);return w.useEffect(()=>{if(h?.isDestroyed)return;if(!h){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const k=f.current;k.style.visibility="hidden",k.style.position="absolute";const v=Ql({...y.current,editor:h,element:k});h.registerPlugin(v);const S=y.current.pluginKey;return x.current=!0,g(!0),()=>{g(!1),h.unregisterPlugin(S),window.requestAnimationFrame(()=>{k.parentNode&&k.parentNode.removeChild(k)})}},[h]),w.useEffect(()=>{if(!(!b||!h||h.isDestroyed)){if(x.current){x.current=!1;return}h.view.dispatch(h.state.tr.setMeta(t,{type:"updateOptions",options:y.current}))}},[b,h,n,r,i,l,s,o]),sn.createPortal(c.jsx("div",{...d,children:a}),f.current)});De.forwardRef(({pluginKey:t="floatingMenu",editor:e,updateDelay:n,resizeDelay:r,appendTo:s,shouldShow:i=null,options:o,children:l,...a},d)=>{const u=w.useRef(document.createElement("div"));typeof d=="function"?d(u.current):d&&(d.current=u.current);const{editor:f}=Yo(),p=e||f,h={updateDelay:n,resizeDelay:r,appendTo:s,pluginKey:t,shouldShow:i,options:o},m=w.useRef(h);m.current=h;const[y,b]=w.useState(!1),g=w.useRef(!0);return w.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const x=u.current;x.style.visibility="hidden",x.style.position="absolute";const k=Gl({...m.current,editor:p,element:x});p.registerPlugin(k);const v=m.current.pluginKey;return g.current=!0,b(!0),()=>{b(!1),p.unregisterPlugin(v),window.requestAnimationFrame(()=>{x.parentNode&&x.parentNode.removeChild(x)})}},[p]),w.useEffect(()=>{if(!(!y||!p||p.isDestroyed)){if(g.current){g.current=!1;return}p.view.dispatch(p.state.tr.setMeta(t,{type:"updateOptions",options:m.current}))}},[y,p,n,r,i,o,s]),sn.createPortal(c.jsx("div",{...a,children:l}),u.current)});const Uf=new Set(["http:","https:","mailto:","tel:","ftp:"]);function Xl(t){if(t.startsWith("/")||t.startsWith(".")||t.startsWith("#"))return!0;try{const e=new URL(t,"https://placeholder.invalid");return Uf.has(e.protocol)}catch{return!1}}function Yl(t){const e=t.trim();return e?e.startsWith("/")||e.startsWith(".")||e.startsWith("#")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)?e:`https://${e}`:""}const qf="noopener noreferrer nofollow";function at(t){const e=F.c(8),{active:n,label:r,onClick:s,children:i}=t,o=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let l;e[0]!==o?(l=ee("flex h-7 w-7 items-center justify-center rounded transition-colors cursor-pointer",o),e[0]=o,e[1]=l):l=e[1];let a;return e[2]!==n||e[3]!==i||e[4]!==r||e[5]!==s||e[6]!==l?(a=c.jsx("button",{type:"button","aria-label":r,"aria-pressed":n,onMouseDown:Kf,onClick:s,className:l,children:i}),e[2]=n,e[3]=i,e[4]=r,e[5]=s,e[6]=l,e[7]=a):a=e[7],a}function Kf(t){return t.preventDefault()}function oo(t){const e=F.c(7),{active:n,label:r,onSelect:s}=t,i=n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let o;e[0]!==i?(o=ee("flex-1 rounded px-2 py-1 text-xs transition-colors cursor-pointer",i),e[0]=i,e[1]=o):o=e[1];let l;return e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==o?(l=c.jsx("button",{type:"button","aria-pressed":n,onMouseDown:Hf,onClick:s,className:o,children:r}),e[2]=n,e[3]=r,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function Hf(t){return t.preventDefault()}function d1(t){const e=F.c(36),{editor:n,active:r,open:s,onOpenChange:i}=t,o=le(),[l,a]=w.useState(""),[d,u]=w.useState(!0),[f,p]=w.useState(!1);let h;e[0]!==r||e[1]!==n||e[2]!==i?(h=()=>{const N=n.getAttributes("link");a(typeof N.href=="string"?N.href:""),u(r?N.target==="_blank":!0),p(!1),i(!0)},e[0]=r,e[1]=n,e[2]=i,e[3]=h):h=e[3];const m=h;let y;e[4]!==n||e[5]!==i?(y=()=>{i(!1),n.chain().focus().run()},e[4]=n,e[5]=i,e[6]=y):y=e[6];const b=y;let g;e[7]!==l||e[8]!==n||e[9]!==d||e[10]!==i?(g=()=>{const N=Yl(l);if(N===""){n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1);return}if(!Xl(N)){p(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:N,target:d?"_blank":null,rel:d?qf:null}).run(),i(!1)},e[7]=l,e[8]=n,e[9]=d,e[10]=i,e[11]=g):g=e[11];const x=g;let k;e[12]!==n||e[13]!==i?(k=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[12]=n,e[13]=i,e[14]=k):k=e[14];const v=k;let S;e[15]!==o?(S=o("sectionsEditor.richTextLinkControl.linkButtonLabel"),e[15]=o,e[16]=S):S=e[16];const T=s?b:m;let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=c.jsx(il,{size:14}),e[17]=C):C=e[17];let j;e[18]!==r||e[19]!==S||e[20]!==T?(j=c.jsx(at,{active:r,label:S,onClick:T,children:C}),e[18]=r,e[19]=S,e[20]=T,e[21]=j):j=e[21];let D;e[22]!==r||e[23]!==x||e[24]!==b||e[25]!==l||e[26]!==f||e[27]!==d||e[28]!==i||e[29]!==s||e[30]!==v||e[31]!==o?(D=s&&c.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 flex-col gap-1 rounded-md border bg-popover p-1 shadow-md",onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||i(!1)},children:[c.jsxs("div",{className:"flex items-center gap-0.5",children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":o("sectionsEditor.richTextLinkControl.urlInputAriaLabel"),"aria-invalid":f,placeholder:o("sectionsEditor.richTextLinkControl.urlInputPlaceholder"),value:l,onChange:N=>{a(N.target.value),p(!1)},onKeyDown:N=>{N.key==="Enter"?(N.preventDefault(),x()):N.key==="Escape"&&(N.preventDefault(),b())},className:ee("h-7 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",f&&"text-destructive")}),c.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.applyLinkLabel"),onClick:x,children:c.jsx(Ds,{size:14})}),r&&c.jsx(at,{active:!1,label:o("sectionsEditor.richTextLinkControl.removeLinkLabel"),onClick:v,children:c.jsx(ll,{size:14})})]}),c.jsxs("div",{className:"flex items-center gap-0.5 rounded bg-muted/40 p-0.5",children:[c.jsx(oo,{active:!d,label:o("sectionsEditor.richTextLinkControl.sameTabLabel"),onSelect:()=>u(!1)}),c.jsx(oo,{active:d,label:o("sectionsEditor.richTextLinkControl.newTabLabel"),onSelect:()=>u(!0)})]})]}),e[22]=r,e[23]=x,e[24]=b,e[25]=l,e[26]=f,e[27]=d,e[28]=i,e[29]=s,e[30]=v,e[31]=o,e[32]=D):D=e[32];let R;return e[33]!==j||e[34]!==D?(R=c.jsxs("div",{className:"relative",children:[j,D]}),e[33]=j,e[34]=D,e[35]=R):R=e[35],R}function Wf(t){const e=F.c(30),{editor:n}=t,r=le(),[s,i]=w.useState(!1),[o,l]=w.useState(""),[a,d]=w.useState(!1);let u;e[0]!==n?(u=n.isActive("link"),e[0]=n,e[1]=u):u=e[1];const f=u;let p;e[2]!==n||e[3]!==s?(p=()=>{if(s){i(!1);return}const C=n.getAttributes("link").href;l(typeof C=="string"?C:""),d(!1),i(!0)},e[2]=n,e[3]=s,e[4]=p):p=e[4];const h=p;let m;e[5]!==n?(m=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=m):m=e[6];const y=m;let b;e[7]!==o||e[8]!==n||e[9]!==y?(b=()=>{const C=Yl(o);if(C===""){y();return}if(!Xl(C)){d(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:C}).run(),i(!1)},e[7]=o,e[8]=n,e[9]=y,e[10]=b):b=e[10];const g=b;let x;e[11]!==r?(x=r("markdownEditor.link"),e[11]=r,e[12]=x):x=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(il,{size:14}),e[13]=k):k=e[13];let v;e[14]!==f||e[15]!==x||e[16]!==h?(v=c.jsx(at,{active:f,label:x,onClick:h,children:k}),e[14]=f,e[15]=x,e[16]=h,e[17]=v):v=e[17];let S;e[18]!==f||e[19]!==g||e[20]!==o||e[21]!==n||e[22]!==a||e[23]!==s||e[24]!==y||e[25]!==r?(S=s&&c.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md border bg-popover p-1 shadow-md",onBlur:C=>{C.currentTarget.contains(C.relatedTarget)||i(!1)},children:[c.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":a,placeholder:r("markdownEditor.linkPlaceholder"),value:o,onChange:C=>{l(C.target.value),d(!1)},onKeyDown:C=>{C.key==="Enter"?(C.preventDefault(),g()):C.key==="Escape"&&(C.preventDefault(),i(!1),n.chain().focus().run())},className:ee("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",a&&"text-destructive")}),c.jsx(at,{active:!1,label:r("markdownEditor.linkApply"),onClick:g,children:c.jsx(Ds,{size:14})}),f&&c.jsx(at,{active:!1,label:r("markdownEditor.linkRemove"),onClick:y,children:c.jsx(ll,{size:14})})]}),e[18]=f,e[19]=g,e[20]=o,e[21]=n,e[22]=a,e[23]=s,e[24]=y,e[25]=r,e[26]=S):S=e[26];let T;return e[27]!==v||e[28]!==S?(T=c.jsxs("div",{className:"relative",children:[v,S]}),e[27]=v,e[28]=S,e[29]=T):T=e[29],T}const _r=()=>{const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},lo=t=>{const e=F.c(2),{children:n}=t;let r;return e[0]!==n?(r=c.jsx("span",{className:"text-[11px] font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},Zl=[1,2,3],Vf=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function Qf(t){const e=F.c(20),{editor:n}=t,r=le(),[s,i]=w.useState(null);let o;e[0]!==n?(o={editor:n,selector:Gf},e[0]=n,e[1]=o):o=e[1];const l=kc(o);let a;e[2]!==r?(a=r("markdownEditor.heading1"),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==r?(d=r("markdownEditor.heading2"),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==r?(u=r("markdownEditor.heading3"),e[6]=r,e[7]=u):u=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u?(f={1:a,2:d,3:u},e[8]=a,e[9]=d,e[10]=u,e[11]=f):f=e[11];const p=f;let h;e[12]!==n||e[13]!==p||e[14]!==s||e[15]!==l||e[16]!==r?(h=s&&c.jsxs(Ff,{editor:n,shouldShow:Vf,appendTo:s,className:"flex items-center gap-0.5 rounded-lg border border-border bg-popover p-1 shadow-md","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[c.jsx(at,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:c.jsx(Ea,{size:14})}),c.jsx(at,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:c.jsx(Ia,{size:14})}),c.jsx(at,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:c.jsx(_a,{size:14})}),c.jsx(at,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:c.jsx(Aa,{size:14})}),c.jsx(_r,{}),Zl.map((y,b)=>c.jsx(at,{active:l.headings[b]??!1,label:p[y],onClick:()=>n.chain().focus().toggleHeading({level:y}).run(),children:c.jsx(lo,{children:`H${y}`})},y)),c.jsx(_r,{}),c.jsx(at,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:c.jsx(Uo,{size:14})}),c.jsx(at,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:c.jsx(lo,{children:"1."})}),c.jsx(at,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:c.jsx(Ba,{size:14})}),c.jsx(_r,{}),c.jsx(Wf,{editor:n})]}),e[12]=n,e[13]=p,e[14]=s,e[15]=l,e[16]=r,e[17]=h):h=e[17];let m;return e[18]!==h?(m=c.jsx("div",{ref:i,className:"relative z-20",children:h}),e[18]=h,e[19]=m):m=e[19],m}function Gf(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:Zl.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}function ji(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bn=ji();function Jl(t){bn=t}var cn={exec:()=>null};function ue(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(st.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,e)};return r}var Xf=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),st={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Yf=/^(?:[ \t]*(?:\n|$))+/,Zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bs=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ti=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ea=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ta=ue(ea).replace(/bull/g,Ti).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),th=ue(ea).replace(/bull/g,Ti).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ni=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nh=/^[^\n]+/,Di=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sh=ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Di).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rh=ue(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ti).getRegex(),yr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ri=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ih=ue("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ri).replace("tag",yr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),na=ue(Ni).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex(),oh=ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",na).getRegex(),Ei={blockquote:oh,code:Zf,def:sh,fences:Jf,heading:eh,hr:Bs,html:ih,lheading:ta,list:rh,newline:Yf,paragraph:na,table:cn,text:nh},ao=ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex(),lh={...Ei,lheading:th,table:ao,paragraph:ue(Ni).replace("hr",Bs).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ao).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",yr).getRegex()},ah={...Ei,html:ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ri).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ue(Ni).replace("hr",Bs).replace("heading",` *#{1,6} *[^
7
- ]`).replace("lheading",ta).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ch=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sa=/^( {2,}|\\)\n(?!\s*$)/,uh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,os=/[\p{P}\p{S}]/u,kr=/[\s\p{P}\p{S}]/u,Ii=/[^\s\p{P}\p{S}]/u,fh=ue(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kr).getRegex(),ra=/(?!~)[\p{P}\p{S}]/u,hh=/(?!~)[\s\p{P}\p{S}]/u,ph=/(?:[^\s\p{P}\p{S}]|~)/u,gh=ue(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ia=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mh=ue(ia,"u").replace(/punct/g,os).getRegex(),xh=ue(ia,"u").replace(/punct/g,ra).getRegex(),oa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bh=ue(oa,"gu").replace(/notPunctSpace/g,Ii).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),yh=ue(oa,"gu").replace(/notPunctSpace/g,ph).replace(/punctSpace/g,hh).replace(/punct/g,ra).getRegex(),kh=ue("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ii).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),vh=ue(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,os).getRegex(),wh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sh=ue(wh,"gu").replace(/notPunctSpace/g,Ii).replace(/punctSpace/g,kr).replace(/punct/g,os).getRegex(),Ch=ue(/\\(punct)/,"gu").replace(/punct/g,os).getRegex(),jh=ue(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=ue(Ri).replace("(?:-->|$)","-->").getRegex(),Nh=ue("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),or=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Dh=ue(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",or).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),la=ue(/^!?\[(label)\]\[(ref)\]/).replace("label",or).replace("ref",Di).getRegex(),aa=ue(/^!?\[(ref)\](?:\[\])?/).replace("ref",Di).getRegex(),Rh=ue("reflink|nolink(?!\\()","g").replace("reflink",la).replace("nolink",aa).getRegex(),co=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_i={_backpedal:cn,anyPunctuation:Ch,autolink:jh,blockSkip:gh,br:sa,code:dh,del:cn,delLDelim:cn,delRDelim:cn,emStrongLDelim:mh,emStrongRDelimAst:bh,emStrongRDelimUnd:kh,escape:ch,link:Dh,nolink:aa,punctuation:fh,reflink:la,reflinkSearch:Rh,tag:Nh,text:uh,url:cn},Eh={..._i,link:ue(/^!?\[(label)\]\((.*?)\)/).replace("label",or).getRegex(),reflink:ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",or).getRegex()},Hr={..._i,emStrongRDelimAst:yh,emStrongLDelim:xh,delLDelim:vh,delRDelim:Sh,url:ue(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",co).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ue(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",co).getRegex()},Ih={...Hr,br:ue(sa).replace("{2,}","*").getRegex(),text:ue(Hr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ws={normal:Ei,gfm:lh,pedantic:ah},us={normal:_i,gfm:Hr,breaks:Ih,pedantic:Eh},_h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uo=t=>_h[t];function Vt(t,e){if(e){if(st.escapeTest.test(t))return t.replace(st.escapeReplace,uo)}else if(st.escapeTestNoEncode.test(t))return t.replace(st.escapeReplaceNoEncode,uo);return t}function fo(t){try{t=encodeURI(t).replace(st.percentDecode,"%")}catch{return null}return t}function ho(t,e){let n=t.replace(st.findPipe,(i,o,l)=>{let a=!1,d=o;for(;--d>=0&&l[d]==="\\";)a=!a;return a?"|":" |"}),r=n.split(st.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(st.slashPipe,"|");return r}function fs(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function Ah(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Bh(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function po(t,e,n,r,s){let i=e.href,o=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function Oh(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
8
- `).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=s.length?i.slice(s.length):i}).join(`
9
- `)}var lr=class{options;rules;lexer;constructor(t){this.options=t||bn}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:fs(n,`
10
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Oh(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=fs(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:fs(e[0],`
11
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=fs(e[0],`
12
- `).split(`
13
- `),r="",s="",i=[];for(;n.length>0;){let o=!1,l=[],a;for(a=0;a<n.length;a++)if(this.rules.other.blockquoteStart.test(n[a]))l.push(n[a]),o=!0;else if(!o)l.push(n[a]);else break;n=n.slice(a);let d=l.join(`
14
- `),u=d.replace(this.rules.other.blockquoteSetextReplace,`
15
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
16
- ${d}`:d,s=s?`${s}
17
- ${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=f,n.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let h=p,m=h.raw+`
18
- `+n.join(`
19
- `),y=this.blockquote(m);i[i.length-1]=y,r=r.substring(0,r.length-h.raw.length)+y.raw,s=s.substring(0,s.length-h.text.length)+y.text;break}else if(p?.type==="list"){let h=p,m=h.raw+`
20
- `+n.join(`
21
- `),y=this.list(m);i[i.length-1]=y,r=r.substring(0,r.length-p.raw.length)+y.raw,s=s.substring(0,s.length-h.raw.length)+y.raw,n=m.substring(i.at(-1).raw.length).split(`
22
- `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let a=!1,d="",u="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let f=Bh(e[2].split(`
23
- `,1)[0],e[1].length),p=t.split(`
24
- `,1)[0],h=!f.trim(),m=0;if(this.options.pedantic?(m=2,u=f.trimStart()):h?m=e[1].length+1:(m=f.search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=f.slice(m),m+=e[1].length),h&&this.rules.other.blankLine.test(p)&&(d+=p+`
25
- `,t=t.substring(p.length+1),a=!0),!a){let y=this.rules.other.nextBulletRegex(m),b=this.rules.other.hrRegex(m),g=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m),v=this.rules.other.blockquoteBeginRegex(m);for(;t;){let S=t.split(`
26
- `,1)[0],T;if(p=S,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),T=p):T=p.replace(this.rules.other.tabCharGlobal," "),g.test(p)||x.test(p)||k.test(p)||v.test(p)||y.test(p)||b.test(p))break;if(T.search(this.rules.other.nonSpaceChar)>=m||!p.trim())u+=`
27
- `+T.slice(m);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||g.test(f)||x.test(f)||b.test(f))break;u+=`
28
- `+p}h=!p.trim(),d+=S+`
29
- `,t=t.substring(S.length+1),f=T.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),s.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),s.raw+=d}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(a.raw);if(d){let u={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};a.checked=u.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=u.raw+a.tokens[0].raw,a.tokens[0].text=u.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(u)):a.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):a.tokens.unshift(u)}}if(!s.loose){let d=a.tokens.filter(f=>f.type==="space"),u=d.length>0&&d.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=u}}if(s.loose)for(let a of s.items){a.loose=!0;for(let d of a.tokens)d.type==="text"&&(d.type="paragraph")}return s}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=ho(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of s)i.rows.push(ho(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
31
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=fs(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Ah(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),po(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return po(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let u=[...r[0]][0].length,f=t.slice(0,s+r.index+u+o);if(Math.min(s,o)%2){let h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...r[0]][0].length,u=t.slice(0,s+r.index+d+o),f=u.slice(s,-s);return{type:"del",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Mt=class Wr{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||bn,this.options.tokenizer=this.options.tokenizer||new lr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:st,block:Ws.normal,inline:us.normal};this.options.pedantic?(n.block=Ws.pedantic,n.inline=us.pedantic):this.options.gfm&&(n.block=Ws.gfm,this.options.breaks?n.inline=us.breaks:n.inline=us.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ws,inline:us}}static lex(e,n){return new Wr(n).lex(e)}static lexInline(e,n){return new Wr(n).inlineTokens(e)}lex(e){e=e.replace(st.carriageReturn,`
32
- `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(st.tabCharGlobal," ").replace(st.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=n.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
33
- `:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
34
- `)?"":`
35
- `)+s.raw,o.text+=`
36
- `+s.text,this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
37
- `)?"":`
38
- `)+s.raw,o.text+=`
39
- `+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(d=>{a=d.call({lexer:this},l),typeof a=="number"&&a>=0&&(o=Math.min(o,a))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
40
- `)?"":`
41
- `)+s.raw,o.text+=`
42
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
43
- `)?"":`
44
- `)+s.raw,o.text+=`
45
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(u=>(a=u.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let u=n.at(-1);a.type==="text"&&u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,r,l)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let d=e;if(this.options.extensions?.startInline){let u=1/0,f=e.slice(1),p;this.options.extensions.startInline.forEach(h=>{p=h.call({lexer:this},f),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(d=e.substring(0,u+1))}if(a=this.tokenizer.inlineText(d)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=a.raw,u.text+=a.text):n.push(a);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},ar=class{options;parser;constructor(t){this.options=t||bn}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(st.notSpaceStart)?.[0],s=t.replace(st.endingNewline,"")+`
46
- `;return r?'<pre><code class="language-'+Vt(r)+'">'+(n?s:Vt(s,!0))+`</code></pre>
47
- `:"<pre><code>"+(n?s:Vt(s,!0))+`</code></pre>
48
- `}blockquote({tokens:t}){return`<blockquote>
49
- ${this.parser.parse(t)}</blockquote>
50
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
51
- `}hr(t){return`<hr>
52
- `}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o<t.items.length;o++){let l=t.items[o];r+=this.listitem(l)}let s=e?"ol":"ul",i=e&&n!==1?' start="'+n+'"':"";return"<"+s+i+`>
53
- `+r+"</"+s+`>
54
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
55
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
56
- `}table(t){let e="",n="";for(let s=0;s<t.header.length;s++)n+=this.tablecell(t.header[s]);e+=this.tablerow({text:n});let r="";for(let s=0;s<t.rows.length;s++){let i=t.rows[s];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
57
- <thead>
58
- `+e+`</thead>
59
- `+r+`</table>
60
- `}tablerow({text:t}){return`<tr>
61
- ${t}</tr>
62
- `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
63
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Vt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),s=fo(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+Vt(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=fo(t);if(s===null)return Vt(n);t=s;let i=`<img src="${t}" alt="${Vt(n)}"`;return e&&(i+=` title="${Vt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Vt(t.text)}},Ai=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},zt=class Vr{options;renderer;textRenderer;constructor(e){this.options=e||bn,this.options.renderer=this.options.renderer||new ar,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ai}static parse(e,n){return new Vr(n).parse(e)}static parseInline(e,n){return new Vr(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let o=s,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let i=s;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=l||"";continue}}let o=i;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return r}},gs=class{options;block;constructor(t){this.options=t||bn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Mt.lex:Mt.lexInline}provideParser(t=this.block){return t?zt.parse:zt.parseInline}},$h=class{defaults=ji();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=zt;Renderer=ar;TextRenderer=Ai;Lexer=Mt;Tokenizer=lr;Hooks=gs;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let o=s[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){let s=this.defaults.renderer||new ar(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=n.renderer[o],a=s[o];s[o]=(...d)=>{let u=l.apply(s,d);return u===!1&&(u=a.apply(s,d)),u||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new lr(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=n.tokenizer[o],a=s[o];s[o]=(...d)=>{let u=l.apply(s,d);return u===!1&&(u=a.apply(s,d)),u}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new gs;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=n.hooks[o],a=s[o];gs.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async&&gs.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await l.call(s,d);return a.call(s,f)})();let u=l.call(s,d);return a.call(s,u)}:s[o]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,d);return f===!1&&(f=await a.apply(s,d)),f})();let u=l.apply(s,d);return u===!1&&(u=a.apply(s,d)),u}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Mt.lex(t,e??this.defaults)}parser(t,e){return zt.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(t):t?Mt.lex:Mt.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser(t):t?zt.parse:zt.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(t):t?Mt.lex:Mt.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(t):t?zt.parse:zt.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(t,e){return n=>{if(n.message+=`
64
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Vt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},pn=new $h;function me(t,e){return pn.parse(t,e)}me.options=me.setOptions=function(t){return pn.setOptions(t),me.defaults=pn.defaults,Jl(me.defaults),me};me.getDefaults=ji;me.defaults=bn;me.use=function(...t){return pn.use(...t),me.defaults=pn.defaults,Jl(me.defaults),me};me.walkTokens=function(t,e){return pn.walkTokens(t,e)};me.parseInline=pn.parseInline;me.Parser=zt;me.parser=zt.parse;me.Renderer=ar;me.TextRenderer=Ai;me.Lexer=Mt;me.lexer=Mt.lex;me.Tokenizer=lr;me.Hooks=gs;me.parse=me;me.options;me.setOptions;me.use;me.walkTokens;me.parseInline;zt.parse;Mt.lex;function Mh(t,e){const r=e.split(`
65
- `).flatMap(s=>[s,""]).map(s=>`${t}${s}`).join(`
66
- `);return r.slice(0,r.length-1)}function zh(t,e){const n=[];return Array.from(t.keys()).forEach(r=>{(!e||!e.marks||!e.marks.map(s=>s.type).includes(r))&&n.push(r)}),n}function Lh(t,e){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{t.has(r)||n.push({type:r,mark:s})}),n}function Ph(t,e,n,r){const s=!n,i=n&&n.type==="text"&&(!n.marks||n.marks.length===0),o=n&&n.type==="text"&&n.marks&&!r(e,new Map(n.marks.map(a=>[a.type,a]))),l=[];if(s||i||o)if(n&&n.type==="text"&&n.marks){const a=new Map(n.marks.map(d=>[d.type,d]));Array.from(t.keys()).forEach(d=>{a.has(d)||l.push(d)})}else(s||i)&&l.push(...Array.from(t.keys()));return l}function Fh(t,e){let n="";return Array.from(t.keys()).reverse().forEach(r=>{const s=t.get(r),i=e(r,s);i&&(n=i+n)}),t.clear(),n}function Uh(t,e,n){let r="";return Array.from(t.entries()).forEach(([s,i])=>{const o=n(s,i);o&&(r+=o),e.set(s,i)}),r}function Ar(t){const n=(t.raw||t.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return n?{isTask:!0,checked:n[2].toLowerCase()==="x",indentLevel:n[1].length}:{isTask:!1,indentLevel:0}}function Vs(t,e){return typeof t!="string"?"json":e}var qh=class{constructor(t){this.baseExtensions=[],this.extensions=[],this.lastParseResult=null;var e,n,r,s,i;this.markedInstance=(e=t?.marked)!=null?e:me,this.lexer=new this.markedInstance.Lexer,this.indentStyle=(r=(n=t?.indentation)==null?void 0:n.style)!=null?r:"space",this.indentSize=(i=(s=t?.indentation)==null?void 0:s.size)!=null?i:2,this.baseExtensions=t?.extensions||[],t?.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(t.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,t?.extensions&&(this.baseExtensions=t.extensions,vc(t.extensions).forEach(l=>this.registerExtension(l,!1))),this.lexer=new this.markedInstance.Lexer}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(t,e=!0){var n,r;this.extensions.push(t);const s=t.name,i=ds(t,"markdownTokenName")||s,o=ds(t,"parseMarkdown"),l=ds(t,"renderMarkdown"),a=ds(t,"markdownTokenizer"),d=(n=ds(t,"markdownOptions"))!=null?n:null,u=(r=d?.indentsContent)!=null?r:!1,f={tokenName:i,nodeName:s,parseMarkdown:o,renderMarkdown:l,isIndenting:u,tokenizer:a};if(i&&o){const p=this.registry.get(i)||[];p.push(f),this.registry.set(i,p)}if(l){const p=this.nodeTypeRegistry.get(s)||[];p.push(f),this.nodeTypeRegistry.set(s,p)}a&&this.hasMarked()&&(this.registerTokenizer(a),e&&(this.lexer=new this.markedInstance.Lexer))}registerTokenizer(t){if(!this.hasMarked())return;const{name:e,start:n,level:r="inline",tokenize:s}=t,l={inlineTokens:u=>this.lexer.inlineTokens(u),blockTokens:u=>this.lexer.blockTokens(u)};let a;n?a=typeof n=="function"?n:u=>u.indexOf(n):a=u=>{const f=s(u,[],l);return f&&f.raw?u.indexOf(f.raw):-1};const d={name:e,level:r,start:a,tokenizer:(u,f)=>{const p=s(u,f,l);if(p&&p.type)return{...p,type:p.type||e,raw:p.raw||"",tokens:p.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[d]})}getHandlersForToken(t){try{return this.registry.get(t)||[]}catch{return[]}}getHandlerForToken(t){const e=this.getHandlersForToken(t);if(e.length>0)return e[0];const n=this.getHandlersForNodeType(t);return n.length>0?n[0]:void 0}getHandlersForNodeType(t){try{return this.nodeTypeRegistry.get(t)||[]}catch{return[]}}serialize(t){if(!t)return"";const e=this.renderNodes(t,t);return this.isEmptyOutput(e)?"":e}isEmptyOutput(t){return!t||t.trim()===""?!0:t.replace(/&nbsp;/g,"").replace(/\u00A0/g,"").trim()===""}parse(t){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const e=this.markedInstance.lexer(t);return{type:"doc",content:this.parseTokens(e,!0)}}parseTokens(t,e=!1){const n=t.reduce((i,o,l)=>(o.type!=="space"&&i.push(l),i),[]);let r=-1,s=0;return t.flatMap((i,o)=>{for(var l;s<n.length&&n[s]<o;)r=n[s],s+=1;if(e&&i.type==="space"){const d=(l=n[s])!=null?l:-1;return this.createImplicitEmptyParagraphsFromSpace(i,r,d)}const a=this.parseToken(i,e);return a===null?[]:Array.isArray(a)?a:[a]})}createImplicitEmptyParagraphsFromSpace(t,e,n){const r=this.countParagraphSeparators(t.raw||"");if(r===0)return[];const i=Math.max(r-(e===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(t){return(t.replace(/\r\n/g,`
67
- `).match(/\n\n/g)||[]).length}parseToken(t,e=!1){if(!t.type)return null;if(t.type==="list")return this.parseListToken(t);const n=this.getHandlersForToken(t.type),r=this.createParseHelpers();if(n.find(i=>{if(!i.parseMarkdown)return!1;const o=i.parseMarkdown(t,r),l=this.normalizeParseResult(o);return l&&(!Array.isArray(l)||l.length>0)?(this.lastParseResult=l,!0):!1})&&this.lastParseResult){const i=this.lastParseResult;return this.lastParseResult=null,i}return this.parseFallbackToken(t,e)}parseListToken(t){if(!t.items||t.items.length===0)return this.parseTokenWithHandlers(t);const e=t.items.some(l=>Ar(l).isTask),n=t.items.some(l=>!Ar(l).isTask);if(!e||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(t);const r=[];let s=[],i=null;for(let l=0;l<t.items.length;l+=1){const a=t.items[l],{isTask:d,checked:u,indentLevel:f}=Ar(a);let p=a;if(d){const y=(a.raw||a.text||"").split(`
68
- `),b=y[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),g=b?b[2]:"";let x=[];if(y.length>1&&y.slice(1).join(`
69
- `).trim()){const v=y.slice(1),S=v.filter(T=>T.trim());if(S.length>0){const T=Math.min(...S.map(D=>D.length-D.trimStart().length)),j=v.map(D=>D.trim()?D.slice(T):"").join(`
70
- `).trim();j&&(x=this.markedInstance.lexer(`${j}
71
- `))}}p={type:"taskItem",raw:"",mainContent:g,indentLevel:f,checked:u??!1,text:g,tokens:this.lexer.inlineTokens(g),nestedTokens:x}}const h=d?"taskList":"list";i!==h?(s.length>0&&r.push({type:i,items:s}),s=[p],i=h):s.push(p)}s.length>0&&r.push({type:i,items:s});const o=[];for(let l=0;l<r.length;l+=1){const a=r[l],d={...t,type:a.type,items:a.items},u=this.parseToken(d);u&&(Array.isArray(u)?o.push(...u):o.push(u))}return o.length>0?o:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(t,n),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){var e,n,r,s;const i=[];for(let o=0;o<t.length;o+=1){const l=t[o];if(l.type==="text")i.push({type:"text",text:l.text||""});else if(l.type==="html"){const a=((n=(e=l.raw)!=null?e:l.text)!=null?n:"").toString(),d=/^<\/[\s]*[\w-]+/i.test(a),u=a.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!d&&u&&!/\/>$/.test(a)){const p=u[1],h=this.escapeRegex(p),m=new RegExp(`^<\\/\\s*${h}\\b`,"i");let y=-1;const b=[a];for(let g=o+1;g<t.length;g+=1){const x=t[g],k=((s=(r=x.raw)!=null?r:x.text)!=null?s:"").toString();if(b.push(k),x.type==="html"&&m.test(k)){y=g;break}}if(y!==-1){const g=b.join(""),x={type:"html",raw:g,text:g,block:!1},k=this.parseHTMLToken(x);if(k){const v=this.normalizeParseResult(k);Array.isArray(v)?i.push(...v):v&&i.push(v)}o=y;continue}}const f=this.parseHTMLToken(l);if(f){const p=this.normalizeParseResult(f);Array.isArray(p)?i.push(...p):p&&i.push(p)}}else if(l.type){const a=this.getHandlerForToken(l.type);if(a&&a.parseMarkdown){const d=this.createParseHelpers(),u=a.parseMarkdown(l,d);if(this.isMarkResult(u)){const f=this.applyMarkToContent(u.mark,u.content,u.attrs);i.push(...f)}else{const f=this.normalizeParseResult(u);Array.isArray(f)?i.push(...f):f&&i.push(f)}}else l.tokens&&i.push(...this.parseInlineTokens(l.tokens))}}return i}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:t.text||""};case"html":return this.parseHTMLToken(t);case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(typeof window>"u")return t.block?{type:"paragraph",content:[{type:"text",text:e}]}:{type:"text",text:e};try{const n=wc(e,this.baseExtensions);return n.type==="doc"&&n.content?t.block?n.content:n.content.length===1&&n.content[0].type==="paragraph"&&n.content[0].content?n.content[0].content:n.content:n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return t.text||"";if(!t.type)return"";const o=this.getHandlerForToken(t.type);if(!o)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,a={renderChildren:(f,p)=>{const h=o.isIndenting?r+1:r;return!Array.isArray(f)&&f.content?this.renderNodes(f.content,t,p||"",n,h):this.renderNodes(f,t,p||"",n,h)},renderChild:(f,p)=>{const h=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(f,t,p,h)},indent:f=>this.indentString+f,wrapInBlock:Mh},d={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=o.renderMarkdown)==null?void 0:i.call(o,t,a,d))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map;return t.forEach((o,l)=>{const a=l<t.length-1?t[l+1]:null;if(o.type)if(o.type==="text"){let d=o.text||"";const u=new Map((o.marks||[]).map(g=>[g.type,g])),f=Lh(i,u),p=zh(u,a);let h="";if(p.length>0){const g=d.match(/(\s+)$/);g&&(h=g[1],d=d.slice(0,-h.length))}p.forEach(g=>{const x=u.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.has(g)&&i.delete(g)});let m="";if(f.length>0){const g=d.match(/^(\s+)/);g&&(m=g[1],d=d.slice(m.length))}f.forEach(({type:g,mark:x})=>{const k=this.getMarkOpening(g,x);k&&(d=k+d),p.includes(g)||i.set(g,x)}),d=m+d;const y=Ph(i,u,a,this.markSetsEqual.bind(this));let b="";if(y.length>0){const g=d.match(/(\s+)$/);g&&(b=g[1],d=d.slice(0,-b.length))}y.forEach(g=>{const x=i.get(g),k=this.getMarkClosing(g,x);k&&(d+=k),i.delete(g)}),d+=b,d+=h,s.push(d)}else{const d=new Map(i),u=Fh(i,this.getMarkClosing.bind(this)),f=this.renderNodeToMarkdown(o,e,l,r),p=o.type==="hardBreak"?"":Uh(d,i,this.getMarkOpening.bind(this));s.push(u+f+p)}}),s.join(n)}getMarkOpening(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:a=>a,wrapInBlock:(a,d)=>a+d},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s);return l>=0?o.substring(0,l):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e){const n=this.getHandlersForNodeType(t),r=n.length>0?n[0]:void 0;if(!r||!r.renderMarkdown)return"";const s="__TIPTAP_MARKDOWN_PLACEHOLDER__",i={type:t,attrs:e.attrs||{},content:[{type:"text",text:s}]};try{const o=r.renderMarkdown(i,{renderChildren:()=>s,renderChild:()=>s,indent:d=>d,wrapInBlock:(d,u)=>d+u},{index:0,level:0,parentType:"text",meta:{}}),l=o.indexOf(s),a=l+s.length;return l>=0?o.substring(a):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.keys()).every(n=>e.has(n))}},go=qh,Kh=oi.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return Xt.setContent(t,e);if(Vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Xt.setContent(t,e);const r=this.editor.markdown.parse(t);return Xt.setContent(r,e)},insertContent:(t,e)=>{if(!e?.contentType)return Xt.insertContent(t,e);if(Vs(t,e?.contentType)!=="markdown"||!this.editor.markdown)return Xt.insertContent(t,e);const r=this.editor.markdown.parse(t);return Xt.insertContent(r,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return Xt.insertContentAt(t,e,n);if(Vs(e,n?.contentType)!=="markdown"||!this.editor.markdown)return Xt.insertContentAt(t,e,n);const s=this.editor.markdown.parse(e);return Xt.insertContentAt(t,s,n)}}},addStorage(){return{manager:new go({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new go({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Vs(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);this.editor.options.content=e}});function Hh(t){const e=F.c(25),{node:n,selected:r,editor:s,deleteNode:i}=t,o=le(),l=typeof n.attrs.href=="string"?n.attrs.href:"",a=typeof n.attrs.name=="string"?n.attrs.name:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.fileNameFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const u=d,f=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let p;e[3]!==f?(p=ee("mx-0.5 inline-flex max-w-full select-none items-center gap-1.5 rounded-lg border border-border bg-card px-2 py-1 align-middle text-sm text-foreground",f),e[3]=f,e[4]=p):p=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Oa,{size:14,className:"shrink-0 text-muted-foreground"}),e[5]=h):h=e[5];let m;e[6]!==u?(m=c.jsx("span",{className:"min-w-0 truncate",children:u}),e[6]=u,e[7]=m):m=e[7];let y;e[8]!==u||e[9]!==o?(y=o("markdownEditor.downloadFile",{name:u}),e[8]=u,e[9]=o,e[10]=y):y=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=c.jsx(Ac,{size:14}),e[11]=b):b=e[11];let g;e[12]!==l||e[13]!==u||e[14]!==y?(g=c.jsx("a",{href:l,download:u,"aria-label":y,onMouseDown:Vh,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:b}),e[12]=l,e[13]=u,e[14]=y,e[15]=g):g=e[15];let x;e[16]!==i||e[17]!==s.isEditable||e[18]!==o?(x=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeFile"),onMouseDown:Wh,onClick:i,className:"shrink-0 rounded-md p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(dn,{size:14})}),e[16]=i,e[17]=s.isEditable,e[18]=o,e[19]=x):x=e[19];let k;return e[20]!==p||e[21]!==m||e[22]!==g||e[23]!==x?(k=c.jsxs(tl,{as:"span",className:p,children:[h,m,g,x]}),e[20]=p,e[21]=m,e[22]=g,e[23]=x,e[24]=k):k=e[24],k}function Wh(t){return t.preventDefault()}function Vh(t){return t.preventDefault()}function Qh(t){return t.replace(/([[\]])/g,"\\$1")}const Gh=Zo.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]"}]},renderHTML({HTMLAttributes:t,node:e}){return["a",el(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${Qh(n)}](${e})`},addNodeView(){return Jo(Hh)}});var Xh=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Yh=Zo.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",el(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,o;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",a=(s=(r=t.attrs)==null?void 0:r.alt)!=null?s:"",d=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return d?`![${a}](${l} "${d}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");Object.entries(o).forEach(([f,p])=>{if(p!=null)switch(f){case"width":case"height":break;default:a.setAttribute(f,p);break}}),a.src=o.src;const d=new Cc({element:a,editor:l,node:s,getPos:i,onResize:(f,p)=>{a.style.width=`${f}px`,a.style.height=`${p}px`},onCommit:(f,p)=>{const h=i();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:f,height:p}).run()},onUpdate:(f,p,h)=>f.type===s.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),u=d.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",a.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Sc({find:Xh,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Zh=Yh;function Jh(t){const e=F.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,o=le(),l=typeof n.attrs.src=="string"?n.attrs.src:"",a=typeof n.attrs.alt=="string"?n.attrs.alt:"";let d;e[0]!==a||e[1]!==o?(d=a||o("markdownEditor.imageAltFallback"),e[0]=a,e[1]=o,e[2]=d):d=e[2];const u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let f;e[3]!==u?(f=ee("max-h-[420px] max-w-full rounded-lg border border-border object-contain",u),e[3]=u,e[4]=f):f=e[4];let p;e[5]!==l||e[6]!==d||e[7]!==f?(p=c.jsx("img",{src:l,alt:d,draggable:!1,className:f}),e[5]=l,e[6]=d,e[7]=f,e[8]=p):p=e[8];let h;e[9]!==i||e[10]!==s.isEditable||e[11]!==o?(h=s.isEditable&&c.jsx("button",{type:"button","aria-label":o("markdownEditor.removeImage"),onMouseDown:ep,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:c.jsx(dn,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=o,e[12]=h):h=e[12];let m;return e[13]!==p||e[14]!==h?(m=c.jsxs(tl,{className:"group/image relative my-3 w-fit max-w-full",children:[p,h]}),e[13]=p,e[14]=h,e[15]=m):m=e[15],m}function ep(t){return t.preventDefault()}const tp=Zh.extend({addNodeView(){return Jo(Jh)}}).configure({inline:!1,allowBase64:!1}),Qr="uploads",np="editor-images",ca="editor-files",sp=new RegExp(`^/api/[^/]+/fs/${Qr}/read$`),mo="http://relative.invalid";function rp(t){let e;try{e=new URL(t,mo)}catch{return!1}return e.origin!==mo||!sp.test(e.pathname)?!1:(e.searchParams.get("path")??"").startsWith(`${ca}/`)}const ip={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},op=jc.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";return rp(n)?e.createNode("attachment",{href:n,name:t.text??""}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function lp(t=""){return[Tc.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),op.configure(ip),ed.configure({placeholder:t}),tp,Gh,Kh.configure({markedOptions:{breaks:!0}})]}const ap=10,cp=25,dp={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function up(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??dp[t.type]??(Bi(t)?".png":"")}function Bi(t){return t.type.startsWith("image/")}function fp(){const t=le(),{upload:e}=kd(Qr),n=yd(Qr),[r,s]=w.useState(0);return{uploadFile:async o=>{const l=Bi(o),a=l?ap:cp;if(o.size>a*1024*1024)return St.error(t("markdownEditor.fileTooLarge",{name:o.name,max:String(a)})),null;const d=l?np:ca,u=`${crypto.randomUUID()}${up(o)}`;s(f=>f+1);try{return await e.mutateAsync({dir:d,files:[new File([o],u,{type:o.type})]}),n(`${d}/${u}`)}catch{return St.error(t("markdownEditor.uploadFailed",{name:o.name})),null}finally{s(f=>f-1)}},pending:r}}const hp=["outline-none","min-h-[200px] sm:min-h-[320px]","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-2 [&_p]:leading-relaxed","[&_h1]:mb-2 [&_h1]:mt-5 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-snug","[&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-snug","[&_h3]:mb-1 [&_h3]:mt-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-snug","[&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-[13px]","[&_pre_code]:bg-transparent [&_pre_code]:p-0","[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2","[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold"].join(" "),pp=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function xo(t,e,n,r){const s=t.state.schema.nodes[n];if(!s)return e;const i=t.state.tr.replaceWith(e,e,s.create(r)),o=i.mapping.map(e,1);return i.setSelection(Qt.near(i.doc.resolve(o))),t.dispatch(i),t.state.selection.to}function gp({defaultValue:t,onChange:e,placeholder:n,editable:r=!0}){const s=le(),{uploadFile:i,pending:o}=fp(),l=w.useRef(null),a=w.useRef(e),d=w.useRef(i);a.current=e,d.current=i;const u=(h,m,y)=>m.length===0?!1:((async()=>{let b=y;for(const g of m){const x=await d.current(g);x&&(b=Bi(g)?xo(h,b,"image",{src:x,alt:g.name}):xo(h,b,"attachment",{href:x,name:g.name}))}})(),!0),f=Nc({extensions:lp(n),content:t,contentType:"markdown",editable:r,editorProps:{attributes:{class:ee(hp,pp)},handlePaste:(h,m)=>u(h,Array.from(m.clipboardData?.files??[]),h.state.selection.to),handleDrop:(h,m,y,b)=>{if(b)return!1;const g=Array.from(m.dataTransfer?.files??[]),x=h.posAtCoords({left:m.clientX,top:m.clientY})?.pos;return x===void 0?!1:u(h,g,x)}},onUpdate:({editor:h})=>a.current(h.getMarkdown())});if(!f)return null;const p=h=>{!h||h.length===0||u(f.view,Array.from(h),f.state.selection.to)};return c.jsxs("div",{className:"flex flex-col",children:[c.jsx(Qf,{editor:f}),c.jsx(Dc,{editor:f,className:"text-[15px] text-foreground"}),c.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground",children:[r&&c.jsx(_e,{type:"button",variant:"ghost",size:"icon-sm","aria-label":s("markdownEditor.attachFile"),onClick:()=>l.current?.click(),children:c.jsx($a,{size:14})}),o>0&&c.jsxs("span",{className:"inline-flex items-center gap-1.5","aria-live":"polite",role:"status",children:[c.jsx(Ns,{size:12,className:"animate-spin"}),o===1?s("markdownEditor.uploading"):s("markdownEditor.uploadingCount",{count:String(o)})]})]}),c.jsx("input",{ref:l,type:"file",multiple:!0,className:"hidden",onChange:h=>{p(h.target.files),h.target.value=""}})]})}const mp=1e4;function xp(t){const e=F.c(10),{locator:n}=$e(),r=mn();let s;e[0]!==t||e[1]!==n?(s=ge.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,refetchInterval:mp,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Xe(l)}function da(t){const e=F.c(10),{locator:n}=$e(),r=mn();let s;e[0]!==t||e[1]!==n?(s=ge.taskBoardActivity(n,t??""),e[0]=t,e[1]=n,e[2]=s):s=e[2];const i=!!t;let o;e[3]!==t||e[4]!==r?(o=async()=>(await r.call("TASK_BOARD_ACTIVITY_LIST",{taskBoardItemId:t})).activity,e[3]=t,e[4]=r,e[5]=o):o=e[5];let l;return e[6]!==s||e[7]!==i||e[8]!==o?(l={queryKey:s,enabled:i,queryFn:o},e[6]=s,e[7]=i,e[8]=o,e[9]=l):l=e[9],Xe(l)}function bp(t){const e=F.c(10),{locator:n}=$e(),r=mn(),s=gn();let i;e[0]!==t||e[1]!==r?(i=async()=>await r.call("TASK_BOARD_PROMOTE_TO_PRODUCTION",{taskBoardItemId:t}),e[0]=t,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==t||e[4]!==n||e[5]!==s?(o=()=>{s.invalidateQueries({queryKey:ge.taskBoardItemPrs(n,t)}),s.invalidateQueries({queryKey:ge.taskBoardActivity(n,t)})},e[3]=t,e[4]=n,e[5]=s,e[6]=o):o=e[6];let l;return e[7]!==i||e[8]!==o?(l={mutationFn:i,onSuccess:o},e[7]=i,e[8]=o,e[9]=l):l=e[9],Ge(l)}function yp(t){const e=[];return t.qa&&e.push("qa"),t.codeReview&&e.push("code_review"),e}function kp(t,e){return e.length===0?!0:rc(t,e)}function Oi(t){const e=F.c(54),{members:n,onSelect:r}=t,s=le();let i;e[0]!==s?(i=s("taskBoard.taskDialog.assignToPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==i?(o=c.jsx(li,{placeholder:i,className:"h-9"}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s?(l=s("taskBoard.taskDialog.noMembersFound"),e[4]=s,e[5]=l):l=e[5];let a;e[6]!==l?(a=c.jsx(ai,{children:l}),e[6]=l,e[7]=a):a=e[7];let d;e[8]!==s?(d=s("taskBoard.taskDialog.superAgentLabel"),e[8]=s,e[9]=d):d=e[9];let u;e[10]!==r?(u=()=>r(ze),e[10]=r,e[11]=u):u=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(Lt,{size:16}),e[12]=f):f=e[12];let p;e[13]!==s?(p=s("taskBoard.taskDialog.superAgentLabel"),e[13]=s,e[14]=p):p=e[14];let h;e[15]!==p?(h=c.jsx("span",{className:"truncate",children:p}),e[15]=p,e[16]=h):h=e[16];let m;e[17]!==d||e[18]!==u||e[19]!==h?(m=c.jsxs(Jt,{value:d,onSelect:u,className:"gap-2",children:[f,h]}),e[17]=d,e[18]=u,e[19]=h,e[20]=m):m=e[20];let y;e[21]!==s?(y=s("taskBoard.taskDialog.unassignedLabel"),e[21]=s,e[22]=y):y=e[22];let b;e[23]!==r?(b=()=>r(null),e[23]=r,e[24]=b):b=e[24];let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=c.jsx(Mr,{size:16,className:"text-muted-foreground"}),e[25]=g):g=e[25];let x;e[26]!==s?(x=s("taskBoard.taskDialog.unassignedLabel"),e[26]=s,e[27]=x):x=e[27];let k;e[28]!==x?(k=c.jsx("span",{className:"truncate",children:x}),e[28]=x,e[29]=k):k=e[29];let v;e[30]!==y||e[31]!==b||e[32]!==k?(v=c.jsxs(Jt,{value:y,onSelect:b,className:"gap-2",children:[g,k]}),e[30]=y,e[31]=b,e[32]=k,e[33]=v):v=e[33];let S;e[34]!==m||e[35]!==v?(S=c.jsxs(ns,{children:[m,v]}),e[34]=m,e[35]=v,e[36]=S):S=e[36];let T;e[37]!==s?(T=s("taskBoard.taskDialog.membersGroupHeading"),e[37]=s,e[38]=T):T=e[38];let C;if(e[39]!==n||e[40]!==r){let N;e[42]!==r?(N=I=>c.jsxs(Jt,{value:I.user?.name??I.userId,onSelect:()=>r(I.userId),className:"gap-2",children:[c.jsx(At,{url:I.user?.image??void 0,fallback:_t(I.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:I.user?.name??I.userId})]},I.userId),e[42]=r,e[43]=N):N=e[43],C=n.map(N),e[39]=n,e[40]=r,e[41]=C}else C=e[41];let j;e[44]!==T||e[45]!==C?(j=c.jsx(ns,{heading:T,children:C}),e[44]=T,e[45]=C,e[46]=j):j=e[46];let D;e[47]!==S||e[48]!==j||e[49]!==a?(D=c.jsxs(ci,{children:[a,S,j]}),e[47]=S,e[48]=j,e[49]=a,e[50]=D):D=e[50];let R;return e[51]!==o||e[52]!==D?(R=c.jsxs(di,{children:[o,D]}),e[51]=o,e[52]=D,e[53]=R):R=e[53],R}function vp({tags:t,selectedIds:e,defaultColor:n,onToggle:r,onCreate:s,onDelete:i}){const o=le(),[l,a]=w.useState(""),[d,u]=w.useState(!1),[f,p]=w.useState(n),h=l.trim(),m=t.some(b=>b.name.toLowerCase()===h.toLowerCase()),y=async()=>{if(!(!h||m||d)){u(!0);try{await s(h,f),a("")}finally{u(!1)}}};return c.jsxs(di,{children:[c.jsx(li,{value:l,onValueChange:a,placeholder:o("taskBoard.taskDialog.tagFilterPlaceholder"),className:"h-9"}),c.jsxs(ci,{children:[h&&!m?c.jsx(ns,{children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"color",value:f,onChange:b=>p(b.target.value),"aria-label":o("taskBoard.taskDialog.pickTagColorAriaLabel"),className:"ml-2 size-4 shrink-0 cursor-pointer appearance-none rounded-full border-0 bg-transparent p-0 [&::-moz-color-swatch]:rounded-full [&::-moz-color-swatch]:border-0 [&::-webkit-color-swatch]:rounded-full [&::-webkit-color-swatch]:border-0 [&::-webkit-color-swatch-wrapper]:p-0"}),c.jsxs(Jt,{value:`create-${h}`,disabled:d,onSelect:y,className:"flex-1 gap-2",children:[c.jsx(ws,{size:16,className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:o("taskBoard.taskDialog.createTagOption",{name:h})})]})]})}):c.jsx(ai,{children:o("taskBoard.taskDialog.noTagsFound")}),c.jsx(ns,{children:t.map(b=>{const g=e.includes(b.id);return c.jsxs(Jt,{value:b.name,onSelect:()=>r(b.id),className:"group gap-2",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:As(b.color)}}),c.jsx("span",{className:"flex-1 truncate",children:b.name}),c.jsx("button",{type:"button","aria-label":o("taskBoard.taskDialog.deleteTagAriaLabel",{name:b.name}),className:"flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground opacity-0 hover:bg-background hover:text-destructive group-hover:opacity-100",onClick:x=>{x.stopPropagation(),i(b.id)},children:c.jsx(Zr,{size:13})}),g&&c.jsx(Ds,{size:14,className:"shrink-0 text-foreground"})]},b.id)})})]})]})}function wp(t){if(!t)return[];const e=[],n=new Set,r=(o,l)=>{n.has(o)||(n.add(o),e.push({url:o,label:l.trim()||o}))},s=t.replace(/!\[[^\]]*\]\([^)]*\)/g,"");for(const o of s.matchAll(/\[([^\]]*)\]\((https?:\/\/[^)\s]+)[^)]*\)/g))r(o[2]??"",o[1]??"");const i=s.replace(/\[[^\]]*\]\([^)]*\)/g,"");for(const o of i.matchAll(/https?:\/\/[^\s)]+/g))r(o[0],o[0]);return e}function Sp(t){const e=F.c(40),{thread:n,me:r,onReply:s,onDelete:i,onToggleResolved:o}=t,l=le(),[a,d]=w.useState(!1);if(n.resolved&&!a){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(!0),e[0]=x):x=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Ma,{size:16,className:"shrink-0 text-muted-foreground"}),e[1]=k):k=e[1];let v;e[2]!==l||e[3]!==n?(v=jp(n,l),e[2]=l,e[3]=n,e[4]=v):v=e[4];let S;e[5]!==v?(S=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:v}),e[5]=v,e[6]=S):S=e[6];let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=c.jsx($c,{size:16,className:"shrink-0 text-muted-foreground"}),e[7]=T):T=e[7];let C;return e[8]!==S?(C=c.jsxs("button",{type:"button",onClick:x,className:"flex w-full items-center gap-2.5 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-muted/60",children:[k,S,T]}),e[8]=S,e[9]=C):C=e[9],C}let u;e[10]!==l||e[11]!==n.resolved?(u=n.resolved&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>d(!1),className:"flex items-center justify-between gap-2 rounded-t-xl bg-muted/40 px-4 py-2.5 text-left text-sm text-muted-foreground transition-colors hover:text-foreground",children:[l("taskBoard.taskDialog.commentCollapseThread"),c.jsx(dn,{size:14,"aria-hidden":!0})]}),c.jsx(Br,{})]}),e[10]=l,e[11]=n.resolved,e[12]=u):u=e[12];let f;e[13]!==r||e[14]!==i||e[15]!==n?(f=bo(n,r)?()=>i(n.id):void 0,e[13]=r,e[14]=i,e[15]=n,e[16]=f):f=e[16];let p;e[17]!==o||e[18]!==f||e[19]!==n?(p=c.jsx(yo,{comment:n,onDelete:f,resolved:n.resolved,onToggleResolved:o}),e[17]=o,e[18]=f,e[19]=n,e[20]=p):p=e[20];let h;if(e[21]!==r||e[22]!==i||e[23]!==n.replies){let x;e[25]!==r||e[26]!==i?(x=(k,v)=>c.jsxs(w.Fragment,{children:[c.jsx(Br,{inset:v>0}),c.jsx(yo,{comment:k,onDelete:bo(k,r)?()=>i(k.id):void 0,isReply:!0})]},k.id),e[25]=r,e[26]=i,e[27]=x):x=e[27],h=n.replies.map(x),e[21]=r,e[22]=i,e[23]=n.replies,e[24]=h}else h=e[24];let m;e[28]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Br,{}),e[28]=m):m=e[28];let y;e[29]!==l?(y=l("taskBoard.taskDialog.commentReplyPlaceholder"),e[29]=l,e[30]=y):y=e[30];let b;e[31]!==r||e[32]!==s||e[33]!==y?(b=c.jsx(fa,{variant:"reply",placeholder:y,author:r,onSubmit:s}),e[31]=r,e[32]=s,e[33]=y,e[34]=b):b=e[34];let g;return e[35]!==u||e[36]!==p||e[37]!==h||e[38]!==b?(g=c.jsxs("div",{className:"flex flex-col rounded-xl bg-card card-shadow",children:[u,p,h,m,b]}),e[35]=u,e[36]=p,e[37]=h,e[38]=b,e[39]=g):g=e[39],g}function bo(t,e){return t.author.id===e.id||t.author.isAgent===!0}const Cp=new Intl.ListFormat(void 0,{style:"long",type:"conjunction"});function jp(t,e){const n=[t,...t.replies],r=Cp.format([...new Set(n.map(s=>s.author.name))]);return n.length===1?e("taskBoard.taskDialog.commentResolvedSummaryOne",{names:r}):e("taskBoard.taskDialog.commentResolvedSummaryMany",{count:n.length,names:r})}function Tp(t){const e=F.c(6),{me:n,onSubmit:r}=t,s=le();let i;e[0]!==s?(i=s("taskBoard.taskDialog.commentPlaceholder"),e[0]=s,e[1]=i):i=e[1];let o;return e[2]!==n||e[3]!==r||e[4]!==i?(o=c.jsx(fa,{variant:"root",placeholder:i,author:n,onSubmit:r}),e[2]=n,e[3]=r,e[4]=i,e[5]=o):o=e[5],o}function Br(t){const e=F.c(4),{inset:n}=t,r=n&&"ml-12";let s;e[0]!==r?(s=ee("h-px bg-border/50",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=c.jsx("span",{className:s}),e[2]=s,e[3]=i):i=e[3],i}function yo(t){const e=F.c(25),{comment:n,isReply:r,resolved:s,onDelete:i,onToggleResolved:o}=t;let l;e[0]!==n.author?(l=c.jsx(ua,{author:n.author}),e[0]=n.author,e[1]=l):l=e[1];let a;e[2]!==n.author.name?(a=c.jsx("span",{className:"text-sm font-medium text-foreground",children:n.author.name}),e[2]=n.author.name,e[3]=a):a=e[3];let d;e[4]!==n.createdAt?(d=ri(new Date(n.createdAt)),e[4]=n.createdAt,e[5]=d):d=e[5];let u;e[6]!==d?(u=c.jsx("span",{className:"text-sm text-muted-foreground",children:d}),e[6]=d,e[7]=u):u=e[7];let f;e[8]!==i||e[9]!==o||e[10]!==s?(f=(i||o)&&c.jsx(Np,{resolved:s,onDelete:i,onToggleResolved:o}),e[8]=i,e[9]=o,e[10]=s,e[11]=f):f=e[11];let p;e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==f?(p=c.jsxs("div",{className:"flex items-center gap-2",children:[l,a,u,f]}),e[12]=l,e[13]=a,e[14]=u,e[15]=f,e[16]=p):p=e[16];const h=r&&"pl-8";let m;e[17]!==h?(m=ee("whitespace-pre-wrap text-[15px] leading-relaxed text-foreground",h),e[17]=h,e[18]=m):m=e[18];let y;e[19]!==n.body||e[20]!==m?(y=c.jsx("div",{className:m,children:n.body}),e[19]=n.body,e[20]=m,e[21]=y):y=e[21];let b;return e[22]!==p||e[23]!==y?(b=c.jsxs("div",{className:"group flex flex-col gap-1.5 p-4",children:[p,y]}),e[22]=p,e[23]=y,e[24]=b):b=e[24],b}function Np(t){const e=F.c(18),{resolved:n,onDelete:r,onToggleResolved:s}=t,i=le();let o;e[0]!==i?(o=i("taskBoard.taskDialog.commentActionsAriaLabel"),e[0]=i,e[1]=o):o=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(Jr,{size:16}),e[2]=l):l=e[2];let a;e[3]!==o?(a=c.jsx(un,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":o,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-colors hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100",children:l})}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==s||e[6]!==n||e[7]!==i?(d=s&&c.jsxs(c.Fragment,{children:[c.jsxs(Ct,{onSelect:s,children:[c.jsx(Ds,{size:16}),i(n?"taskBoard.taskDialog.commentUnresolveThread":"taskBoard.taskDialog.commentResolveThread")]}),c.jsx(qo,{})]}),e[5]=s,e[6]=n,e[7]=i,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==i?(u=r&&c.jsxs(Ct,{variant:"destructive",onSelect:r,children:[c.jsx(Zr,{size:16}),i("taskBoard.taskDialog.commentDelete")]}),e[9]=r,e[10]=i,e[11]=u):u=e[11];let f;e[12]!==d||e[13]!==u?(f=c.jsxs(fn,{align:"end",className:"w-48",children:[d,u]}),e[12]=d,e[13]=u,e[14]=f):f=e[14];let p;return e[15]!==a||e[16]!==f?(p=c.jsxs(hn,{children:[a,f]}),e[15]=a,e[16]=f,e[17]=p):p=e[17],p}function ua(t){const e=F.c(6),{author:n}=t;if(n.isAgent){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(Lt,{size:24}),e[0]=o):o=e[0],o}const r=n.image??void 0;let s;e[1]!==n.name?(s=_t(n.name),e[1]=n.name,e[2]=s):s=e[2];let i;return e[3]!==r||e[4]!==s?(i=c.jsx(At,{url:r,fallback:s,shape:"circle",size:"xs"}),e[3]=r,e[4]=s,e[5]=i):i=e[5],i}function fa(t){const e=F.c(36),{variant:n,placeholder:r,author:s,onSubmit:i}=t,o=le(),l=w.useRef(null),[a,d]=w.useState("");let u;e[0]!==i||e[1]!==a?(u=()=>{const _=a.trim();if(!_)return;i(_),d("");const M=l.current;M&&(M.value="",ko(M))},e[0]=i,e[1]=a,e[2]=u):u=e[2];const f=u;let p;e[3]!==f?(p=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),f())},e[3]=f,e[4]=p):p=e[4];const h=p;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=_=>{d(_.currentTarget.value),ko(_.currentTarget)},e[5]=m):m=e[5];const y=n==="root"&&"min-h-10";let b;e[6]!==y?(b=ee("w-full resize-none overflow-hidden border-0 bg-transparent text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground",y),e[6]=y,e[7]=b):b=e[7];let g;e[8]!==h||e[9]!==r||e[10]!==b||e[11]!==a?(g=c.jsx("textarea",{ref:l,value:a,onChange:m,onKeyDown:h,placeholder:r,rows:1,className:b}),e[8]=h,e[9]=r,e[10]=b,e[11]=a,e[12]=g):g=e[12];const x=g;let k;e[13]!==a?(k=a.trim(),e[13]=a,e[14]=k):k=e[14];const v=!k;let S;e[15]!==o?(S=o("taskBoard.taskDialog.commentSubmitAriaLabel"),e[15]=o,e[16]=S):S=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=c.jsx(Oc,{size:16}),e[17]=T):T=e[17];let C;e[18]!==f||e[19]!==v||e[20]!==S?(C=c.jsx("button",{type:"button",disabled:v,onClick:f,"aria-label":S,className:"flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40",children:T}),e[18]=f,e[19]=v,e[20]=S,e[21]=C):C=e[21];const j=C;let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>l.current?.focus(),e[22]=D):D=e[22];const R=D;if(n==="root"){let _;e[23]!==j?(_=c.jsx("div",{className:"flex items-center justify-end",children:j}),e[23]=j,e[24]=_):_=e[24];let M;return e[25]!==_||e[26]!==x?(M=c.jsxs("div",{"data-testid":"new-comment-composer",onClick:R,className:"relative flex cursor-text flex-col gap-1 rounded-xl bg-card p-3 card-shadow",children:[x,_]}),e[25]=_,e[26]=x,e[27]=M):M=e[27],M}let N;e[28]!==s?(N=c.jsx("span",{className:"mt-0.5 shrink-0",children:c.jsx(ua,{author:s})}),e[28]=s,e[29]=N):N=e[29];let I;e[30]!==x?(I=c.jsx("div",{className:"min-w-0 flex-1 pt-0.5",children:x}),e[30]=x,e[31]=I):I=e[31];let A;return e[32]!==j||e[33]!==N||e[34]!==I?(A=c.jsxs("div",{"data-testid":"reply-composer",onClick:R,className:"relative flex cursor-text items-start gap-2 p-3",children:[N,I,j]}),e[32]=j,e[33]=N,e[34]=I,e[35]=A):A=e[35],A}function ko(t){t.style.height="auto",t.style.height=`${t.scrollHeight}px`}function Dp(t){const e=t.filter(r=>!r.parentId).map(r=>({...r,replies:[]})),n=new Map(e.map(r=>[r.id,r]));for(const r of t)r.parentId&&n.get(r.parentId)?.replies.push(r);return e}function Rp(t){const e=F.c(36),{locator:n}=$e(),r=mn(),s=gn();let i;e[0]!==t||e[1]!==n?(i=ge.taskBoardComments(n,t??""),e[0]=t,e[1]=n,e[2]=i):i=e[2];const o=i,l=!!t;let a;e[3]!==t||e[4]!==r?(a=async()=>Dp((await r.call("TASK_BOARD_COMMENT_LIST",{taskBoardItemId:t})).comments),e[3]=t,e[4]=r,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==l||e[8]!==a?(d={queryKey:o,enabled:l,queryFn:a},e[6]=o,e[7]=l,e[8]=a,e[9]=d):d=e[9];const u=Xe(d);let f;e[10]!==s||e[11]!==o?(f=()=>s.invalidateQueries({queryKey:o}),e[10]=s,e[11]=o,e[12]=f):f=e[12];const p=f;let h;e[13]!==t||e[14]!==r?(h=j=>r.call("TASK_BOARD_COMMENT_CREATE",{taskBoardItemId:t,...j}),e[13]=t,e[14]=r,e[15]=h):h=e[15];let m;e[16]!==p||e[17]!==h?(m={mutationFn:h,onSuccess:p},e[16]=p,e[17]=h,e[18]=m):m=e[18];const y=Ge(m);let b;e[19]!==r?(b=j=>r.call("TASK_BOARD_COMMENT_UPDATE",j),e[19]=r,e[20]=b):b=e[20];let g;e[21]!==p||e[22]!==b?(g={mutationFn:b,onSuccess:p},e[21]=p,e[22]=b,e[23]=g):g=e[23];const x=Ge(g);let k;e[24]!==r?(k=j=>r.call("TASK_BOARD_COMMENT_DELETE",{id:j}),e[24]=r,e[25]=k):k=e[25];let v;e[26]!==p||e[27]!==k?(v={mutationFn:k,onSuccess:p},e[26]=p,e[27]=k,e[28]=v):v=e[28];const S=Ge(v);let T;e[29]!==u.data?(T=u.data??[],e[29]=u.data,e[30]=T):T=e[30];let C;return e[31]!==y||e[32]!==S||e[33]!==x||e[34]!==T?(C={threads:T,post:y,setResolved:x,remove:S},e[31]=y,e[32]=S,e[33]=x,e[34]=T,e[35]=C):C=e[35],C}function Gr(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function Xr(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const ha=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Qn="inline-flex h-9 items-center justify-start gap-2 rounded-lg border border-border px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted sm:border-transparent";function Ep(t){const e=F.c(305),{open:n,onClose:r,item:s,defaultStatus:i,onSubmit:o,onDelete:l,onOpenThread:a,onNewChat:d,onAutoFix:u,onRerun:f,isSaving:p}=t,h=le(),{data:m}=Wo();let y;e[0]!==m?.data?.members?(y=m?.data?.members??[],e[0]=m?.data?.members,e[1]=y):y=e[1];const b=y,{handleCopy:g,copied:x}=Ic(),{data:k}=Qo();let v;e[2]!==k?(v=k===void 0?[]:k,e[2]=k,e[3]=v):v=e[3];const S=v,T=ac(),C=cc(),[j,D]=w.useState(s?.title??""),[R,N]=w.useState(s?.description??""),[I,A]=w.useState(s?.status??i??"triage"),[_,M]=w.useState(s?.priority??"medium"),[E,O]=w.useState(s?.assigneeId??null),z=s?.dueDate;let B;e[4]!==z?(B=Xr(z),e[4]=z,e[5]=B):B=e[5];const[P,L]=w.useState(B);let U;e[6]!==s?.tags?(U=s?.tags.map(Op)??[],e[6]=s?.tags,e[7]=U):U=e[7];const[H,W]=w.useState(U),[V,Z]=w.useState(!1),[te,ie]=w.useState(!1),[ne,q]=w.useState(!1);let X;e[8]!==i||e[9]!==s?.assigneeId||e[10]!==s?.description||e[11]!==s?.dueDate||e[12]!==s?.priority||e[13]!==s?.status||e[14]!==s?.tags||e[15]!==s?.title?(X=()=>{D(s?.title??""),N(s?.description??""),A(s?.status??i??"triage"),M(s?.priority??"medium"),O(s?.assigneeId??null),L(Xr(s?.dueDate)),W(s?.tags.map(Bp)??[])},e[8]=i,e[9]=s?.assigneeId,e[10]=s?.description,e[11]=s?.dueDate,e[12]=s?.priority,e[13]=s?.status,e[14]=s?.tags,e[15]=s?.title,e[16]=X):X=e[16];const J=X;let oe;e[17]!==r||e[18]!==J?(oe=()=>{r(),J()},e[17]=r,e[18]=J,e[19]=oe):oe=e[19];const G=oe;let K;e[20]!==T?(K=async(Q,Ne)=>{const Ue=await T.mutateAsync({name:Q,color:Ne});W(Dt=>[...Dt,Ue.id])},e[20]=T,e[21]=K):K=e[21];const Y=K;let ae;e[22]!==C?(ae=Q=>{C.mutate(Q),W(Ne=>Ne.filter(Ue=>Ue!==Q))},e[22]=C,e[23]=ae):ae=e[23];const he=ae;let xe;e[24]!==E||e[25]!==R||e[26]!==P||e[27]!==o||e[28]!==_||e[29]!==I||e[30]!==H||e[31]!==j?(xe=()=>{const Q=j.trim();Q&&o({title:Q,description:R.trim()||null,status:I,priority:_,assigneeId:E,dueDate:P?Gr(P):null,tagIds:H})},e[24]=E,e[25]=R,e[26]=P,e[27]=o,e[28]=_,e[29]=I,e[30]=H,e[31]=j,e[32]=xe):xe=e[32];const ye=xe,Ce=E===ze,Me=s&&u&&(I==="triage"||I==="todo")&&!Ce,Ze=s&&f&&s.assigneeId===ze;let ct;if(e[33]!==E||e[34]!==R||e[35]!==P||e[36]!==s||e[37]!==_||e[38]!==I||e[39]!==H||e[40]!==j){const Q=s?.tags.map(Ap)??[];ct=!s||j.trim()!==s.title||(R.trim()||null)!==s.description||I!==s.status||_!==s.priority||E!==(s.assigneeId??null)||(P?Gr(P):null)!==(s.dueDate??null)||H.length!==Q.length||!H.every(Ne=>Q.includes(Ne)),e[33]=E,e[34]=R,e[35]=P,e[36]=s,e[37]=_,e[38]=I,e[39]=H,e[40]=j,e[41]=ct}else ct=e[41];const Tt=ct;let Bt;if(e[42]!==E||e[43]!==b){let Q;e[45]!==E?(Q=Ne=>Ne.userId===E,e[45]=E,e[46]=Q):Q=e[46],Bt=b.find(Q),e[42]=E,e[43]=b,e[44]=Bt}else Bt=e[44];const ce=Bt;let dt;e[47]!==s||e[48]!==b?(dt=s?.assignedBy?b.find(Q=>Q.userId===s.assignedBy):void 0,e[47]=s,e[48]=b,e[49]=dt):dt=e[49];const je=dt,ln=Et[I].icon;let Ke,it,se,ut,Je,pe,Ut,He,et,tt,nt,ke,ve,we,Ae,Ee,Te,Se,Be,fe,Oe;if(e[50]!==G||e[51]!==s||e[52]!==n||e[53]!==h||e[54]!==j){se=!!s&&Vo(s),it=Jn,fe=n,e[76]!==G?(Oe=Dt=>!Dt&&G(),e[76]=G,e[77]=Oe):Oe=e[77],Ke=es,Ee="flex max-h-[92vh] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:h-[90vh] sm:max-h-[820px] sm:max-w-[1040px]",Te="hidden";let Q;e[78]!==s||e[79]!==h?(Q=h(s?"taskBoard.taskDialog.editTaskTitle":"taskBoard.taskDialog.newTaskTitle"),e[78]=s,e[79]=h,e[80]=Q):Q=e[80],e[81]!==Q?(Se=c.jsx(ts,{className:"sr-only",children:Q}),e[81]=Q,e[82]=Se):Se=e[82];let Ne;e[83]!==h?(Ne=h("taskBoard.taskDialog.closeAriaLabel"),e[83]=h,e[84]=Ne):Ne=e[84];let Ue;e[85]===Symbol.for("react.memo_cache_sentinel")?(Ue=c.jsx(dn,{size:16}),e[85]=Ue):Ue=e[85],e[86]!==G||e[87]!==Ne?(Be=c.jsx("button",{type:"button","aria-label":Ne,onClick:G,className:"absolute right-2.5 top-2.5 z-10 flex size-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Ue}),e[86]=G,e[87]=Ne,e[88]=Be):Be=e[88],Ae="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden",we="flex min-w-0 flex-col sm:flex-1 sm:overflow-y-auto",ve="sticky top-0 z-10 bg-background p-6 pb-0 sm:p-8 sm:pb-0",ut=_p,Je=j,pe=Dt=>{se||(D(Dt.target.value),Dt.target.style.height="auto",Dt.target.style.height=`${Dt.target.scrollHeight}px`)},Ut=Ip,e[89]!==h?(He=h("taskBoard.taskDialog.taskTitlePlaceholder"),e[89]=h,e[90]=He):He=e[90],et=!0,tt=1,nt=se,ke=ee("w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30",se&&"cursor-default"),e[50]=G,e[51]=s,e[52]=n,e[53]=h,e[54]=j,e[55]=Ke,e[56]=it,e[57]=se,e[58]=ut,e[59]=Je,e[60]=pe,e[61]=Ut,e[62]=He,e[63]=et,e[64]=tt,e[65]=nt,e[66]=ke,e[67]=ve,e[68]=we,e[69]=Ae,e[70]=Ee,e[71]=Te,e[72]=Se,e[73]=Be,e[74]=fe,e[75]=Oe}else Ke=e[55],it=e[56],se=e[57],ut=e[58],Je=e[59],pe=e[60],Ut=e[61],He=e[62],et=e[63],tt=e[64],nt=e[65],ke=e[66],ve=e[67],we=e[68],Ae=e[69],Ee=e[70],Te=e[71],Se=e[72],Be=e[73],fe=e[74],Oe=e[75];let Re;e[91]!==ut||e[92]!==Je||e[93]!==pe||e[94]!==Ut||e[95]!==He||e[96]!==et||e[97]!==tt||e[98]!==nt||e[99]!==ke?(Re=c.jsx("textarea",{ref:ut,value:Je,onChange:pe,onKeyDown:Ut,placeholder:He,autoFocus:et,rows:tt,readOnly:nt,className:ke}),e[91]=ut,e[92]=Je,e[93]=pe,e[94]=Ut,e[95]=He,e[96]=et,e[97]=tt,e[98]=nt,e[99]=ke,e[100]=Re):Re=e[100];let Ie;e[101]!==se||e[102]!==h?(Ie=se&&c.jsxs("p",{className:"mb-3 mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[c.jsx(Ta,{size:12}),h("taskBoard.taskDialog.reportsContentLocked")]}),e[101]=se,e[102]=h,e[103]=Ie):Ie=e[103];let Le;e[104]!==ve||e[105]!==Re||e[106]!==Ie?(Le=c.jsxs("div",{className:ve,children:[Re,Ie]}),e[104]=ve,e[105]=Re,e[106]=Ie,e[107]=Le):Le=e[107];let Pe;e[108]!==h?(Pe=h("taskBoard.taskDialog.descriptionPlaceholder"),e[108]=h,e[109]=Pe):Pe=e[109];const Fe=!se;let Qe;e[110]!==R||e[111]!==Pe||e[112]!==Fe?(Qe=c.jsx(gp,{defaultValue:R,onChange:N,placeholder:Pe,editable:Fe}),e[110]=R,e[111]=Pe,e[112]=Fe,e[113]=Qe):Qe=e[113];let ot;e[114]!==x||e[115]!==R||e[116]!==g||e[117]!==h?(ot=R&&c.jsx(_e,{type:"button",variant:"ghost",size:"icon","aria-label":h("taskBoard.taskDialog.copyDescriptionAriaLabel"),className:"absolute right-0 top-0 size-7 rounded-md border border-border bg-card text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground group-hover:opacity-100",onClick:()=>g(R),children:x?c.jsx(Ds,{size:14}):c.jsx(_c,{size:14})}),e[114]=x,e[115]=R,e[116]=g,e[117]=h,e[118]=ot):ot=e[118];let qt;e[119]!==Qe||e[120]!==ot?(qt=c.jsxs("div",{className:"group relative flex flex-col",children:[Qe,ot]}),e[119]=Qe,e[120]=ot,e[121]=qt):qt=e[121];let Kt;e[122]!==s?(Kt=s&&c.jsx("hr",{className:"border-border"}),e[122]=s,e[123]=Kt):Kt=e[123];let Ht;e[124]!==R||e[125]!==s||e[126]!==a?(Ht=s?.id&&c.jsx(Hp,{item:s,description:R,onOpenThread:a}),e[124]=R,e[125]=s,e[126]=a,e[127]=Ht):Ht=e[127];let ft;e[128]!==je||e[129]!==ce||e[130]!==s||e[131]!==b||e[132]!==a?(ft=s&&c.jsx(Qp,{item:s,members:b,startedBy:je??ce,onOpenThread:a}),e[128]=je,e[129]=ce,e[130]=s,e[131]=b,e[132]=a,e[133]=ft):ft=e[133];let ht;e[134]!==qt||e[135]!==Kt||e[136]!==Ht||e[137]!==ft?(ht=c.jsxs("div",{className:"flex flex-col gap-6 p-6 pt-6 sm:p-8 sm:pt-6",children:[qt,Kt,Ht,ft]}),e[134]=qt,e[135]=Kt,e[136]=Ht,e[137]=ft,e[138]=ht):ht=e[138];let pt;e[139]!==we||e[140]!==Le||e[141]!==ht?(pt=c.jsxs("div",{className:we,children:[Le,ht]}),e[139]=we,e[140]=Le,e[141]=ht,e[142]=pt):pt=e[142];let gt;e[143]!==h?(gt=h("taskBoard.taskDialog.propertiesLabel"),e[143]=h,e[144]=gt):gt=e[144];let mt;e[145]!==gt?(mt=c.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:gt}),e[145]=gt,e[146]=mt):mt=e[146];let xt;e[147]!==s||e[148]!==I?(xt=ee(s?vi({...s,status:I}):Et[I].iconClassName),e[147]=s,e[148]=I,e[149]=xt):xt=e[149];let bt;e[150]!==ln||e[151]!==xt?(bt=c.jsx(ln,{size:16,className:xt}),e[150]=ln,e[151]=xt,e[152]=bt):bt=e[152];const en=Et[I];let yt;e[153]!==h||e[154]!==en.labelKey?(yt=h(en.labelKey),e[153]=h,e[154]=en.labelKey,e[155]=yt):yt=e[155];let kt;e[156]!==bt||e[157]!==yt?(kt=c.jsx(un,{asChild:!0,children:c.jsxs("button",{type:"button",className:Qn,children:[bt,yt]})}),e[156]=bt,e[157]=yt,e[158]=kt):kt=e[158];let Ot;e[159]!==h?(Ot=ir.map(Q=>{const Ne=Et[Q].icon;return c.jsxs(Ct,{onSelect:()=>A(Q),className:"gap-2",children:[c.jsx(Ne,{size:16,className:Et[Q].iconClassName}),h(Et[Q].labelKey)]},Q)}),e[159]=h,e[160]=Ot):Ot=e[160];let vt;e[161]!==Ot?(vt=c.jsx(fn,{align:"start",className:"w-44",children:Ot}),e[161]=Ot,e[162]=vt):vt=e[162];let $t;e[163]!==kt||e[164]!==vt?($t=c.jsxs(hn,{children:[kt,vt]}),e[163]=kt,e[164]=vt,e[165]=$t):$t=e[165];let wt;e[166]!==se||e[167]!==h?(wt=se?h("taskBoard.taskDialog.reportsContentLocked"):void 0,e[166]=se,e[167]=h,e[168]=wt):wt=e[168];const Wt=_==="none"&&"text-muted-foreground",tn=se&&"cursor-default opacity-60";let $;e[169]!==Wt||e[170]!==tn?($=ee(Qn,Wt,tn),e[169]=Wt,e[170]=tn,e[171]=$):$=e[171];let re;e[172]!==_||e[173]!==h?(re=_==="none"?c.jsxs(c.Fragment,{children:[c.jsx(Jr,{size:16}),h("taskBoard.taskDialog.setPriorityButton")]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:ee("size-2 rounded-full",It[_].dotClassName)}),h(It[_].labelKey)]}),e[172]=_,e[173]=h,e[174]=re):re=e[174];let be;e[175]!==se||e[176]!==wt||e[177]!==$||e[178]!==re?(be=c.jsx(un,{asChild:!0,children:c.jsx("button",{type:"button",disabled:se,title:wt,className:$,children:re})}),e[175]=se,e[176]=wt,e[177]=$,e[178]=re,e[179]=be):be=e[179];let We;e[180]!==h?(We=wi.map(Q=>c.jsxs(Ct,{onSelect:()=>M(Q),children:[c.jsx("span",{className:ee("size-2 rounded-full",It[Q].dotClassName)}),h(It[Q].labelKey)]},Q)),e[180]=h,e[181]=We):We=e[181];let lt;e[182]!==We?(lt=c.jsx(fn,{align:"start",className:"w-40",children:We}),e[182]=We,e[183]=lt):lt=e[183];let Nt;e[184]!==be||e[185]!==lt?(Nt=c.jsxs(hn,{children:[be,lt]}),e[184]=be,e[185]=lt,e[186]=Nt):Nt=e[186];const wr=!E&&"text-muted-foreground";let yn;e[187]!==wr?(yn=ee(Qn,wr),e[187]=wr,e[188]=yn):yn=e[188];let kn;e[189]!==je||e[190]!==ce||e[191]!==Ce||e[192]!==h?(kn=Ce&&je?c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[c.jsx(At,{url:je.user?.image??void 0,fallback:_t(je.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:je.user?.name??h("taskBoard.taskDialog.superAgentDefaultName")})]}),c.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[c.jsxs("span",{className:"inline-flex items-center",children:[c.jsx(At,{url:je.user?.image??void 0,fallback:_t(je.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),c.jsx(Lt,{size:16,className:"ring-2 ring-background"})]}),h("taskBoard.taskDialog.superAgentLabel")]})]}):Ce?c.jsxs(c.Fragment,{children:[c.jsx(Lt,{size:16}),h("taskBoard.taskDialog.superAgentLabel")]}):ce?c.jsxs(c.Fragment,{children:[c.jsx(At,{url:ce.user?.image??void 0,fallback:_t(ce.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:ce.user?.name??h("taskBoard.taskDialog.unassignedLabel")})]}):c.jsxs(c.Fragment,{children:[c.jsx(Po,{size:16,className:"text-muted-foreground"}),h("taskBoard.taskDialog.assignButton")]}),e[189]=je,e[190]=ce,e[191]=Ce,e[192]=h,e[193]=kn):kn=e[193];let vn;e[194]!==yn||e[195]!==kn?(vn=c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button",className:yn,children:kn})}),e[194]=yn,e[195]=kn,e[196]=vn):vn=e[196];let $s;e[197]===Symbol.for("react.memo_cache_sentinel")?($s=Q=>{O(Q),ie(!1)},e[197]=$s):$s=e[197];let wn;e[198]!==b?(wn=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsx(Oi,{members:b,onSelect:$s})}),e[198]=b,e[199]=wn):wn=e[199];let Sn;e[200]!==te||e[201]!==vn||e[202]!==wn?(Sn=c.jsxs(bs,{open:te,onOpenChange:ie,modal:!0,children:[vn,wn]}),e[200]=te,e[201]=vn,e[202]=wn,e[203]=Sn):Sn=e[203];let Cn;e[204]!==je||e[205]!==Ce||e[206]!==h?(Cn=Ce&&je&&c.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[c.jsx("span",{className:"absolute -top-1.5 left-5 h-[calc(50%+0.375rem)] w-2.5 rounded-bl-md border-b border-l border-border"}),c.jsxs("span",{className:ee(Qn,"pointer-events-none"),children:[c.jsx(Lt,{size:16}),h("taskBoard.taskDialog.superAgentLabel")]})]}),e[204]=je,e[205]=Ce,e[206]=h,e[207]=Cn):Cn=e[207];let jn;e[208]!==Sn||e[209]!==Cn?(jn=c.jsxs("div",{className:"flex flex-col",children:[Sn,Cn]}),e[208]=Sn,e[209]=Cn,e[210]=jn):jn=e[210];const Sr=!P&&"text-muted-foreground";let Tn;e[211]!==Sr?(Tn=ee(Qn,Sr),e[211]=Sr,e[212]=Tn):Tn=e[212];let Ms;e[213]===Symbol.for("react.memo_cache_sentinel")?(Ms=c.jsx(Yn,{size:16,className:"text-muted-foreground"}),e[213]=Ms):Ms=e[213];let Nn;e[214]!==P||e[215]!==h?(Nn=P?ha.format(P):h("taskBoard.taskDialog.dueDateLabel"),e[214]=P,e[215]=h,e[216]=Nn):Nn=e[216];let Dn;e[217]!==P||e[218]!==h?(Dn=P&&c.jsx("span",{role:"button",tabIndex:0,"aria-label":h("taskBoard.taskDialog.clearDueDateAriaLabel"),className:"-mr-1 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:Q=>{Q.stopPropagation(),L(null)},onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),Q.stopPropagation(),L(null))},children:c.jsx(dn,{size:12})}),e[217]=P,e[218]=h,e[219]=Dn):Dn=e[219];let Rn;e[220]!==Tn||e[221]!==Nn||e[222]!==Dn?(Rn=c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:Tn,children:[Ms,Nn,Dn]})}),e[220]=Tn,e[221]=Nn,e[222]=Dn,e[223]=Rn):Rn=e[223];const Cr=P??void 0;let zs;e[224]===Symbol.for("react.memo_cache_sentinel")?(zs=Q=>{L(Q??null),Q&&Z(!1)},e[224]=zs):zs=e[224];let En;e[225]!==Cr?(En=c.jsx(xs,{className:"w-auto p-0",align:"start",children:c.jsx(nl,{mode:"single",selected:Cr,onSelect:zs,initialFocus:!0})}),e[225]=Cr,e[226]=En):En=e[226];let In;e[227]!==V||e[228]!==Rn||e[229]!==En?(In=c.jsxs(bs,{open:V,onOpenChange:Z,children:[Rn,En]}),e[227]=V,e[228]=Rn,e[229]=En,e[230]=In):In=e[230];let _n;e[231]!==S||e[232]!==h||e[233]!==H?(_n=H.length===0?c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:ee(Qn,"text-muted-foreground"),children:[c.jsx(za,{size:16}),h("taskBoard.taskDialog.tagsButton")]})}):c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 sm:px-3",children:[H.map(Q=>{const Ne=S.find(Ue=>Ue.id===Q);return Ne?c.jsxs("button",{type:"button",onClick:()=>q(!0),className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-sm font-medium text-foreground transition-colors hover:bg-muted",children:[c.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:As(Ne.color)}}),c.jsx("span",{className:"truncate",children:Ne.name}),c.jsx("span",{role:"button",tabIndex:0,"aria-label":h("taskBoard.taskDialog.removeTagAriaLabel",{name:Ne.name}),className:"-mr-0.5 flex size-3.5 items-center justify-center rounded-sm text-muted-foreground hover:bg-background hover:text-foreground",onClick:Ue=>{Ue.stopPropagation(),W(Dt=>Dt.filter(jr=>jr!==Q))},onKeyDown:Ue=>{(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),Ue.stopPropagation(),W(Dt=>Dt.filter(jr=>jr!==Q)))},children:c.jsx(dn,{size:10})})]},Q):null}),c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":h("taskBoard.taskDialog.addTagButton"),className:"flex size-7 items-center justify-center rounded-md border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c.jsx(ws,{size:14})})})]}),e[231]=S,e[232]=h,e[233]=H,e[234]=_n):_n=e[234];let An;e[235]!==S.length?(An=Df(S.length),e[235]=S.length,e[236]=An):An=e[236];let Ls;e[237]===Symbol.for("react.memo_cache_sentinel")?(Ls=Q=>W(Ne=>Ne.includes(Q)?Ne.filter(Ue=>Ue!==Q):[...Ne,Q]),e[237]=Ls):Ls=e[237];let Bn;e[238]!==Y||e[239]!==he||e[240]!==S||e[241]!==An||e[242]!==H?(Bn=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsx(vp,{tags:S,selectedIds:H,defaultColor:An,onToggle:Ls,onCreate:Y,onDelete:he})}),e[238]=Y,e[239]=he,e[240]=S,e[241]=An,e[242]=H,e[243]=Bn):Bn=e[243];let On;e[244]!==_n||e[245]!==Bn||e[246]!==ne?(On=c.jsxs(bs,{open:ne,onOpenChange:q,modal:!0,children:[_n,Bn]}),e[244]=_n,e[245]=Bn,e[246]=ne,e[247]=On):On=e[247];let $n;e[248]!==$t||e[249]!==Nt||e[250]!==jn||e[251]!==In||e[252]!==On?($n=c.jsxs("div",{className:"flex flex-wrap gap-2 sm:flex-col",children:[$t,Nt,jn,In,On]}),e[248]=$t,e[249]=Nt,e[250]=jn,e[251]=In,e[252]=On,e[253]=$n):$n=e[253];let Mn;e[254]!==mt||e[255]!==$n?(Mn=c.jsxs("div",{className:"flex w-full shrink-0 flex-col gap-4 border-t border-border p-6 sm:w-[220px] sm:border-t-0 sm:border-l sm:px-6 sm:py-10",children:[mt,$n]}),e[254]=mt,e[255]=$n,e[256]=Mn):Mn=e[256];let zn;e[257]!==Ae||e[258]!==pt||e[259]!==Mn?(zn=c.jsxs("div",{className:Ae,children:[pt,Mn]}),e[257]=Ae,e[258]=pt,e[259]=Mn,e[260]=zn):zn=e[260];let Ln;e[261]!==s||e[262]!==l||e[263]!==h?(Ln=s&&l?c.jsx(_e,{variant:"ghost",size:"icon","aria-label":h("taskBoard.taskDialog.deleteTaskAriaLabel"),className:"size-10 text-muted-foreground hover:text-destructive",onClick:l,children:c.jsx(Zr,{size:16})}):c.jsx("span",{}),e[261]=s,e[262]=l,e[263]=h,e[264]=Ln):Ln=e[264];let Pn;e[265]!==s||e[266]!==d||e[267]!==h?(Pn=s&&d&&c.jsxs(_e,{variant:"outline",size:"sm",onClick:d,children:[c.jsx(Fo,{size:16}),h("taskBoard.taskDialog.newChatButton")]}),e[265]=s,e[266]=d,e[267]=h,e[268]=Pn):Pn=e[268];let Fn;e[269]!==u||e[270]!==Me||e[271]!==h?(Fn=Me&&c.jsxs(_e,{variant:"outline",size:"sm",onClick:u,children:[c.jsx(ur,{size:16}),h("taskBoard.taskBoard.autoFix")]}),e[269]=u,e[270]=Me,e[271]=h,e[272]=Fn):Fn=e[272];let Un;e[273]!==f||e[274]!==Ze||e[275]!==h?(Un=Ze&&c.jsxs(_e,{variant:"outline",size:"sm",onClick:f,children:[c.jsx(zo,{size:16}),h("taskBoard.taskBoard.rerun")]}),e[273]=f,e[274]=Ze,e[275]=h,e[276]=Un):Un=e[276];let qn;e[277]!==Tt||e[278]!==p||e[279]!==s||e[280]!==ye||e[281]!==h||e[282]!==j?(qn=Tt&&c.jsxs(_e,{size:"sm",disabled:!j.trim()||p,onClick:ye,children:[s?null:c.jsx(ws,{size:16}),h(s?"taskBoard.taskDialog.saveButton":"taskBoard.taskDialog.createTaskButton")]}),e[277]=Tt,e[278]=p,e[279]=s,e[280]=ye,e[281]=h,e[282]=j,e[283]=qn):qn=e[283];let Kn;e[284]!==Pn||e[285]!==Fn||e[286]!==Un||e[287]!==qn?(Kn=c.jsxs("div",{className:"flex items-center gap-2",children:[Pn,Fn,Un,qn]}),e[284]=Pn,e[285]=Fn,e[286]=Un,e[287]=qn,e[288]=Kn):Kn=e[288];let Hn;e[289]!==Ln||e[290]!==Kn?(Hn=c.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[Ln,Kn]}),e[289]=Ln,e[290]=Kn,e[291]=Hn):Hn=e[291];let Wn;e[292]!==Ke||e[293]!==Ee||e[294]!==Te||e[295]!==Se||e[296]!==Be||e[297]!==zn||e[298]!==Hn?(Wn=c.jsxs(Ke,{className:Ee,closeButtonClassName:Te,children:[Se,Be,zn,Hn]}),e[292]=Ke,e[293]=Ee,e[294]=Te,e[295]=Se,e[296]=Be,e[297]=zn,e[298]=Hn,e[299]=Wn):Wn=e[299];let Ps;return e[300]!==it||e[301]!==fe||e[302]!==Oe||e[303]!==Wn?(Ps=c.jsx(it,{open:fe,onOpenChange:Oe,children:Wn}),e[300]=it,e[301]=fe,e[302]=Oe,e[303]=Wn,e[304]=Ps):Ps=e[304],Ps}function Ip(t){t.key==="Enter"&&t.preventDefault()}function _p(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function Ap(t){return t.id}function Bp(t){return t.id}function Op(t){return t.id}function $p(t,e){switch(t){case"failed":return{label:e("taskBoard.taskDialog.threadStatusError"),className:"text-destructive",icon:Pa};case"requires_action":return{label:e("taskBoard.taskDialog.threadStatusNeedsInput"),className:"text-warning",icon:ei};case"in_progress":return{label:e("taskBoard.taskDialog.threadStatusRunning"),className:"text-primary",icon:Ns,spin:!0};case"completed":return{label:e("taskBoard.taskDialog.threadStatusCompleted"),className:"text-success",icon:xn};case"expired":return{label:e("taskBoard.taskDialog.threadStatusExpired"),className:"text-muted-foreground",icon:fr};default:return t}}function Mp(t){const e=F.c(31),{thread:n,startedBy:r,onOpen:s}=t,i=le();let o;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==n){const l=n.status?$p(n.status,i):null,a=n.lastMessage;let d;e[5]!==n.title?(d=zi(n.title,"qa"),e[5]=n.title,e[6]=d):d=e[6];const u=d;let f;e[7]!==n.title?(f=zi(n.title,"code_review"),e[7]=n.title,e[8]=f):f=e[8];const p=f;let h;e[9]!==s||e[10]!==n?(h=()=>s?.(n),e[9]=s,e[10]=n,e[11]=h):h=e[11];let m;e[12]!==p||e[13]!==u?(m=u?c.jsx(Pl,{size:16,className:"shrink-0"}):p?c.jsx(Fl,{size:16,className:"shrink-0"}):c.jsx(Lt,{size:16,className:"shrink-0"}),e[12]=p,e[13]=u,e[14]=m):m=e[14];let y;e[15]!==i||e[16]!==n.title?(y=n.title||i("taskBoard.taskDialog.superAgentDefaultName"),e[15]=i,e[16]=n.title,e[17]=y):y=e[17];let b;e[18]!==y?(b=c.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y}),e[18]=y,e[19]=b):b=e[19];let g;e[20]!==r||e[21]!==i?(g=r&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"shrink-0 text-sm text-muted-foreground/50",children:i("taskBoard.taskDialog.startedByLabel")}),c.jsx(At,{url:r.user?.image??void 0,fallback:_t(r.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate text-sm text-foreground",children:r.user?.name??i("taskBoard.taskDialog.someoneLabel")})]}),e[20]=r,e[21]=i,e[22]=g):g=e[22];let x;e[23]!==s||e[24]!==i?(x=s&&c.jsxs("span",{className:"ml-auto flex shrink-0 items-center gap-1 text-xs text-muted-foreground/60 group-hover:text-foreground",children:[i("taskBoard.taskDialog.openThreadHint"),c.jsx(sl,{size:14})]}),e[23]=s,e[24]=i,e[25]=x):x=e[25];let k;e[26]!==m||e[27]!==b||e[28]!==g||e[29]!==x?(k=c.jsxs("div",{className:"flex items-center gap-2",children:[m,b,g,x]}),e[26]=m,e[27]=b,e[28]=g,e[29]=x,e[30]=k):k=e[30],o=c.jsxs("button",{type:"button",disabled:!s,onClick:h,className:"group flex w-full flex-col gap-2 rounded-xl bg-card p-4 text-left card-shadow transition-colors enabled:hover:bg-muted/60 disabled:cursor-default",children:[k,l&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:ee("flex shrink-0 items-center gap-1.5",l.className),children:[c.jsx(l.icon,{size:15,className:ee(l.spin&&"animate-spin")}),c.jsx("span",{className:"text-sm",children:l.label})]}),a&&c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:a})]})]}),e[0]=s,e[1]=r,e[2]=i,e[3]=n,e[4]=o}else o=e[4];return o}function zp(t,e){return t.merged?{label:e("taskBoard.taskDialog.prStateMerged"),className:"text-special",icon:La}:t.state==="closed"?{label:e("taskBoard.taskDialog.prStateClosed"),className:"text-destructive",icon:Tr}:t.draft?{label:e("taskBoard.taskDialog.prStateDraft"),className:"text-muted-foreground",icon:Tr}:{label:e("taskBoard.taskDialog.prStateOpen"),className:"text-success",icon:Tr}}function Lp(t,e){switch(t){case"passing":return{label:e("taskBoard.taskDialog.prChecksPassing"),className:"text-success",icon:xn};case"failing":return{label:e("taskBoard.taskDialog.prChecksFailing"),className:"text-destructive",icon:fr};case"pending":return{label:e("taskBoard.taskDialog.prChecksPending"),className:"text-warning",icon:Ns};default:return null}}const Pp=new Set(["failure","cancelled","timed_out","action_required","startup_failure","stale"]);function Fp(t){if(t.status!=="completed")return{icon:Ns,className:"text-warning",spin:!0};const e=t.conclusion;return e&&Pp.has(e)?{icon:fr,className:"text-destructive",spin:!1}:e==="success"||e==="neutral"||e==="skipped"?{icon:xn,className:"text-success",spin:!1}:{icon:ei,className:"text-muted-foreground",spin:!1}}function Up(t){const e=F.c(37),{pr:n,previewThread:r,reviewsReady:s,shipPending:i,onShip:o,onOpenThread:l}=t,a=le(),[d,u]=w.useState(!1);let f;if(e[0]!==d||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a){const p=zp(n,a),h=Lp(n.checksStatus,a),m=n.state==="open"&&!n.merged,y=n.checksStatus!=="failing"&&n.checksStatus!=="pending",b=s&&m&&y,g=!!r||!!n.previewUrl||b;let x;e[9]!==n.checks?(x=n.checks??[],e[9]=n.checks,e[10]=x):x=e[10];const k=x,v=k.length>0||h!=null,S=k.length>0;let T;e[11]===Symbol.for("react.memo_cache_sentinel")?(T=c.jsx($r,{className:"size-4 shrink-0 text-foreground"}),e[11]=T):T=e[11];const C=n.title??`${n.repoOwner}/${n.repoName}`;let j;e[12]!==C?(j=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:C}),e[12]=C,e[13]=j):j=e[13];const D=ee("flex shrink-0 items-center gap-1 text-xs font-medium",p.className);let R;e[14]!==p?(R=c.jsx(p.icon,{size:13}),e[14]=p,e[15]=R):R=e[15];let N;e[16]!==p||e[17]!==D||e[18]!==R?(N=c.jsxs("span",{className:D,children:[R,p.label]}),e[16]=p,e[17]=D,e[18]=R,e[19]=N):N=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=c.jsx(Gs,{size:12,className:"text-muted-foreground/60 group-hover:text-foreground"}),e[20]=I):I=e[20];let A;e[21]!==n.number||e[22]!==n.url?(A=c.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",title:n.url,className:"group flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted",children:["#",n.number,I]}),e[21]=n.number,e[22]=n.url,e[23]=A):A=e[23];let _;e[24]!==A||e[25]!==j||e[26]!==N?(_=c.jsxs("div",{className:"flex items-center gap-3",children:[T,j,N,A]}),e[24]=A,e[25]=j,e[26]=N,e[27]=_):_=e[27];let M;e[28]!==g||e[29]!==l||e[30]!==o||e[31]!==n.previewUrl||e[32]!==r||e[33]!==i||e[34]!==b||e[35]!==a?(M=g&&c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r&&c.jsxs(_e,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",title:a("taskBoard.taskDialog.openPreviewTitle"),onClick:()=>l?.(r),children:[c.jsx(Fo,{size:13}),a("taskBoard.taskDialog.openPreviewButton")]}),n.previewUrl&&c.jsx(_e,{asChild:!0,type:"button",variant:"outline",size:"sm",className:"gap-1.5",children:c.jsxs("a",{href:n.previewUrl,target:"_blank",rel:"noreferrer",children:[c.jsx(rl,{size:14}),a("taskBoard.taskDialog.previewLabel"),c.jsx(Gs,{size:12})]})}),b&&c.jsx(_e,{type:"button",variant:"success",size:"sm",disabled:i,onClick:o,children:a("taskBoard.taskDialog.shipToProductionButton")})]}),e[28]=g,e[29]=l,e[30]=o,e[31]=n.previewUrl,e[32]=r,e[33]=i,e[34]=b,e[35]=a,e[36]=M):M=e[36],f=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[_,M,v&&c.jsxs("div",{className:"border-t border-border pt-2 text-xs",children:[c.jsxs("button",{type:"button",disabled:!S,onClick:()=>u(qp),className:"flex w-full items-center gap-1.5 font-medium disabled:cursor-default",children:[h?c.jsx(h.icon,{size:13,className:h.className}):c.jsx(xn,{size:13,className:"text-muted-foreground"}),c.jsx("span",{className:ee(h?.className??"text-muted-foreground"),children:h?.label??a("taskBoard.taskDialog.prChecksLabel")}),S&&c.jsx(sl,{size:14,className:ee("ml-auto text-muted-foreground/60 transition-transform",d&&"rotate-90")})]}),d&&c.jsx("div",{className:"mt-2 flex flex-col gap-2",children:k.map(E=>{const O=Fp(E);return c.jsxs("div",{className:"rounded-md bg-muted/40 p-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(O.icon,{size:13,className:ee("shrink-0",O.className,O.spin&&"animate-spin")}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:E.name}),E.detailsUrl&&c.jsx("a",{href:E.detailsUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:c.jsx(Gs,{size:12})})]}),E.summary&&c.jsx("div",{className:"mt-1.5 max-h-64 overflow-auto text-muted-foreground",children:c.jsx(Rc,{id:`${n.url}-${E.name}`,text:E.summary})})]},E.name)})})]})]}),e[0]=d,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=f}else f=e[8];return f}function qp(t){return!t}function Kp(){const t=F.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Vn,{className:"size-4 shrink-0 rounded"}),c.jsx(Vn,{className:"h-4 min-w-0 flex-1"}),c.jsx(Vn,{className:"h-4 w-16 shrink-0"}),c.jsx(Vn,{className:"h-4 w-10 shrink-0"})]}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-3 card-shadow",children:[e,c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Vn,{className:"h-7 w-20"}),c.jsx(Vn,{className:"h-7 w-28"})]})]}),t[1]=n):n=t[1],n}function Hp(t){const e=F.c(36),{item:n,description:r,onOpenThread:s}=t,i=le(),{data:o,isLoading:l}=xp(n.id),{data:a}=da(n.id),d=Li("qa_agent_enabled"),u=Li("code_reviewer_enabled"),f=bp(n.id);let p,h;if(e[0]!==a||e[1]!==u||e[2]!==r||e[3]!==n.status||e[4]!==n.threads||e[5]!==s||e[6]!==f||e[7]!==o||e[8]!==l||e[9]!==d||e[10]!==i){h=Symbol.for("react.early_return_sentinel");e:{const m=wp(r),y=l&&!o;if(!y&&(!o||o.length===0)&&m.length===0){h=null;break e}let b;e[13]!==a||e[14]!==u||e[15]!==n.status||e[16]!==d?(b=n.status==="in_review"&&kp(a??[],yp({qa:d,codeReview:u})),e[13]=a,e[14]=u,e[15]=n.status,e[16]=d,e[17]=b):b=e[17];const g=b;let x;e[18]!==f||e[19]!==i?(x=()=>f.mutate(void 0,{onSuccess:D=>D?.merged?St.success(i("taskBoard.taskDialog.shipSuccess")):St.error(i("taskBoard.taskDialog.shipError")),onError:()=>St.error(i("taskBoard.taskDialog.shipError"))}),e[18]=f,e[19]=i,e[20]=x):x=e[20];const k=x;let v;e[21]!==n.threads||e[22]!==s?(v=s?n.threads.find(Vp):void 0,e[21]=n.threads,e[22]=s,e[23]=v):v=e[23];const S=v;let T;e[24]!==i?(T=i("taskBoard.taskDialog.linksLabel"),e[24]=i,e[25]=T):T=e[25];let C;e[26]!==T?(C=c.jsx("span",{className:"mb-1 text-xs font-medium text-muted-foreground",children:T}),e[26]=T,e[27]=C):C=e[27];let j;e[28]!==y||e[29]!==s||e[30]!==k||e[31]!==S||e[32]!==f||e[33]!==o||e[34]!==g?(j=y?c.jsx(Kp,{}):(o??[]).map(D=>c.jsx(Up,{pr:D,previewThread:S,reviewsReady:g,shipPending:f.isPending,onShip:k,onOpenThread:s},D.url)),e[28]=y,e[29]=s,e[30]=k,e[31]=S,e[32]=f,e[33]=o,e[34]=g,e[35]=j):j=e[35],p=c.jsxs("div",{className:"flex flex-col gap-1 pb-2",children:[C,j,m.map(Wp)]})}e[0]=a,e[1]=u,e[2]=r,e[3]=n.status,e[4]=n.threads,e[5]=s,e[6]=f,e[7]=o,e[8]=l,e[9]=d,e[10]=i,e[11]=p,e[12]=h}else p=e[11],h=e[12];return h!==Symbol.for("react.early_return_sentinel")?h:p}function Wp(t){return c.jsxs("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"group flex items-center gap-2 rounded-md px-1 py-1.5 transition-colors hover:bg-muted",children:[c.jsx(rl,{size:15,className:"shrink-0 text-muted-foreground"}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.label}),c.jsx(Gs,{size:13,className:"shrink-0 text-muted-foreground/50 group-hover:text-foreground"})]},t.url)}function Vp(t){return t.hasPreview&&t.virtualMcpId}function Qp(t){const e=F.c(6),{item:n,members:r,startedBy:s,onOpenThread:i}=t,o=le(),{data:l}=da(n.id),{data:a}=Do.useSession(),d=new Map(r.map(Jp)),u={id:a?.user?.id??"me",name:a?.user?.name??o("taskBoard.taskDialog.commentYouLabel"),image:a?.user?.image},f=Rp(n.id),p=k=>{if(k===ze)return{id:k,name:o("taskBoard.taskDialog.superAgentLabel"),isAgent:!0};if(k===u.id)return u;const v=d.get(k);return{id:k,name:v?.user?.name??k,image:v?.user?.image}},h=f.threads.map(k=>({id:k.id,author:p(k.authorId),body:k.body,createdAt:k.createdAt,resolved:k.resolved,replies:k.replies.map(v=>({id:v.id,author:p(v.authorId),body:v.body,createdAt:v.createdAt,replies:[]}))})),m=[...(l??[]).map(Zp),...n.threads.map(Yp),...h.map(Xp)].sort(Gp),y=[];for(const k of m){if(k.kind==="thread"){y.push({type:"thread",thread:k.thread});continue}if(k.kind==="comment"){y.push({type:"comment",comment:k.comment});continue}const v=y[y.length-1];v?.type==="timeline"?v.items.push(k.activity):y.push({type:"timeline",items:[k.activity]})}let b;e[0]!==o?(b=o("taskBoard.taskDialog.activityLabel"),e[0]=o,e[1]=b):b=e[1];let g;e[2]!==b?(g=c.jsx("span",{className:"text-sm font-medium text-foreground",children:b}),e[2]=b,e[3]=g):g=e[3];let x;return e[4]!==f.post?(x=k=>f.post.mutate({body:k}),e[4]=f.post,e[5]=x):x=e[5],c.jsxs("div",{className:"flex flex-col gap-5 pb-2",children:[g,y.map((k,v)=>k.type==="timeline"?c.jsx(tg,{items:k.items,memberByUserId:d},`timeline-${v}`):k.type==="comment"?c.jsx(Sp,{thread:k.comment,me:u,onReply:S=>f.post.mutate({body:S,parentId:k.comment.id}),onDelete:S=>f.remove.mutate(S),onToggleResolved:()=>f.setResolved.mutate({id:k.comment.id,resolved:!k.comment.resolved})},`comment-${k.comment.id}`):c.jsx(Mp,{thread:k.thread,startedBy:s,onOpen:i},`thread-${k.thread.threadId}`)),c.jsx(Tp,{me:u,onSubmit:x})]})}function Gp(t,e){return t.at-e.at}function Xp(t){return{kind:"comment",at:new Date(t.createdAt).getTime(),comment:t}}function Yp(t){return{kind:"thread",at:new Date(t.createdAt).getTime(),thread:t}}function Zp(t){return{kind:"activity",at:new Date(t.occurredAt).getTime(),activity:t}}function Jp(t){return[t.userId,t]}function an(t){const e=F.c(7),{icon:n,label:r}=t;let s;e[0]!==n?(s=c.jsx("span",{className:"ml-1 mr-1 inline-flex h-[1lh] items-center align-top",children:n}),e[0]=n,e[1]=s):s=e[1];let i;e[2]!==r?(i=c.jsx("span",{className:"mr-1",children:r}),e[2]=r,e[3]=i):i=e[3];let o;return e[4]!==s||e[5]!==i?(o=c.jsxs(c.Fragment,{children:[s,i]}),e[4]=s,e[5]=i,e[6]=o):o=e[6],o}const cr="\0";function Qs(t){return`${cr}${t}${cr}`}function Gn(t,e){return t.split(new RegExp(`${cr}(\\w+)${cr}`)).map((n,r)=>c.jsx(w.Fragment,{children:r%2===0?n:e[n]},r))}function hs(t,e){return e(t==="code_review"?"taskBoard.taskDialog.codeReviewerLabel":"taskBoard.taskDialog.qaAgentLabel")}function eg(t,e,n){const r=p=>{const h=typeof p=="string"?Et[p]:void 0;if(!h)return String(p??"");const m=h.icon;return c.jsx(an,{icon:c.jsx(m,{size:14,className:h.iconClassName}),label:e(h.labelKey)})},s=p=>{const h=typeof p=="string"?It[p]:void 0;return h?c.jsx(an,{icon:c.jsx("span",{className:ee("size-2 rounded-full",h.dotClassName)}),label:e(h.labelKey)}):String(p??"")},i=p=>{const h=Xr(typeof p=="string"?p:null);return h?c.jsx(an,{icon:c.jsx(Yn,{size:14,className:"text-muted-foreground"}),label:ha.format(h)}):""},o=p=>!Array.isArray(p)||p.length===0?null:p.map((h,m)=>{const y=h;return c.jsx(an,{icon:c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:As(y.color)}}),label:y.name??""},y.id??m)}),l=p=>{if(p===ze)return c.jsx(an,{icon:c.jsx(Lt,{size:14}),label:e("taskBoard.taskDialog.superAgentLabel")});const h=typeof p=="string"?n.get(p):void 0;return c.jsx(an,{icon:c.jsx(At,{url:h?.user?.image??void 0,fallback:_t(h?.user?.name),shape:"circle",size:"2xs"}),label:h?.user?.name??e("taskBoard.taskDialog.someoneLabel")})},a=p=>c.jsx(an,{icon:p==="code_review"?c.jsx(Fl,{size:14}):c.jsx(Pl,{size:14}),label:hs(p,e)}),d=t.data,u=Qs("from"),f=Qs("to");switch(t.action){case"created":return e("taskBoard.taskDialog.activityCreated");case"status_changed":return Gn(d.from?e("taskBoard.taskDialog.activityMovedFromTo",{from:u,to:f}):e("taskBoard.taskDialog.activityMovedTo",{to:f}),{from:r(d.from),to:r(d.to)});case"assignee_changed":return d.to==null?e("taskBoard.taskDialog.activityUnassigned"):Gn(e(d.to===ze?"taskBoard.taskDialog.activityDelegated":"taskBoard.taskDialog.activityAssigned",{name:Qs("name")}),{name:l(d.to)});case"priority_changed":return d.to==="none"?e("taskBoard.taskDialog.activityPriorityCleared"):Gn(!d.from||d.from==="none"?e("taskBoard.taskDialog.activityPrioritySet",{to:f}):e("taskBoard.taskDialog.activityPriorityFromTo",{from:u,to:f}),{from:s(d.from),to:s(d.to)});case"due_date_changed":return d.to==null?e("taskBoard.taskDialog.activityDueDateCleared"):Gn(d.from==null?e("taskBoard.taskDialog.activityDueDateSet",{to:f}):e("taskBoard.taskDialog.activityDueDateFromTo",{from:u,to:f}),{from:i(d.from),to:i(d.to)});case"title_changed":return e("taskBoard.taskDialog.activityRenamed",{to:String(d.to??"")});case"description_changed":return e("taskBoard.taskDialog.activityDescriptionUpdated");case"tags_changed":return!Array.isArray(d.to)||d.to.length===0?e("taskBoard.taskDialog.activityTagsCleared"):Gn(e("taskBoard.taskDialog.activityTagsSet",{to:f}),{to:o(d.to)});case"review_requested":return Gn(e("taskBoard.taskDialog.activityDelegated",{name:Qs("name")}),{name:a(d.reviewer)});case"review_approved":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewApprovedWithNotes",{reviewer:hs(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewApproved",{reviewer:hs(d.reviewer,e)});case"review_changes_requested":return typeof d.notes=="string"&&d.notes.trim()?e("taskBoard.taskDialog.activityReviewChangesRequestedWithNotes",{reviewer:hs(d.reviewer,e),notes:d.notes}):e("taskBoard.taskDialog.activityReviewChangesRequested",{reviewer:hs(d.reviewer,e)});case"merge_conflict_resolution":return e("taskBoard.taskDialog.activityMergeConflictResolution");default:{const p=t.action;return String(p)}}}function vo(t){return!t||t===ze}function tg(t){const e=F.c(21),{items:n,memberByUserId:r}=t,s=le();let i;e[0]!==r||e[1]!==s?(i=p=>vo(p)?s("taskBoard.taskDialog.superAgentLabel"):r.get(p)?.user?.name??s("taskBoard.taskDialog.someoneLabel"),e[0]=r,e[1]=s,e[2]=i):i=e[2];const o=i;let l;e[3]!==r?(l=p=>{if(vo(p))return c.jsx("span",{className:"z-10 flex size-4 shrink-0 items-center justify-center bg-background",children:c.jsx(Lt,{size:16})});const h=r.get(p);return c.jsx("span",{className:"z-10 shrink-0 rounded-full bg-background",children:c.jsx(At,{url:h?.user?.image??void 0,fallback:_t(h?.user?.name),shape:"circle",size:"2xs"})})},e[3]=r,e[4]=l):l=e[4];const a=l;let d;e[5]!==n.length?(d=n.length>1&&c.jsx("span",{"aria-hidden":!0,className:"absolute bottom-3 left-2 top-3 w-px bg-border"}),e[5]=n.length,e[6]=d):d=e[6];let u;if(e[7]!==a||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==s){let p;e[13]!==a||e[14]!==o||e[15]!==r||e[16]!==s?(p=h=>c.jsxs("div",{className:"relative flex items-center gap-2.5",children:[a(h.actorId),c.jsxs("span",{className:"min-w-0 truncate text-sm text-muted-foreground",children:[c.jsx("span",{className:"font-medium text-foreground",children:o(h.actorId)})," ",eg(h,s,r),c.jsxs("span",{className:"text-muted-foreground/60",children:[" · ",ri(new Date(h.occurredAt))]})]})]},h.id),e[13]=a,e[14]=o,e[15]=r,e[16]=s,e[17]=p):p=e[17],u=n.map(p),e[7]=a,e[8]=o,e[9]=n,e[10]=r,e[11]=s,e[12]=u}else u=e[12];let f;return e[18]!==d||e[19]!==u?(f=c.jsxs("div",{className:"relative flex flex-col gap-4",children:[d,u]}),e[18]=d,e[19]=u,e[20]=f):f=e[20],f}const pa="https://decoims.com/image?src=decocms%2F7263a67f-fb83-410b-a5f2-e54e87deaaac%2Freport-kanban.png&quality=original&fit=cover",ng=["taskBoard.backlogPaywall.benefitPrioritizedTasks","taskBoard.backlogPaywall.benefitRecurringReport","taskBoard.backlogPaywall.benefitAgentResolves"],wo={price:"R$ 99",anchor:"R$ 499"};function sg(t){const e=F.c(21),{onOpen:n}=t,r=le();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-success/10",children:c.jsx(ur,{size:16,className:"text-success"})}),e[0]=s):s=e[0];let i;e[1]!==r?(i=r("taskBoard.backlogPaywall.bannerTitle"),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==i?(o=c.jsx("span",{className:"text-sm font-medium text-foreground",children:i}),e[3]=i,e[4]=o):o=e[4];let l;e[5]!==r?(l=r("taskBoard.backlogPaywall.bannerSubtitle"),e[5]=r,e[6]=l):l=e[6];let a;e[7]!==l?(a=c.jsx("span",{className:"text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=a):a=e[8];let d;e[9]!==o||e[10]!==a?(d=c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[s,c.jsxs("div",{className:"flex min-w-0 flex-col",children:[o,a]})]}),e[9]=o,e[10]=a,e[11]=d):d=e[11];let u;e[12]!==r?(u=r("taskBoard.backlogPaywall.unlockButton"),e[12]=r,e[13]=u):u=e[13];let f;e[14]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(ol,{size:16}),e[14]=f):f=e[14];let p;e[15]!==n||e[16]!==u?(p=c.jsxs(_e,{size:"sm",onClick:n,className:"w-full gap-2 sm:w-auto sm:shrink-0",children:[u,f]}),e[15]=n,e[16]=u,e[17]=p):p=e[17];let h;return e[18]!==d||e[19]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-3 rounded-xl bg-card p-4 card-shadow sm:flex-row sm:items-center sm:gap-4",children:[d,p]}),e[18]=d,e[19]=p,e[20]=h):h=e[20],h}function rg({open:t,onOpenChange:e,cdClient:n,onExpired:r}){const s=le(),[i,o]=w.useState(!1),l=async()=>{if(!n){r();return}o(!0);try{const a=await n.callTool({name:"start_checkout",arguments:{}}),{url:d}=zr(a);if(new URL(d).protocol!=="https:")throw new Error("unsafe checkout url");window.open(d,"_blank","noopener,noreferrer"),e(!1)}catch{r()}finally{o(!1)}};return c.jsx(Jn,{open:t,onOpenChange:e,children:c.jsxs(es,{className:"gap-0 p-3 sm:max-w-[500px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:pa,alt:s("taskBoard.backlogPaywall.previewAlt"),className:"h-[208px] w-full object-cover object-left-top"})}),c.jsxs("div",{className:"flex flex-col gap-7 px-3 pb-3 pt-7",children:[c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsx(ts,{className:"text-xl font-semibold text-foreground",children:s("taskBoard.backlogPaywall.modalTitle")}),c.jsx("ul",{className:"flex flex-col gap-3.5",children:ng.map(a=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(xn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(a)})]},a))})]}),c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:wo.price}),c.jsx("span",{className:"text-sm text-muted-foreground line-through",children:wo.anchor})]}),c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[c.jsx(_e,{variant:"ghost",onClick:()=>e(!1),disabled:i,className:"order-2 w-full sm:order-none sm:w-auto",children:s("taskBoard.backlogPaywall.exploreButton")}),c.jsxs(_e,{onClick:l,disabled:i,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[i?c.jsx(Ts,{size:16,className:"animate-spin"}):null,s("taskBoard.backlogPaywall.unlockButton"),!i&&c.jsx(ol,{size:16})]})]})]})]})]})})}function Or(t){return`board-paywall-seen:${t}`}function ig(){const t=F.c(26),{org:e}=$e(),n=Lo(),{diagnostic:r,cdClient:s,connectionId:i}=jd();let o;t[0]!==e.id?(o=()=>({orgId:e.id,open:!sessionStorage.getItem(Or(e.id))}),t[0]=e.id,t[1]=o):o=t[1];const[l,a]=w.useState(o);let d;t[2]!==l.open||t[3]!==l.orgId||t[4]!==e.id?(d=l.orgId===e.id?l.open:!sessionStorage.getItem(Or(e.id)),t[2]=l.open,t[3]=l.orgId,t[4]=e.id,t[5]=d):d=t[5];const u=d;if(!r?.locked)return null;let f;t[6]!==e.id?(f=v=>a({orgId:e.id,open:v}),t[6]=e.id,t[7]=f):f=t[7];const p=f;let h;t[8]!==e.id||t[9]!==p?(h=v=>{p(v),v||sessionStorage.setItem(Or(e.id),"1")},t[8]=e.id,t[9]=p,t[10]=h):h=t[10];const m=h;let y;t[11]!==i||t[12]!==n||t[13]!==e?(y=()=>{$i("board_paywall_report_opened",{organization_id:e.id}),n(Nd(e,i))},t[11]=i,t[12]=n,t[13]=e,t[14]=y):y=t[14];const b=y;let g;t[15]!==e.id||t[16]!==p?(g=c.jsx(sg,{onOpen:()=>{$i("board_paywall_banner_clicked",{organization_id:e.id}),p(!0)}}),t[15]=e.id,t[16]=p,t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==m||t[20]!==u||t[21]!==b?(x=c.jsx(rg,{open:u,onOpenChange:m,cdClient:s,onExpired:b}),t[18]=s,t[19]=m,t[20]=u,t[21]=b,t[22]=x):x=t[22];let k;return t[23]!==g||t[24]!==x?(k=c.jsxs(c.Fragment,{children:[g,x]}),t[23]=g,t[24]=x,t[25]=k):k=t[25],k}function og(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(Na,{fallback:null,children:c.jsx(ig,{})}),t[0]=e):e=t[0],e}const lg=["taskBoard.subscriptionPaywall.trialBenefitMonitoring","taskBoard.subscriptionPaywall.trialBenefitAutoFix","taskBoard.subscriptionPaywall.trialBenefitRuns"];function ag(t){const e=F.c(83),{kind:n,onOpenChange:r}=t,s=le(),{mutate:i,isPending:o}=Mc("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");if(n==="trial_exhausted"){let v;e[0]!==s?(v=s("taskBoard.subscriptionPaywall.previewAlt"),e[0]=s,e[1]=v):v=e[1];let S;e[2]!==v?(S=c.jsx("div",{className:"overflow-hidden rounded-xl bg-muted",children:c.jsx("img",{src:pa,alt:v,className:"h-[160px] w-full object-cover object-left-top"})}),e[2]=v,e[3]=S):S=e[3];let T;e[4]!==s?(T=s("taskBoard.subscriptionPaywall.trialTitle"),e[4]=s,e[5]=T):T=e[5];let C;e[6]!==T?(C=c.jsx(ts,{className:"text-xl font-semibold text-foreground",children:T}),e[6]=T,e[7]=C):C=e[7];let j;e[8]!==s?(j=lg.map(te=>c.jsxs("li",{className:"flex items-start gap-3 text-sm",children:[c.jsx(xn,{size:18,className:"mt-0.5 shrink-0 text-success","aria-hidden":!0}),c.jsx("span",{className:"leading-snug text-foreground",children:s(te)})]},te)),e[8]=s,e[9]=j):j=e[9];let D;e[10]!==j?(D=c.jsx("ul",{className:"flex flex-col gap-3",children:j}),e[10]=j,e[11]=D):D=e[11];let R;e[12]!==s?(R=s("taskBoard.subscriptionPaywall.trialPrice"),e[12]=s,e[13]=R):R=e[13];let N;e[14]!==R?(N=c.jsx("span",{className:"text-2xl font-semibold text-foreground",children:R}),e[14]=R,e[15]=N):N=e[15];let I;e[16]!==s?(I=s("taskBoard.subscriptionPaywall.trialPricePeriod"),e[16]=s,e[17]=I):I=e[17];let A;e[18]!==I?(A=c.jsx("span",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=A):A=e[19];let _;e[20]!==A||e[21]!==N?(_=c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[N,A]}),e[20]=A,e[21]=N,e[22]=_):_=e[22];let M;e[23]!==r?(M=()=>r(!1),e[23]=r,e[24]=M):M=e[24];let E;e[25]!==s?(E=s("taskBoard.subscriptionPaywall.notNowButton"),e[25]=s,e[26]=E):E=e[26];let O;e[27]!==o||e[28]!==M||e[29]!==E?(O=c.jsx(_e,{variant:"ghost",onClick:M,disabled:o,className:"order-2 w-full sm:order-none sm:w-auto",children:E}),e[27]=o,e[28]=M,e[29]=E,e[30]=O):O=e[30];let z;e[31]!==r||e[32]!==i?(z=()=>i(void 0,{onSuccess:()=>r(!1)}),e[31]=r,e[32]=i,e[33]=z):z=e[33];let B;e[34]!==o?(B=o&&c.jsx(Ts,{size:16,className:"animate-spin"}),e[34]=o,e[35]=B):B=e[35];let P;e[36]!==s?(P=s("taskBoard.subscriptionPaywall.subscribeButton"),e[36]=s,e[37]=P):P=e[37];let L;e[38]!==o||e[39]!==z||e[40]!==B||e[41]!==P?(L=c.jsxs(_e,{disabled:o,onClick:z,className:"order-1 w-full gap-2 sm:order-none sm:w-auto",children:[B,P]}),e[38]=o,e[39]=z,e[40]=B,e[41]=P,e[42]=L):L=e[42];let U;e[43]!==O||e[44]!==L?(U=c.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[O,L]}),e[43]=O,e[44]=L,e[45]=U):U=e[45];let H;e[46]!==_||e[47]!==U?(H=c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[_,U]}),e[46]=_,e[47]=U,e[48]=H):H=e[48];let W;e[49]!==H||e[50]!==C||e[51]!==D?(W=c.jsxs("div",{className:"flex flex-col gap-6 px-3 pb-3 pt-7",children:[C,D,H]}),e[49]=H,e[50]=C,e[51]=D,e[52]=W):W=e[52];let V;e[53]!==S||e[54]!==W?(V=c.jsxs(es,{className:"gap-0 p-3 sm:max-w-[440px]",closeButtonClassName:"z-10 rounded-full bg-background/70 p-1 text-foreground backdrop-blur transition-colors hover:bg-background",children:[S,W]}),e[53]=S,e[54]=W,e[55]=V):V=e[55];let Z;return e[56]!==r||e[57]!==V?(Z=c.jsx(Jn,{open:!0,onOpenChange:r,children:V}),e[56]=r,e[57]=V,e[58]=Z):Z=e[58],Z}let l;e[59]!==n||e[60]!==s?(l=n?{monthly_exhausted:{title:s("taskBoard.subscriptionPaywall.monthlyTitle"),description:s("taskBoard.subscriptionPaywall.monthlyDescription")},runs_exhausted:{title:s("taskBoard.subscriptionPaywall.runsTitle"),description:s("taskBoard.subscriptionPaywall.runsDescription")}}[n]:null,e[59]=n,e[60]=s,e[61]=l):l=e[61];const a=l,d=!!n,u=a?.title;let f;e[62]!==u?(f=c.jsx(ts,{children:u}),e[62]=u,e[63]=f):f=e[63];const p=a?.description;let h;e[64]!==p?(h=c.jsx(ti,{children:p}),e[64]=p,e[65]=h):h=e[65];let m;e[66]!==f||e[67]!==h?(m=c.jsxs(ni,{children:[f,h]}),e[66]=f,e[67]=h,e[68]=m):m=e[68];let y;e[69]!==r?(y=()=>r(!1),e[69]=r,e[70]=y):y=e[70];let b;e[71]!==s?(b=s("taskBoard.subscriptionPaywall.dismissButton"),e[71]=s,e[72]=b):b=e[72];let g;e[73]!==y||e[74]!==b?(g=c.jsx(si,{children:c.jsx(_e,{variant:"ghost",onClick:y,children:b})}),e[73]=y,e[74]=b,e[75]=g):g=e[75];let x;e[76]!==g||e[77]!==m?(x=c.jsxs(es,{className:"sm:max-w-[440px]",children:[m,g]}),e[76]=g,e[77]=m,e[78]=x):x=e[78];let k;return e[79]!==r||e[80]!==x||e[81]!==d?(k=c.jsx(Jn,{open:d,onOpenChange:r,children:x}),e[79]=r,e[80]=x,e[81]=d,e[82]=k):k=e[82],k}const cg=new Set(["completed","failed","expired"]);function dg(t){return t.threads.some(e=>e.status!==null&&!cg.has(e.status))}function ug(t){const e=F.c(39),{item:n,pending:r,onOpenChange:s,onConfirm:i}=t,o=le(),l=n!==null;let a;e[0]!==o?(a=o("taskBoard.rerun.title"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=c.jsx(ts,{children:a}),e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==o?(u=n&&dg(n)?o("taskBoard.rerun.descriptionTakeover"):o("taskBoard.rerun.description"),e[4]=n,e[5]=o,e[6]=u):u=e[6];let f;e[7]!==u?(f=c.jsx(ti,{children:u}),e[7]=u,e[8]=f):f=e[8];let p;e[9]!==d||e[10]!==f?(p=c.jsxs(ni,{children:[d,f]}),e[9]=d,e[10]=f,e[11]=p):p=e[11];let h;e[12]!==s?(h=()=>s(!1),e[12]=s,e[13]=h):h=e[13];let m;e[14]!==o?(m=o("taskBoard.rerun.cancel"),e[14]=o,e[15]=m):m=e[15];let y;e[16]!==r||e[17]!==h||e[18]!==m?(y=c.jsx(_e,{variant:"outline",onClick:h,disabled:r,children:m}),e[16]=r,e[17]=h,e[18]=m,e[19]=y):y=e[19];let b;e[20]!==r?(b=r&&c.jsx(Ts,{className:"size-4 animate-spin"}),e[20]=r,e[21]=b):b=e[21];let g;e[22]!==o?(g=o("taskBoard.rerun.confirm"),e[22]=o,e[23]=g):g=e[23];let x;e[24]!==i||e[25]!==r||e[26]!==b||e[27]!==g?(x=c.jsxs(_e,{onClick:i,disabled:r,children:[b,g]}),e[24]=i,e[25]=r,e[26]=b,e[27]=g,e[28]=x):x=e[28];let k;e[29]!==x||e[30]!==y?(k=c.jsxs(si,{children:[y,x]}),e[29]=x,e[30]=y,e[31]=k):k=e[31];let v;e[32]!==k||e[33]!==p?(v=c.jsxs(es,{className:"max-w-md",children:[p,k]}),e[32]=k,e[33]=p,e[34]=v):v=e[34];let S;return e[35]!==s||e[36]!==l||e[37]!==v?(S=c.jsx(Jn,{open:l,onOpenChange:s,children:v}),e[35]=s,e[36]=l,e[37]=v,e[38]=S):S=e[38],S}const So=380,fg=90,Co=5,hg="cubic-bezier(0.22, 0.61, 0.36, 1)";function pg(t,e,n){const r=w.useRef(new Map),s=w.useRef(new Map);w.useLayoutEffect(()=>{const i=t.current;if(!i)return;const o=i.querySelectorAll("[data-flip-id]"),l=new Map,a=r.current;r.current=l;const d=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,u=[];for(const g of o){const x=g.dataset.flipId;if(!x)continue;const k=g.getBoundingClientRect(),v=g.dataset.flipLane;if(l.set(x,{rect:k,lane:v}),!n)continue;const S=a.get(x);if(!S)continue;const T=S.rect.left-k.left,C=S.rect.top-k.top;(T||C)&&u.push({el:g,dx:T,dy:C,lane:S.lane!==v})}if(!n||d||u.length===0)return;const f=s.current,p=g=>{g instanceof HTMLElement&&(f.set(g,(f.get(g)??0)+1),g.style.overflow="visible")},h=g=>{if(!(g instanceof HTMLElement))return;const x=(f.get(g)??1)-1;if(x>0){f.set(g,x);return}f.delete(g),g.style.overflow=""};for(const g of u){const x=g.lane?` rotate(${g.dx>0?Co:-Co}deg)`:"";g.el.style.transition="none",g.el.style.transform=`translate(${g.dx}px, ${g.dy}px)${x}`,g.lane&&(g.el.style.zIndex="10",p(g.el.closest("[data-lane-scroll]")))}let m=0;const y=[],b=requestAnimationFrame(()=>{for(const g of u){const x=g.lane?m++*fg:0;g.el.style.transition=`transform ${So}ms ${hg} ${x}ms`,g.el.style.transform="",y.push(window.setTimeout(()=>{g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&h(g.el.closest("[data-lane-scroll]"))},So+x+30))}});return()=>{cancelAnimationFrame(b);for(const g of y)clearTimeout(g);for(const g of u)g.el.style.transition="",g.el.style.transform="",g.el.style.zIndex="",g.lane&&h(g.el.closest("[data-lane-scroll]"))}},[e,t,n])}function gg(t,e=[]){const n=[[`# Task: ${t.title}`,t.description?.trim()].filter(Boolean).join(`
72
-
73
- `)];if(e.length>0){const r=e.map(s=>{const i=s.merged?"merged":s.state??(s.draft?"draft":"open"),o=s.title?.trim()||`${s.repoOwner}/${s.repoName}`;return`- #${s.number} ${o} [${i}] ${s.url}`});n.push(["## Linked pull requests",...r].join(`
74
- `))}if(t.threads.length>0){const r=t.threads.map(s=>{const i=s.title?.trim()||"Untitled chat";return s.status?`- ${i} [${s.status}]`:`- ${i}`});n.push(["## Other chats on this task",...r].join(`
75
- `))}return n.join(`
76
-
77
- `)}const Yr="__unassigned__",dr={assignee:null,priority:null,due:null};function mg(t){return t.assignee!==null||t.priority!==null||t.due!==null}function xg(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const bg=864e5;function yg(t,e){const n=new Date(t),r=new Date(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function kg(t,e){if(e.assignee!==null){if(e.assignee===Yr){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),r=Date.now();if(e.due==="overdue"&&n>=r||e.due==="today"&&!yg(n,r)||e.due==="week"&&(n<r||n>r+7*bg))return!1}return!0}const jo={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function vr(t,e=!1){return ee("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function vg(t){const e=F.c(95),{value:n,members:r,onChange:s,block:i}=t,o=le(),[l,a]=w.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=c.jsx(Mr,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,f;e[1]!==o?(f=o("taskBoard.taskFilters.assigneeLabel"),e[1]=o,e[2]=f):f=e[2];let p=f;if(n===Yr){let q;e[3]!==o?(q=o("taskBoard.taskFilters.assigneeUnassigned"),e[3]=o,e[4]=q):q=e[4],p=q}else if(n===ze){let q;e[5]===Symbol.for("react.memo_cache_sentinel")?(q=c.jsx(Lt,{size:14}),e[5]=q):q=e[5],u=q;let X;e[6]!==o?(X=o("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=o,e[7]=X):X=e[7],p=X}else if(n){let q,X,J,oe;if(e[8]!==r||e[9]!==n){let Y;e[14]!==n?(Y=ae=>ae.userId===n,e[14]=n,e[15]=Y):Y=e[15],X=r.find(Y),q=At,J=X?.user?.image??void 0,oe=_t(X?.user?.name),e[8]=r,e[9]=n,e[10]=q,e[11]=X,e[12]=J,e[13]=oe}else q=e[10],X=e[11],J=e[12],oe=e[13];let G;e[16]!==q||e[17]!==J||e[18]!==oe?(G=c.jsx(q,{url:J,fallback:oe,shape:"circle",size:"2xs"}),e[16]=q,e[17]=J,e[18]=oe,e[19]=G):G=e[19],u=G;let K;e[20]!==X?.user?.name||e[21]!==o?(K=X?.user?.name??o("taskBoard.taskFilters.assigneeMember"),e[20]=X?.user?.name,e[21]=o,e[22]=K):K=e[22],p=K}let h;e[23]!==s?(h=q=>{s(q),a(!1)},e[23]=s,e[24]=h):h=e[24];const m=h,y=n!==null;let b;e[25]!==i||e[26]!==y?(b=vr(y,i),e[25]=i,e[26]=y,e[27]=b):b=e[27];const g=b,x=i&&"ml-auto";let k;e[28]!==x?(k=ee("shrink-0 opacity-60",x),e[28]=x,e[29]=k):k=e[29];const v=k;let S;e[30]!==p?(S=c.jsx("span",{className:"max-w-[10rem] truncate",children:p}),e[30]=p,e[31]=S):S=e[31];let T;e[32]!==v?(T=c.jsx(ui,{size:12,className:v}),e[32]=v,e[33]=T):T=e[33];let C;e[34]!==u||e[35]!==S||e[36]!==T||e[37]!==g?(C=c.jsx(Xn,{asChild:!0,children:c.jsxs("button",{type:"button",className:g,children:[u,S,T]})}),e[34]=u,e[35]=S,e[36]=T,e[37]=g,e[38]=C):C=e[38];let j;e[39]!==o?(j=o("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=o,e[40]=j):j=e[40];let D;e[41]!==j?(D=c.jsx(li,{placeholder:j,className:"h-9"}),e[41]=j,e[42]=D):D=e[42];let R;e[43]!==o?(R=o("taskBoard.taskFilters.assigneeNoMembersFound"),e[43]=o,e[44]=R):R=e[44];let N;e[45]!==R?(N=c.jsx(ai,{children:R}),e[45]=R,e[46]=N):N=e[46];let I;e[47]!==m?(I=()=>m(null),e[47]=m,e[48]=I):I=e[48];let A;e[49]!==o?(A=o("taskBoard.taskFilters.assigneeAnyone"),e[49]=o,e[50]=A):A=e[50];let _;e[51]!==I||e[52]!==A?(_=c.jsx(Jt,{value:"Anyone",onSelect:I,children:A}),e[51]=I,e[52]=A,e[53]=_):_=e[53];let M;e[54]!==m?(M=()=>m(Yr),e[54]=m,e[55]=M):M=e[55];let E;e[56]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(Mr,{size:16,className:"text-muted-foreground"}),e[56]=E):E=e[56];let O;e[57]!==o?(O=o("taskBoard.taskFilters.assigneeUnassigned"),e[57]=o,e[58]=O):O=e[58];let z;e[59]!==M||e[60]!==O?(z=c.jsxs(Jt,{value:"Unassigned",onSelect:M,className:"gap-2",children:[E,O]}),e[59]=M,e[60]=O,e[61]=z):z=e[61];let B;e[62]!==m?(B=()=>m(ze),e[62]=m,e[63]=B):B=e[63];let P;e[64]===Symbol.for("react.memo_cache_sentinel")?(P=c.jsx(Lt,{size:16}),e[64]=P):P=e[64];let L;e[65]!==o?(L=o("taskBoard.taskFilters.assigneeSuperAgent"),e[65]=o,e[66]=L):L=e[66];let U;e[67]!==B||e[68]!==L?(U=c.jsxs(Jt,{value:"Super Agent",onSelect:B,className:"gap-2",children:[P,L]}),e[67]=B,e[68]=L,e[69]=U):U=e[69];let H;e[70]!==_||e[71]!==z||e[72]!==U?(H=c.jsxs(ns,{children:[_,z,U]}),e[70]=_,e[71]=z,e[72]=U,e[73]=H):H=e[73];let W;e[74]!==o?(W=o("taskBoard.taskFilters.assigneeGroupMembers"),e[74]=o,e[75]=W):W=e[75];let V;if(e[76]!==r||e[77]!==m){let q;e[79]!==m?(q=X=>c.jsxs(Jt,{value:X.user?.name??X.userId,onSelect:()=>m(X.userId),className:"gap-2",children:[c.jsx(At,{url:X.user?.image??void 0,fallback:_t(X.user?.name),shape:"circle",size:"2xs"}),c.jsx("span",{className:"truncate",children:X.user?.name??X.userId})]},X.userId),e[79]=m,e[80]=q):q=e[80],V=r.map(q),e[76]=r,e[77]=m,e[78]=V}else V=e[78];let Z;e[81]!==W||e[82]!==V?(Z=c.jsx(ns,{heading:W,children:V}),e[81]=W,e[82]=V,e[83]=Z):Z=e[83];let te;e[84]!==N||e[85]!==H||e[86]!==Z?(te=c.jsxs(ci,{children:[N,H,Z]}),e[84]=N,e[85]=H,e[86]=Z,e[87]=te):te=e[87];let ie;e[88]!==D||e[89]!==te?(ie=c.jsx(xs,{align:"start",className:"w-56 p-0",children:c.jsxs(di,{children:[D,te]})}),e[88]=D,e[89]=te,e[90]=ie):ie=e[90];let ne;return e[91]!==l||e[92]!==C||e[93]!==ie?(ne=c.jsxs(bs,{open:l,onOpenChange:a,children:[C,ie]}),e[91]=l,e[92]=C,e[93]=ie,e[94]=ne):ne=e[94],ne}function wg(t){const e=F.c(33),{value:n,onChange:r,block:s}=t,i=le(),o=n!==null;let l;e[0]!==s||e[1]!==o?(l=vr(o,s),e[0]=s,e[1]=o,e[2]=l):l=e[2];const a=l,d=s&&"ml-auto";let u;e[3]!==d?(u=ee("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const f=u;let p;e[5]!==n?(p=n?c.jsx("span",{className:ee("size-2 shrink-0 rounded-full",It[n].dotClassName)}):c.jsx(Hc,{size:14,className:"shrink-0"}),e[5]=n,e[6]=p):p=e[6];let h;e[7]!==i||e[8]!==n?(h=i(n?It[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=i,e[8]=n,e[9]=h):h=e[9];let m;e[10]!==f?(m=c.jsx(ui,{size:12,className:f}),e[10]=f,e[11]=m):m=e[11];let y;e[12]!==p||e[13]!==h||e[14]!==m||e[15]!==a?(y=c.jsx(un,{asChild:!0,children:c.jsxs("button",{type:"button",className:a,children:[p,h,m]})}),e[12]=p,e[13]=h,e[14]=m,e[15]=a,e[16]=y):y=e[16];let b;e[17]!==r?(b=()=>r(null),e[17]=r,e[18]=b):b=e[18];let g;e[19]!==i?(g=i("taskBoard.taskFilters.priorityAnyPriority"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==g||e[22]!==b?(x=c.jsx(Ct,{onSelect:b,children:g}),e[21]=g,e[22]=b,e[23]=x):x=e[23];let k;e[24]!==r||e[25]!==i?(k=wi.map(T=>c.jsxs(Ct,{onSelect:()=>r(T),className:"gap-2",children:[c.jsx("span",{className:ee("size-2 rounded-full",It[T].dotClassName)}),i(It[T].labelKey)]},T)),e[24]=r,e[25]=i,e[26]=k):k=e[26];let v;e[27]!==x||e[28]!==k?(v=c.jsxs(fn,{align:"start",className:"w-40",children:[x,k]}),e[27]=x,e[28]=k,e[29]=v):v=e[29];let S;return e[30]!==v||e[31]!==y?(S=c.jsxs(hn,{children:[y,v]}),e[30]=v,e[31]=y,e[32]=S):S=e[32],S}function Sg(t){const e=F.c(35),{value:n,onChange:r,block:s}=t,i=le();let o;e[0]!==i||e[1]!==n?(o=n?i(jo[n]):void 0,e[0]=i,e[1]=n,e[2]=o):o=e[2];const l=o,a=n!==null;let d;e[3]!==s||e[4]!==a?(d=vr(a,s),e[3]=s,e[4]=a,e[5]=d):d=e[5];const u=d,f=s&&"ml-auto";let p;e[6]!==f?(p=ee("shrink-0 opacity-60",f),e[6]=f,e[7]=p):p=e[7];const h=p;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=c.jsx(Yn,{size:14,className:"shrink-0"}),e[8]=m):m=e[8];let y;e[9]!==l||e[10]!==i?(y=l??i("taskBoard.taskFilters.dueDateLabel"),e[9]=l,e[10]=i,e[11]=y):y=e[11];let b;e[12]!==h?(b=c.jsx(ui,{size:12,className:h}),e[12]=h,e[13]=b):b=e[13];let g;e[14]!==y||e[15]!==b||e[16]!==u?(g=c.jsx(un,{asChild:!0,children:c.jsxs("button",{type:"button",className:u,children:[m,y,b]})}),e[14]=y,e[15]=b,e[16]=u,e[17]=g):g=e[17];let x;e[18]!==r?(x=()=>r(null),e[18]=r,e[19]=x):x=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=c.jsx(Yn,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==i?(v=i("taskBoard.taskFilters.dueDateAnyTime"),e[21]=i,e[22]=v):v=e[22];let S;e[23]!==x||e[24]!==v?(S=c.jsxs(Ct,{onSelect:x,className:"gap-2",children:[k,v]}),e[23]=x,e[24]=v,e[25]=S):S=e[25];let T;e[26]!==r||e[27]!==i?(T=Object.entries(jo).map(D=>{const[R,N]=D,I=R==="overdue";return c.jsxs(Ct,{onSelect:()=>r(R),className:ee("gap-2",I&&"text-destructive"),children:[c.jsx(Yn,{size:16,className:ee("shrink-0",I?"text-destructive":"text-muted-foreground")}),i(N)]},R)}),e[26]=r,e[27]=i,e[28]=T):T=e[28];let C;e[29]!==S||e[30]!==T?(C=c.jsxs(fn,{align:"start",className:"w-44",children:[S,T]}),e[29]=S,e[30]=T,e[31]=C):C=e[31];let j;return e[32]!==C||e[33]!==g?(j=c.jsxs(hn,{children:[g,C]}),e[32]=C,e[33]=g,e[34]=j):j=e[34],j}function ga(t){const e=F.c(26),{filters:n,members:r,onChange:s,block:i}=t;let o;e[0]!==n||e[1]!==s?(o=h=>s({...n,assignee:h}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let l;e[3]!==i||e[4]!==n.assignee||e[5]!==r||e[6]!==o?(l=c.jsx(vg,{block:i,value:n.assignee,members:r,onChange:o}),e[3]=i,e[4]=n.assignee,e[5]=r,e[6]=o,e[7]=l):l=e[7];let a;e[8]!==n||e[9]!==s?(a=h=>s({...n,priority:h}),e[8]=n,e[9]=s,e[10]=a):a=e[10];let d;e[11]!==i||e[12]!==n.priority||e[13]!==a?(d=c.jsx(wg,{block:i,value:n.priority,onChange:a}),e[11]=i,e[12]=n.priority,e[13]=a,e[14]=d):d=e[14];let u;e[15]!==n||e[16]!==s?(u=h=>s({...n,due:h}),e[15]=n,e[16]=s,e[17]=u):u=e[17];let f;e[18]!==i||e[19]!==n.due||e[20]!==u?(f=c.jsx(Sg,{block:i,value:n.due,onChange:u}),e[18]=i,e[19]=n.due,e[20]=u,e[21]=f):f=e[21];let p;return e[22]!==l||e[23]!==d||e[24]!==f?(p=c.jsxs(c.Fragment,{children:[l,d,f]}),e[22]=l,e[23]=d,e[24]=f,e[25]=p):p=e[25],p}function Cg(t){const e=F.c(12),{filters:n,members:r,onChange:s}=t,i=le();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=c.jsx(al,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let l;e[1]!==n||e[2]!==r||e[3]!==s?(l=c.jsx(ga,{filters:n,members:r,onChange:s}),e[1]=n,e[2]=r,e[3]=s,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==s||e[7]!==i?(a=mg(n)&&c.jsx("button",{type:"button",onClick:()=>s(dr),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:i("taskBoard.taskFilters.clearButton")}),e[5]=n,e[6]=s,e[7]=i,e[8]=a):a=e[8];let d;return e[9]!==l||e[10]!==a?(d=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,l,a]}),e[9]=l,e[10]=a,e[11]=d):d=e[11],d}function jg(t){const e=F.c(38),{filters:n,members:r,onChange:s}=t,i=le(),[o,l]=w.useState(!1),a=xg(n),d=a>0;let u;e[0]!==d?(u=vr(d),e[0]=d,e[1]=u):u=e[1];const f=u;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(al,{size:14,className:"shrink-0"}),e[2]=p):p=e[2];let h;e[3]!==i?(h=i("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=i,e[4]=h):h=e[4];let m;e[5]!==a?(m=a>0&&c.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:a}),e[5]=a,e[6]=m):m=e[6];let y;e[7]!==h||e[8]!==m||e[9]!==f?(y=c.jsx(Lc,{asChild:!0,children:c.jsxs("button",{type:"button",className:f,children:[p,h,m]})}),e[7]=h,e[8]=m,e[9]=f,e[10]=y):y=e[10];let b;e[11]!==i?(b=i("taskBoard.taskFilters.filterDrawerTitle"),e[11]=i,e[12]=b):b=e[12];let g;e[13]!==b?(g=c.jsx(Pc,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=g):g=e[14];let x;e[15]!==n||e[16]!==r||e[17]!==s?(x=c.jsx("div",{className:"flex flex-col gap-2 p-4",children:c.jsx(ga,{block:!0,filters:n,members:r,onChange:s})}),e[15]=n,e[16]=r,e[17]=s,e[18]=x):x=e[18];let k;e[19]!==a||e[20]!==s||e[21]!==i?(k=a>0&&c.jsx(_e,{variant:"outline",className:"flex-1",onClick:()=>s(dr),children:i("taskBoard.taskFilters.clearAllButton")}),e[19]=a,e[20]=s,e[21]=i,e[22]=k):k=e[22];let v;e[23]!==i?(v=i("taskBoard.taskFilters.doneButton"),e[23]=i,e[24]=v):v=e[24];let S;e[25]!==v?(S=c.jsx(Fc,{asChild:!0,children:c.jsx(_e,{className:"flex-1",children:v})}),e[25]=v,e[26]=S):S=e[26];let T;e[27]!==k||e[28]!==S?(T=c.jsxs(Uc,{className:"flex-row gap-2",children:[k,S]}),e[27]=k,e[28]=S,e[29]=T):T=e[29];let C;e[30]!==T||e[31]!==g||e[32]!==x?(C=c.jsxs(qc,{className:"p-0",children:[g,x,T]}),e[30]=T,e[31]=g,e[32]=x,e[33]=C):C=e[33];let j;return e[34]!==o||e[35]!==C||e[36]!==y?(j=c.jsxs(Kc,{open:o,onOpenChange:l,direction:"bottom",children:[y,C]}),e[34]=o,e[35]=C,e[36]=y,e[37]=j):j=e[37],j}Ra(()=>import("./index-CZI3aMGz.js").then(t=>t.bd),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148])).catch(()=>{});function Tg(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:c.jsx("div",{className:"h-full p-0.5 pt-0.25",children:c.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:c.jsx(va,{})})})}),t[0]=e):e=t[0],e}const Ng=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function Dg(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Ng.format(e),overdue:n}}const Os="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground";function ma(){const t=F.c(9),e=le();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=ee(Os,"border-warning/30 text-warning"),t[0]=n):n=t[0];let r;t[1]!==e?(r=e("taskBoard.taskBoard.blockedBadgeTitle"),t[1]=e,t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsx(ei,{size:14}),t[3]=s):s=t[3];let i;t[4]!==e?(i=e("taskBoard.taskBoard.needsInput"),t[4]=e,t[5]=i):i=t[5];let o;return t[6]!==r||t[7]!==i?(o=c.jsxs("span",{className:n,title:r,children:[s,i]}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function xa(t){const e=F.c(10),{priority:n}=t,r=le(),s=It[n];let i;e[0]!==s.dotClassName?(i=ee("size-2 rounded-full",s.dotClassName),e[0]=s.dotClassName,e[1]=i):i=e[1];let o;e[2]!==i?(o=c.jsx("span",{className:i}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==s.labelKey||e[5]!==r?(l=r(s.labelKey),e[4]=s.labelKey,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==o||e[8]!==l?(a=c.jsxs("span",{className:Os,children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9],a}function ba(t){const e=F.c(7),{iso:n}=t;let r,s;if(e[0]!==n){const{label:l,overdue:a}=Dg(n);r=l,s=ee(Os,a&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=r,e[2]=s}else r=e[1],s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Yn,{size:14}),e[3]=i):i=e[3];let o;return e[4]!==r||e[5]!==s?(o=c.jsxs("span",{className:s,children:[i,r]}),e[4]=r,e[5]=s,e[6]=o):o=e[6],o}function ya(t){const e=F.c(7),{tag:n}=t;let r;e[0]!==n.color?(r=As(n.color),e[0]=n.color,e[1]=r):r=e[1];let s;e[2]!==r?(s=c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:r}}),e[2]=r,e[3]=s):s=e[3];let i;return e[4]!==s||e[5]!==n.name?(i=c.jsxs("span",{className:Os,children:[s,n.name]}),e[4]=s,e[5]=n.name,e[6]=i):i=e[6],i}function ka(t){const e=F.c(32),{item:n,assignee:r,assignedBy:s,members:i,onAssign:o}=t,l=le(),[a,d]=w.useState(!1);if(n.assigneeId===ze){let x;e[0]!==s||e[1]!==l?(x=s?.user?.name?l("taskBoard.taskBoard.assignedToSuperAgentBy",{name:s.user.name}):l("taskBoard.taskBoard.assignedToSuperAgent"),e[0]=s,e[1]=l,e[2]=x):x=e[2];let k;e[3]!==s?(k=s&&c.jsx(At,{url:s.user?.image??void 0,fallback:_t(s.user?.name),shape:"circle",size:"xs",className:"-mr-2 ring-2 ring-background"}),e[3]=s,e[4]=k):k=e[4];let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=c.jsx(Lt,{size:20,className:"ring-2 ring-background"}),e[5]=v):v=e[5];let S;return e[6]!==x||e[7]!==k?(S=c.jsxs("span",{className:"inline-flex items-center",title:x,children:[k,v]}),e[6]=x,e[7]=k,e[8]=S):S=e[8],S}if(r){const x=r.user?.image??void 0,k=r.user?.name;let v;e[9]!==k?(v=_t(k),e[9]=k,e[10]=v):v=e[10];let S;return e[11]!==x||e[12]!==v?(S=c.jsx(At,{url:x,fallback:v,shape:"circle",size:"xs"}),e[11]=x,e[12]=v,e[13]=S):S=e[13],S}if(!o||!i?.length)return null;let u;e[14]!==l?(u=l("taskBoard.taskBoard.assignButton"),e[14]=l,e[15]=u):u=e[15];let f;e[16]!==l?(f=l("taskBoard.taskBoard.assignButton"),e[16]=l,e[17]=f):f=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=x=>{x.stopPropagation(),d(!0)},e[18]=p):p=e[18];let h;e[19]===Symbol.for("react.memo_cache_sentinel")?(h=c.jsx(Po,{size:13}),e[19]=h):h=e[19];let m;e[20]!==u||e[21]!==f?(m=c.jsx(Xn,{asChild:!0,children:c.jsx("button",{type:"button",title:u,"aria-label":f,onClick:p,className:"flex size-6 shrink-0 items-center justify-center rounded-full border border-dashed border-muted-foreground/40 text-muted-foreground/40 transition-colors hover:border-muted-foreground hover:text-muted-foreground",children:h})}),e[20]=u,e[21]=f,e[22]=m):m=e[22];let y;e[23]!==o?(y=x=>{o(x),d(!1)},e[23]=o,e[24]=y):y=e[24];let b;e[25]!==i||e[26]!==y?(b=c.jsx(xs,{className:"w-56 p-0",align:"end",side:"bottom",onClick:Rg,children:c.jsx(Oi,{members:i,onSelect:y})}),e[25]=i,e[26]=y,e[27]=b):b=e[27];let g;return e[28]!==a||e[29]!==m||e[30]!==b?(g=c.jsxs(bs,{open:a,onOpenChange:d,children:[m,b]}),e[28]=a,e[29]=m,e[30]=b,e[31]=g):g=e[31],g}function Rg(t){return t.stopPropagation()}function va(){const t=F.c(151),e=le(),{items:n,isLoading:r}=Cf(),s=jf(),i=Bc(),o=Za({slug:"mcp-github"})??[];let l;t[0]!==o?(l=o.some(Bg),t[0]=o,t[1]=l):l=t[1];const a=l,[d,u]=w.useState(!1),[f,p]=w.useState(!1);let h;t[2]!==a?(h=$=>$===ze&&!a?(u(!0),!0):!1,t[2]=a,t[3]=h):h=t[3];const m=h,[y,b]=w.useState(null);let g;t[4]===Symbol.for("react.memo_cache_sentinel")?(g=$=>{const re=Gc($);re&&b(re)},t[4]=g):g=t[4];const x=g,[k,v]=w.useState(null);let S;t[5]!==s||t[6]!==m||t[7]!==k?(S=()=>{if(k){if(m(ze)){v(null);return}s.rerun.mutate({id:k.id},{onError:$=>{x($),v(null)},onSuccess:()=>v(null)})}},t[5]=s,t[6]=m,t[7]=k,t[8]=S):S=t[8];const T=S,{data:C}=Wo();let j,D;t[9]!==C?.data?.members?(j=C?.data?.members??[],D=new Map(j.map(Ag)),t[9]=C?.data?.members,t[10]=j,t[11]=D):(j=t[10],D=t[11]);const R=D,[N,I]=w.useState("board"),[A,_]=w.useState(dr);let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=new Set,t[12]=M):M=t[12];const[E,O]=w.useState(M);let z;t[13]===Symbol.for("react.memo_cache_sentinel")?(z=$=>O(re=>{const be=new Set(re);return be.has($)?be.delete($):be.add($),be}),t[13]=z):z=t[13];const B=z,P=$=>O(re=>{const be=new Set(re);for(const We of ct)We.status===$&&be.add(We.id);return be});let L;t[14]===Symbol.for("react.memo_cache_sentinel")?(L=()=>O(new Set),t[14]=L):L=t[14];const U=L,[H,W]=w.useState(!1),[V,Z]=w.useState(null),[te,ie]=w.useState(null),{setTaskId:ne}=Wc(),{create:q}=Vc(),X=mn(),{org:J,locator:oe}=$e(),G=Lo();let K;t[15]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},t[15]=K):K=t[15];const{task:Y}=Da(K);let ae;t[16]!==Y||t[17]!==n?(ae=Y?n.find($=>$.id===Y)??null:null,t[16]=Y,t[17]=n,t[18]=ae):ae=t[18];const he=ae;let xe;t[19]!==Y||t[20]!==G||t[21]!==J?(xe=()=>{Y&&G({to:"/$org/board",params:{org:J.slug},search:{},replace:!0})},t[19]=Y,t[20]=G,t[21]=J,t[22]=xe):xe=t[22];const ye=xe;let Ce;t[23]!==s||t[24]!==q||t[25]!==oe||t[26]!==J||t[27]!==ne||t[28]!==X?(Ce=async $=>{const re=crypto.randomUUID(),be=Qa(J.id).id,We=await X.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:$.id}).then(_g).catch(Ig),lt=gg($,We),Nt={type:"doc",content:[{type:"paragraph",content:[Ec({id:$.id,name:$.title,char:"@",kind:"task",metadata:{title:$.title,description:$.description,context:lt}}),{type:"text",text:" "}]}]};Zc(sessionStorage,oe,re,Nt),W(!1);try{await q({id:re,virtual_mcp_id:be}),await s.link.mutateAsync({id:$.id,linkThreadId:re})}catch{}ne(re,be)},t[23]=s,t[24]=q,t[25]=oe,t[26]=J,t[27]=ne,t[28]=X,t[29]=Ce):Ce=t[29];const Me=Ce;let Ze;t[30]!==A?(Ze=$=>kg($,A),t[30]=A,t[31]=Ze):Ze=t[31];const ct=n.filter(Ze);let Tt;t[32]===Symbol.for("react.memo_cache_sentinel")?(Tt=()=>{Z(null),ie(null),W(!0)},t[32]=Tt):Tt=t[32];const Bt=Tt;let ce;t[33]===Symbol.for("react.memo_cache_sentinel")?(ce=$=>{Z(null),ie($),W(!0)},t[33]=ce):ce=t[33];const dt=ce;let je;t[34]===Symbol.for("react.memo_cache_sentinel")?(je=$=>{Z($),W(!0)},t[34]=je):je=t[34];const Ke=je;let it;t[35]!==he||t[36]!==V||t[37]!==n?(it=(V&&n.find($=>$.id===V.id))??V??he,t[35]=he,t[36]=V,t[37]=n,t[38]=it):it=t[38];const se=it,ut=H||!!he;let Je;t[39]!==ye?(Je=()=>{W(!1),Z(null),ie(null),ye()},t[39]=ye,t[40]=Je):Je=t[40];const pe=Je;if(r&&n.length===0){let $;return t[41]===Symbol.for("react.memo_cache_sentinel")?($=c.jsx("div",{className:"flex flex-1 items-center justify-center",children:c.jsx(Ts,{size:20,className:"animate-spin text-muted-foreground"})}),t[41]=$):$=t[41],$}const Ut="relative flex min-h-0 flex-1 flex-col";let He;t[42]!==e?(He=e("taskBoard.taskBoard.tasksTitle"),t[42]=e,t[43]=He):He=t[43];let et;t[44]!==He?(et=c.jsx("h1",{className:"text-xl font-medium text-foreground",children:He}),t[44]=He,t[45]=et):et=t[45];let tt;t[46]!==i?(tt=i&&c.jsx(og,{}),t[46]=i,t[47]=tt):tt=t[47];let nt;t[48]!==A||t[49]!==n.length||t[50]!==j?(nt=n.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sm:hidden",children:c.jsx(jg,{filters:A,members:j,onChange:_})}),c.jsx("div",{className:"hidden sm:block",children:c.jsx(Cg,{filters:A,members:j,onChange:_})})]}),t[48]=A,t[49]=n.length,t[50]=j,t[51]=nt):nt=t[51];const ke=N==="list";let ve;t[52]!==U?(ve=()=>{I("list"),U()},t[52]=U,t[53]=ve):ve=t[53];let we;t[54]!==e?(we=e("common.taskBoard.listView"),t[54]=e,t[55]=we):we=t[55];let Ae;t[56]!==ke||t[57]!==ve||t[58]!==we?(Ae=c.jsx(To,{active:ke,onClick:ve,icon:Uo,label:we}),t[56]=ke,t[57]=ve,t[58]=we,t[59]=Ae):Ae=t[59];const Ee=N==="board";let Te;t[60]===Symbol.for("react.memo_cache_sentinel")?(Te=()=>I("board"),t[60]=Te):Te=t[60];let Se;t[61]!==e?(Se=e("common.taskBoard.boardView"),t[61]=e,t[62]=Se):Se=t[62];let Be;t[63]!==Ee||t[64]!==Se?(Be=c.jsx(To,{active:Ee,onClick:Te,icon:Fa,label:Se}),t[63]=Ee,t[64]=Se,t[65]=Be):Be=t[65];let fe;t[66]!==Ae||t[67]!==Be?(fe=c.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[Ae,Be]}),t[66]=Ae,t[67]=Be,t[68]=fe):fe=t[68];let Oe;t[69]===Symbol.for("react.memo_cache_sentinel")?(Oe=c.jsx(ws,{size:16}),t[69]=Oe):Oe=t[69];let Re;t[70]!==e?(Re=e("taskBoard.taskBoard.newTask"),t[70]=e,t[71]=Re):Re=t[71];let Ie;t[72]!==Re?(Ie=c.jsxs(_e,{size:"sm",onClick:Bt,children:[Oe,Re]}),t[72]=Re,t[73]=Ie):Ie=t[73];let Le;t[74]!==fe||t[75]!==Ie?(Le=c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[fe,Ie]}),t[74]=fe,t[75]=Ie,t[76]=Le):Le=t[76];let Pe;t[77]!==nt||t[78]!==Le?(Pe=c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[nt,Le]}),t[77]=nt,t[78]=Le,t[79]=Pe):Pe=t[79];let Fe;t[80]!==et||t[81]!==tt||t[82]!==Pe?(Fe=c.jsxs("div",{className:"mx-auto flex w-full max-w-[1680px] flex-col gap-4 px-4 pt-6 sm:px-8 sm:pt-8",children:[et,tt,Pe]}),t[80]=et,t[81]=tt,t[82]=Pe,t[83]=Fe):Fe=t[83];const Qe=n.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.jsx("div",{className:"rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:e("taskBoard.taskBoard.noTasksYet")})}):ct.length===0?c.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:[e("taskBoard.taskBoard.noTasksMatch"),c.jsx(_e,{variant:"outline",size:"sm",onClick:()=>_(dr),children:e("taskBoard.taskBoard.clearFilters")})]})}):N==="board"?c.jsx(Mg,{items:ct,members:j,memberByUserId:R,selectedIds:E,onToggleSelect:B,onSelectAllInLane:P,onOpen:Ke,onCreate:dt,onMove:($,re,be)=>{const We=zl(be,$.length);$.forEach((lt,Nt)=>s.update.mutate({id:lt,status:re,sortOrder:We[Nt]}))},onAssign:($,re)=>{m(re)||s.update.mutate({id:$,assigneeId:re},{onError:x})},onAutoFix:$=>{m(ze)||s.update.mutate({id:$.id,assigneeId:ze},{onError:x})},onRerun:v}):c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:c.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:ct.map($=>c.jsx(Wg,{item:$,assignee:$.assigneeId?R.get($.assigneeId):void 0,assignedBy:$.assignedBy?R.get($.assignedBy):void 0,onOpen:()=>Ke($)},$.id))})}),ot=ut?se?.id??`new-${te??"default"}`:"closed",qt=se??void 0,Kt=te??void 0,Ht=s.create.isPending||s.update.isPending;let ft;t[84]!==s.create||t[85]!==s.update||t[86]!==se||t[87]!==m||t[88]!==pe?(ft=$=>{if(m($.assigneeId)){pe();return}if(se){const{title:re,description:be,priority:We,...lt}=$,Nt=Vo(se)?{}:{title:re,description:be,priority:We};s.update.mutate({id:se.id,...lt,...Nt},{onError:x})}else s.create.mutate($);pe()},t[84]=s.create,t[85]=s.update,t[86]=se,t[87]=m,t[88]=pe,t[89]=ft):ft=t[89];let ht;t[90]!==s.remove||t[91]!==se||t[92]!==pe?(ht=se?()=>{s.remove.mutate(se.id),pe()}:void 0,t[90]=s.remove,t[91]=se,t[92]=pe,t[93]=ht):ht=t[93];let pt;t[94]!==se||t[95]!==Me?(pt=se?()=>{Me(se)}:void 0,t[94]=se,t[95]=Me,t[96]=pt):pt=t[96];let gt;t[97]!==s.update||t[98]!==se||t[99]!==m||t[100]!==pe?(gt=se?()=>{m(ze)||(s.update.mutate({id:se.id,assigneeId:ze},{onError:x}),pe())}:void 0,t[97]=s.update,t[98]=se,t[99]=m,t[100]=pe,t[101]=gt):gt=t[101];let mt;t[102]!==se||t[103]!==pe?(mt=se?()=>{pe(),v(se)}:void 0,t[102]=se,t[103]=pe,t[104]=mt):mt=t[104];let xt;t[105]!==pe||t[106]!==ne?(xt=$=>{$.virtualMcpId&&(pe(),ne($.threadId,$.virtualMcpId,{main:$.hasPreview?"preview":"board"}))},t[105]=pe,t[106]=ne,t[107]=xt):xt=t[107];let bt;t[108]!==pe||t[109]!==ut||t[110]!==ot||t[111]!==qt||t[112]!==Kt||t[113]!==Ht||t[114]!==ft||t[115]!==ht||t[116]!==pt||t[117]!==gt||t[118]!==mt||t[119]!==xt?(bt=c.jsx(Ep,{open:ut,onClose:pe,item:qt,defaultStatus:Kt,isSaving:Ht,onSubmit:ft,onDelete:ht,onNewChat:pt,onAutoFix:gt,onRerun:mt,onOpenThread:xt},ot),t[108]=pe,t[109]=ut,t[110]=ot,t[111]=qt,t[112]=Kt,t[113]=Ht,t[114]=ft,t[115]=ht,t[116]=pt,t[117]=gt,t[118]=mt,t[119]=xt,t[120]=bt):bt=t[120];let en;t[121]===Symbol.for("react.memo_cache_sentinel")?(en=()=>p(!0),t[121]=en):en=t[121];let yt;t[122]!==d?(yt=c.jsx(Og,{open:d,onOpenChange:u,onConnected:en}),t[122]=d,t[123]=yt):yt=t[123];let kt;t[124]!==f?(kt=c.jsx(Xa,{mode:"connection",open:f,onOpenChange:p}),t[124]=f,t[125]=kt):kt=t[125];let Ot;t[126]===Symbol.for("react.memo_cache_sentinel")?(Ot=$=>!$&&b(null),t[126]=Ot):Ot=t[126];let vt;t[127]!==y?(vt=c.jsx(ag,{kind:y,onOpenChange:Ot}),t[127]=y,t[128]=vt):vt=t[128];let $t;t[129]===Symbol.for("react.memo_cache_sentinel")?($t=$=>!$&&v(null),t[129]=$t):$t=t[129];let wt;t[130]!==s.rerun.isPending||t[131]!==T||t[132]!==k?(wt=c.jsx(ug,{item:k,pending:s.rerun.isPending,onOpenChange:$t,onConfirm:T}),t[130]=s.rerun.isPending,t[131]=T,t[132]=k,t[133]=wt):wt=t[133];let Wt;t[134]!==s.removeMany||t[135]!==s.update||t[136]!==m||t[137]!==U||t[138]!==n||t[139]!==j||t[140]!==E?(Wt=E.size>0&&c.jsx($g,{count:E.size,members:j,onMoveTo:$=>{for(const re of E)s.update.mutate({id:re,status:$});U()},onSetPriority:$=>{for(const re of E)s.update.mutate({id:re,priority:$});U()},onAddTag:$=>{for(const re of E){const be=n.find(lt=>lt.id===re);if(!be)continue;const We=be.tags.map(Eg);We.includes($)||s.update.mutate({id:re,tagIds:[...We,$]})}U()},onAssign:$=>{if(!m($)){for(const re of E)s.update.mutate({id:re,assigneeId:$},{onError:x});U()}},onSetDueDate:$=>{const re=Gr($);for(const be of E)s.update.mutate({id:be,dueDate:re});U()},onAutoFix:E.size>0&&Array.from(E).every($=>{const re=n.find(be=>be.id===$);return re&&(re.status==="triage"||re.status==="todo")&&re.assigneeId!==ze})?()=>{if(!m(ze)){for(const $ of E)s.update.mutate({id:$,assigneeId:ze},{onError:x});U()}}:void 0,onDelete:()=>{s.removeMany.mutate(Array.from(E)),U()},onClear:U}),t[134]=s.removeMany,t[135]=s.update,t[136]=m,t[137]=U,t[138]=n,t[139]=j,t[140]=E,t[141]=Wt):Wt=t[141];let tn;return t[142]!==Fe||t[143]!==Qe||t[144]!==bt||t[145]!==yt||t[146]!==kt||t[147]!==vt||t[148]!==wt||t[149]!==Wt?(tn=c.jsxs("div",{className:Ut,children:[Fe,Qe,bt,yt,kt,vt,wt,Wt]}),t[142]=Fe,t[143]=Qe,t[144]=bt,t[145]=yt,t[146]=kt,t[147]=vt,t[148]=wt,t[149]=Wt,t[150]=tn):tn=t[150],tn}function Eg(t){return t.id}function Ig(){return[]}function _g(t){return t.prs}function Ag(t){return[t.userId,t]}function Bg(t){return t.status==="active"&&Ja(t)!==null}function Og(t){const e=F.c(32),{open:n,onOpenChange:r,onConnected:s}=t,i=le(),{connect:o,isConnecting:l}=sf("deco/mcp-github");let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx("div",{className:"flex h-28 items-center justify-center bg-gradient-to-br from-muted via-muted to-accent",children:c.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-foreground text-background shadow-sm",children:c.jsx($r,{className:"size-7"})})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=i("taskBoard.taskBoard.connectGithubTitle"),e[1]=i,e[2]=d):d=e[2];let u;e[3]!==d?(u=c.jsx(ts,{children:d}),e[3]=d,e[4]=u):u=e[4];let f;e[5]!==i?(f=i("taskBoard.taskBoard.connectGithubDescription"),e[5]=i,e[6]=f):f=e[6];let p;e[7]!==f?(p=c.jsx(ti,{children:f}),e[7]=f,e[8]=p):p=e[8];let h;e[9]!==u||e[10]!==p?(h=c.jsxs(ni,{children:[u,p]}),e[9]=u,e[10]=p,e[11]=h):h=e[11];let m;e[12]!==o||e[13]!==s||e[14]!==r?(m=async()=>{await o(),r(!1),s()},e[12]=o,e[13]=s,e[14]=r,e[15]=m):m=e[15];let y;e[16]!==l?(y=l?c.jsx(Ts,{size:16,className:"animate-spin"}):c.jsx($r,{className:"size-4"}),e[16]=l,e[17]=y):y=e[17];let b;e[18]!==i?(b=i("taskBoard.taskBoard.connectGithubButton"),e[18]=i,e[19]=b):b=e[19];let g;e[20]!==l||e[21]!==m||e[22]!==y||e[23]!==b?(g=c.jsx(si,{children:c.jsxs(_e,{onClick:m,disabled:l,className:"gap-2",children:[y,b]})}),e[20]=l,e[21]=m,e[22]=y,e[23]=b,e[24]=g):g=e[24];let x;e[25]!==g||e[26]!==h?(x=c.jsxs(es,{className:"gap-0 overflow-hidden p-0 sm:max-w-md",children:[a,c.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,g]})]}),e[25]=g,e[26]=h,e[27]=x):x=e[27];let k;return e[28]!==r||e[29]!==n||e[30]!==x?(k=c.jsx(Jn,{open:n,onOpenChange:r,children:x}),e[28]=r,e[29]=n,e[30]=x,e[31]=k):k=e[31],k}function $g(t){const e=F.c(91),{count:n,members:r,onMoveTo:s,onSetPriority:i,onAddTag:o,onAssign:l,onSetDueDate:a,onAutoFix:d,onDelete:u,onClear:f}=t,p=le(),{data:h}=Qo();let m;e[0]!==h?(m=h===void 0?[]:h,e[0]=h,e[1]=m):m=e[1];const y=m;let b;e[2]!==n||e[3]!==p?(b=p("taskBoard.taskBoard.selectedCount",{count:n}),e[2]=n,e[3]=p,e[4]=b):b=e[4];let g;e[5]!==b?(g=c.jsx("span",{className:"pl-1 text-sm font-medium text-foreground",children:b}),e[5]=b,e[6]=g):g=e[6];let x;e[7]!==p?(x=p("taskBoard.taskBoard.actionsButton"),e[7]=p,e[8]=x):x=e[8];let k;e[9]!==x?(k=c.jsx(un,{asChild:!0,children:c.jsx("button",{type:"button",className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:x})}),e[9]=x,e[10]=k):k=e[10];let v;e[11]!==p?(v=p("taskBoard.taskBoard.moveToButton"),e[11]=p,e[12]=v):v=e[12];let S;e[13]!==v?(S=c.jsx(as,{children:v}),e[13]=v,e[14]=S):S=e[14];let T;e[15]!==s||e[16]!==p?(T=ir.map(G=>c.jsx(Ct,{onClick:()=>s(G),children:p(Et[G].labelKey)},G)),e[15]=s,e[16]=p,e[17]=T):T=e[17];let C;e[18]!==T?(C=c.jsx(cs,{children:T}),e[18]=T,e[19]=C):C=e[19];let j;e[20]!==C||e[21]!==S?(j=c.jsxs(ls,{children:[S,C]}),e[20]=C,e[21]=S,e[22]=j):j=e[22];let D;e[23]!==p?(D=p("taskBoard.taskBoard.changePriorityButton"),e[23]=p,e[24]=D):D=e[24];let R;e[25]!==D?(R=c.jsx(as,{children:D}),e[25]=D,e[26]=R):R=e[26];let N;e[27]!==i||e[28]!==p?(N=wi.map(G=>c.jsxs(Ct,{onClick:()=>i(G),children:[c.jsx("span",{className:ee("size-2 rounded-full",It[G].dotClassName)}),p(It[G].labelKey)]},G)),e[27]=i,e[28]=p,e[29]=N):N=e[29];let I;e[30]!==N?(I=c.jsx(cs,{children:N}),e[30]=N,e[31]=I):I=e[31];let A;e[32]!==R||e[33]!==I?(A=c.jsxs(ls,{children:[R,I]}),e[32]=R,e[33]=I,e[34]=A):A=e[34];let _;e[35]!==p?(_=p("taskBoard.taskBoard.assignButton"),e[35]=p,e[36]=_):_=e[36];let M;e[37]!==_?(M=c.jsx(as,{children:_}),e[37]=_,e[38]=M):M=e[38];let E;e[39]!==r||e[40]!==l?(E=c.jsx(cs,{className:"w-56 p-0",children:c.jsx(Oi,{members:r,onSelect:l})}),e[39]=r,e[40]=l,e[41]=E):E=e[41];let O;e[42]!==M||e[43]!==E?(O=c.jsxs(ls,{children:[M,E]}),e[42]=M,e[43]=E,e[44]=O):O=e[44];let z;e[45]!==p?(z=p("taskBoard.taskBoard.dueDateButton"),e[45]=p,e[46]=z):z=e[46];let B;e[47]!==z?(B=c.jsx(as,{children:z}),e[47]=z,e[48]=B):B=e[48];let P;e[49]!==a?(P=c.jsx(cs,{className:"w-auto p-0",children:c.jsx(nl,{mode:"single",onSelect:G=>G&&a(G),initialFocus:!0})}),e[49]=a,e[50]=P):P=e[50];let L;e[51]!==B||e[52]!==P?(L=c.jsxs(ls,{children:[B,P]}),e[51]=B,e[52]=P,e[53]=L):L=e[53];let U;e[54]!==o||e[55]!==y||e[56]!==p?(U=y.length>0&&c.jsxs(ls,{children:[c.jsx(as,{children:p("taskBoard.taskBoard.addTagButton")}),c.jsx(cs,{children:y.map(G=>c.jsxs(Ct,{onClick:()=>o(G.id),children:[c.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:As(G.color)}}),G.name]},G.id))})]}),e[54]=o,e[55]=y,e[56]=p,e[57]=U):U=e[57];let H;e[58]===Symbol.for("react.memo_cache_sentinel")?(H=c.jsx(qo,{}),e[58]=H):H=e[58];let W;e[59]!==p?(W=p("taskBoard.taskBoard.deleteSelectedButton"),e[59]=p,e[60]=W):W=e[60];let V;e[61]!==u||e[62]!==W?(V=c.jsx(Ct,{variant:"destructive",onClick:u,children:W}),e[61]=u,e[62]=W,e[63]=V):V=e[63];let Z;e[64]!==j||e[65]!==A||e[66]!==O||e[67]!==L||e[68]!==U||e[69]!==V?(Z=c.jsxs(fn,{align:"center",side:"top",children:[j,A,O,L,U,H,V]}),e[64]=j,e[65]=A,e[66]=O,e[67]=L,e[68]=U,e[69]=V,e[70]=Z):Z=e[70];let te;e[71]!==Z||e[72]!==k?(te=c.jsxs(hn,{children:[k,Z]}),e[71]=Z,e[72]=k,e[73]=te):te=e[73];let ie;e[74]!==d||e[75]!==p?(ie=d&&c.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(ur,{size:14}),p("taskBoard.taskBoard.autoFix")]}),e[74]=d,e[75]=p,e[76]=ie):ie=e[76];let ne;e[77]!==p?(ne=p("taskBoard.taskBoard.clearSelectionButton"),e[77]=p,e[78]=ne):ne=e[78];let q;e[79]!==p?(q=p("taskBoard.taskBoard.clearSelectionButton"),e[79]=p,e[80]=q):q=e[80];let X;e[81]===Symbol.for("react.memo_cache_sentinel")?(X=c.jsx(dn,{size:16}),e[81]=X):X=e[81];let J;e[82]!==f||e[83]!==ne||e[84]!==q?(J=c.jsx("button",{type:"button","aria-label":ne,title:q,onClick:f,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:X}),e[82]=f,e[83]=ne,e[84]=q,e[85]=J):J=e[85];let oe;return e[86]!==te||e[87]!==ie||e[88]!==J||e[89]!==g?(oe=c.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center",children:c.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 rounded-full bg-background px-3 py-2 card-shadow",children:[g,te,ie,J]})}),e[86]=te,e[87]=ie,e[88]=J,e[89]=g,e[90]=oe):oe=e[90],oe}function To(t){const e=F.c(14),{active:n,onClick:r,icon:s,label:i}=t,o=le();let l;e[0]!==i||e[1]!==o?(l=o("taskBoard.taskBoard.layoutViewAriaLabel",{label:i}),e[0]=i,e[1]=o,e[2]=l):l=e[2];const a=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let d;e[3]!==a?(d=ee("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",a),e[3]=a,e[4]=d):d=e[4];let u;e[5]!==s?(u=c.jsx(s,{size:14}),e[5]=s,e[6]=u):u=e[6];let f;return e[7]!==n||e[8]!==i||e[9]!==r||e[10]!==l||e[11]!==d||e[12]!==u?(f=c.jsxs("button",{type:"button",onClick:r,"aria-label":l,"aria-pressed":n,className:d,children:[u,i]}),e[7]=n,e[8]=i,e[9]=r,e[10]=l,e[11]=d,e[12]=u,e[13]=f):f=e[13],f}const ms="lane:";function No(t,e){return t.sortOrder-e.sortOrder}function Mg(t){const e=F.c(30),{items:n,members:r,memberByUserId:s,selectedIds:i,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onMove:u,onAutoFix:f,onRerun:p,onAssign:h}=t,[m,y]=w.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],e[0]=b):b=e[0];const[g,x]=w.useState(b);let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=new Map,e[1]=k):k=e[1];const[v,S]=w.useState(k),T=w.useRef(null),C=v.size>0?n.map(K=>{const Y=v.get(K.id);return Y?{...K,...Y}:K}):n;if(v.size>0&&!m){const K=[...v].filter(Y=>{const[ae,he]=Y,xe=n.find(ye=>ye.id===ae);return xe?.status===he.status&&xe.sortOrder===he.sortOrder});K.length>0&&S(Y=>{const ae=new Map(Y);for(const[he]of K)ae.delete(he);return ae})}pg(T,C.map(Fg).join(","),m===null);const j=K=>C.filter(Y=>Y.status===K).sort(No),D=K=>{if(K===void 0)return null;const Y=String(K);if(Y.startsWith(ms)){const ae=Y.slice(ms.length);return ir.find(he=>he===ae)??null}return C.find(ae=>ae.id===Y)?.status??null};let R;e[2]!==i?(R=K=>i.has(K)&&i.size>1?[K,...Array.from(i).filter(Y=>Y!==K)]:[K],e[2]=i,e[3]=R):R=e[3];const N=R;let I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I=(K,Y,ae)=>{const he=zl(ae,K.length);S(xe=>{const ye=new Map(xe);return K.forEach((Ce,Me)=>ye.set(Ce,{status:Y,sortOrder:he[Me]})),ye})},e[4]=I):I=e[4];const A=I;let _;e[5]===Symbol.for("react.memo_cache_sentinel")?(_={activationConstraint:{distance:4}},e[5]=_):_=e[5];let M;e[6]===Symbol.for("react.memo_cache_sentinel")?(M={coordinateGetter:vf},e[6]=M):M=e[6];const E=Ud(Fi(bi,_),Fi(mi,M)),O=K=>{const Y=String(K.active.id),ae=D(K.over?.id),he=C.find(Me=>Me.id===Y);if(!ae||!he||he.status===ae)return;const xe=N(Y),ye=String(K.over?.id??""),Ce=j(ae).filter(Me=>!xe.includes(Me.id));A(xe,ae,no(Ce,ye.startsWith(ms)?null:ye,Y))},z=K=>{const Y=String(K.active.id);y(null);const ae=D(K.over?.id)??C.find(ce=>ce.id===Y)?.status;if(!ae){S(new Map);return}const he=N(Y),xe=j(ae),ye=String(K.over?.id??""),Ce=xe.findIndex(ce=>ce.id===Y),Me=ye.startsWith(ms)?xe.length-1:xe.findIndex(ce=>ce.id===ye),Ze=Ce===-1||Me===-1?xe:ki(xe,Ce,Me);if(n.filter(ce=>ce.status===ae).sort(No).map(Pg).join()===Ze.map(Lg).join()){S(new Map);return}const Tt=Ze.slice(Ze.findIndex(ce=>ce.id===Y)+1).find(ce=>!he.includes(ce.id)),Bt=no(xe.filter(ce=>!he.includes(ce.id)),Tt?.id??null,Y);A(he,ae,Bt),x(he),u(he,ae,Bt)},B=m?C.find(K=>K.id===m):null;let P;e[7]!==m||e[8]!==N?(P=m?N(m):[],e[7]=m,e[8]=N,e[9]=P):P=e[9];const L=P,U=zu,H=gl;let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=K=>{y(String(K.active.id)),x([])},e[10]=W):W=e[10];let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{y(null),S(new Map)},e[11]=V):V=e[11];const Z=ir.map(K=>c.jsx(Ug,{status:K,items:j(K),members:r,memberByUserId:s,selectedIds:i,isTarget:B?.status===K,hiddenIds:L,landedIds:g,onToggleSelect:o,onSelectAllInLane:l,onOpen:a,onCreate:d,onAutoFix:f,onRerun:p,onAssign:h},K));let te;e[12]!==Z?(te=c.jsx("div",{ref:T,className:"min-h-0 flex-1 overflow-x-auto",children:c.jsx("div",{className:"mx-auto flex h-full w-full max-w-[1680px] gap-3 px-4 pt-6 sm:px-8",children:Z})}),e[12]=Z,e[13]=te):te=e[13];const ie=sn.createPortal,ne=nf,q=null,X=B&&c.jsxs("div",{className:"relative w-[292px] cursor-grabbing",children:[c.jsx(wa,{item:B,assignee:B.assigneeId?s.get(B.assigneeId):void 0,assignedBy:B.assignedBy?s.get(B.assignedBy):void 0,selected:i.has(B.id),onOpen:zg,className:"w-full shadow-lg"}),L.length>1&&c.jsx("span",{className:"absolute -top-2 -right-2 flex h-5 min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 text-[11px] font-semibold text-background",children:L.length})]});let J;e[14]!==ne||e[15]!==X?(J=c.jsx(ne,{dropAnimation:q,children:X}),e[14]=ne,e[15]=X,e[16]=J):J=e[16];let oe;e[17]!==ie||e[18]!==J?(oe=ie(J,document.body),e[17]=ie,e[18]=J,e[19]=oe):oe=e[19];let G;return e[20]!==U||e[21]!==z||e[22]!==O||e[23]!==E||e[24]!==V||e[25]!==te||e[26]!==oe||e[27]!==H||e[28]!==W?(G=c.jsxs(U,{sensors:E,collisionDetection:H,onDragStart:W,onDragOver:O,onDragEnd:z,onDragCancel:V,children:[te,oe]}),e[20]=U,e[21]=z,e[22]=O,e[23]=E,e[24]=V,e[25]=te,e[26]=oe,e[27]=H,e[28]=W,e[29]=G):G=e[29],G}function zg(){}function Lg(t){return t.id}function Pg(t){return t.id}function Fg(t){return`${t.id}:${t.status}`}function Ug(t){const e=F.c(93),{status:n,items:r,members:s,memberByUserId:i,selectedIds:o,isTarget:l,hiddenIds:a,landedIds:d,onToggleSelect:u,onSelectAllInLane:f,onOpen:p,onCreate:h,onAutoFix:m,onRerun:y,onAssign:b}=t,g=le(),x=Et[n],k=x.icon,v=`${ms}${n}`;let S;e[0]!==v?(S={id:v},e[0]=v,e[1]=S):S=e[1];const{setNodeRef:T}=_l(S),C=l&&"bg-muted/50";let j;e[2]!==C?(j=ee("flex h-full w-[300px] shrink-0 flex-col rounded-xl py-1 transition-colors",C),e[2]=C,e[3]=j):j=e[3];const D=l?"bg-muted":"bg-background";let R;e[4]!==D?(R=ee("sticky top-0 z-10 flex items-center gap-2 px-2 py-1.5 transition-colors",D),e[4]=D,e[5]=R):R=e[5];let N;e[6]!==x.iconClassName?(N=ee("shrink-0",x.iconClassName.replace(/\banimate-\S+\b/g,"").trim()),e[6]=x.iconClassName,e[7]=N):N=e[7];let I;e[8]!==k||e[9]!==N?(I=c.jsx(k,{size:15,className:N}),e[8]=k,e[9]=N,e[10]=I):I=e[10];let A;e[11]!==x.labelKey||e[12]!==g?(A=g(x.labelKey),e[11]=x.labelKey,e[12]=g,e[13]=A):A=e[13];let _;e[14]!==A?(_=c.jsx("span",{className:"text-sm font-medium text-foreground",children:A}),e[14]=A,e[15]=_):_=e[15];let M;e[16]!==r.length?(M=c.jsx("span",{className:"rounded-md bg-muted px-1.5 text-[11px] font-medium text-muted-foreground",children:r.length}),e[16]=r.length,e[17]=M):M=e[17];let E;e[18]!==x.labelKey||e[19]!==g?(E=g("taskBoard.taskBoard.laneMenuAriaLabel",{lane:g(x.labelKey)}),e[18]=x.labelKey,e[19]=g,e[20]=E):E=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=c.jsx(Jr,{size:15}),e[21]=O):O=e[21];let z;e[22]!==E?(z=c.jsx(un,{asChild:!0,children:c.jsx("button",{type:"button","aria-label":E,className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:O})}),e[22]=E,e[23]=z):z=e[23];let B;e[24]!==f||e[25]!==n?(B=()=>f(n),e[24]=f,e[25]=n,e[26]=B):B=e[26];let P;e[27]!==g?(P=g("taskBoard.taskBoard.selectAllInLane"),e[27]=g,e[28]=P):P=e[28];let L;e[29]!==B||e[30]!==P?(L=c.jsx(fn,{align:"end",children:c.jsx(Ct,{onClick:B,children:P})}),e[29]=B,e[30]=P,e[31]=L):L=e[31];let U;e[32]!==z||e[33]!==L?(U=c.jsxs(hn,{children:[z,L]}),e[32]=z,e[33]=L,e[34]=U):U=e[34];let H;e[35]!==x.labelKey||e[36]!==g?(H=g("taskBoard.taskBoard.newTaskInLaneAriaLabel",{lane:g(x.labelKey)}),e[35]=x.labelKey,e[36]=g,e[37]=H):H=e[37];let W;e[38]!==x.labelKey||e[39]!==g?(W=g("taskBoard.taskBoard.newTaskInLaneTitle",{lane:g(x.labelKey)}),e[38]=x.labelKey,e[39]=g,e[40]=W):W=e[40];let V;e[41]!==h||e[42]!==n?(V=()=>h(n),e[41]=h,e[42]=n,e[43]=V):V=e[43];let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=c.jsx(ws,{size:15}),e[44]=Z):Z=e[44];let te;e[45]!==H||e[46]!==W||e[47]!==V?(te=c.jsx("button",{type:"button","aria-label":H,title:W,onClick:V,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:Z}),e[45]=H,e[46]=W,e[47]=V,e[48]=te):te=e[48];let ie;e[49]!==_||e[50]!==M||e[51]!==U||e[52]!==te||e[53]!==R||e[54]!==I?(ie=c.jsxs("div",{className:R,children:[I,_,M,U,te]}),e[49]=_,e[50]=M,e[51]=U,e[52]=te,e[53]=R,e[54]=I,e[55]=ie):ie=e[55];let ne;e[56]!==r?(ne=r.map(qg),e[56]=r,e[57]=ne):ne=e[57];let q;if(e[58]!==a||e[59]!==r||e[60]!==d||e[61]!==i||e[62]!==s||e[63]!==b||e[64]!==m||e[65]!==p||e[66]!==y||e[67]!==u||e[68]!==o){let G;e[70]!==a||e[71]!==d||e[72]!==i||e[73]!==s||e[74]!==b||e[75]!==m||e[76]!==p||e[77]!==y||e[78]!==u||e[79]!==o?(G=K=>c.jsx(Kg,{item:K,assignee:K.assigneeId?i.get(K.assigneeId):void 0,assignedBy:K.assignedBy?i.get(K.assignedBy):void 0,members:s,selected:o.has(K.id),hidden:a.includes(K.id),landed:d.includes(K.id),onToggleSelect:()=>u(K.id),onOpen:()=>p(K),onAutoFix:m?()=>m(K):void 0,onRerun:y?()=>y(K):void 0,onAssign:b?Y=>b(K.id,Y):void 0},K.id),e[70]=a,e[71]=d,e[72]=i,e[73]=s,e[74]=b,e[75]=m,e[76]=p,e[77]=y,e[78]=u,e[79]=o,e[80]=G):G=e[80],q=r.map(G),e[58]=a,e[59]=r,e[60]=d,e[61]=i,e[62]=s,e[63]=b,e[64]=m,e[65]=p,e[66]=y,e[67]=u,e[68]=o,e[69]=q}else q=e[69];let X;e[81]!==ne||e[82]!==q?(X=c.jsx(uf,{items:ne,strategy:cf,children:q}),e[81]=ne,e[82]=q,e[83]=X):X=e[83];let J;e[84]!==T||e[85]!==n||e[86]!==X?(J=c.jsx("div",{ref:T,"data-lane-scroll":n,className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-1 pt-1 pb-16 [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1",children:X}),e[84]=T,e[85]=n,e[86]=X,e[87]=J):J=e[87];let oe;return e[88]!==n||e[89]!==ie||e[90]!==J||e[91]!==j?(oe=c.jsxs("div",{"data-lane":n,className:j,children:[ie,J]}),e[88]=n,e[89]=ie,e[90]=J,e[91]=j,e[92]=oe):oe=e[92],oe}function qg(t){return t.id}function Kg(t){const e=F.c(29);let n,r,s,i;e[0]!==t?({item:r,hidden:n,landed:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=s,e[4]=i):(n=e[1],r=e[2],s=e[3],i=e[4]);let o;e[5]!==r.id?(o={id:r.id},e[5]=r.id,e[6]=o):o=e[6];const{attributes:l,listeners:a,setNodeRef:d,transform:u,transition:f,isDragging:p}=bf(o),h=r.id,m=r.status;let y;e[7]!==l||e[8]!==a?(y={attributes:l,listeners:a},e[7]=l,e[8]=a,e[9]=y):y=e[9];const b=s&&"animate-card-land";let g;e[10]!==b?(g=ee("w-full",b),e[10]=b,e[11]=g):g=e[11];let x;e[12]!==u?(x=on.Translate.toString(u),e[12]=u,e[13]=x):x=e[13];const k=p||n?0:void 0;let v;e[14]!==x||e[15]!==k||e[16]!==f?(v={transform:x,transition:f,opacity:k},e[14]=x,e[15]=k,e[16]=f,e[17]=v):v=e[17];let S;e[18]!==r||e[19]!==i||e[20]!==d||e[21]!==y||e[22]!==g||e[23]!==v?(S=c.jsx(wa,{...i,item:r,dragRef:d,bindings:y,className:g,style:v}),e[18]=r,e[19]=i,e[20]=d,e[21]=y,e[22]=g,e[23]=v,e[24]=S):S=e[24];let T;return e[25]!==r.id||e[26]!==r.status||e[27]!==S?(T=c.jsx("div",{className:"flex","data-flip-id":h,"data-flip-lane":m,children:S}),e[25]=r.id,e[26]=r.status,e[27]=S,e[28]=T):T=e[28],T}function wa(t){const e=F.c(48),{item:n,assignee:r,assignedBy:s,members:i,selected:o,className:l,dragRef:a,bindings:d,style:u,onToggleSelect:f,onOpen:p,onAutoFix:h,onRerun:m,onAssign:y}=t,b=le(),g=Et[n.status].icon,x=Nf(n)?.lastMessage,k=h&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==ze,v=m&&!k&&n.assigneeId===ze&&n.status!=="done",S=d?.attributes,T=d?.listeners;let C;e[0]!==p||e[1]!==f?(C=L=>{L.shiftKey&&f?f():p()},e[0]=p,e[1]=f,e[2]=C):C=e[2];const j=o&&"bg-accent";let D;e[3]!==l||e[4]!==j?(D=ee("group flex shrink-0 cursor-grab flex-col gap-2 rounded-xl bg-card px-3 py-2.5 text-left card-shadow hover:bg-accent/60 active:cursor-grabbing",j,l),e[3]=l,e[4]=j,e[5]=D):D=e[5];const R=n.title;let N;e[6]!==n?(N=ee("mt-px shrink-0",vi(n)),e[6]=n,e[7]=N):N=e[7];let I;e[8]!==g||e[9]!==N?(I=c.jsx(g,{size:16,className:N}),e[8]=g,e[9]=N,e[10]=I):I=e[10];let A;e[11]!==n.title?(A=c.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground line-clamp-2",children:n.title}),e[11]=n.title,e[12]=A):A=e[12];let _;e[13]!==s||e[14]!==r||e[15]!==n||e[16]!==i||e[17]!==y?(_=c.jsx(ka,{item:n,assignee:r,assignedBy:s,members:i,onAssign:y}),e[13]=s,e[14]=r,e[15]=n,e[16]=i,e[17]=y,e[18]=_):_=e[18];let M;e[19]!==_||e[20]!==I||e[21]!==A?(M=c.jsxs("div",{className:"flex items-start gap-2",children:[I,A,_]}),e[19]=_,e[20]=I,e[21]=A,e[22]=M):M=e[22];let E;e[23]!==x?(E=x&&c.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:x}),e[23]=x,e[24]=E):E=e[24];let O;e[25]!==n?(O=(rr(n)||n.priority!=="none"||!!n.dueDate||n.tags.length>0)&&c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[rr(n)&&c.jsx(ma,{}),n.priority!=="none"&&c.jsx(xa,{priority:n.priority}),n.dueDate&&c.jsx(ba,{iso:n.dueDate}),n.tags.map(Hg)]}),e[25]=n,e[26]=O):O=e[26];let z;e[27]!==h||e[28]!==k||e[29]!==b?(z=k&&c.jsxs("button",{type:"button",onClick:L=>{L.stopPropagation(),h()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[c.jsx(ur,{size:12}),b("taskBoard.taskBoard.autoFix")]}),e[27]=h,e[28]=k,e[29]=b,e[30]=z):z=e[30];let B;e[31]!==m||e[32]!==v||e[33]!==b?(B=v&&c.jsxs("button",{type:"button",onClick:L=>{L.stopPropagation(),m()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground opacity-0 transition-opacity hover:bg-accent focus-visible:opacity-100 group-hover:opacity-100",children:[c.jsx(zo,{size:12}),b("taskBoard.taskBoard.rerun")]}),e[31]=m,e[32]=v,e[33]=b,e[34]=B):B=e[34];let P;return e[35]!==a||e[36]!==n.title||e[37]!==u||e[38]!==S||e[39]!==M||e[40]!==E||e[41]!==O||e[42]!==z||e[43]!==B||e[44]!==T||e[45]!==C||e[46]!==D?(P=c.jsxs("button",{type:"button",ref:a,style:u,...S,...T,onClick:C,className:D,title:R,children:[M,E,O,z,B]}),e[35]=a,e[36]=n.title,e[37]=u,e[38]=S,e[39]=M,e[40]=E,e[41]=O,e[42]=z,e[43]=B,e[44]=T,e[45]=C,e[46]=D,e[47]=P):P=e[47],P}function Hg(t){return c.jsx(ya,{tag:t},t.id)}function Wg(t){const e=F.c(33),{item:n,assignee:r,assignedBy:s,onOpen:i}=t,o=Et[n.status].icon;let l;e[0]!==n?(l=ee("shrink-0",vi(n)),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==o||e[3]!==l?(a=c.jsx(o,{size:16,className:l}),e[2]=o,e[3]=l,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=c.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let u;e[7]!==n?(u=rr(n)&&c.jsx(ma,{}),e[7]=n,e[8]=u):u=e[8];let f;e[9]!==n.priority?(f=n.priority!=="none"&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(xa,{priority:n.priority})}),e[9]=n.priority,e[10]=f):f=e[10];let p;e[11]!==n.dueDate?(p=n.dueDate&&c.jsx("span",{className:"hidden sm:inline-flex",children:c.jsx(ba,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=p):p=e[12];let h;e[13]!==n.tags?(h=n.tags.length>0&&c.jsxs("span",{className:"hidden items-center gap-1.5 sm:inline-flex",children:[n.tags.slice(0,2).map(Vg),n.tags.length>2&&c.jsxs("span",{className:Os,children:["+",n.tags.length-2]})]}),e[13]=n.tags,e[14]=h):h=e[14];let m;e[15]!==s||e[16]!==r||e[17]!==n?(m=c.jsx(ka,{item:n,assignee:r,assignedBy:s}),e[15]=s,e[16]=r,e[17]=n,e[18]=m):m=e[18];let y;e[19]!==n.createdAt?(y=ri(new Date(n.createdAt)),e[19]=n.createdAt,e[20]=y):y=e[20];let b;e[21]!==y?(b=c.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:y}),e[21]=y,e[22]=b):b=e[22];let g;return e[23]!==i||e[24]!==b||e[25]!==a||e[26]!==d||e[27]!==u||e[28]!==f||e[29]!==p||e[30]!==h||e[31]!==m?(g=c.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[a,d,u,f,p,h,m,b]}),e[23]=i,e[24]=b,e[25]=a,e[26]=d,e[27]=u,e[28]=f,e[29]=p,e[30]=h,e[31]=m,e[32]=g):g=e[32],g}function Vg(t){return c.jsx(ya,{tag:t},t.id)}const u1=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:va,default:Tg},Symbol.toStringTag,{value:"Module"}));export{va as $,bf as A,vf as B,on as C,zu as D,ki as E,Cf as F,jf as G,Km as H,Et as I,It as J,mi as K,Lt as L,at as M,s1 as N,l1 as O,bi as P,Gm as Q,d1 as R,od as S,Ep as T,a1 as U,Ym as V,yd as W,Xm as X,e1 as Y,i1 as Z,Zm as _,ld as a,Al as a0,u1 as a1,Qm as b,n1 as c,Xc as d,Wm as e,r1 as f,kd as g,o1 as h,ed as i,Jm as j,t1 as k,jd as l,wd as m,Nd as n,Ud as o,Fi as p,nf as q,Hm as r,Gc as s,Fu as t,Vm as u,sf as v,Zc as w,c1 as x,uf as y,cf as z};