@lobu/runtime-server 24.9.0 → 24.10.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 (221) hide show
  1. package/dist/catalogs/automations.json +2 -2
  2. package/dist/catalogs/connectors.json +16 -4
  3. package/dist/catalogs/skills.json +1 -1
  4. package/dist/component.json +1 -1
  5. package/dist/connectors/postgres.ts +39 -24
  6. package/dist/connectors/whatsapp-web-adapter.js +41 -10
  7. package/dist/connectors/whatsapp-web-helpers.ts +12 -2
  8. package/dist/connectors/whatsapp_web.ts +18 -2
  9. package/dist/db/migrations/20261112210000_instance_identity.sql +18 -0
  10. package/dist/dependencies.bun.lock +62 -60
  11. package/dist/embeddings-server.mjs +38 -5
  12. package/dist/owletto/dist/assets/_-CYvj1y65.js +3 -0
  13. package/dist/owletto/dist/assets/_-CeLTSYYY.js +2 -0
  14. package/dist/owletto/dist/assets/_agentId-BB5E-L6T.js +2 -0
  15. package/dist/owletto/dist/assets/{_agentId-bna2tPsW.js → _agentId-DN0EwMAC.js} +2 -2
  16. package/dist/owletto/dist/assets/_automationId-DvUl9CSd.js +2 -0
  17. package/dist/owletto/dist/assets/_connectorKey._connectionId-CVKfL9AG.js +2 -0
  18. package/dist/owletto/dist/assets/_connectorKey.index-Cv6FzK1v.js +2 -0
  19. package/dist/owletto/dist/assets/{_conversationId-zcs-S3dY.js → _conversationId-CPpNySjO.js} +2 -2
  20. package/dist/owletto/dist/assets/_eventId-DZKicuq6.js +2 -0
  21. package/dist/owletto/dist/assets/_owner-Dauk3YuD.js +3 -0
  22. package/dist/owletto/dist/assets/_shape-cKrEID3T.js +2 -0
  23. package/dist/owletto/dist/assets/_slug-DJx_8fsV.js +2 -0
  24. package/dist/owletto/dist/assets/_viewKey-CPVzVKEf.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-CW8gexOQ.js +2 -0
  26. package/dist/owletto/dist/assets/accept-invitation-Dwq1GAnG.js +2 -0
  27. package/dist/owletto/dist/assets/activity-route-location-C1jcXC7v.js +2 -0
  28. package/dist/owletto/dist/assets/activity-route-view-D78Wj0RH.js +2 -0
  29. package/dist/owletto/dist/assets/agent-connect-pages-DoI9UR0a.js +4 -0
  30. package/dist/owletto/dist/assets/{agent-editor-form-Bnc_q5WD.js → agent-editor-form-DlavYg2q.js} +2 -2
  31. package/dist/owletto/dist/assets/{agent-loading-shells-xteN-pyK.js → agent-loading-shells-DYqQphN7.js} +2 -2
  32. package/dist/owletto/dist/assets/agent-permissions-matrix-C1L8IcYR.js +2 -0
  33. package/dist/owletto/dist/assets/{agent-skill-context-r0O0BVOu.js → agent-skill-context-D1nMrVod.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-subpage-shell-C2KpYdu3.js → agent-subpage-shell-2w7vTeXw.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-thread-Bv_chdPy.js → agent-thread-BopD-2k1.js} +3 -3
  36. package/dist/owletto/dist/assets/{app._appId-BUcNaSMS.js → app._appId-BXeFXW1w.js} +2 -2
  37. package/dist/owletto/dist/assets/{assist-composer-B1LykXpD.js → assist-composer-CL5x8pNt.js} +2 -2
  38. package/dist/owletto/dist/assets/automation-run-now-MtxUTfzd.js +2 -0
  39. package/dist/owletto/dist/assets/{callback-kSLa4n5s.js → callback-BgfwP1Eo.js} +2 -2
  40. package/dist/owletto/dist/assets/{card-C01y1O-W.js → card-DtLIFq7D.js} +2 -2
  41. package/dist/owletto/dist/assets/{claim-Dnux9Lqf.js → claim-CT3hYVMF.js} +2 -2
  42. package/dist/owletto/dist/assets/{client-activity-scopes-BBIq16tG.js → client-activity-scopes-BPbRX-Pe.js} +2 -2
  43. package/dist/owletto/dist/assets/{client-rows-DGh1O-Fu.js → client-rows-vrNA6FLs.js} +2 -2
  44. package/dist/owletto/dist/assets/clients-xnzZeEdZ.js +2 -0
  45. package/dist/owletto/dist/assets/{code-editor-BdRMYojw.js → code-editor-mrKkAfcE.js} +2 -2
  46. package/dist/owletto/dist/assets/connect-NUCSay8X.js +2 -0
  47. package/dist/owletto/dist/assets/{connect-menu-D4w-JhJW.js → connect-menu-C6iVtuSo.js} +2 -2
  48. package/dist/owletto/dist/assets/connect._clientId-Cp-d9Q5b.js +2 -0
  49. package/dist/owletto/dist/assets/{connected._clientId-BsDzltNz.js → connected._clientId-ROfVgp9h.js} +2 -2
  50. package/dist/owletto/dist/assets/connection-BMz740Wi.js +2 -0
  51. package/dist/owletto/dist/assets/{connection-feed-detail-CJju0qiw.js → connection-feed-detail-0VAJiZTP.js} +2 -2
  52. package/dist/owletto/dist/assets/connector-page-shell-BFv21yuv.js +2 -0
  53. package/dist/owletto/dist/assets/{connector-provenance-B2C2cjBg.js → connector-provenance-b59RfBtk.js} +2 -2
  54. package/dist/owletto/dist/assets/connectors-nYS31lO2.js +2 -0
  55. package/dist/owletto/dist/assets/consent-cPRF9JQv.js +2 -0
  56. package/dist/owletto/dist/assets/{copy-button-BhXeXLIm.js → copy-button-C3wMMv63.js} +2 -2
  57. package/dist/owletto/dist/assets/{core.esm-CJUp2aNZ.js → core.esm-C9QlSrgK.js} +3 -3
  58. package/dist/owletto/dist/assets/{create-DUlRsFNn.js → create-ASRN3Obq.js} +2 -2
  59. package/dist/owletto/dist/assets/create-CBcodaSO.js +2 -0
  60. package/dist/owletto/dist/assets/create-CGOWfMk4.js +2 -0
  61. package/dist/owletto/dist/assets/{create-automation-form-D141prEG.js → create-automation-form-CLicoPH5.js} +3 -3
  62. package/dist/owletto/dist/assets/create._connectorKey-s4xkktTC.js +2 -0
  63. package/dist/owletto/dist/assets/{custom-guardrail-edits-DuQ28xv3.js → custom-guardrail-edits-BUL7nmuO.js} +2 -2
  64. package/dist/owletto/dist/assets/{definition-comparison-BUDNuAN_.js → definition-comparison-4UYMI6BK.js} +2 -2
  65. package/dist/owletto/dist/assets/{detail-page-skeleton-BRHaq5Sj.js → detail-page-skeleton-C8v3rJXK.js} +2 -2
  66. package/dist/owletto/dist/assets/device-BBwsOi7q.js +2 -0
  67. package/dist/owletto/dist/assets/{device-pin-tombstone-BIM-ziCH.js → device-pin-tombstone-Bcpe7nAA.js} +2 -2
  68. package/dist/owletto/dist/assets/{device._deviceId-BnPqTgK1.js → device._deviceId-DLT4jh0Z.js} +2 -2
  69. package/dist/owletto/dist/assets/{dynamic-schema-form-OkIZImgp.js → dynamic-schema-form-BDT8x0Vg.js} +2 -2
  70. package/dist/owletto/dist/assets/{entity-options-CpeX7iiX.js → entity-options-B9hm9V87.js} +2 -2
  71. package/dist/owletto/dist/assets/entity-page-DZjzQ2V4.js +2 -0
  72. package/dist/owletto/dist/assets/entity-pages-BWBpttz3.js +2 -0
  73. package/dist/owletto/dist/assets/entity-schema-graph-lMMx3HhR.js +2 -0
  74. package/dist/owletto/dist/assets/{entity-type-page-MgZ7_0oh.js → entity-type-page-CkQm0yEu.js} +2 -2
  75. package/dist/owletto/dist/assets/{event-detail-D6AH6a2C.js → event-detail-CkzfakTK.js} +2 -2
  76. package/dist/owletto/dist/assets/events-feed-DmRzikZW.js +2 -0
  77. package/dist/owletto/dist/assets/{filter-editors-DDTwyYt0.js → filter-editors-CQoSj-20.js} +3 -3
  78. package/dist/owletto/dist/assets/{full-page-spinner-DWo519BU.js → full-page-spinner-CYyCnKve.js} +2 -2
  79. package/dist/owletto/dist/assets/index-BE7eb2kE.js +2 -0
  80. package/dist/owletto/dist/assets/index-BFR0uiKY.js +2 -0
  81. package/dist/owletto/dist/assets/{index-Cd8jMsz8.js → index-BS5Ty3tf.js} +2 -2
  82. package/dist/owletto/dist/assets/index-C38OzBpB.js +2 -0
  83. package/dist/owletto/dist/assets/{index-D1UCJQl1.js → index-C3hz9tzx.js} +2 -2
  84. package/dist/owletto/dist/assets/index-CDyFQ32o.js +2 -0
  85. package/dist/owletto/dist/assets/{index-BW7IFKXC.js → index-CUndAH6o.js} +2 -2
  86. package/dist/owletto/dist/assets/index-CiKysEhV.js +2 -0
  87. package/dist/owletto/dist/assets/{index-CdDNNAx2.js → index-DByaMzsG.js} +274 -274
  88. package/dist/owletto/dist/assets/index-DfdinB7B.js +2 -0
  89. package/dist/owletto/dist/assets/index-DgMM4Zt5.css +1 -0
  90. package/dist/owletto/dist/assets/index-Xk711gVC.js +2 -0
  91. package/dist/owletto/dist/assets/{index-DmqnKGqW.js → index-ittfA0k8.js} +2 -2
  92. package/dist/owletto/dist/assets/{json-diff-C-WQqyIf.js → json-diff-mcDgyct_.js} +2 -2
  93. package/dist/owletto/dist/assets/{list-skeleton-0B1bTrAK.js → list-skeleton-DsYGUHxi.js} +2 -2
  94. package/dist/owletto/dist/assets/login-EoLq136v.js +2 -0
  95. package/dist/owletto/dist/assets/{logout-D474YsYQ.js → logout-gLgEQOiX.js} +2 -2
  96. package/dist/owletto/dist/assets/{member-scope-gate-CH_0jHiM.js → member-scope-gate-vvkgSAb2.js} +2 -2
  97. package/dist/owletto/dist/assets/memory-browse-page-DvDtwrEI.js +74 -0
  98. package/dist/owletto/dist/assets/{model-selector-XYmk7Iru.js → model-selector-D3vSMLO2.js} +2 -2
  99. package/dist/owletto/dist/assets/{needs-you-list-Bd4iiiqm.js → needs-you-list-B5Bgd05M.js} +2 -2
  100. package/dist/owletto/dist/assets/{new-CJ6TF3Vc.js → new-BPW3V0Y1.js} +2 -2
  101. package/dist/owletto/dist/assets/new-Bk_flKQO.js +2 -0
  102. package/dist/owletto/dist/assets/new-C5HtQdM_.js +2 -0
  103. package/dist/owletto/dist/assets/new-dLXsCHBd.js +2 -0
  104. package/dist/owletto/dist/assets/organization-DBfgBkzq.js +2 -0
  105. package/dist/owletto/dist/assets/{peek-pane-content-Cc8YX1oy.js → peek-pane-content-c2PG3TEX.js} +2 -2
  106. package/dist/owletto/dist/assets/{pending-seed-D7-ld7as.js → pending-seed-CBhx2Ql-.js} +2 -2
  107. package/dist/owletto/dist/assets/{proposal-review-shell-BWRJidwb.js → proposal-review-shell-B-jYcKfB.js} +2 -2
  108. package/dist/owletto/dist/assets/public-shell-ready-D8TijlRY.js +2 -0
  109. package/dist/owletto/dist/assets/record-activity-DnRVOrG2.js +2 -0
  110. package/dist/owletto/dist/assets/{record-session-ClKBr1_C.js → record-session-CAmGHMyM.js} +2 -2
  111. package/dist/owletto/dist/assets/{renderer-DZ0w2k2r.js → renderer-olRv_HMI.js} +3 -3
  112. package/dist/owletto/dist/assets/reset-password-B9_xi8Pq.js +2 -0
  113. package/dist/owletto/dist/assets/{run-initiator-B8IRlRd-.js → run-initiator-DhE5v4z0.js} +2 -2
  114. package/dist/owletto/dist/assets/runs-C8sZQr4o.js +2 -0
  115. package/dist/owletto/dist/assets/{runs-list-8gUPWjP4.js → runs-list-CwtH-wmk.js} +2 -2
  116. package/dist/owletto/dist/assets/{schema-value-k19Ata7u.js → schema-value-zTJGE4eh.js} +3 -3
  117. package/dist/owletto/dist/assets/{scoped-feed-bar-L7h-Ca4u.js → scoped-feed-bar-BKyJSa3_.js} +2 -2
  118. package/dist/owletto/dist/assets/{settings-BZqntV3E.js → settings-z02cvVS3.js} +2 -2
  119. package/dist/owletto/dist/assets/source-record-panels-CGmKIJdN.js +2 -0
  120. package/dist/owletto/dist/assets/{status-variants-BR_iGWN5.js → status-variants-DyRCXBzM.js} +2 -2
  121. package/dist/owletto/dist/assets/subDays-D8nHthaS.js +2 -0
  122. package/dist/owletto/dist/assets/{table-C3DMoL4K.js → table-C637cQxG.js} +2 -2
  123. package/dist/owletto/dist/assets/use-automations-CgWNoYio.js +2 -0
  124. package/dist/owletto/dist/assets/use-login-redirect-tDdhXTpt.js +2 -0
  125. package/dist/owletto/dist/assets/{use-mention-search-CtbixPEE.js → use-mention-search-D-kIKchD.js} +2 -2
  126. package/dist/owletto/dist/assets/view-param-filters-CUCj9Df-.js +2 -0
  127. package/dist/owletto/dist/assets/{views-access-required-CvIIxdS_.js → views-access-required-C35Dyt91.js} +2 -2
  128. package/dist/owletto/dist/index.html +2 -2
  129. package/dist/server-main.bundle.mjs +2733 -1795
  130. package/npm-shrinkwrap.json +238 -221
  131. package/package.json +1 -1
  132. package/vendor/connector-sdk/dist/connector-types.d.ts +6 -0
  133. package/vendor/connector-sdk/dist/index.d.ts +1 -0
  134. package/vendor/connector-sdk/dist/index.js +1 -0
  135. package/vendor/connector-sdk/dist/ip-reachability.d.ts +1 -1
  136. package/vendor/connector-sdk/dist/ip-reachability.js +1 -1
  137. package/vendor/connector-sdk/dist/logger.d.ts +1 -1
  138. package/vendor/connector-sdk/dist/logger.js +1 -1
  139. package/vendor/connector-sdk/dist/reaction-client-types.d.ts +3 -1
  140. package/vendor/connector-sdk/dist/retry.d.ts +1 -1
  141. package/vendor/connector-sdk/dist/retry.js +1 -1
  142. package/vendor/connector-sdk/dist/source-withheld-error.d.ts +16 -0
  143. package/vendor/connector-sdk/dist/source-withheld-error.js +19 -0
  144. package/vendor/connector-sdk/package.json +1 -1
  145. package/vendor/core/dist/classify-error.d.ts +1 -1
  146. package/vendor/core/dist/classify-error.js +2 -2
  147. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +28 -3
  148. package/vendor/core/dist/contracts/tools/manage-automations.js +27 -8
  149. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +8 -0
  150. package/vendor/core/dist/contracts/tools/manage-entity.js +11 -3
  151. package/vendor/core/dist/contracts/tools/save-memory.d.ts +11 -1
  152. package/vendor/core/dist/contracts/tools/save-memory.js +25 -3
  153. package/vendor/core/dist/contracts/tools/search-memory.js +1 -1
  154. package/vendor/core/dist/credentials.d.ts +12 -0
  155. package/vendor/core/dist/credentials.js +1 -0
  156. package/vendor/core/dist/errors.js +2 -2
  157. package/vendor/core/dist/worker/auth.d.ts +5 -0
  158. package/vendor/core/dist/worker/auth.js +15 -4
  159. package/vendor/core/package.json +1 -1
  160. package/vendor/postgres/cf/src/connection.js +7 -2
  161. package/vendor/postgres/cjs/src/connection.js +7 -2
  162. package/vendor/postgres/src/connection.js +7 -2
  163. package/vendor/views/dist/native.d.ts +33 -1
  164. package/vendor/views/dist/native.js +3 -0
  165. package/vendor/views/package.json +1 -1
  166. package/dist/owletto/dist/assets/_-B2C9B2RM.js +0 -2
  167. package/dist/owletto/dist/assets/_-CjyiGzwB.js +0 -3
  168. package/dist/owletto/dist/assets/_agentId-DKHXGvS2.js +0 -2
  169. package/dist/owletto/dist/assets/_automationId-CowRFD4E.js +0 -2
  170. package/dist/owletto/dist/assets/_connectorKey._connectionId-dE6im18z.js +0 -2
  171. package/dist/owletto/dist/assets/_connectorKey.index-DqwSv8Zs.js +0 -2
  172. package/dist/owletto/dist/assets/_eventId-BVOVizs4.js +0 -2
  173. package/dist/owletto/dist/assets/_owner-DsvIC94q.js +0 -3
  174. package/dist/owletto/dist/assets/_shape-CWjpzcvv.js +0 -2
  175. package/dist/owletto/dist/assets/_slug-DuCxYsJk.js +0 -2
  176. package/dist/owletto/dist/assets/_viewKey-BqVeHB6Z.js +0 -2
  177. package/dist/owletto/dist/assets/_viewKey-DzyOCG5U.js +0 -2
  178. package/dist/owletto/dist/assets/accept-invitation-k1u3zBcn.js +0 -2
  179. package/dist/owletto/dist/assets/activity-route-view-jTBMW7a9.js +0 -2
  180. package/dist/owletto/dist/assets/agent-connect-pages-D3mVM_q4.js +0 -4
  181. package/dist/owletto/dist/assets/agent-permissions-matrix-C_ayr0pd.js +0 -2
  182. package/dist/owletto/dist/assets/automation-run-now-CjkJIkaZ.js +0 -2
  183. package/dist/owletto/dist/assets/clients-BCvjAJDT.js +0 -2
  184. package/dist/owletto/dist/assets/connect-DZeFSGIH.js +0 -2
  185. package/dist/owletto/dist/assets/connect._clientId-IZEMQJ64.js +0 -2
  186. package/dist/owletto/dist/assets/connection-C7glVpPE.js +0 -2
  187. package/dist/owletto/dist/assets/connector-page-shell-BeuyjiB2.js +0 -2
  188. package/dist/owletto/dist/assets/connectors-DSQ5AWPf.js +0 -2
  189. package/dist/owletto/dist/assets/consent-B6Aw_89N.js +0 -2
  190. package/dist/owletto/dist/assets/create-CWcza8NT.js +0 -2
  191. package/dist/owletto/dist/assets/create-bGOYifof.js +0 -2
  192. package/dist/owletto/dist/assets/create._connectorKey-Ds4tpwHP.js +0 -2
  193. package/dist/owletto/dist/assets/device-D3fzoIrM.js +0 -2
  194. package/dist/owletto/dist/assets/entity-page-Cjc8oXA2.js +0 -2
  195. package/dist/owletto/dist/assets/entity-pages-18xSANrS.js +0 -2
  196. package/dist/owletto/dist/assets/entity-schema-graph-uwZ-P0t8.js +0 -2
  197. package/dist/owletto/dist/assets/events-feed-BI7wNRUY.js +0 -2
  198. package/dist/owletto/dist/assets/index-9tTjJo_J.css +0 -1
  199. package/dist/owletto/dist/assets/index-BYcFrinP.js +0 -2
  200. package/dist/owletto/dist/assets/index-BhJsTy-C.js +0 -2
  201. package/dist/owletto/dist/assets/index-CEcsgXDj.js +0 -2
  202. package/dist/owletto/dist/assets/index-CPscKk2u.js +0 -2
  203. package/dist/owletto/dist/assets/index-CfJ2-EpK.js +0 -2
  204. package/dist/owletto/dist/assets/index-D5DM4g2w.js +0 -2
  205. package/dist/owletto/dist/assets/index-DznAbTOF.js +0 -2
  206. package/dist/owletto/dist/assets/login-CH7P2AyR.js +0 -2
  207. package/dist/owletto/dist/assets/memory-browse-page-Ba4aYavw.js +0 -74
  208. package/dist/owletto/dist/assets/new-BOsrRqp8.js +0 -2
  209. package/dist/owletto/dist/assets/new-DGPOjak2.js +0 -2
  210. package/dist/owletto/dist/assets/new-Q0XqiZq2.js +0 -2
  211. package/dist/owletto/dist/assets/organization-hD_Z6TSd.js +0 -2
  212. package/dist/owletto/dist/assets/public-shell-ready-CRyAZATw.js +0 -2
  213. package/dist/owletto/dist/assets/record-activity-9ux6SfCd.js +0 -2
  214. package/dist/owletto/dist/assets/reset-password-D2RfrEVZ.js +0 -2
  215. package/dist/owletto/dist/assets/runs-CuC7WMtd.js +0 -2
  216. package/dist/owletto/dist/assets/source-record-panels-C4UItfdk.js +0 -2
  217. package/dist/owletto/dist/assets/subDays-hOwerOLo.js +0 -2
  218. package/dist/owletto/dist/assets/use-automations-CdtiVLCv.js +0 -2
  219. package/dist/owletto/dist/assets/use-login-redirect-CYlVkAhE.js +0 -2
  220. package/dist/owletto/dist/assets/view-param-filters-BdN8OU35.js +0 -2
  221. /package/vendor/postgres/{.bun-tag-c81dacd34e959a7a → .bun-tag-652f2580b8090d71} +0 -0
@@ -1,6 +1,6 @@
1
- import{r as s,bH as X,bE as me}from"./index-CdDNNAx2.js";function Lr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Fe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ge(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nt(e){return"nodeType"in e}function k(e){var t,n;return e?ge(e)?e:nt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function rt(e){const{Document:t}=k(e);return e instanceof t}function Ee(e){return ge(e)?!1:e instanceof k(e).HTMLElement}function $t(e){return e instanceof k(e).SVGElement}function ve(e){return e?ge(e)?e.document:nt(e)?rt(e)?e:Ee(e)||$t(e)?e.ownerDocument:document:document:document}const re=Fe?s.useLayoutEffect:s.useEffect;function ot(e){const t=s.useRef(e);return re(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function gn(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Se(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return re(()=>{n.current!==e&&(n.current=e)},t),n}function Me(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ke(e){const t=ot(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let Ve={};function $e(e,t){return s.useMemo(()=>{if(t)return t;const n=Ve[e]==null?0:Ve[e]+1;return Ve[e]=n,e+"-"+n},[e,t])}function Xt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,l)=>{const a=Object.entries(l);for(const[c,u]of a){const f=i[c];f!=null&&(i[c]=f+e*u)}return i},{...t})}}const he=Xt(1),ze=Xt(-1);function vn(e){return"clientX"in e&&"clientY"in e}function jt(e){if(!e)return!1;const{KeyboardEvent:t}=k(e.target);return t&&e instanceof t}function pn(e){if(!e)return!1;const{TouchEvent:t}=k(e.target);return t&&e instanceof t}function Ze(e){if(pn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return vn(e)?{x:e.clientX,y:e.clientY}:null}const Rt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Rt.Translate.toString(e),Rt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Et="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function bn(e){return e.matches(Et)?e:e.querySelector(Et)}const wn={display:"none"};function yn(e){let{id:t,value:n}=e;return X.createElement("div",{id:t,style:wn},n)}function mn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={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 X.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function xn(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ut=s.createContext(null);function Dn(e){const t=s.useContext(Ut);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Cn(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:i}=r;e.forEach(l=>{var a;return(a=l[o])==null?void 0:a.call(l,i)})},[e]),t]}const Sn={draggable:`
1
+ import{r as s,bG as X,bD as me}from"./index-DByaMzsG.js";function Lr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Fe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ge(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nt(e){return"nodeType"in e}function k(e){var t,n;return e?ge(e)?e:nt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function rt(e){const{Document:t}=k(e);return e instanceof t}function Ee(e){return ge(e)?!1:e instanceof k(e).HTMLElement}function $t(e){return e instanceof k(e).SVGElement}function ve(e){return e?ge(e)?e.document:nt(e)?rt(e)?e:Ee(e)||$t(e)?e.ownerDocument:document:document:document}const re=Fe?s.useLayoutEffect:s.useEffect;function ot(e){const t=s.useRef(e);return re(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function gn(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Se(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return re(()=>{n.current!==e&&(n.current=e)},t),n}function Me(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ke(e){const t=ot(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Qe(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let Ve={};function $e(e,t){return s.useMemo(()=>{if(t)return t;const n=Ve[e]==null?0:Ve[e]+1;return Ve[e]=n,e+"-"+n},[e,t])}function Xt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,l)=>{const a=Object.entries(l);for(const[c,u]of a){const f=i[c];f!=null&&(i[c]=f+e*u)}return i},{...t})}}const he=Xt(1),ze=Xt(-1);function vn(e){return"clientX"in e&&"clientY"in e}function jt(e){if(!e)return!1;const{KeyboardEvent:t}=k(e.target);return t&&e instanceof t}function pn(e){if(!e)return!1;const{TouchEvent:t}=k(e.target);return t&&e instanceof t}function Ze(e){if(pn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return vn(e)?{x:e.clientX,y:e.clientY}:null}const Rt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Rt.Translate.toString(e),Rt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Et="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function bn(e){return e.matches(Et)?e:e.querySelector(Et)}const wn={display:"none"};function yn(e){let{id:t,value:n}=e;return X.createElement("div",{id:t,style:wn},n)}function mn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={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 X.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function xn(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ut=s.createContext(null);function Dn(e){const t=s.useContext(Ut);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Cn(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:i}=r;e.forEach(l=>{var a;return(a=l[o])==null?void 0:a.call(l,i)})},[e]),t]}const Sn={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
5
- `},Rn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function En(e){let{announcements:t=Rn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Sn}=e;const{announce:i,announcement:l}=xn(),a=$e("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),Dn(s.useMemo(()=>({onDragStart(d){let{active:v}=d;i(t.onDragStart({active:v}))},onDragMove(d){let{active:v,over:h}=d;t.onDragMove&&i(t.onDragMove({active:v,over:h}))},onDragOver(d){let{active:v,over:h}=d;i(t.onDragOver({active:v,over:h}))},onDragEnd(d){let{active:v,over:h}=d;i(t.onDragEnd({active:v,over:h}))},onDragCancel(d){let{active:v,over:h}=d;i(t.onDragCancel({active:v,over:h}))}}),[i,t])),!c)return null;const f=X.createElement(X.Fragment,null,X.createElement(yn,{id:r,value:o.draggable}),X.createElement(mn,{id:a,announcement:l}));return n?me.createPortal(f,n):f}var E;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(E||(E={}));function Pe(){}function Ir(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function kr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const W=Object.freeze({x:0,y:0});function Wt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Mn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Mt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function An(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function At(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const zr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=At(t,t.left,t.top),i=[];for(const l of r){const{id:a}=l,c=n.get(a);if(c){const u=Wt(At(c),o);i.push({id:a,data:{droppableContainer:l,value:u}})}}return i.sort(Yt)},Pr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Mt(t),i=[];for(const l of r){const{id:a}=l,c=n.get(a);if(c){const u=Mt(c),f=o.reduce((v,h,C)=>v+Wt(u[C],h),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:l,value:d}})}}return i.sort(Yt)};function On(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,f=l*a,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const Tn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:l}=i,a=n.get(l);if(a){const c=On(a,t);c>0&&o.push({id:l,data:{droppableContainer:i,value:c}})}}return o.sort(Mn)};function Nn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Ht(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:W}function Ln(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((l,a)=>({...l,top:l.top+e*a.y,bottom:l.bottom+e*a.y,left:l.left+e*a.x,right:l.right+e*a.x}),{...n})}}const In=Ln(1);function kn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function zn(e,t,n){const r=kn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:l,y:a}=r,c=e.left-l-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const Pn={ignoreTransform:!1};function Ae(e,t){t===void 0&&(t=Pn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=k(e).getComputedStyle(e);u&&(n=zn(n,u,f))}const{top:r,left:o,width:i,height:l,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:l,bottom:a,right:c}}function Ot(e){return Ae(e,{ignoreTransform:!0})}function Bn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Fn(e,t){return t===void 0&&(t=k(e).getComputedStyle(e)),t.position==="fixed"}function $n(e,t){t===void 0&&(t=k(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function it(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(rt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ee(o)||$t(o)||n.includes(o))return n;const i=k(e).getComputedStyle(o);return o!==e&&$n(o,i)&&n.push(o),Fn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Kt(e){const[t]=it(e,1);return t??null}function qe(e){return!Fe||!e?null:ge(e)?e:nt(e)?rt(e)||e===ve(e).scrollingElement?window:Ee(e)?e:null:null}function Vt(e){return ge(e)?e.scrollX:e.scrollLeft}function qt(e){return ge(e)?e.scrollY:e.scrollTop}function _e(e){return{x:Vt(e),y:qt(e)}}var O;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(O||(O={}));function Jt(e){return!Fe||!e?!1:e===document.scrollingElement}function Gt(e){const t={x:0,y:0},n=Jt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:l,isRight:a,maxScroll:r,minScroll:t}}const Xn={x:.2,y:.2};function jn(e,t,n,r,o){let{top:i,left:l,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Xn);const{isTop:u,isBottom:f,isLeft:d,isRight:v}=Gt(e),h={x:0,y:0},C={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+g.height?(h.y=O.Backward,C.y=r*Math.abs((t.top+g.height-i)/g.height)):!f&&c>=t.bottom-g.height&&(h.y=O.Forward,C.y=r*Math.abs((t.bottom-g.height-c)/g.height)),!v&&a>=t.right-g.width?(h.x=O.Forward,C.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&l<=t.left+g.width&&(h.x=O.Backward,C.x=r*Math.abs((t.left+g.width-l)/g.width)),{direction:h,speed:C}}function Un(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Qt(e){return e.reduce((t,n)=>he(t,_e(n)),W)}function Wn(e){return e.reduce((t,n)=>t+Vt(n),0)}function Yn(e){return e.reduce((t,n)=>t+qt(n),0)}function Hn(e,t){if(t===void 0&&(t=Ae),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Kt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Kn=[["x",["left","right"],Wn],["y",["top","bottom"],Yn]];class st{constructor(t,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=it(n),o=Qt(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,l,a]of Kn)for(const c of l)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xe{constructor(t){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=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Vn(e){const{EventTarget:t}=k(e);return e instanceof t?e:ve(e)}function Je(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var $;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($||($={}));function Tt(e){e.preventDefault()}function qn(e){e.stopPropagation()}var x;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(x||(x={}));const Zt={start:[x.Space,x.Enter],cancel:[x.Esc],end:[x.Space,x.Enter,x.Tab]},Jn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case x.Right:return{...n,x:n.x+25};case x.Left:return{...n,x:n.x-25};case x.Down:return{...n,y:n.y+25};case x.Up:return{...n,y:n.y-25}}};class _t{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xe(ve(n)),this.windowListeners=new xe(k(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($.Resize,this.handleCancel),this.windowListeners.add($.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Hn(r),n(W)}handleKeyDown(t){if(jt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=Zt,coordinateGetter:l=Jn,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:W;this.referenceCoordinates||(this.referenceCoordinates=f);const d=l(t,{active:n,context:r.current,currentCoordinates:f});if(d){const v=ze(d,f),h={x:0,y:0},{scrollableAncestors:C}=r.current;for(const g of C){const p=t.code,{isTop:m,isRight:D,isLeft:y,isBottom:N,maxScroll:S,minScroll:R}=Gt(g),w=Un(g),b={x:Math.min(p===x.Right?w.right-w.width/2:w.right,Math.max(p===x.Right?w.left:w.left+w.width/2,d.x)),y:Math.min(p===x.Down?w.bottom-w.height/2:w.bottom,Math.max(p===x.Down?w.top:w.top+w.height/2,d.y))},M=p===x.Right&&!D||p===x.Left&&!y,I=p===x.Down&&!N||p===x.Up&&!m;if(M&&b.x!==d.x){const A=g.scrollLeft+v.x,K=p===x.Right&&A<=S.x||p===x.Left&&A>=R.x;if(K&&!v.y){g.scrollTo({left:A,behavior:a});return}K?h.x=g.scrollLeft-A:h.x=p===x.Right?g.scrollLeft-S.x:g.scrollLeft-R.x,h.x&&g.scrollBy({left:-h.x,behavior:a});break}else if(I&&b.y!==d.y){const A=g.scrollTop+v.y,K=p===x.Down&&A<=S.y||p===x.Up&&A>=R.y;if(K&&!v.x){g.scrollTo({top:A,behavior:a});return}K?h.y=g.scrollTop-A:h.y=p===x.Down?g.scrollTop-S.y:g.scrollTop-R.y,h.y&&g.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,he(ze(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}_t.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Zt,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Nt(e){return!!(e&&"distance"in e)}function Lt(e){return!!(e&&"delay"in e)}class at{constructor(t,n,r){var o;r===void 0&&(r=Vn(t.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=t,this.events=n;const{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=ve(l),this.documentListeners=new xe(this.document),this.listeners=new xe(r),this.windowListeners=new xe(k(l)),this.initialCoordinates=(o=Ze(i))!=null?o:W,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add($.Resize,this.handleCancel),this.windowListeners.add($.DragStart,Tt),this.windowListeners.add($.VisibilityChange,this.handleCancel),this.windowListeners.add($.ContextMenu,Tt),this.documentListeners.add($.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Nt(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(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add($.Click,qn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:l,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=Ze(t))!=null?n:W,u=ze(o,c);if(!r&&a){if(Nt(a)){if(a.tolerance!=null&&Je(u,a.tolerance))return this.handleCancel();if(Je(u,a.distance))return this.handleStart()}if(Lt(a)&&Je(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),l(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===x.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Gn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class en extends at{constructor(t){const{event:n}=t,r=ve(n.target);super(t,Gn,r)}}en.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Qn={move:{name:"mousemove"},end:{name:"mouseup"}};var et;(function(e){e[e.RightClick=2]="RightClick"})(et||(et={}));class Zn extends at{constructor(t){super(t,Qn,ve(t.event.target))}}Zn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===et.RightClick?!1:(r?.({event:n}),!0)}}];const Ge={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _n extends at{constructor(t){super(t,Ge)}static setup(){return window.addEventListener(Ge.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ge.move.name,t)};function t(){}}}_n.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var De;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(De||(De={}));var Be;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Be||(Be={}));function er(e){let{acceleration:t,activator:n=De.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:l=5,order:a=Be.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:v}=e;const h=nr({delta:d,disabled:!i}),[C,g]=gn(),p=s.useRef({x:0,y:0}),m=s.useRef({x:0,y:0}),D=s.useMemo(()=>{switch(n){case De.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case De.DraggableRect:return o}},[n,o,c]),y=s.useRef(null),N=s.useCallback(()=>{const R=y.current;if(!R)return;const w=p.current.x*m.current.x,b=p.current.y*m.current.y;R.scrollBy(w,b)},[]),S=s.useMemo(()=>a===Be.TreeOrder?[...u].reverse():u,[a,u]);s.useEffect(()=>{if(!i||!u.length||!D){g();return}for(const R of S){if(r?.(R)===!1)continue;const w=u.indexOf(R),b=f[w];if(!b)continue;const{direction:M,speed:I}=jn(R,b,D,t,v);for(const A of["x","y"])h[A][M[A]]||(I[A]=0,M[A]=0);if(I.x>0||I.y>0){g(),y.current=R,C(N,l),p.current=I,m.current=M;return}}p.current={x:0,y:0},m.current={x:0,y:0},g()},[t,N,r,g,i,l,JSON.stringify(D),JSON.stringify(h),C,u,S,f,JSON.stringify(v)])}const tr={x:{[O.Backward]:!1,[O.Forward]:!1},y:{[O.Backward]:!1,[O.Forward]:!1}};function nr(e){let{delta:t,disabled:n}=e;const r=Qe(t);return Me(o=>{if(n||!r||!o)return tr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[O.Backward]:o.x[O.Backward]||i.x===-1,[O.Forward]:o.x[O.Forward]||i.x===1},y:{[O.Backward]:o.y[O.Backward]||i.y===-1,[O.Forward]:o.y[O.Forward]||i.y===1}}},[n,t,r])}function rr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Me(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function or(e,t){return s.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...i]},[]),[e,t])}var Re;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Re||(Re={}));var tt;(function(e){e.Optimized="optimized"})(tt||(tt={}));const It=new Map;function ir(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,l]=s.useState(null),{frequency:a,measure:c,strategy:u}=o,f=s.useRef(e),d=p(),v=Se(d),h=s.useCallback(function(m){m===void 0&&(m=[]),!v.current&&l(D=>D===null?m:D.concat(m.filter(y=>!D.includes(y))))},[v]),C=s.useRef(null),g=Me(m=>{if(d&&!n)return It;if(!m||m===It||f.current!==e||i!=null){const D=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){D.set(y.id,y.rect.current);continue}const N=y.node.current,S=N?new st(c(N),N):null;y.rect.current=S,S&&D.set(y.id,S)}return D}return m},[e,i,n,d,c]);return s.useEffect(()=>{f.current=e},[e]),s.useEffect(()=>{d||h()},[n,d]),s.useEffect(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),s.useEffect(()=>{d||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{h(),C.current=null},a))},[a,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:i!=null};function p(){switch(u){case Re.Always:return!1;case Re.BeforeDragging:return n;default:return!n}}}function tn(e,t){return Me(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function sr(e,t){return tn(e,t)}function ar(e){let{callback:t,disabled:n}=e;const r=ot(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function Xe(e){let{callback:t,disabled:n}=e;const r=ot(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function lr(e){return new st(Ae(e),e)}function kt(e,t,n){t===void 0&&(t=lr);const[r,o]=s.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const l=ar({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=Xe({callback:i});return re(()=>{i(),e?(a?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),l?.disconnect())},[e]),r}function cr(e){const t=tn(e);return Ht(e,t)}const zt=[];function ur(e){const t=s.useRef(e),n=Me(r=>e?r&&r!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?r:it(e):zt,[e]);return s.useEffect(()=>{t.current=e},[e]),n}function dr(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(i=>{const l=qe(i.target);l&&n(a=>a?(a.set(l,_e(l)),new Map(a)):null)},[]);return s.useEffect(()=>{const i=r.current;if(e!==i){l(i);const a=e.map(c=>{const u=qe(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,_e(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{l(e),l(i)};function l(a){a.forEach(c=>{const u=qe(c);u?.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,l)=>he(i,l),W):Qt(e):W,[e,t])}function Pt(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const r=e!==W;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):W}function fr(e){s.useEffect(()=>{if(!Fe)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function hr(e,t){return s.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=l=>{i(l,t)},n},{}),[e,t])}function nn(e){return s.useMemo(()=>e?Bn(e):null,[e])}const Bt=[];function gr(e,t){t===void 0&&(t=Ae);const[n]=e,r=nn(n?k(n):null),[o,i]=s.useState(Bt);function l(){i(()=>e.length?e.map(c=>Jt(c)?r:new st(t(c),c)):Bt)}const a=Xe({callback:l});return re(()=>{a?.disconnect(),l(),e.forEach(c=>a?.observe(c))},[e]),o}function vr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ee(t)?t:e}function pr(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(u=>{for(const{target:f}of u)if(Ee(f)){r(d=>{const v=t(f);return d?{...d,width:v.width,height:v.height}:v});break}},[t]),i=Xe({callback:o}),l=s.useCallback(u=>{const f=vr(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,c]=ke(l);return s.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const br=[{sensor:en,options:{}},{sensor:_t,options:{}}],wr={current:{}},Ie={draggable:{measure:Ot},droppable:{measure:Ot,strategy:Re.WhileDragging,frequency:tt.Optimized},dragOverlay:{measure:Ae}};class Ce extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const yr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ce,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ie,measureDroppableContainers:Pe,windowRect:null,measuringScheduled:!1},mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pe,draggableNodes:new Map,over:null,measureDroppableContainers:Pe},je=s.createContext(mr),rn=s.createContext(yr);function xr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ce}}}function Dr(e,t){switch(t.type){case E.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case E.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case E.DragEnd:case E.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case E.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ce(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case E.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const l=new Ce(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case E.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ce(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Cr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(je),i=Qe(r),l=Qe(n?.id);return s.useEffect(()=>{if(!t&&!r&&i&&l!=null){if(!jt(i)||document.activeElement===i.target)return;const a=o.get(l);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=bn(f);if(d){d.focus();break}}})}},[r,t,o,l,i]),null}function Sr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Rr(e){return s.useMemo(()=>({draggable:{...Ie.draggable,...e?.draggable},droppable:{...Ie.droppable,...e?.droppable},dragOverlay:{...Ie.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Er(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=s.useRef(!1),{x:l,y:a}=typeof o=="boolean"?{x:o,y:o}:o;re(()=>{if(!l&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Ht(f,r);if(l||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const v=Kt(u);v&&v.scrollBy({top:d.y,left:d.x})}},[t,l,a,r,n])}const on=s.createContext({...W,scaleX:1,scaleY:1});var ne;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ne||(ne={}));const Br=s.memo(function(t){var n,r,o,i;let{id:l,accessibility:a,autoScroll:c=!0,children:u,sensors:f=br,collisionDetection:d=Tn,measuring:v,modifiers:h,...C}=t;const g=s.useReducer(Dr,void 0,xr),[p,m]=g,[D,y]=Cn(),[N,S]=s.useState(ne.Uninitialized),R=N===ne.Initialized,{draggable:{active:w,nodes:b,translate:M},droppable:{containers:I}}=p,A=w!=null?b.get(w):null,K=s.useRef({initial:null,translated:null}),V=s.useMemo(()=>{var L;return w!=null?{id:w,data:(L=A?.data)!=null?L:wr,rect:K}:null},[w,A]),G=s.useRef(null),[lt,ct]=s.useState(null),[q,ut]=s.useState(null),oe=Se(C,Object.values(C)),Ue=$e("DndDescribedBy",l),dt=s.useMemo(()=>I.getEnabled(),[I]),ie=Rr(v),{droppableRects:le,measureDroppableContainers:Oe,measuringScheduled:ft}=ir(dt,{dragging:R,dependencies:[M.x,M.y],config:ie.droppable}),j=rr(b,w),ht=s.useMemo(()=>q?Ze(q):null,[q]),gt=hn(),vt=sr(j,ie.draggable.measure);Er({activeNode:w!=null?b.get(w):null,config:gt.layoutShiftCompensation,initialRect:vt,measure:ie.draggable.measure});const U=kt(j,ie.draggable.measure,vt),We=kt(j?j.parentElement:null),se=s.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pt=I.getNodeFor((n=se.current.over)==null?void 0:n.id),ae=pr({measure:ie.dragOverlay.measure}),Te=(r=ae.nodeRef.current)!=null?r:j,ce=R?(o=ae.rect)!=null?o:U:null,bt=!!(ae.nodeRef.current&&ae.rect),wt=cr(bt?null:U),Ye=nn(Te?k(Te):null),Q=ur(R?pt??j:null),Ne=gr(Q),Le=Sr(h,{transform:{x:M.x-wt.x,y:M.y-wt.y,scaleX:1,scaleY:1},activatorEvent:q,active:V,activeNodeRect:U,containerNodeRect:We,draggingNodeRect:ce,over:se.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Q,scrollableAncestorRects:Ne,windowRect:Ye}),yt=ht?he(ht,M):null,mt=dr(Q),sn=Pt(mt),an=Pt(mt,[U]),ue=he(Le,sn),de=ce?In(ce,Le):null,pe=V&&de?d({active:V,collisionRect:de,droppableRects:le,droppableContainers:dt,pointerCoordinates:yt}):null,xt=An(pe,"id"),[Z,Dt]=s.useState(null),ln=bt?Le:he(Le,an),cn=Nn(ln,(i=Z?.rect)!=null?i:null,U),He=s.useRef(null),Ct=s.useCallback((L,z)=>{let{sensor:P,options:_}=z;if(G.current==null)return;const F=b.get(G.current);if(!F)return;const B=L.nativeEvent,Y=new P({active:G.current,activeNode:F,event:B,options:_,context:se,onAbort(T){if(!b.get(T))return;const{onDragAbort:H}=oe.current,J={id:T};H?.(J),D({type:"onDragAbort",event:J})},onPending(T,ee,H,J){if(!b.get(T))return;const{onDragPending:we}=oe.current,te={id:T,constraint:ee,initialCoordinates:H,offset:J};we?.(te),D({type:"onDragPending",event:te})},onStart(T){const ee=G.current;if(ee==null)return;const H=b.get(ee);if(!H)return;const{onDragStart:J}=oe.current,be={activatorEvent:B,active:{id:ee,data:H.data,rect:K}};me.unstable_batchedUpdates(()=>{J?.(be),S(ne.Initializing),m({type:E.DragStart,initialCoordinates:T,active:ee}),D({type:"onDragStart",event:be}),ct(He.current),ut(B)})},onMove(T){m({type:E.DragMove,coordinates:T})},onEnd:fe(E.DragEnd),onCancel:fe(E.DragCancel)});He.current=Y;function fe(T){return async function(){const{active:H,collisions:J,over:be,scrollAdjustedTranslate:we}=se.current;let te=null;if(H&&we){const{cancelDrop:ye}=oe.current;te={activatorEvent:B,active:H,collisions:J,delta:we,over:be},T===E.DragEnd&&typeof ye=="function"&&await Promise.resolve(ye(te))&&(T=E.DragCancel)}G.current=null,me.unstable_batchedUpdates(()=>{m({type:T}),S(ne.Uninitialized),Dt(null),ct(null),ut(null),He.current=null;const ye=T===E.DragEnd?"onDragEnd":"onDragCancel";if(te){const Ke=oe.current[ye];Ke?.(te),D({type:ye,event:te})}})}}},[b]),un=s.useCallback((L,z)=>(P,_)=>{const F=P.nativeEvent,B=b.get(_);if(G.current!==null||!B||F.dndKit||F.defaultPrevented)return;const Y={active:B};L(P,z.options,Y)===!0&&(F.dndKit={capturedBy:z.sensor},G.current=_,Ct(P,z))},[b,Ct]),St=or(f,un);fr(f),re(()=>{U&&N===ne.Initializing&&S(ne.Initialized)},[U,N]),s.useEffect(()=>{const{onDragMove:L}=oe.current,{active:z,activatorEvent:P,collisions:_,over:F}=se.current;if(!z||!P)return;const B={active:z,activatorEvent:P,collisions:_,delta:{x:ue.x,y:ue.y},over:F};me.unstable_batchedUpdates(()=>{L?.(B),D({type:"onDragMove",event:B})})},[ue.x,ue.y]),s.useEffect(()=>{const{active:L,activatorEvent:z,collisions:P,droppableContainers:_,scrollAdjustedTranslate:F}=se.current;if(!L||G.current==null||!z||!F)return;const{onDragOver:B}=oe.current,Y=_.get(xt),fe=Y&&Y.rect.current?{id:Y.id,rect:Y.rect.current,data:Y.data,disabled:Y.disabled}:null,T={active:L,activatorEvent:z,collisions:P,delta:{x:F.x,y:F.y},over:fe};me.unstable_batchedUpdates(()=>{Dt(fe),B?.(T),D({type:"onDragOver",event:T})})},[xt]),re(()=>{se.current={activatorEvent:q,active:V,activeNode:j,collisionRect:de,collisions:pe,droppableRects:le,draggableNodes:b,draggingNode:Te,draggingNodeRect:ce,droppableContainers:I,over:Z,scrollableAncestors:Q,scrollAdjustedTranslate:ue},K.current={initial:ce,translated:de}},[V,j,pe,de,b,Te,ce,le,I,Z,Q,ue]),er({...gt,delta:M,draggingRect:de,pointerCoordinates:yt,scrollableAncestors:Q,scrollableAncestorRects:Ne});const dn=s.useMemo(()=>({active:V,activeNode:j,activeNodeRect:U,activatorEvent:q,collisions:pe,containerNodeRect:We,dragOverlay:ae,draggableNodes:b,droppableContainers:I,droppableRects:le,over:Z,measureDroppableContainers:Oe,scrollableAncestors:Q,scrollableAncestorRects:Ne,measuringConfiguration:ie,measuringScheduled:ft,windowRect:Ye}),[V,j,U,q,pe,We,ae,b,I,le,Z,Oe,Q,Ne,ie,ft,Ye]),fn=s.useMemo(()=>({activatorEvent:q,activators:St,active:V,activeNodeRect:U,ariaDescribedById:{draggable:Ue},dispatch:m,draggableNodes:b,over:Z,measureDroppableContainers:Oe}),[q,St,V,U,m,Ue,b,Z,Oe]);return X.createElement(Ut.Provider,{value:y},X.createElement(je.Provider,{value:fn},X.createElement(rn.Provider,{value:dn},X.createElement(on.Provider,{value:cn},u)),X.createElement(Cr,{disabled:a?.restoreFocus===!1})),X.createElement(En,{...a,hiddenTextDescribedById:Ue}));function hn(){const L=lt?.autoScrollEnabled===!1,z=typeof c=="object"?c.enabled===!1:c===!1,P=R&&!L&&!z;return typeof c=="object"?{...c,enabled:P}:{enabled:P}}}),Mr=s.createContext(null),Ft="button",Ar="Draggable";function Fr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e(Ar),{activators:l,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:v}=s.useContext(je),{role:h=Ft,roleDescription:C="draggable",tabIndex:g=0}=o??{},p=c?.id===t,m=s.useContext(p?on:Mr),[D,y]=ke(),[N,S]=ke(),R=hr(l,t),w=Se(n);re(()=>(d.set(t,{id:t,key:i,node:D,activatorNode:N,data:w}),()=>{const M=d.get(t);M&&M.key===i&&d.delete(t)}),[d,t]);const b=s.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":p&&h===Ft?!0:void 0,"aria-roledescription":C,"aria-describedby":f.draggable}),[r,h,g,p,C,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:b,isDragging:p,listeners:r?void 0:R,node:D,over:v,setNodeRef:y,setActivatorNodeRef:S,transform:m}}function $r(){return s.useContext(rn)}const Or="Droppable",Tr={timeout:25};function Xr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(Or),{active:l,dispatch:a,over:c,measureDroppableContainers:u}=s.useContext(je),f=s.useRef({disabled:n}),d=s.useRef(!1),v=s.useRef(null),h=s.useRef(null),{disabled:C,updateMeasurementsFor:g,timeout:p}={...Tr,...o},m=Se(g??r),D=s.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),h.current=null},p)},[p]),y=Xe({callback:D,disabled:C||!l}),N=s.useCallback((b,M)=>{y&&(M&&(y.unobserve(M),d.current=!1),b&&y.observe(b))},[y]),[S,R]=ke(N),w=Se(t);return s.useEffect(()=>{!y||!S.current||(y.disconnect(),d.current=!1,y.observe(S.current))},[S,y]),s.useEffect(()=>(a({type:E.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:v,data:w}}),()=>a({type:E.UnregisterDroppable,key:i,id:r})),[r]),s.useEffect(()=>{n!==f.current.disabled&&(a({type:E.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:l,rect:v,isOver:c?.id===r,node:S,over:c,setNodeRef:R}}export{Rt as C,Br as D,x as K,en as P,Ir as a,Xr as b,Fr as c,Pr as d,it as e,$r as f,An as g,$e as h,re as i,Lr as j,jt as k,Ae as l,_t as m,zr as n,ze as s,kr as u};
6
- //# sourceMappingURL=core.esm-CJUp2aNZ.js.map
5
+ `},Rn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function En(e){let{announcements:t=Rn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Sn}=e;const{announce:i,announcement:l}=xn(),a=$e("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),Dn(s.useMemo(()=>({onDragStart(d){let{active:v}=d;i(t.onDragStart({active:v}))},onDragMove(d){let{active:v,over:h}=d;t.onDragMove&&i(t.onDragMove({active:v,over:h}))},onDragOver(d){let{active:v,over:h}=d;i(t.onDragOver({active:v,over:h}))},onDragEnd(d){let{active:v,over:h}=d;i(t.onDragEnd({active:v,over:h}))},onDragCancel(d){let{active:v,over:h}=d;i(t.onDragCancel({active:v,over:h}))}}),[i,t])),!c)return null;const f=X.createElement(X.Fragment,null,X.createElement(yn,{id:r,value:o.draggable}),X.createElement(mn,{id:a,announcement:l}));return n?me.createPortal(f,n):f}var E;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(E||(E={}));function Pe(){}function Ir(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function kr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const W=Object.freeze({x:0,y:0});function Wt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Mn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Mt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function An(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function At(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const zr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=At(t,t.left,t.top),i=[];for(const l of r){const{id:a}=l,c=n.get(a);if(c){const u=Wt(At(c),o);i.push({id:a,data:{droppableContainer:l,value:u}})}}return i.sort(Yt)},Pr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Mt(t),i=[];for(const l of r){const{id:a}=l,c=n.get(a);if(c){const u=Mt(c),f=o.reduce((v,h,C)=>v+Wt(u[C],h),0),d=Number((f/4).toFixed(4));i.push({id:a,data:{droppableContainer:l,value:d}})}}return i.sort(Yt)};function On(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=o-r,a=i-n;if(r<o&&n<i){const c=t.width*t.height,u=e.width*e.height,f=l*a,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const Tn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:l}=i,a=n.get(l);if(a){const c=On(a,t);c>0&&o.push({id:l,data:{droppableContainer:i,value:c}})}}return o.sort(Mn)};function Nn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Kt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:W}function Ln(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((l,a)=>({...l,top:l.top+e*a.y,bottom:l.bottom+e*a.y,left:l.left+e*a.x,right:l.right+e*a.x}),{...n})}}const In=Ln(1);function kn(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function zn(e,t,n){const r=kn(t);if(!r)return e;const{scaleX:o,scaleY:i,x:l,y:a}=r,c=e.left-l-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const Pn={ignoreTransform:!1};function Ae(e,t){t===void 0&&(t=Pn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=k(e).getComputedStyle(e);u&&(n=zn(n,u,f))}const{top:r,left:o,width:i,height:l,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:l,bottom:a,right:c}}function Ot(e){return Ae(e,{ignoreTransform:!0})}function Bn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Fn(e,t){return t===void 0&&(t=k(e).getComputedStyle(e)),t.position==="fixed"}function $n(e,t){t===void 0&&(t=k(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function it(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(rt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ee(o)||$t(o)||n.includes(o))return n;const i=k(e).getComputedStyle(o);return o!==e&&$n(o,i)&&n.push(o),Fn(o,i)?n:r(o.parentNode)}return e?r(e):n}function Ht(e){const[t]=it(e,1);return t??null}function qe(e){return!Fe||!e?null:ge(e)?e:nt(e)?rt(e)||e===ve(e).scrollingElement?window:Ee(e)?e:null:null}function Vt(e){return ge(e)?e.scrollX:e.scrollLeft}function qt(e){return ge(e)?e.scrollY:e.scrollTop}function _e(e){return{x:Vt(e),y:qt(e)}}var O;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(O||(O={}));function Gt(e){return!Fe||!e?!1:e===document.scrollingElement}function Jt(e){const t={x:0,y:0},n=Gt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:l,isRight:a,maxScroll:r,minScroll:t}}const Xn={x:.2,y:.2};function jn(e,t,n,r,o){let{top:i,left:l,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Xn);const{isTop:u,isBottom:f,isLeft:d,isRight:v}=Jt(e),h={x:0,y:0},C={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+g.height?(h.y=O.Backward,C.y=r*Math.abs((t.top+g.height-i)/g.height)):!f&&c>=t.bottom-g.height&&(h.y=O.Forward,C.y=r*Math.abs((t.bottom-g.height-c)/g.height)),!v&&a>=t.right-g.width?(h.x=O.Forward,C.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&l<=t.left+g.width&&(h.x=O.Backward,C.x=r*Math.abs((t.left+g.width-l)/g.width)),{direction:h,speed:C}}function Un(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Qt(e){return e.reduce((t,n)=>he(t,_e(n)),W)}function Wn(e){return e.reduce((t,n)=>t+Vt(n),0)}function Yn(e){return e.reduce((t,n)=>t+qt(n),0)}function Kn(e,t){if(t===void 0&&(t=Ae),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Ht(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Hn=[["x",["left","right"],Wn],["y",["top","bottom"],Yn]];class st{constructor(t,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=it(n),o=Qt(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,l,a]of Hn)for(const c of l)Object.defineProperty(this,c,{get:()=>{const u=a(r),f=o[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class xe{constructor(t){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=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Vn(e){const{EventTarget:t}=k(e);return e instanceof t?e:ve(e)}function Ge(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var $;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($||($={}));function Tt(e){e.preventDefault()}function qn(e){e.stopPropagation()}var x;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(x||(x={}));const Zt={start:[x.Space,x.Enter],cancel:[x.Esc],end:[x.Space,x.Enter,x.Tab]},Gn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case x.Right:return{...n,x:n.x+25};case x.Left:return{...n,x:n.x-25};case x.Down:return{...n,y:n.y+25};case x.Up:return{...n,y:n.y-25}}};class _t{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new xe(ve(n)),this.windowListeners=new xe(k(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($.Resize,this.handleCancel),this.windowListeners.add($.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Kn(r),n(W)}handleKeyDown(t){if(jt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=Zt,coordinateGetter:l=Gn,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:W;this.referenceCoordinates||(this.referenceCoordinates=f);const d=l(t,{active:n,context:r.current,currentCoordinates:f});if(d){const v=ze(d,f),h={x:0,y:0},{scrollableAncestors:C}=r.current;for(const g of C){const p=t.code,{isTop:m,isRight:D,isLeft:y,isBottom:N,maxScroll:S,minScroll:R}=Jt(g),w=Un(g),b={x:Math.min(p===x.Right?w.right-w.width/2:w.right,Math.max(p===x.Right?w.left:w.left+w.width/2,d.x)),y:Math.min(p===x.Down?w.bottom-w.height/2:w.bottom,Math.max(p===x.Down?w.top:w.top+w.height/2,d.y))},M=p===x.Right&&!D||p===x.Left&&!y,I=p===x.Down&&!N||p===x.Up&&!m;if(M&&b.x!==d.x){const A=g.scrollLeft+v.x,H=p===x.Right&&A<=S.x||p===x.Left&&A>=R.x;if(H&&!v.y){g.scrollTo({left:A,behavior:a});return}H?h.x=g.scrollLeft-A:h.x=p===x.Right?g.scrollLeft-S.x:g.scrollLeft-R.x,h.x&&g.scrollBy({left:-h.x,behavior:a});break}else if(I&&b.y!==d.y){const A=g.scrollTop+v.y,H=p===x.Down&&A<=S.y||p===x.Up&&A>=R.y;if(H&&!v.x){g.scrollTo({top:A,behavior:a});return}H?h.y=g.scrollTop-A:h.y=p===x.Down?g.scrollTop-S.y:g.scrollTop-R.y,h.y&&g.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,he(ze(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}_t.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Zt,onActivation:o}=t,{active:i}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Nt(e){return!!(e&&"distance"in e)}function Lt(e){return!!(e&&"delay"in e)}class at{constructor(t,n,r){var o;r===void 0&&(r=Vn(t.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=t,this.events=n;const{event:i}=t,{target:l}=i;this.props=t,this.events=n,this.document=ve(l),this.documentListeners=new xe(this.document),this.listeners=new xe(r),this.windowListeners=new xe(k(l)),this.initialCoordinates=(o=Ze(i))!=null?o:W,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add($.Resize,this.handleCancel),this.windowListeners.add($.DragStart,Tt),this.windowListeners.add($.VisibilityChange,this.handleCancel),this.windowListeners.add($.ContextMenu,Tt),this.documentListeners.add($.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Nt(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(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add($.Click,qn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:l,options:{activationConstraint:a}}=i;if(!o)return;const c=(n=Ze(t))!=null?n:W,u=ze(o,c);if(!r&&a){if(Nt(a)){if(a.tolerance!=null&&Ge(u,a.tolerance))return this.handleCancel();if(Ge(u,a.distance))return this.handleStart()}if(Lt(a)&&Ge(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),l(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===x.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Jn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class en extends at{constructor(t){const{event:n}=t,r=ve(n.target);super(t,Jn,r)}}en.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Qn={move:{name:"mousemove"},end:{name:"mouseup"}};var et;(function(e){e[e.RightClick=2]="RightClick"})(et||(et={}));class Zn extends at{constructor(t){super(t,Qn,ve(t.event.target))}}Zn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===et.RightClick?!1:(r?.({event:n}),!0)}}];const Je={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class _n extends at{constructor(t){super(t,Je)}static setup(){return window.addEventListener(Je.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Je.move.name,t)};function t(){}}}_n.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var De;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(De||(De={}));var Be;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Be||(Be={}));function er(e){let{acceleration:t,activator:n=De.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:l=5,order:a=Be.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:v}=e;const h=nr({delta:d,disabled:!i}),[C,g]=gn(),p=s.useRef({x:0,y:0}),m=s.useRef({x:0,y:0}),D=s.useMemo(()=>{switch(n){case De.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case De.DraggableRect:return o}},[n,o,c]),y=s.useRef(null),N=s.useCallback(()=>{const R=y.current;if(!R)return;const w=p.current.x*m.current.x,b=p.current.y*m.current.y;R.scrollBy(w,b)},[]),S=s.useMemo(()=>a===Be.TreeOrder?[...u].reverse():u,[a,u]);s.useEffect(()=>{if(!i||!u.length||!D){g();return}for(const R of S){if(r?.(R)===!1)continue;const w=u.indexOf(R),b=f[w];if(!b)continue;const{direction:M,speed:I}=jn(R,b,D,t,v);for(const A of["x","y"])h[A][M[A]]||(I[A]=0,M[A]=0);if(I.x>0||I.y>0){g(),y.current=R,C(N,l),p.current=I,m.current=M;return}}p.current={x:0,y:0},m.current={x:0,y:0},g()},[t,N,r,g,i,l,JSON.stringify(D),JSON.stringify(h),C,u,S,f,JSON.stringify(v)])}const tr={x:{[O.Backward]:!1,[O.Forward]:!1},y:{[O.Backward]:!1,[O.Forward]:!1}};function nr(e){let{delta:t,disabled:n}=e;const r=Qe(t);return Me(o=>{if(n||!r||!o)return tr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[O.Backward]:o.x[O.Backward]||i.x===-1,[O.Forward]:o.x[O.Forward]||i.x===1},y:{[O.Backward]:o.y[O.Backward]||i.y===-1,[O.Forward]:o.y[O.Forward]||i.y===1}}},[n,t,r])}function rr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Me(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function or(e,t){return s.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...i]},[]),[e,t])}var Re;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Re||(Re={}));var tt;(function(e){e.Optimized="optimized"})(tt||(tt={}));const It=new Map;function ir(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,l]=s.useState(null),{frequency:a,measure:c,strategy:u}=o,f=s.useRef(e),d=p(),v=Se(d),h=s.useCallback(function(m){m===void 0&&(m=[]),!v.current&&l(D=>D===null?m:D.concat(m.filter(y=>!D.includes(y))))},[v]),C=s.useRef(null),g=Me(m=>{if(d&&!n)return It;if(!m||m===It||f.current!==e||i!=null){const D=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){D.set(y.id,y.rect.current);continue}const N=y.node.current,S=N?new st(c(N),N):null;y.rect.current=S,S&&D.set(y.id,S)}return D}return m},[e,i,n,d,c]);return s.useEffect(()=>{f.current=e},[e]),s.useEffect(()=>{d||h()},[n,d]),s.useEffect(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),s.useEffect(()=>{d||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{h(),C.current=null},a))},[a,d,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:i!=null};function p(){switch(u){case Re.Always:return!1;case Re.BeforeDragging:return n;default:return!n}}}function tn(e,t){return Me(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function sr(e,t){return tn(e,t)}function ar(e){let{callback:t,disabled:n}=e;const r=ot(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function Xe(e){let{callback:t,disabled:n}=e;const r=ot(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function lr(e){return new st(Ae(e),e)}function kt(e,t,n){t===void 0&&(t=lr);const[r,o]=s.useState(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const l=ar({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=Xe({callback:i});return re(()=>{i(),e?(a?.observe(e),l?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),l?.disconnect())},[e]),r}function cr(e){const t=tn(e);return Kt(e,t)}const zt=[];function ur(e){const t=s.useRef(e),n=Me(r=>e?r&&r!==zt&&e&&t.current&&e.parentNode===t.current.parentNode?r:it(e):zt,[e]);return s.useEffect(()=>{t.current=e},[e]),n}function dr(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(i=>{const l=qe(i.target);l&&n(a=>a?(a.set(l,_e(l)),new Map(a)):null)},[]);return s.useEffect(()=>{const i=r.current;if(e!==i){l(i);const a=e.map(c=>{const u=qe(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,_e(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{l(e),l(i)};function l(a){a.forEach(c=>{const u=qe(c);u?.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,l)=>he(i,l),W):Qt(e):W,[e,t])}function Pt(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const r=e!==W;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ze(e,n.current):W}function fr(e){s.useEffect(()=>{if(!Fe)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function hr(e,t){return s.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=l=>{i(l,t)},n},{}),[e,t])}function nn(e){return s.useMemo(()=>e?Bn(e):null,[e])}const Bt=[];function gr(e,t){t===void 0&&(t=Ae);const[n]=e,r=nn(n?k(n):null),[o,i]=s.useState(Bt);function l(){i(()=>e.length?e.map(c=>Gt(c)?r:new st(t(c),c)):Bt)}const a=Xe({callback:l});return re(()=>{a?.disconnect(),l(),e.forEach(c=>a?.observe(c))},[e]),o}function vr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ee(t)?t:e}function pr(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(u=>{for(const{target:f}of u)if(Ee(f)){r(d=>{const v=t(f);return d?{...d,width:v.width,height:v.height}:v});break}},[t]),i=Xe({callback:o}),l=s.useCallback(u=>{const f=vr(u);i?.disconnect(),f&&i?.observe(f),r(f?t(f):null)},[t,i]),[a,c]=ke(l);return s.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const br=[{sensor:en,options:{}},{sensor:_t,options:{}}],wr={current:{}},Ie={draggable:{measure:Ot},droppable:{measure:Ot,strategy:Re.WhileDragging,frequency:tt.Optimized},dragOverlay:{measure:Ae}};class Ce extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const yr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ce,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pe},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ie,measureDroppableContainers:Pe,windowRect:null,measuringScheduled:!1},mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pe,draggableNodes:new Map,over:null,measureDroppableContainers:Pe},je=s.createContext(mr),rn=s.createContext(yr);function xr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ce}}}function Dr(e,t){switch(t.type){case E.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case E.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case E.DragEnd:case E.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case E.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Ce(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case E.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const l=new Ce(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case E.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Ce(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Cr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(je),i=Qe(r),l=Qe(n?.id);return s.useEffect(()=>{if(!t&&!r&&i&&l!=null){if(!jt(i)||document.activeElement===i.target)return;const a=o.get(l);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=bn(f);if(d){d.focus();break}}})}},[r,t,o,l,i]),null}function Sr(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Rr(e){return s.useMemo(()=>({draggable:{...Ie.draggable,...e?.draggable},droppable:{...Ie.droppable,...e?.droppable},dragOverlay:{...Ie.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Er(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=s.useRef(!1),{x:l,y:a}=typeof o=="boolean"?{x:o,y:o}:o;re(()=>{if(!l&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Kt(f,r);if(l||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const v=Ht(u);v&&v.scrollBy({top:d.y,left:d.x})}},[t,l,a,r,n])}const on=s.createContext({...W,scaleX:1,scaleY:1});var ne;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ne||(ne={}));const Br=s.memo(function(t){var n,r,o,i;let{id:l,accessibility:a,autoScroll:c=!0,children:u,sensors:f=br,collisionDetection:d=Tn,measuring:v,modifiers:h,...C}=t;const g=s.useReducer(Dr,void 0,xr),[p,m]=g,[D,y]=Cn(),[N,S]=s.useState(ne.Uninitialized),R=N===ne.Initialized,{draggable:{active:w,nodes:b,translate:M},droppable:{containers:I}}=p,A=w!=null?b.get(w):null,H=s.useRef({initial:null,translated:null}),V=s.useMemo(()=>{var L;return w!=null?{id:w,data:(L=A?.data)!=null?L:wr,rect:H}:null},[w,A]),J=s.useRef(null),[lt,ct]=s.useState(null),[q,ut]=s.useState(null),oe=Se(C,Object.values(C)),Ue=$e("DndDescribedBy",l),dt=s.useMemo(()=>I.getEnabled(),[I]),ie=Rr(v),{droppableRects:le,measureDroppableContainers:Oe,measuringScheduled:ft}=ir(dt,{dragging:R,dependencies:[M.x,M.y],config:ie.droppable}),j=rr(b,w),ht=s.useMemo(()=>q?Ze(q):null,[q]),gt=hn(),vt=sr(j,ie.draggable.measure);Er({activeNode:w!=null?b.get(w):null,config:gt.layoutShiftCompensation,initialRect:vt,measure:ie.draggable.measure});const U=kt(j,ie.draggable.measure,vt),We=kt(j?j.parentElement:null),se=s.useRef({activatorEvent:null,active:null,activeNode:j,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pt=I.getNodeFor((n=se.current.over)==null?void 0:n.id),ae=pr({measure:ie.dragOverlay.measure}),Te=(r=ae.nodeRef.current)!=null?r:j,ce=R?(o=ae.rect)!=null?o:U:null,bt=!!(ae.nodeRef.current&&ae.rect),wt=cr(bt?null:U),Ye=nn(Te?k(Te):null),Q=ur(R?pt??j:null),Ne=gr(Q),Le=Sr(h,{transform:{x:M.x-wt.x,y:M.y-wt.y,scaleX:1,scaleY:1},activatorEvent:q,active:V,activeNodeRect:U,containerNodeRect:We,draggingNodeRect:ce,over:se.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Q,scrollableAncestorRects:Ne,windowRect:Ye}),yt=ht?he(ht,M):null,mt=dr(Q),sn=Pt(mt),an=Pt(mt,[U]),ue=he(Le,sn),de=ce?In(ce,Le):null,pe=V&&de?d({active:V,collisionRect:de,droppableRects:le,droppableContainers:dt,pointerCoordinates:yt}):null,xt=An(pe,"id"),[Z,Dt]=s.useState(null),ln=bt?Le:he(Le,an),cn=Nn(ln,(i=Z?.rect)!=null?i:null,U),Ke=s.useRef(null),Ct=s.useCallback((L,z)=>{let{sensor:P,options:_}=z;if(J.current==null)return;const F=b.get(J.current);if(!F)return;const B=L.nativeEvent,Y=new P({active:J.current,activeNode:F,event:B,options:_,context:se,onAbort(T){if(!b.get(T))return;const{onDragAbort:K}=oe.current,G={id:T};K?.(G),D({type:"onDragAbort",event:G})},onPending(T,ee,K,G){if(!b.get(T))return;const{onDragPending:we}=oe.current,te={id:T,constraint:ee,initialCoordinates:K,offset:G};we?.(te),D({type:"onDragPending",event:te})},onStart(T){const ee=J.current;if(ee==null)return;const K=b.get(ee);if(!K)return;const{onDragStart:G}=oe.current,be={activatorEvent:B,active:{id:ee,data:K.data,rect:H}};me.unstable_batchedUpdates(()=>{G?.(be),S(ne.Initializing),m({type:E.DragStart,initialCoordinates:T,active:ee}),D({type:"onDragStart",event:be}),ct(Ke.current),ut(B)})},onMove(T){m({type:E.DragMove,coordinates:T})},onEnd:fe(E.DragEnd),onCancel:fe(E.DragCancel)});Ke.current=Y;function fe(T){return async function(){const{active:K,collisions:G,over:be,scrollAdjustedTranslate:we}=se.current;let te=null;if(K&&we){const{cancelDrop:ye}=oe.current;te={activatorEvent:B,active:K,collisions:G,delta:we,over:be},T===E.DragEnd&&typeof ye=="function"&&await Promise.resolve(ye(te))&&(T=E.DragCancel)}J.current=null,me.unstable_batchedUpdates(()=>{m({type:T}),S(ne.Uninitialized),Dt(null),ct(null),ut(null),Ke.current=null;const ye=T===E.DragEnd?"onDragEnd":"onDragCancel";if(te){const He=oe.current[ye];He?.(te),D({type:ye,event:te})}})}}},[b]),un=s.useCallback((L,z)=>(P,_)=>{const F=P.nativeEvent,B=b.get(_);if(J.current!==null||!B||F.dndKit||F.defaultPrevented)return;const Y={active:B};L(P,z.options,Y)===!0&&(F.dndKit={capturedBy:z.sensor},J.current=_,Ct(P,z))},[b,Ct]),St=or(f,un);fr(f),re(()=>{U&&N===ne.Initializing&&S(ne.Initialized)},[U,N]),s.useEffect(()=>{const{onDragMove:L}=oe.current,{active:z,activatorEvent:P,collisions:_,over:F}=se.current;if(!z||!P)return;const B={active:z,activatorEvent:P,collisions:_,delta:{x:ue.x,y:ue.y},over:F};me.unstable_batchedUpdates(()=>{L?.(B),D({type:"onDragMove",event:B})})},[ue.x,ue.y]),s.useEffect(()=>{const{active:L,activatorEvent:z,collisions:P,droppableContainers:_,scrollAdjustedTranslate:F}=se.current;if(!L||J.current==null||!z||!F)return;const{onDragOver:B}=oe.current,Y=_.get(xt),fe=Y&&Y.rect.current?{id:Y.id,rect:Y.rect.current,data:Y.data,disabled:Y.disabled}:null,T={active:L,activatorEvent:z,collisions:P,delta:{x:F.x,y:F.y},over:fe};me.unstable_batchedUpdates(()=>{Dt(fe),B?.(T),D({type:"onDragOver",event:T})})},[xt]),re(()=>{se.current={activatorEvent:q,active:V,activeNode:j,collisionRect:de,collisions:pe,droppableRects:le,draggableNodes:b,draggingNode:Te,draggingNodeRect:ce,droppableContainers:I,over:Z,scrollableAncestors:Q,scrollAdjustedTranslate:ue},H.current={initial:ce,translated:de}},[V,j,pe,de,b,Te,ce,le,I,Z,Q,ue]),er({...gt,delta:M,draggingRect:de,pointerCoordinates:yt,scrollableAncestors:Q,scrollableAncestorRects:Ne});const dn=s.useMemo(()=>({active:V,activeNode:j,activeNodeRect:U,activatorEvent:q,collisions:pe,containerNodeRect:We,dragOverlay:ae,draggableNodes:b,droppableContainers:I,droppableRects:le,over:Z,measureDroppableContainers:Oe,scrollableAncestors:Q,scrollableAncestorRects:Ne,measuringConfiguration:ie,measuringScheduled:ft,windowRect:Ye}),[V,j,U,q,pe,We,ae,b,I,le,Z,Oe,Q,Ne,ie,ft,Ye]),fn=s.useMemo(()=>({activatorEvent:q,activators:St,active:V,activeNodeRect:U,ariaDescribedById:{draggable:Ue},dispatch:m,draggableNodes:b,over:Z,measureDroppableContainers:Oe}),[q,St,V,U,m,Ue,b,Z,Oe]);return X.createElement(Ut.Provider,{value:y},X.createElement(je.Provider,{value:fn},X.createElement(rn.Provider,{value:dn},X.createElement(on.Provider,{value:cn},u)),X.createElement(Cr,{disabled:a?.restoreFocus===!1})),X.createElement(En,{...a,hiddenTextDescribedById:Ue}));function hn(){const L=lt?.autoScrollEnabled===!1,z=typeof c=="object"?c.enabled===!1:c===!1,P=R&&!L&&!z;return typeof c=="object"?{...c,enabled:P}:{enabled:P}}}),Mr=s.createContext(null),Ft="button",Ar="Draggable";function Fr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e(Ar),{activators:l,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:v}=s.useContext(je),{role:h=Ft,roleDescription:C="draggable",tabIndex:g=0}=o??{},p=c?.id===t,m=s.useContext(p?on:Mr),[D,y]=ke(),[N,S]=ke(),R=hr(l,t),w=Se(n);re(()=>(d.set(t,{id:t,key:i,node:D,activatorNode:N,data:w}),()=>{const M=d.get(t);M&&M.key===i&&d.delete(t)}),[d,t]);const b=s.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":p&&h===Ft?!0:void 0,"aria-roledescription":C,"aria-describedby":f.draggable}),[r,h,g,p,C,f.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:b,isDragging:p,listeners:r?void 0:R,node:D,over:v,setNodeRef:y,setActivatorNodeRef:S,transform:m}}function $r(){return s.useContext(rn)}const Or="Droppable",Tr={timeout:25};function Xr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(Or),{active:l,dispatch:a,over:c,measureDroppableContainers:u}=s.useContext(je),f=s.useRef({disabled:n}),d=s.useRef(!1),v=s.useRef(null),h=s.useRef(null),{disabled:C,updateMeasurementsFor:g,timeout:p}={...Tr,...o},m=Se(g??r),D=s.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(m.current)?m.current:[m.current]),h.current=null},p)},[p]),y=Xe({callback:D,disabled:C||!l}),N=s.useCallback((b,M)=>{y&&(M&&(y.unobserve(M),d.current=!1),b&&y.observe(b))},[y]),[S,R]=ke(N),w=Se(t);return s.useEffect(()=>{!y||!S.current||(y.disconnect(),d.current=!1,y.observe(S.current))},[S,y]),s.useEffect(()=>(a({type:E.RegisterDroppable,element:{id:r,key:i,disabled:n,node:S,rect:v,data:w}}),()=>a({type:E.UnregisterDroppable,key:i,id:r})),[r]),s.useEffect(()=>{n!==f.current.disabled&&(a({type:E.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,a]),{active:l,rect:v,isOver:c?.id===r,node:S,over:c,setNodeRef:R}}export{Rt as C,Br as D,x as K,en as P,Ir as a,Xr as b,Fr as c,Pr as d,it as e,$r as f,An as g,$e as h,re as i,Lr as j,jt as k,Ae as l,_t as m,zr as n,ze as s,kr as u};
6
+ //# sourceMappingURL=core.esm-C9QlSrgK.js.map
@@ -1,2 +1,2 @@
1
- import{c as A,r as t,j as e,cU as I,T as g,U as F,f5 as P,bT as R,B as L,i as T,e8 as $,hW as E,hX as M,jK as B}from"./index-CdDNNAx2.js";import{u as D,c as H,f as K}from"./agent-skill-context-r0O0BVOu.js";import{A as Q,a as U}from"./agent-subpage-shell-C2KpYdu3.js";import{a as k}from"./skill-route-key-sF006xiz.js";import"./core.esm-CJUp2aNZ.js";import"./skill-editor-D_W3QlRz.js";function X({owner:a,agentId:l}){const r=A(),[o,x]=t.useState(""),[p,c]=t.useState(!1),[n,f]=t.useState(""),[u,j]=t.useState(""),{skillRows:m,catalog:d,isLoading:S,addSkillFromCatalog:C,addCustomSkill:v}=D(),h=t.useMemo(()=>new Set(m.map(s=>s.repo)),[m]),i=t.useMemo(()=>H(d?.catalog??[],h),[d?.catalog,h]),N=t.useMemo(()=>K(i,o),[i,o]),w=s=>{C(s),r({to:"/$owner/agents/$agentId",params:{owner:a,agentId:l},search:{skill:k(s)},hash:"skills"})},y=()=>{const s=v({name:n,instructions:u});s&&r({to:"/$owner/agents/$agentId",params:{owner:a,agentId:l},search:{skill:k(s)},hash:"skills"})},b=e.jsx(Q,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."});return e.jsxs("div",{className:"space-y-6",children:[b,e.jsx("div",{className:T($,"w-full"),children:p?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(F,{id:"custom-skill-name",value:n,onChange:s=>f(s.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:u,onChange:s=>j(s.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(R,{onCancel:()=>c(!1),children:e.jsx(L,{type:"button",size:"sm",onClick:y,disabled:!n.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>c(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(I,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),S?e.jsx(E,{}):e.jsx(M,{items:N,searchQuery:o,onSearchChange:x,onSelect:s=>w(s.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:o.trim()?`No skills match "${o}"`:i.length===0?"All catalog skills are already configured":"No skills available"})]})}function z({owner:a,agentId:l}){return e.jsx(U,{children:e.jsx(X,{owner:a,agentId:l})})}function V(){const{owner:a,agentId:l}=B.useParams();return e.jsx(z,{owner:a,agentId:l})}export{V as component};
2
- //# sourceMappingURL=create-DUlRsFNn.js.map
1
+ import{c as A,r as t,j as e,dg as I,Z as h,$ as F,f3 as P,bR as R,B as $,i as L,e6 as E,hS as M,hT as T,jG as B}from"./index-DByaMzsG.js";import{u as D,c as H,f as Q}from"./agent-skill-context-D1nMrVod.js";import{A as z,a as G}from"./agent-subpage-shell-2w7vTeXw.js";import{a as k}from"./skill-route-key-sF006xiz.js";import"./core.esm-C9QlSrgK.js";import"./skill-editor-D_W3QlRz.js";function K({owner:a,agentId:l}){const r=A(),[o,x]=t.useState(""),[p,c]=t.useState(!1),[n,f]=t.useState(""),[u,j]=t.useState(""),{skillRows:m,catalog:d,isLoading:S,addSkillFromCatalog:C,addCustomSkill:v}=D(),g=t.useMemo(()=>new Set(m.map(s=>s.repo)),[m]),i=t.useMemo(()=>H(d?.catalog??[],g),[d?.catalog,g]),N=t.useMemo(()=>Q(i,o),[i,o]),w=s=>{C(s),r({to:"/$owner/agents/$agentId",params:{owner:a,agentId:l},search:{skill:k(s)},hash:"skills"})},y=()=>{const s=v({name:n,instructions:u});s&&r({to:"/$owner/agents/$agentId",params:{owner:a,agentId:l},search:{skill:k(s)},hash:"skills"})},b=e.jsx(z,{title:"Add a skill",description:"Skills bundle instructions, tools, and knowledge an agent can reuse. Pick one from the catalog or create your own."});return e.jsxs("div",{className:"space-y-6",children:[b,e.jsx("div",{className:L(E,"w-full"),children:p?e.jsxs("div",{className:"space-y-3 p-3",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(h,{htmlFor:"custom-skill-name",children:"Name"}),e.jsx(F,{id:"custom-skill-name",value:n,onChange:s=>f(s.target.value),placeholder:"my-skill"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(h,{htmlFor:"custom-skill-instructions",children:"Instructions"}),e.jsx(P,{id:"custom-skill-instructions",value:u,onChange:s=>j(s.target.value),placeholder:"Instructions for the agent when this skill is active...",rows:3})]})]}),e.jsx(R,{onCancel:()=>c(!1),children:e.jsx($,{type:"button",size:"sm",onClick:y,disabled:!n.trim(),children:"Add custom skill"})})]}):e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-3 text-left text-muted-foreground transition-colors hover:text-foreground",onClick:()=>c(!0),children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted",children:e.jsx(I,{className:"h-4 w-4"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Create custom skill"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Define instructions and packages"})]})]})}),S?e.jsx(M,{}):e.jsx(T,{items:N,searchQuery:o,onSearchChange:x,onSelect:s=>w(s.key),searchPlaceholder:"Search skills...",searchAriaLabel:"Search skills",emptyMessage:o.trim()?`No skills match "${o}"`:i.length===0?"All catalog skills are already configured":"No skills available"})]})}function O({owner:a,agentId:l}){return e.jsx(G,{children:e.jsx(K,{owner:a,agentId:l})})}function V(){const{owner:a,agentId:l}=B.useParams();return e.jsx(O,{owner:a,agentId:l})}export{V as component};
2
+ //# sourceMappingURL=create-ASRN3Obq.js.map
@@ -0,0 +1,2 @@
1
+ import{c as h,hd as G,iZ as b,i_ as L,i6 as v,j as t,dv as y,by as r,jH as w}from"./index-DByaMzsG.js";import{A as S,v as N,a as P}from"./custom-guardrail-edits-BUL7nmuO.js";import{A as $,a as F}from"./agent-subpage-shell-2w7vTeXw.js";import"./model-selector-D3vSMLO2.js";function R({owner:e,agentId:a}){const i=h(),{data:n,isLoading:c}=G(a),{data:m,isLoading:p}=b(a),{data:o=null,isLoading:f}=L(a),C=c||p||f,u=v(a),g=n?.guardrailsInline??[],A=(m??[]).map(s=>s.name),j=async s=>{if(!n){r.error("Still loading agent settings — try again in a moment");return}const d=N(s,g,A,o);if(d){r.error(d);return}try{await u.mutateAsync({guardrailsInline:P(g,s)}),r.success("Guardrail created"),i({to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},hash:"guardrails"})}catch(l){r.error(l instanceof Error?l.message:"Failed to create guardrail")}},x=()=>void i({to:"/$owner/agents/$agentId",params:{owner:e,agentId:a},hash:"guardrails"});return t.jsxs("div",{className:"space-y-6",children:[t.jsx($,{title:"New custom guardrail",description:"A custom guardrail judges text at one stage against a policy you write."}),C?t.jsx(y,{rows:4}):t.jsx(S,{judgeModelDefault:o,submitLabel:"Create guardrail",submitting:u.isPending,onSubmit:j,onCancel:x})]})}function D({owner:e,agentId:a}){return t.jsx(F,{children:t.jsx(R,{owner:e,agentId:a})})}function M(){const{owner:e,agentId:a}=w.useParams();return t.jsx(D,{owner:e,agentId:a})}export{M as component};
2
+ //# sourceMappingURL=create-CBcodaSO.js.map
@@ -0,0 +1,2 @@
1
+ import{j as n,aS as t,O as c,cK as r,au as i,dr as l,bd as d,ds as m,L as x,dt as u,du as C,dv as j}from"./index-DByaMzsG.js";function g({owner:o,initialConnectorKey:e}){return n.jsx(t,{owner:o,children:a=>n.jsx(h,{ownerSlug:a.ownerSlug,organizationId:a.organizationId,initialConnectorKey:e})})}function h({ownerSlug:o,organizationId:e,initialConnectorKey:a}){const{data:s=[]}=r(e??"");return n.jsxs(i,{className:"flex flex-1 flex-col gap-6",children:[n.jsx(l,{breadcrumb:n.jsx(m,{crumbs:[n.jsx(x,{to:"/$owner/connectors",params:{owner:o},search:{},className:u,children:"Connectors"},"connectors")]}),icon:n.jsx(d.connectors.icon,{className:"h-6 w-6"}),title:"Add a connection",caption:"Pick a connector from the catalog or drop in an MCP URL — Lobu handles auth and brings the data into memory."}),e?n.jsx(C,{ownerSlug:o,organizationId:e,connections:s,initialConnectorKey:a},a??"catalog"):n.jsx("div",{className:"max-w-3xl",children:n.jsx(j,{rows:4})})]})}const S=()=>n.jsx(c,{});export{g as ConnectionsCreateRouteContent,S as component};
2
+ //# sourceMappingURL=create-CGOWfMk4.js.map