@compill/admin 1.0.28 → 1.0.30

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 (70) hide show
  1. package/index.d.ts +44 -44
  2. package/index.js +10 -240
  3. package/index.mjs +3323 -40485
  4. package/index.umd.js +10 -240
  5. package/lib/SectionTitle.d.ts +2 -2
  6. package/lib/breadcrumbs/BreadCrumbs.d.ts +2 -2
  7. package/lib/buttons/DialogButton.d.ts +4 -3
  8. package/lib/buttons/IconButton.d.ts +2 -2
  9. package/lib/buttons/InvalidateButton.d.ts +2 -2
  10. package/lib/buttons/NavigateButton.d.ts +2 -2
  11. package/lib/buttons/PublishButton.d.ts +2 -2
  12. package/lib/buttons/UpdateButton.d.ts +2 -2
  13. package/lib/buttons/ViewButton.d.ts +2 -2
  14. package/lib/json/DetailsView.d.ts +3 -3
  15. package/lib/json/EditItemView.d.ts +2 -2
  16. package/lib/json/MultiQueryWrapper.d.ts +3 -3
  17. package/lib/json/QueryWrapper.d.ts +3 -3
  18. package/lib/json/ScreenRenderer.d.ts +3 -3
  19. package/lib/json/ScreenTopBar.d.ts +3 -3
  20. package/lib/json/TabbedView.d.ts +3 -3
  21. package/lib/json/buttons/ActionButton.d.ts +2 -2
  22. package/lib/json/buttons/ConfirmationActionButton.d.ts +2 -2
  23. package/lib/json/dialog/DialogRenderer.d.ts +4 -4
  24. package/lib/json/dialog/ItemDeleteDialog.d.ts +2 -2
  25. package/lib/json/dialog/ItemEditDialog.d.ts +6 -5
  26. package/lib/json/dialog/MultiQueryWrapperDialog.d.ts +2 -2
  27. package/lib/json/dialog/QueryWrapperDialog.d.ts +3 -3
  28. package/lib/json/table/TableRowActionsView.d.ts +2 -2
  29. package/lib/json/table/TableRowPublishPostButton.d.ts +2 -2
  30. package/lib/json/table/TableView.d.ts +3 -3
  31. package/lib/json/table/TableViewContext.d.ts +5 -4
  32. package/lib/json/table/useTableProps.d.ts +2 -1
  33. package/lib/json/types/DetailsView.d.ts +3 -3
  34. package/lib/json/types/EditItemDialog.d.ts +2 -1
  35. package/lib/json/types/MultiQueryWrapper.d.ts +4 -3
  36. package/lib/json/types/MultiQueryWrapperDialog.d.ts +2 -1
  37. package/lib/json/types/QueryWrapper.d.ts +4 -3
  38. package/lib/json/types/QueryWrapperDialog.d.ts +2 -1
  39. package/lib/json/types/ScreenConfig.d.ts +7 -6
  40. package/lib/json/types/TabbedView.d.ts +6 -6
  41. package/lib/json/types/TableView.d.ts +9 -9
  42. package/lib/modal/AttachDialog.d.ts +4 -4
  43. package/lib/modal/FormActionDialog.d.ts +6 -5
  44. package/lib/modal/ItemEditDialog.d.ts +5 -4
  45. package/lib/page/PageContainer.d.ts +2 -2
  46. package/lib/page/PageContentEditor.d.ts +2 -2
  47. package/lib/page/PageMain.d.ts +2 -2
  48. package/lib/page/PageQueryStateContainer.d.ts +3 -2
  49. package/lib/page/PageSectionTitle.d.ts +2 -2
  50. package/lib/page/PageSidebar.d.ts +2 -2
  51. package/lib/page/PageSidebarSection.d.ts +2 -2
  52. package/lib/page/PageStateContainer.d.ts +3 -2
  53. package/lib/page/PageSubSectionTitle.d.ts +2 -2
  54. package/lib/page/PageTitle.d.ts +2 -2
  55. package/lib/page/PageTopBar.d.ts +4 -3
  56. package/lib/status/StatusBadge.d.ts +2 -2
  57. package/lib/table/TableContainer.d.ts +3 -3
  58. package/lib/table/TableContainerContext.d.ts +3 -2
  59. package/lib/table/TableCreateButton.d.ts +2 -2
  60. package/lib/table/TableFilterButton.d.ts +2 -2
  61. package/lib/table/TableFilters.d.ts +1 -1
  62. package/lib/table/TableMassActions.d.ts +2 -2
  63. package/lib/table/TableRowActionBar.d.ts +2 -2
  64. package/lib/table/TableRowDeleteButton.d.ts +2 -2
  65. package/lib/table/TableRowEditButton.d.ts +2 -2
  66. package/lib/table/TableRowNavigateButton.d.ts +2 -2
  67. package/lib/table/TableRowPublishPostButton.d.ts +2 -2
  68. package/lib/table/TableRowViewButton.d.ts +2 -2
  69. package/lib/table/TableTopBar.d.ts +2 -2
  70. package/package.json +1 -1
package/index.umd.js CHANGED
@@ -1,227 +1,12 @@
1
- (function(Ae,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("@soperio/jsx-runtime"),require("@valerya/ui"),require("react/jsx-runtime"),require("react"),require("@compill/api"),require("react-router-dom"),require("@soperio/react"),require("formik"),require("react-dom"),require("@tanstack/react-query")):typeof define=="function"&&define.amd?define(["exports","@soperio/jsx-runtime","@valerya/ui","react/jsx-runtime","react","@compill/api","react-router-dom","@soperio/react","formik","react-dom","@tanstack/react-query"],y):(Ae=typeof globalThis<"u"?globalThis:Ae||self,y(Ae.admin={},Ae.jsxRuntime,Ae.ui,Ae.require$$2$1,Ae.React,Ae.api,Ae.reactRouterDom,Ae.react$1,Ae.formik,Ae.require$$3,Ae.reactQuery))})(this,function(Ae,y,N,Ei,T,Re,Qt,Fe,Xe,Mo,Dg){"use strict";var v$=Object.defineProperty;var b$=(Ae,y,N)=>y in Ae?v$(Ae,y,{enumerable:!0,configurable:!0,writable:!0,value:N}):Ae[y]=N;var z_=(Ae,y,N)=>(b$(Ae,typeof y!="symbol"?y+"":y,N),N);function W_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Wr=W_(T);function K_({children:t,...e}){return y.jsx("h2",{textSize:"xl",fontWeight:"600",textColor:"slate-800",...e,children:t})}var G_="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M12,17L17,12H14V8H10V12H7L12,17Z",J_="M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M12,7L7,12H10V16H14V12H17L12,7Z",eu="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",X_="M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z",Y_="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z",Q_="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",Z_="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",ex="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",Ng="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",tx="M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z",Rg="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",Fg="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",nx="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",rx="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",ox="M6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.03C18.17 12 18.33 12 18.5 12C19 12 19.5 12.07 20 12.18V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.17 21 12.33 21 12.5 21C12.24 20.37 12.09 19.7 12.03 19L12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.17 16 12.34 16 12.5 16C12.85 15.18 13.34 14.46 13.95 13.86C13.32 13.95 12.67 14 12 14C9.58 14 7.3 13.4 6 12.45M12 5C15.87 5 18 6.5 18 7S15.87 9 12 9 6 7.5 6 7 8.13 5 12 5M18 18.5L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5S16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5S15.79 14.5 18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18Z",tu="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",nu="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",ix="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",sx="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",ax="M16.5,12C19,12 21,14 21,16.5C21,17.38 20.75,18.21 20.31,18.9L23.39,22L22,23.39L18.88,20.32C18.19,20.75 17.37,21 16.5,21C14,21 12,19 12,16.5C12,14 14,12 16.5,12M16.5,14A2.5,2.5 0 0,0 14,16.5A2.5,2.5 0 0,0 16.5,19A2.5,2.5 0 0,0 19,16.5A2.5,2.5 0 0,0 16.5,14M9,4L11,6H19A2,2 0 0,1 21,8V11.81C19.83,10.69 18.25,10 16.5,10A6.5,6.5 0 0,0 10,16.5C10,17.79 10.37,19 11,20H3C1.89,20 1,19.1 1,18V6C1,4.89 1.89,4 3,4H9Z",lx="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z",cx="M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z",ux="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z",Hg="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z",Bg="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M22,20V22H14.5V20H22Z",Vg="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M2,20H13V22H2V20Z",$g="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",jg="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z",zg="M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z",dx="M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z",fx="M9.6,14L12,7.7L14.4,14M11,5L5.5,19H7.7L8.8,16H15L16.1,19H18.3L13,5H11Z",hx="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z",px="M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z",gx="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",mx="M21 17.2L6.8 3H19C20.1 3 21 3.9 21 5V17.2M20.7 22L19.7 21H5C3.9 21 3 20.1 3 19V4.3L2 3.3L3.3 2L22 20.7L20.7 22M16.8 18L12.9 14.1L11 16.5L8.5 13.5L5 18H16.8Z",yx="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z",vx="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",ru="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",Ug="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",bx="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",wx="M3 3V21H21V3H3M18 18H6V17H18V18M18 16H6V15H18V16M18 12H6V6H18V12Z",qg="M5,4V6H19V4H5M5,14H9V20H15V14H19L12,7L5,14Z",Wg="M20.8 22.7L15 16.9V20H9V14H5L8.6 10.4L1.1 3L2.4 1.7L22.1 21.4L20.8 22.7M19 6V4H7.2L9.2 6H19M17.2 14H19L12 7L11.1 7.9L17.2 14Z",Kg="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",Sx="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",Cx="M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",Ex="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",Gg="M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z",_x="M16,15H9V13H16V15M19,11H9V9H19V11M19,7H9V5H19V7M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3M21,1A2,2 0 0,1 23,3V17C23,18.11 22.11,19 21,19H7A2,2 0 0,1 5,17V3C5,1.89 5.89,1 7,1H21M7,3V17H21V3H7Z",Jg="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",xx="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z";function Xg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ax(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var ou={exports:{}},Ft={};Ft._=Ft._interop_require_default=Tx;function Tx(t){return t&&t.__esModule?t:{default:t}}var zs={exports:{}},iu={},Yg;function Us(){return Yg||(Yg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}});function n(s){const a={};return s.forEach((l,c)=>{typeof a[c]>"u"?a[c]=l:Array.isArray(a[c])?a[c].push(l):a[c]=[a[c],l]}),a}function r(s){return typeof s=="string"||typeof s=="number"&&!isNaN(s)||typeof s=="boolean"?String(s):""}function o(s){const a=new URLSearchParams;return Object.entries(s).forEach(l=>{let[c,u]=l;Array.isArray(u)?u.forEach(d=>a.append(c,r(d))):a.set(c,r(u))}),a}function i(s){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return l.forEach(u=>{Array.from(u.keys()).forEach(d=>s.delete(d)),u.forEach((d,h)=>s.append(h,d))}),s}}(iu)),iu}var su={},qs={},Qg;function _i(){if(Qg)return qs;Qg=1;function t(n){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(t=function(i){return i?o:r})(n)}qs._=qs._interop_require_wildcard=e;function e(n,r){if(!r&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var o=t(r);if(o&&o.has(n))return o.get(n);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var l=s?Object.getOwnPropertyDescriptor(n,a):null;l&&(l.get||l.set)?Object.defineProperty(i,a,l):i[a]=n[a]}return i.default=n,o&&o.set(n,i),i}return qs}var Zg;function au(){return Zg||(Zg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{formatUrl:function(){return i},formatWithValidation:function(){return a},urlObjectKeys:function(){return s}});const r=_i()._(Us()),o=/https?|ftp|gopher|file/;function i(l){let{auth:c,hostname:u}=l,d=l.protocol||"",h=l.pathname||"",f=l.hash||"",p=l.query||"",g=!1;c=c?encodeURIComponent(c).replace(/%3A/i,":")+"@":"",l.host?g=c+l.host:u&&(g=c+(~u.indexOf(":")?"["+u+"]":u),l.port&&(g+=":"+l.port)),p&&typeof p=="object"&&(p=String(r.urlQueryToSearchParams(p)));let m=l.search||p&&"?"+p||"";return d&&!d.endsWith(":")&&(d+=":"),l.slashes||(!d||o.test(d))&&g!==!1?(g="//"+(g||""),h&&h[0]!=="/"&&(h="/"+h)):g||(g=""),f&&f[0]!=="#"&&(f="#"+f),m&&m[0]!=="?"&&(m="?"+m),h=h.replace(/[?#]/g,encodeURIComponent),m=m.replace("#","%23"),""+d+g+h+m+f}const s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(l){return process.env.NODE_ENV==="development"&&l!==null&&typeof l=="object"&&Object.keys(l).forEach(c=>{s.includes(c)||console.warn("Unknown key passed via urlObject into url.format: "+c)}),i(l)}}(su)),su}var lu={},em;function tm(){return em||(em=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return e}});function e(n,r){const o={};return Object.keys(n).forEach(i=>{r.includes(i)||(o[i]=n[i])}),o}}(lu)),lu}var cu={},nm;function Po(){return nm||(nm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(b,S){for(var E in S)Object.defineProperty(b,E,{enumerable:!0,get:S[E]})}e(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return C},MissingStaticPage:function(){return v},NormalizeError:function(){return g},PageNotFoundError:function(){return m},SP:function(){return h},ST:function(){return f},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return l},getLocationOrigin:function(){return s},getURL:function(){return a},isAbsoluteUrl:function(){return i},isResSent:function(){return c},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return w}});const n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(b){let S=!1,E;return function(){for(var x=arguments.length,_=new Array(x),A=0;A<x;A++)_[A]=arguments[A];return S||(S=!0,E=b(..._)),E}}const o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=b=>o.test(b);function s(){const{protocol:b,hostname:S,port:E}=window.location;return b+"//"+S+(E?":"+E:"")}function a(){const{href:b}=window.location,S=s();return b.substring(S.length)}function l(b){return typeof b=="string"?b:b.displayName||b.name||"Unknown"}function c(b){return b.finished||b.headersSent}function u(b){const S=b.split("?");return S[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(S[1]?"?"+S.slice(1).join("?"):"")}async function d(b,S){if(process.env.NODE_ENV!=="production"){var E;if((E=b.prototype)!=null&&E.getInitialProps){const A='"'+l(b)+'.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';throw new Error(A)}}const x=S.res||S.ctx&&S.ctx.res;if(!b.getInitialProps)return S.ctx&&S.Component?{pageProps:await d(S.Component,S.ctx)}:{};const _=await b.getInitialProps(S);if(x&&c(x))return _;if(!_){const A='"'+l(b)+'.getInitialProps()" should resolve to an object. But found "'+_+'" instead.';throw new Error(A)}return process.env.NODE_ENV!=="production"&&Object.keys(_).length===0&&!S.ctx&&console.warn(""+l(b)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),_}const h=typeof performance<"u",f=h&&["mark","measure","getEntriesByName"].every(b=>typeof performance[b]=="function");class p extends Error{}class g extends Error{}class m extends Error{constructor(S){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+S}}class v extends Error{constructor(S,E){super(),this.message="Failed to load static file for page: "+S+" "+E}}class C extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(b){return JSON.stringify({message:b.message,stack:b.stack})}}(cu)),cu}var Ws={exports:{}},uu={},rm;function xi(){return rm||(rm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\/$/,"")||"/"}}(uu)),uu}var du={},om;function Io(){return om||(om=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return e}});function e(n){const r=n.indexOf("#"),o=n.indexOf("?"),i=o>-1&&(r<0||o<r);return i||r>-1?{pathname:n.substring(0,i?o:r),query:i?n.substring(o,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(du)),du}var im;function Ks(){return im||(im=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});const n=xi(),r=Io(),o=i=>{if(!i.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return i;const{pathname:s,query:a,hash:l}=(0,r.parsePath)(i);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(s)?""+(0,n.removeTrailingSlash)(s)+a+l:s.endsWith("/")?""+s+a+l:s+"/"+a+l:""+(0,n.removeTrailingSlash)(s)+a+l};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ws,Ws.exports)),Ws.exports}var fu={},Gs={exports:{}},hu={},sm;function Js(){return sm||(sm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const e=Io();function n(r,o){if(typeof r!="string")return!1;const{pathname:i}=(0,e.parsePath)(r);return i===o||i.startsWith(o+"/")}}(hu)),hu}var am;function pu(){return am||(am=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"hasBasePath",{enumerable:!0,get:function(){return o}});const n=Js(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return(0,n.pathHasPrefix)(i,r)}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Gs,Gs.exports)),Gs.exports}var lm;function gu(){return lm||(lm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return r}});const e=Po(),n=pu();function r(o){if(!(0,e.isAbsoluteUrl)(o))return!0;try{const i=(0,e.getLocationOrigin)(),s=new URL(o,i);return s.origin===i&&(0,n.hasBasePath)(s.pathname)}catch{return!1}}}(fu)),fu}var mu={},yu={},cm;function Ox(){return cm||(cm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class e{insert(o){this._insert(o.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(o){o===void 0&&(o="/");const i=[...this.children.keys()].sort();this.slugName!==null&&i.splice(i.indexOf("[]"),1),this.restSlugName!==null&&i.splice(i.indexOf("[...]"),1),this.optionalRestSlugName!==null&&i.splice(i.indexOf("[[...]]"),1);const s=i.map(a=>this.children.get(a)._smoosh(""+o+a+"/")).reduce((a,l)=>[...a,...l],[]);if(this.slugName!==null&&s.push(...this.children.get("[]")._smoosh(o+"["+this.slugName+"]/")),!this.placeholder){const a=o==="/"?"/":o.slice(0,-1);if(this.optionalRestSlugName!=null)throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("'+a+'" and "'+a+"[[..."+this.optionalRestSlugName+']]").');s.unshift(a)}return this.restSlugName!==null&&s.push(...this.children.get("[...]")._smoosh(o+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&s.push(...this.children.get("[[...]]")._smoosh(o+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(o,i,s){if(o.length===0){this.placeholder=!1;return}if(s)throw new Error("Catch-all must be the last part of the URL.");let a=o[0];if(a.startsWith("[")&&a.endsWith("]")){let u=function(d,h){if(d!==null&&d!==h)throw new Error("You cannot use different slug names for the same dynamic path ('"+d+"' !== '"+h+"').");i.forEach(f=>{if(f===h)throw new Error('You cannot have the same slug name "'+h+'" repeat within a single dynamic path');if(f.replace(/\W/g,"")===a.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+f+'" and "'+h+'" differ only by non-word symbols within a single dynamic path')}),i.push(h)},l=a.slice(1,-1),c=!1;if(l.startsWith("[")&&l.endsWith("]")&&(l=l.slice(1,-1),c=!0),l.startsWith("...")&&(l=l.substring(3),s=!0),l.startsWith("[")||l.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+l+"').");if(l.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+l+"').");if(s)if(c){if(this.restSlugName!=null)throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+o[0]+'" ).');u(this.optionalRestSlugName,l),this.optionalRestSlugName=l,a="[[...]]"}else{if(this.optionalRestSlugName!=null)throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+o[0]+'").');u(this.restSlugName,l),this.restSlugName=l,a="[...]"}else{if(c)throw new Error('Optional route parameters are not yet supported ("'+o[0]+'").');u(this.slugName,l),this.slugName=l,a="[]"}}this.children.has(a)||this.children.set(a,new e),this.children.get(a)._insert(o.slice(1),i,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(r){const o=new e;return r.forEach(i=>o.insert(i)),o.smoosh()}}(yu)),yu}var vu={},bu={},wu={},Su={},um;function kx(){return um||(um=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.startsWith("/")?n:"/"+n}}(Su)),Su}var Cu={},dm;function Mx(){return dm||(dm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});function n(i){return i[0]==="("&&i.endsWith(")")}const r="__PAGE__",o="__DEFAULT__"}(Cu)),Cu}var fm;function Px(){return fm||(fm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return i}});const n=kx(),r=Mx();function o(s){return(0,n.ensureLeadingSlash)(s.split("/").reduce((a,l,c,u)=>!l||(0,r.isGroupSegment)(l)||l[0]==="@"||(l==="page"||l==="route")&&c===u.length-1?a:a+"/"+l,""))}function i(s){return s.replace(/\.rsc($|\?)/,"$1")}}(wu)),wu}var hm;function Eu(){return hm||(hm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{INTERCEPTION_ROUTE_MARKERS:function(){return r},extractInterceptionRouteInformation:function(){return i},isInterceptionRouteAppPath:function(){return o}});const n=Px(),r=["(..)(..)","(.)","(..)","(...)"];function o(s){return s.split("/").find(a=>r.find(l=>a.startsWith(l)))!==void 0}function i(s){let a,l,c;for(const u of s.split("/"))if(l=r.find(d=>u.startsWith(d)),l){[a,c]=s.split(l,2);break}if(!a||!l||!c)throw new Error(`Invalid interception route: ${s}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(a=(0,n.normalizeAppPath)(a),l){case"(.)":a==="/"?c=`/${c}`:c=a+"/"+c;break;case"(..)":if(a==="/")throw new Error(`Invalid interception route: ${s}. Cannot use (..) marker at the root level, use (.) instead.`);c=a.split("/").slice(0,-1).concat(c).join("/");break;case"(...)":c="/"+c;break;case"(..)(..)":const u=a.split("/");if(u.length<=2)throw new Error(`Invalid interception route: ${s}. Cannot use (..)(..) marker at the root level or one level up.`);c=u.slice(0,-2).concat(c).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:a,interceptedRoute:c}}}(bu)),bu}var pm;function gm(){return pm||(pm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return r}});const e=Eu(),n=/\/\[[^/]+?\](?=\/|$)/;function r(o){return(0,e.isInterceptionRouteAppPath)(o)&&(o=(0,e.extractInterceptionRouteInformation)(o).interceptedRoute),n.test(o)}}(vu)),vu}var mm;function ym(){return mm||(mm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});const n=Ox(),r=gm()}(mu)),mu}var _u={},xu={},vm;function bm(){return vm||(vm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return n}});const e=Po();function n(r){let{re:o,groups:i}=r;return s=>{const a=o.exec(s);if(!a)return!1;const l=u=>{try{return decodeURIComponent(u)}catch{throw new e.DecodeError("failed to decode param")}},c={};return Object.keys(i).forEach(u=>{const d=i[u],h=a[d.pos];h!==void 0&&(c[u]=~h.indexOf("/")?h.split("/").map(f=>l(f)):d.repeat?[l(h)]:l(h))}),c}}}(xu)),xu}var Au={},Tu={},wm;function Sm(){return wm||(wm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});const e=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function r(o){return e.test(o)?o.replace(n,"\\$&"):o}}(Tu)),Tu}var Cm;function Em(){return Cm||(Cm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(g,m){for(var v in m)Object.defineProperty(g,v,{enumerable:!0,get:m[v]})}e(t,{getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return c},parseParameter:function(){return a}});const n=Eu(),r=Sm(),o=xi(),i="nxtP",s="nxtI";function a(g){const m=g.startsWith("[")&&g.endsWith("]");m&&(g=g.slice(1,-1));const v=g.startsWith("...");return v&&(g=g.slice(3)),{key:g,repeat:v,optional:m}}function l(g){const m=(0,o.removeTrailingSlash)(g).slice(1).split("/"),v={};let C=1;return{parameterizedRoute:m.map(w=>{const b=n.INTERCEPTION_ROUTE_MARKERS.find(E=>w.startsWith(E)),S=w.match(/\[((?:\[.*\])|.+)\]/);if(b&&S){const{key:E,optional:x,repeat:_}=a(S[1]);return v[E]={pos:C++,repeat:_,optional:x},"/"+(0,r.escapeStringRegexp)(b)+"([^/]+?)"}else if(S){const{key:E,repeat:x,optional:_}=a(S[1]);return v[E]={pos:C++,repeat:x,optional:_},x?_?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,r.escapeStringRegexp)(w)}).join(""),groups:v}}function c(g){const{parameterizedRoute:m,groups:v}=l(g);return{re:new RegExp("^"+m+"(?:/)?$"),groups:v}}function u(){let g=0;return()=>{let m="",v=++g;for(;v>0;)m+=String.fromCharCode(97+(v-1)%26),v=Math.floor((v-1)/26);return m}}function d(g){let{interceptionMarker:m,getSafeRouteKey:v,segment:C,routeKeys:w,keyPrefix:b}=g;const{key:S,optional:E,repeat:x}=a(C);let _=S.replace(/\W/g,"");b&&(_=""+b+_);let A=!1;(_.length===0||_.length>30)&&(A=!0),isNaN(parseInt(_.slice(0,1)))||(A=!0),A&&(_=v()),b?w[_]=""+b+S:w[_]=S;const O=m?(0,r.escapeStringRegexp)(m):"";return x?E?"(?:/"+O+"(?<"+_+">.+?))?":"/"+O+"(?<"+_+">.+?)":"/"+O+"(?<"+_+">[^/]+?)"}function h(g,m){const v=(0,o.removeTrailingSlash)(g).slice(1).split("/"),C=u(),w={};return{namedParameterizedRoute:v.map(b=>{const S=n.INTERCEPTION_ROUTE_MARKERS.some(x=>b.startsWith(x)),E=b.match(/\[((?:\[.*\])|.+)\]/);if(S&&E){const[x]=b.split(E[0]);return d({getSafeRouteKey:C,interceptionMarker:x,segment:E[1],routeKeys:w,keyPrefix:m?s:void 0})}else return E?d({getSafeRouteKey:C,segment:E[1],routeKeys:w,keyPrefix:m?i:void 0}):"/"+(0,r.escapeStringRegexp)(b)}).join(""),routeKeys:w}}function f(g,m){const v=h(g,m);return{...c(g),namedRegex:"^"+v.namedParameterizedRoute+"(?:/)?$",routeKeys:v.routeKeys}}function p(g,m){const{parameterizedRoute:v}=l(g),{catchAll:C=!0}=m;if(v==="/")return{namedRegex:"^/"+(C?".*":"")+"$"};const{namedParameterizedRoute:w}=h(g,!1);let b=C?"(?:(/.*)?)":"";return{namedRegex:"^"+w+b+"$"}}}(Au)),Au}var _m;function xm(){return _m||(_m=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return r}});const e=bm(),n=Em();function r(o,i,s){let a="";const l=(0,n.getRouteRegex)(o),c=l.groups,u=(i!==o?(0,e.getRouteMatcher)(l)(i):"")||s;a=o;const d=Object.keys(c);return d.every(h=>{let f=u[h]||"";const{repeat:p,optional:g}=c[h];let m="["+(p?"...":"")+h+"]";return g&&(m=(f?"":"/")+"["+m+"]"),p&&!Array.isArray(f)&&(f=[f]),(g||h in u)&&(a=a.replace(m,p?f.map(v=>encodeURIComponent(v)).join("/"):encodeURIComponent(f))||"/")})||(a=""),{params:d,result:a}}}(_u)),_u}var Am;function Tm(){return Am||(Am=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"resolveHref",{enumerable:!0,get:function(){return u}});const n=Us(),r=au(),o=tm(),i=Po(),s=Ks(),a=gu(),l=ym(),c=xm();function u(d,h,f){let p,g=typeof h=="string"?h:(0,r.formatWithValidation)(h);const m=g.match(/^[a-zA-Z]{1,}:\/\//),v=m?g.slice(m[0].length):g;if((v.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+g+"' passed to next/router in page: '"+d.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const w=(0,i.normalizeRepeatedSlashes)(v);g=(m?m[0]:"")+w}if(!(0,a.isLocalURL)(g))return f?[g]:g;try{p=new URL(g.startsWith("#")?d.asPath:d.pathname,"http://n")}catch{p=new URL("/","http://n")}try{const w=new URL(g,p);w.pathname=(0,s.normalizePathTrailingSlash)(w.pathname);let b="";if((0,l.isDynamicRoute)(w.pathname)&&w.searchParams&&f){const E=(0,n.searchParamsToUrlQuery)(w.searchParams),{result:x,params:_}=(0,c.interpolateAs)(w.pathname,w.pathname,E);x&&(b=(0,r.formatWithValidation)({pathname:x,hash:w.hash,query:(0,o.omit)(E,_)}))}const S=w.origin===p.origin?w.href.slice(w.origin.length):w.href;return f?[S,b||S]:S}catch{return f?[g]:g}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(zs,zs.exports)),zs.exports}var Xs={exports:{}},Ou={},ku={},Om;function Mu(){return Om||(Om=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return n}});const e=Io();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:i,query:s,hash:a}=(0,e.parsePath)(r);return""+o+i+s+a}}(ku)),ku}var km;function Mm(){return km||(km=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}});const e=Mu(),n=Js();function r(o,i,s,a){if(!i||i===s)return o;const l=o.toLowerCase();return!a&&((0,n.pathHasPrefix)(l,"/api")||(0,n.pathHasPrefix)(l,"/"+i.toLowerCase()))?o:(0,e.addPathPrefix)(o,"/"+i)}}(Ou)),Ou}var Pm;function Im(){return Pm||(Pm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const n=Ks(),r=function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];return process.env.__NEXT_I18N_SUPPORT?(0,n.normalizePathTrailingSlash)(Mm().addLocale(o,...s)):o};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Xs,Xs.exports)),Xs.exports}var Pu={},Lm;function Iu(){return Lm||(Lm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});const r=Ft._(T).default.createContext(null);process.env.NODE_ENV!=="production"&&(r.displayName="RouterContext")}(Pu)),Pu}var Lu={},Dm;function Ix(){return Dm||(Dm=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0});function e(c,u){for(var d in u)Object.defineProperty(c,d,{enumerable:!0,get:u[d]})}e(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return i},MissingSlotContext:function(){return l},TemplateContext:function(){return a}});const r=Ft._(T),o=r.default.createContext(null),i=r.default.createContext(null),s=r.default.createContext(null),a=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(o.displayName="AppRouterContext",i.displayName="LayoutRouterContext",s.displayName="GlobalLayoutRouterContext",a.displayName="TemplateContext");const l=r.default.createContext(new Set)}(Lu)),Lu}var Ys={exports:{}},Qs={exports:{}},Nm;function Du(){return Nm||(Nm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}n(e,{cancelIdleCallback:function(){return o},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(i){let s=Date.now();return self.setTimeout(function(){i({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-s))}})},1)},o=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(i){return clearTimeout(i)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Qs,Qs.exports)),Qs.exports}var Rm;function Lx(){return Rm||(Rm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIntersection",{enumerable:!0,get:function(){return c}});const n=T,r=Du(),o=typeof IntersectionObserver=="function",i=new Map,s=[];function a(u){const d={root:u.root||null,margin:u.rootMargin||""},h=s.find(m=>m.root===d.root&&m.margin===d.margin);let f;if(h&&(f=i.get(h),f))return f;const p=new Map,g=new IntersectionObserver(m=>{m.forEach(v=>{const C=p.get(v.target),w=v.isIntersecting||v.intersectionRatio>0;C&&w&&C(w)})},u);return f={id:d,observer:g,elements:p},s.push(d),i.set(d,f),f}function l(u,d,h){const{id:f,observer:p,elements:g}=a(h);return g.set(u,d),p.observe(u),function(){if(g.delete(u),p.unobserve(u),g.size===0){p.disconnect(),i.delete(f);const v=s.findIndex(C=>C.root===f.root&&C.margin===f.margin);v>-1&&s.splice(v,1)}}}function c(u){let{rootRef:d,rootMargin:h,disabled:f}=u;const p=f||!o,[g,m]=(0,n.useState)(!1),v=(0,n.useRef)(null),C=(0,n.useCallback)(b=>{v.current=b},[]);(0,n.useEffect)(()=>{if(o){if(p||g)return;const b=v.current;if(b&&b.tagName)return l(b,E=>E&&m(E),{root:d==null?void 0:d.current,rootMargin:h})}else if(!g){const b=(0,r.requestIdleCallback)(()=>m(!0));return()=>(0,r.cancelIdleCallback)(b)}},[p,h,d,g,v.current]);const w=(0,n.useCallback)(()=>{m(!1)},[]);return[C,g,w]}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ys,Ys.exports)),Ys.exports}var Zs={exports:{}},ea={exports:{}},Nu={},Fm;function ta(){return Fm||(Fm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(n,r){let o;const i=n.split("/");return(r||[]).some(s=>i[1]&&i[1].toLowerCase()===s.toLowerCase()?(o=s,i.splice(1,1),n=i.join("/")||"/",!0):!1),{pathname:n,detectedLocale:o}}}(Nu)),Nu}var Hm;function Dx(){return Hm||(Hm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const n=(r,o)=>process.env.__NEXT_I18N_SUPPORT?ta().normalizeLocalePath(r,o):{pathname:r,detectedLocale:void 0};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ea,ea.exports)),ea.exports}var na={exports:{}},Ru={},Bm;function Nx(){return Bm||(Bm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(n,r,o){if(n){o&&(o=o.toLowerCase());for(const a of n){var i,s;const l=(i=a.domain)==null?void 0:i.split(":",1)[0].toLowerCase();if(r===l||o===a.defaultLocale.toLowerCase()||(s=a.locales)!=null&&s.some(c=>c.toLowerCase()===o))return a}}}}(Ru)),Ru}var Vm;function $m(){return Vm||(Vm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return n}});const n=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(process.env.__NEXT_I18N_SUPPORT)return Nx().detectDomainLocale(...o)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(na,na.exports)),na.exports}var jm;function Rx(){return jm||(jm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDomainLocale",{enumerable:!0,get:function(){return o}});const n=Ks(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i,s,a,l){if(process.env.__NEXT_I18N_SUPPORT){const c=Dx().normalizeLocalePath,u=$m().detectDomainLocale,d=s||c(i,a).detectedLocale,h=u(l,void 0,d);if(h){const f="http"+(h.http?"":"s")+"://",p=d===h.defaultLocale?"":"/"+d;return""+f+h.domain+(0,n.normalizePathTrailingSlash)(""+r+p+i)}return!1}else return!1}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Zs,Zs.exports)),Zs.exports}var ra={exports:{}},zm;function Um(){return zm||(zm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addBasePath",{enumerable:!0,get:function(){return i}});const n=Mu(),r=Ks(),o=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s,a){return(0,r.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!a?s:(0,n.addPathPrefix)(s,o))}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ra,ra.exports)),ra.exports}var oa={exports:{}},qm;function Fx(){return qm||(qm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(f,p){for(var g in p)Object.defineProperty(f,g,{enumerable:!0,get:p[g]})}n(e,{ACTION_FAST_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return o},ACTION_PREFETCH:function(){return a},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return c},ACTION_SERVER_PATCH:function(){return s},PrefetchCacheEntryStatus:function(){return d},PrefetchKind:function(){return u},isThenable:function(){return h}});const r="refresh",o="navigate",i="restore",s="server-patch",a="prefetch",l="fast-refresh",c="server-action";var u;(function(f){f.AUTO="auto",f.FULL="full",f.TEMPORARY="temporary"})(u||(u={}));var d;(function(f){f.fresh="fresh",f.reusable="reusable",f.expired="expired",f.stale="stale"})(d||(d={}));function h(f){return f&&(typeof f=="object"||typeof f=="function")&&typeof f.then=="function"}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(oa,oa.exports)),oa.exports}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return E}});const n=Ft,r=Ei,o=n._(T),i=Tm(),s=gu(),a=au(),l=Po(),c=Im(),u=Iu(),d=Ix(),h=Lx(),f=Rx(),p=Um(),g=Fx(),m=new Set;function v(x,_,A,O,k,M){if(typeof window>"u"||!M&&!(0,s.isLocalURL)(_))return;if(!O.bypassPrefetchedCheck){const P=typeof O.locale<"u"?O.locale:"locale"in x?x.locale:void 0,F=_+"%"+A+"%"+P;if(m.has(F))return;m.add(F)}(async()=>M?x.prefetch(_,k):x.prefetch(_,A,O))().catch(P=>{if(process.env.NODE_ENV!=="production")throw P})}function C(x){const A=x.currentTarget.getAttribute("target");return A&&A!=="_self"||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.nativeEvent&&x.nativeEvent.which===2}function w(x,_,A,O,k,M,I,P,F){const{nodeName:z}=x.currentTarget;if(z.toUpperCase()==="A"&&(C(x)||!F&&!(0,s.isLocalURL)(A)))return;x.preventDefault();const J=()=>{const K=I??!0;"beforePopState"in _?_[k?"replace":"push"](A,O,{shallow:M,locale:P,scroll:K}):_[k?"replace":"push"](O||A,{scroll:K})};F?o.default.startTransition(J):J()}function b(x){return typeof x=="string"?x:(0,a.formatUrl)(x)}const E=o.default.forwardRef(function(_,A){let O;const{href:k,as:M,children:I,prefetch:P=null,passHref:F,replace:z,shallow:V,scroll:J,locale:K,onClick:R,onMouseEnter:Q,onTouchStart:se,legacyBehavior:ie=!1,...de}=_;O=I,ie&&(typeof O=="string"||typeof O=="number")&&(O=(0,r.jsx)("a",{children:O}));const ue=o.default.useContext(u.RouterContext),pe=o.default.useContext(d.AppRouterContext),D=ue??pe,ce=!ue,ye=P!==!1,be=P===null?g.PrefetchKind.AUTO:g.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let Z=function(te){return new Error("Failed prop type: The prop `"+te.key+"` expects a "+te.expected+" in `<Link>`, but got `"+te.actual+"` instead."+(typeof window<"u"?`
2
- Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(te=>{if(te==="href"&&(_[te]==null||typeof _[te]!="string"&&typeof _[te]!="object"))throw Z({key:te,expected:"`string` or `object`",actual:_[te]===null?"null":typeof _[te]})}),Object.keys({as:!0,replace:!0,scroll:!0,shallow:!0,passHref:!0,prefetch:!0,locale:!0,onClick:!0,onMouseEnter:!0,onTouchStart:!0,legacyBehavior:!0}).forEach(te=>{const fe=typeof _[te];if(te==="as"){if(_[te]&&fe!=="string"&&fe!=="object")throw Z({key:te,expected:"`string` or `object`",actual:fe})}else if(te==="locale"){if(_[te]&&fe!=="string")throw Z({key:te,expected:"`string`",actual:fe})}else if(te==="onClick"||te==="onMouseEnter"||te==="onTouchStart"){if(_[te]&&fe!=="function")throw Z({key:te,expected:"`function`",actual:fe})}else if((te==="replace"||te==="scroll"||te==="shallow"||te==="passHref"||te==="prefetch"||te==="legacyBehavior")&&_[te]!=null&&fe!=="boolean")throw Z({key:te,expected:"`boolean`",actual:fe})});const j=o.default.useRef(!1);_.prefetch&&!j.current&&!ce&&(j.current=!0,console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated"))}if(process.env.NODE_ENV!=="production"&&ce&&!M){let Z;if(typeof k=="string"?Z=k:typeof k=="object"&&typeof k.pathname=="string"&&(Z=k.pathname),Z&&Z.split("/").some(U=>U.startsWith("[")&&U.endsWith("]")))throw new Error("Dynamic href `"+Z+"` found in <Link> while using the `/app` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href")}const{href:H,as:L}=o.default.useMemo(()=>{if(!ue){const U=b(k);return{href:U,as:M?b(M):U}}const[Z,Se]=(0,i.resolveHref)(ue,k,!0);return{href:Z,as:M?(0,i.resolveHref)(ue,M):Se||Z}},[ue,k,M]),Ve=o.default.useRef(H),G=o.default.useRef(L);let ne;if(ie)if(process.env.NODE_ENV==="development"){R&&console.warn('"onClick" was passed to <Link> with `href` of `'+k+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),Q&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+k+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{ne=o.default.Children.only(O)}catch{throw O?new Error("Multiple children were passed to <Link> with `href` of `"+k+"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"+(typeof window<"u"?`
3
- Open your browser's console to view the Component stack trace.`:"")):new Error("No children were passed to <Link> with `href` of `"+k+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else ne=o.default.Children.only(O);else if(process.env.NODE_ENV==="development"&&(O==null?void 0:O.type)==="a")throw new Error(`Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
4
- Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor`);const X=ie?ne&&typeof ne=="object"&&ne.ref:A,[W,$,ee]=(0,h.useIntersection)({rootMargin:"200px"}),Ce=o.default.useCallback(Z=>{(G.current!==L||Ve.current!==H)&&(ee(),G.current=L,Ve.current=H),W(Z),X&&(typeof X=="function"?X(Z):typeof X=="object"&&(X.current=Z))},[L,X,H,ee,W]);o.default.useEffect(()=>{process.env.NODE_ENV==="production"&&D&&(!$||!ye||v(D,H,L,{locale:K},{kind:be},ce))},[L,H,$,K,ye,ue==null?void 0:ue.locale,D,ce,be]);const we={ref:Ce,onClick(Z){if(process.env.NODE_ENV!=="production"&&!Z)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!ie&&typeof R=="function"&&R(Z),ie&&ne.props&&typeof ne.props.onClick=="function"&&ne.props.onClick(Z),D&&(Z.defaultPrevented||w(Z,D,H,L,z,V,J,K,ce))},onMouseEnter(Z){!ie&&typeof Q=="function"&&Q(Z),ie&&ne.props&&typeof ne.props.onMouseEnter=="function"&&ne.props.onMouseEnter(Z),D&&((!ye||process.env.NODE_ENV==="development")&&ce||v(D,H,L,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(Se){!ie&&typeof se=="function"&&se(Se),ie&&ne.props&&typeof ne.props.onTouchStart=="function"&&ne.props.onTouchStart(Se),D&&(!ye&&ce||v(D,H,L,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))}};if((0,l.isAbsoluteUrl)(L))we.href=L;else if(!ie||F||ne.type==="a"&&!("href"in ne.props)){const Z=typeof K<"u"?K:ue==null?void 0:ue.locale,Se=(ue==null?void 0:ue.isLocaleDomain)&&(0,f.getDomainLocale)(L,Z,ue==null?void 0:ue.locales,ue==null?void 0:ue.domainLocales);we.href=Se||(0,p.addBasePath)((0,c.addLocale)(L,Z,ue==null?void 0:ue.defaultLocale))}return ie?o.default.cloneElement(ne,we):(0,r.jsx)("a",{...de,...we,children:O})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(ou,ou.exports);var Hx=ou.exports,Bx=Hx;const Vx=Xg(Bx);function Fu({breadcrumbs:t,...e}){return y.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",trait:"typo.h5",...e,children:t.map((n,r)=>y.jsx($x,{breadcrumb:n,showSeparator:r>0},r))})}function $x({breadcrumb:t,showSeparator:e}){return y.jsxs(y.Fragment,{children:[e&&y.jsx(N.Icon,{path:tx,mx:"1"}),y.jsx(Vx,{href:`/${t.path??"#"}`,children:y.jsx("span",{hover_textDecoration:t.path?"underline":void 0,cursor:t.path?"pointer":void 0,children:t.label})})]})}function ia({buildDialog:t,...e}){const[n,r]=T.useState(!1),o=T.useCallback(s=>{s==null||s.preventDefault(),s==null||s.stopPropagation(),r(!0)},[r]),i=T.useCallback(()=>{r(!1)},[r]);return y.jsxs(y.Fragment,{children:[y.jsx(N.Button,{onClick:o,...e}),n&&t(i)]})}function jx({icon:t,...e}){return y.jsx(N.Button,{variant:"glass",w:"10",h:"10",rounded:"full",...e,children:y.jsx(N.Icon,{path:t})})}function Wm(t,e){return function(){return t.apply(e,arguments)}}const{toString:zx}=Object.prototype,{getPrototypeOf:Hu}=Object,sa=(t=>e=>{const n=zx.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),En=t=>(t=t.toLowerCase(),e=>sa(e)===t),aa=t=>e=>typeof e===t,{isArray:Lo}=Array,Ai=aa("undefined");function Ux(t){return t!==null&&!Ai(t)&&t.constructor!==null&&!Ai(t.constructor)&&sn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Km=En("ArrayBuffer");function qx(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Km(t.buffer),e}const Wx=aa("string"),sn=aa("function"),Gm=aa("number"),la=t=>t!==null&&typeof t=="object",Kx=t=>t===!0||t===!1,ca=t=>{if(sa(t)!=="object")return!1;const e=Hu(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Gx=En("Date"),Jx=En("File"),Xx=En("Blob"),Yx=En("FileList"),Qx=t=>la(t)&&sn(t.pipe),Zx=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||sn(t.append)&&((e=sa(t))==="formdata"||e==="object"&&sn(t.toString)&&t.toString()==="[object FormData]"))},eA=En("URLSearchParams"),tA=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ti(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),Lo(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(r=0;r<s;r++)a=i[r],e.call(null,t[a],a,t)}}function Jm(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const Xm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ym=t=>!Ai(t)&&t!==Xm;function Bu(){const{caseless:t}=Ym(this)&&this||{},e={},n=(r,o)=>{const i=t&&Jm(e,o)||o;ca(e[i])&&ca(r)?e[i]=Bu(e[i],r):ca(r)?e[i]=Bu({},r):Lo(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Ti(arguments[r],n);return e}const nA=(t,e,n,{allOwnKeys:r}={})=>(Ti(e,(o,i)=>{n&&sn(o)?t[i]=Wm(o,n):t[i]=o},{allOwnKeys:r}),t),rA=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),oA=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},iA=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Hu(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},sA=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},aA=t=>{if(!t)return null;if(Lo(t))return t;let e=t.length;if(!Gm(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},lA=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Hu(Uint8Array)),cA=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},uA=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},dA=En("HTMLFormElement"),fA=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Qm=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),hA=En("RegExp"),Zm=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ti(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},pA=t=>{Zm(t,(e,n)=>{if(sn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(sn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},gA=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Lo(t)?r(t):r(String(t).split(e)),n},mA=()=>{},yA=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Vu="abcdefghijklmnopqrstuvwxyz",ey="0123456789",ty={DIGIT:ey,ALPHA:Vu,ALPHA_DIGIT:Vu+Vu.toUpperCase()+ey},vA=(t=16,e=ty.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function bA(t){return!!(t&&sn(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const wA=t=>{const e=new Array(10),n=(r,o)=>{if(la(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=Lo(r)?[]:{};return Ti(r,(s,a)=>{const l=n(s,o+1);!Ai(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},SA=En("AsyncFunction"),oe={isArray:Lo,isArrayBuffer:Km,isBuffer:Ux,isFormData:Zx,isArrayBufferView:qx,isString:Wx,isNumber:Gm,isBoolean:Kx,isObject:la,isPlainObject:ca,isUndefined:Ai,isDate:Gx,isFile:Jx,isBlob:Xx,isRegExp:hA,isFunction:sn,isStream:Qx,isURLSearchParams:eA,isTypedArray:lA,isFileList:Yx,forEach:Ti,merge:Bu,extend:nA,trim:tA,stripBOM:rA,inherits:oA,toFlatObject:iA,kindOf:sa,kindOfTest:En,endsWith:sA,toArray:aA,forEachEntry:cA,matchAll:uA,isHTMLForm:dA,hasOwnProperty:Qm,hasOwnProp:Qm,reduceDescriptors:Zm,freezeMethods:pA,toObjectSet:gA,toCamelCase:fA,noop:mA,toFiniteNumber:yA,findKey:Jm,global:Xm,isContextDefined:Ym,ALPHABET:ty,generateString:vA,isSpecCompliantForm:bA,toJSONObject:wA,isAsyncFn:SA,isThenable:t=>t&&(la(t)||sn(t))&&sn(t.then)&&sn(t.catch)};function $e(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}oe.inherits($e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ny=$e.prototype,ry={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ry[t]={value:t}}),Object.defineProperties($e,ry),Object.defineProperty(ny,"isAxiosError",{value:!0}),$e.from=(t,e,n,r,o,i)=>{const s=Object.create(ny);return oe.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),$e.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const CA=null;function $u(t){return oe.isPlainObject(t)||oe.isArray(t)}function oy(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function iy(t,e,n){return t?t.concat(e).map(function(o,i){return o=oy(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function EA(t){return oe.isArray(t)&&!t.some($u)}const _A=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function ua(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!oe.isUndefined(m[g])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(oe.isDate(p))return p.toISOString();if(!l&&oe.isBlob(p))throw new $e("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(p)||oe.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let v=p;if(p&&!m&&typeof p=="object"){if(oe.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(oe.isArray(p)&&EA(p)||(oe.isFileList(p)||oe.endsWith(g,"[]"))&&(v=oe.toArray(p)))return g=oy(g),v.forEach(function(w,b){!(oe.isUndefined(w)||w===null)&&e.append(s===!0?iy([g],b,i):s===null?g:g+"[]",c(w))}),!1}return $u(p)?!0:(e.append(iy(m,g,i),c(p)),!1)}const d=[],h=Object.assign(_A,{defaultVisitor:u,convertValue:c,isVisitable:$u});function f(p,g){if(!oe.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),oe.forEach(p,function(v,C){(!(oe.isUndefined(v)||v===null)&&o.call(e,v,oe.isString(C)?C.trim():C,g,h))===!0&&f(v,g?g.concat(C):[C])}),d.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return f(t),e}function sy(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ju(t,e){this._pairs=[],t&&ua(t,this,e)}const ay=ju.prototype;ay.append=function(e,n){this._pairs.push([e,n])},ay.toString=function(e){const n=e?function(r){return e.call(this,r,sy)}:sy;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function xA(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ly(t,e,n){if(!e)return t;const r=n&&n.encode||xA,o=n&&n.serialize;let i;if(o?i=o(e,n):i=oe.isURLSearchParams(e)?e.toString():new ju(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class cy{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const uy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ju,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},dy=typeof window<"u"&&typeof document<"u",TA=(t=>dy&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),OA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_n={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:dy,hasStandardBrowserEnv:TA,hasStandardBrowserWebWorkerEnv:OA},Symbol.toStringTag,{value:"Module"})),...AA};function kA(t,e){return ua(t,new _n.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return _n.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function MA(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function PA(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}function fy(t){function e(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=i>=n.length;return s=!s&&oe.isArray(o)?o.length:s,l?(oe.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!oe.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&oe.isArray(o[s])&&(o[s]=PA(o[s])),!a)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,o)=>{e(MA(r),o,n,0)}),n}return null}function IA(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const zu={transitional:uy,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=oe.isObject(e);if(i&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return o?JSON.stringify(fy(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kA(e,this.formSerializer).toString();if((a=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ua(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),IA(e)):e}],transformResponse:[function(e){const n=this.transitional||zu.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(e&&oe.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?$e.from(a,$e.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_n.classes.FormData,Blob:_n.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{zu.headers[t]={}});const Uu=zu,LA=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),DA=t=>{const e={};let n,r,o;return t&&t.split(`
5
- `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&LA[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},hy=Symbol("internals");function Oi(t){return t&&String(t).trim().toLowerCase()}function da(t){return t===!1||t==null?t:oe.isArray(t)?t.map(da):String(t)}function NA(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const RA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function qu(t,e,n,r,o){if(oe.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function FA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function HA(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}class fa{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(a,l,c){const u=Oi(l);if(!u)throw new Error("header name must be a non-empty string");const d=oe.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=da(a))}const s=(a,l)=>oe.forEach(a,(c,u)=>i(c,u,l));return oe.isPlainObject(e)||e instanceof this.constructor?s(e,n):oe.isString(e)&&(e=e.trim())&&!RA(e)?s(DA(e),n):e!=null&&i(n,e,r),this}get(e,n){if(e=Oi(e),e){const r=oe.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return NA(o);if(oe.isFunction(n))return n.call(this,o,r);if(oe.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Oi(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||qu(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=Oi(s),s){const a=oe.findKey(r,s);a&&(!n||qu(r,r[a],a,n))&&(delete r[a],o=!0)}}return oe.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||qu(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return oe.forEach(this,(o,i)=>{const s=oe.findKey(r,i);if(s){n[s]=da(o),delete n[i];return}const a=e?FA(i):String(i).trim();a!==i&&delete n[i],n[a]=da(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
6
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[hy]=this[hy]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Oi(s);r[a]||(HA(o,s),r[a]=!0)}return oe.isArray(e)?e.forEach(i):i(e),this}}fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(fa.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),oe.freezeMethods(fa);const zn=fa;function Wu(t,e){const n=this||Uu,r=e||n,o=zn.from(r.headers);let i=r.data;return oe.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function py(t){return!!(t&&t.__CANCEL__)}function ki(t,e,n){$e.call(this,t??"canceled",$e.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(ki,$e,{__CANCEL__:!0});function BA(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new $e("Request failed with status code "+n.status,[$e.ERR_BAD_REQUEST,$e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const VA=_n.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&s.push("path="+r),oe.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $A(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function jA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gy(t,e){return t&&!$A(e)?jA(t,e):e}const zA=_n.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const a=oe.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function UA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function qA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[i];s||(s=c),n[o]=l,r[o]=c;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s<e)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function my(t,e){let n=0;const r=qA(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,l=r(a),c=i<=s;n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-i)/l:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const Ku={http:CA,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){let o=t.data;const i=zn.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let u;if(oe.isFormData(o)){if(_n.hasStandardBrowserEnv||_n.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((u=i.getContentType())!==!1){const[g,...m]=u?u.split(";").map(v=>v.trim()).filter(Boolean):[];i.setContentType([g||"multipart/form-data",...m].join("; "))}}let d=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(g+":"+m))}const h=gy(t.baseURL,t.url);d.open(t.method.toUpperCase(),ly(h,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function f(){if(!d)return;const g=zn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),v={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:t,request:d};BA(function(w){n(w),c()},function(w){r(w),c()},v),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new $e("Request aborted",$e.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new $e("Network Error",$e.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||uy;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),r(new $e(m,v.clarifyTimeoutError?$e.ETIMEDOUT:$e.ECONNABORTED,t,d)),d=null},_n.hasStandardBrowserEnv&&(a&&oe.isFunction(a)&&(a=a(t)),a||a!==!1&&zA(h))){const g=t.xsrfHeaderName&&t.xsrfCookieName&&VA.read(t.xsrfCookieName);g&&i.set(t.xsrfHeaderName,g)}o===void 0&&i.setContentType(null),"setRequestHeader"in d&&oe.forEach(i.toJSON(),function(m,v){d.setRequestHeader(v,m)}),oe.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),s&&s!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",my(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",my(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=g=>{d&&(r(!g||g.type?new ki(null,t,d):g),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=UA(h);if(p&&_n.protocols.indexOf(p)===-1){r(new $e("Unsupported protocol "+p+":",$e.ERR_BAD_REQUEST,t));return}d.send(o||null)})}};oe.forEach(Ku,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const yy=t=>`- ${t}`,WA=t=>oe.isFunction(t)||t===null||t===!1,vy={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){n=t[i];let s;if(r=n,!WA(n)&&(r=Ku[(s=String(n)).toLowerCase()],r===void 0))throw new $e(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
7
- `+i.map(yy).join(`
8
- `):" "+yy(i[0]):"as no adapter specified";throw new $e("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Ku};function Gu(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ki(null,t)}function by(t){return Gu(t),t.headers=zn.from(t.headers),t.data=Wu.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),vy.getAdapter(t.adapter||Uu.adapter)(t).then(function(r){return Gu(t),r.data=Wu.call(t,t.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return py(r)||(Gu(t),r&&r.response&&(r.response.data=Wu.call(t,t.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const wy=t=>t instanceof zn?t.toJSON():t;function Do(t,e){e=e||{};const n={};function r(c,u,d){return oe.isPlainObject(c)&&oe.isPlainObject(u)?oe.merge.call({caseless:d},c,u):oe.isPlainObject(u)?oe.merge({},u):oe.isArray(u)?u.slice():u}function o(c,u,d){if(oe.isUndefined(u)){if(!oe.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function i(c,u){if(!oe.isUndefined(u))return r(void 0,u)}function s(c,u){if(oe.isUndefined(u)){if(!oe.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>o(wy(c),wy(u),!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||o,h=d(t[u],e[u],u);oe.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Sy="1.6.7",Ju={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ju[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Cy={};Ju.transitional=function(e,n,r){function o(i,s){return"[Axios v"+Sy+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new $e(o(s," has been removed"+(n?" in "+n:"")),$e.ERR_DEPRECATED);return n&&!Cy[s]&&(Cy[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function KA(t,e,n){if(typeof t!="object")throw new $e("options must be an object",$e.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new $e("option "+i+" must be "+l,$e.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $e("Unknown option "+i,$e.ERR_BAD_OPTION)}}const Xu={assertOptions:KA,validators:Ju},cr=Xu.validators;class ha{constructor(e){this.defaults=e,this.interceptors={request:new cy,response:new cy}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
9
- `+i):r.stack=i}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Do(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Xu.assertOptions(r,{silentJSONParsing:cr.transitional(cr.boolean),forcedJSONParsing:cr.transitional(cr.boolean),clarifyTimeoutError:cr.transitional(cr.boolean)},!1),o!=null&&(oe.isFunction(o)?n.paramsSerializer={serialize:o}:Xu.assertOptions(o,{encode:cr.function,serialize:cr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&oe.merge(i.common,i[n.method]);i&&oe.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=zn.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[by.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(m){g.call(this,m);break}}try{u=by.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Do(this.defaults,e);const n=gy(e.baseURL,e.url);return ly(n,e.params,e.paramsSerializer)}}oe.forEach(["delete","get","head","options"],function(e){ha.prototype[e]=function(n,r){return this.request(Do(r||{},{method:e,url:n,data:(r||{}).data}))}}),oe.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(Do(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}ha.prototype[e]=n(),ha.prototype[e+"Form"]=n(!0)});const pa=ha;class Yu{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new ki(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Yu(function(o){e=o}),cancel:e}}}const GA=Yu;function JA(t){return function(n){return t.apply(null,n)}}function XA(t){return oe.isObject(t)&&t.isAxiosError===!0}const Qu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qu).forEach(([t,e])=>{Qu[e]=t});const YA=Qu;function Ey(t){const e=new pa(t),n=Wm(pa.prototype.request,e);return oe.extend(n,pa.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Ey(Do(t,o))},n}const ht=Ey(Uu);ht.Axios=pa,ht.CanceledError=ki,ht.CancelToken=GA,ht.isCancel=py,ht.VERSION=Sy,ht.toFormData=ua,ht.AxiosError=$e,ht.Cancel=ht.CanceledError,ht.all=function(e){return Promise.all(e)},ht.spread=JA,ht.isAxiosError=XA,ht.mergeConfig=Do,ht.AxiosHeaders=zn,ht.formToJSON=t=>fy(oe.isHTMLForm(t)?new FormData(t):t),ht.getAdapter=vy.getAdapter,ht.HttpStatusCode=YA,ht.default=ht;const _y={adminApiURL:"",nextAPIURL:"",invalidateToken:""};class xy extends Re.BaseAPI{constructor(n){console.warn("AdminAPI: nextAPIURL is not set. Please set it in the AdminApiProvider."),console.warn("AdminAPI: invalidateToken is not set. Please set it in the AdminApiProvider.");const r=ht.create({baseURL:_y.nextAPIURL,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Invalidate-Token":_y.invalidateToken},withCredentials:!0});super(r,"api/invalidate");z_(this,"pathOrPermalink");this.pathOrPermalink=n,this.invalidate=this.invalidate.bind(this)}invalidate(){let n=this.pathOrPermalink;if(n.startsWith("https://")){const r=n.substring(8);n=r.substring(r.indexOf("/"))}if(n.startsWith("http://")){const r=n.substring(7);n=r.substring(r.indexOf("/"))}return n.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{path:n})}invalidateCustomPath(n){let r=n;if(n.startsWith("https://")){const o=n.substring(8);r=o.substring(o.indexOf("/"))}if(n.startsWith("http://")){const o=n.substring(7);r=o.substring(o.indexOf("/"))}return r.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{_path:r})}}const QA={new:t=>new xy(t),custom:()=>new xy("")};function Zu({pathOrPermalink:t,...e}){const n=QA.new(t),r=Re.useApiMutation(n.invalidate,n.queryKey),o=Re.useMutate(r,{successMsg:"Page successfully invalidated"});return y.jsx(N.Button,{scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",title:"Regenerate",disabled:r.isLoading,onClick:o,...e,children:y.jsx(N.Icon,{path:ox})})}function ZA({path:t,...e}){const n=Qt.useNavigate(),r=T.useCallback(()=>{n(t)},[n,t]);return y.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...e,children:y.jsx(N.Icon,{path:wx})})}function Ay(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Ay(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function ur(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Ay(t))&&(r&&(r+=" "),r+=e);return r}const Mi=t=>typeof t=="number"&&!isNaN(t),Kr=t=>typeof t=="string",zt=t=>typeof t=="function",ga=t=>Kr(t)||zt(t)?t:null,ed=t=>T.isValidElement(t)||Kr(t)||zt(t)||Mi(t);function eT(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=t;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(e,n)})})}function ma(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=t;return function(s){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:d,isIn:h}=s;const f=r?`${e}--${l}`:e,p=r?`${n}--${l}`:n,g=T.useRef(0);return T.useLayoutEffect(()=>{const m=d.current,v=f.split(" "),C=w=>{w.target===d.current&&(m.dispatchEvent(new Event("d")),m.removeEventListener("animationend",C),m.removeEventListener("animationcancel",C),g.current===0&&w.type!=="animationcancel"&&m.classList.remove(...v))};m.classList.add(...v),m.addEventListener("animationend",C),m.addEventListener("animationcancel",C)},[]),T.useEffect(()=>{const m=d.current,v=()=>{m.removeEventListener("animationend",v),o?eT(m,u,i):u()};h||(c?v():(g.current=1,m.className+=` ${p}`,m.addEventListener("animationend",v)))},[h]),T.createElement(T.Fragment,null,a)}}function Ty(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const an={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(r=>r!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n)})}},ya=t=>{let{theme:e,type:n,...r}=t;return T.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},td={info:function(t){return T.createElement(ya,{...t},T.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return T.createElement(ya,{...t},T.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return T.createElement(ya,{...t},T.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return T.createElement(ya,{...t},T.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return T.createElement("div",{className:"Toastify__spinner"})}};function tT(t){const[,e]=T.useReducer(f=>f+1,0),[n,r]=T.useState([]),o=T.useRef(null),i=T.useRef(new Map).current,s=f=>n.indexOf(f)!==-1,a=T.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:s,getToast:f=>i.get(f)}).current;function l(f){let{containerId:p}=f;const{limit:g}=a.props;!g||p&&a.containerId!==p||(a.count-=a.queue.length,a.queue=[])}function c(f){r(p=>f==null?[]:p.filter(g=>g!==f))}function u(){const{toastContent:f,toastProps:p,staleId:g}=a.queue.shift();h(f,p,g)}function d(f,p){let{delay:g,staleId:m,...v}=p;if(!ed(f)||function(M){return!o.current||a.props.enableMultiContainer&&M.containerId!==a.props.containerId||i.has(M.toastId)&&M.updateId==null}(v))return;const{toastId:C,updateId:w,data:b}=v,{props:S}=a,E=()=>c(C),x=w==null;x&&a.count++;const _={...S,style:S.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(v).filter(M=>{let[I,P]=M;return P!=null})),toastId:C,updateId:w,data:b,closeToast:E,isIn:!1,className:ga(v.className||S.toastClassName),bodyClassName:ga(v.bodyClassName||S.bodyClassName),progressClassName:ga(v.progressClassName||S.progressClassName),autoClose:!v.isLoading&&(A=v.autoClose,O=S.autoClose,A===!1||Mi(A)&&A>0?A:O),deleteToast(){const M=Ty(i.get(C),"removed");i.delete(C),an.emit(4,M);const I=a.queue.length;if(a.count=C==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),I>0){const P=C==null?a.props.limit:1;if(I===1||P===1)a.displayedToast++,u();else{const F=P>I?I:P;a.displayedToast=F;for(let z=0;z<F;z++)u()}}else e()}};var A,O;_.iconOut=function(M){let{theme:I,type:P,isLoading:F,icon:z}=M,V=null;const J={theme:I,type:P};return z===!1||(zt(z)?V=z(J):T.isValidElement(z)?V=T.cloneElement(z,J):Kr(z)||Mi(z)?V=z:F?V=td.spinner():(K=>K in td)(P)&&(V=td[P](J))),V}(_),zt(v.onOpen)&&(_.onOpen=v.onOpen),zt(v.onClose)&&(_.onClose=v.onClose),_.closeButton=S.closeButton,v.closeButton===!1||ed(v.closeButton)?_.closeButton=v.closeButton:v.closeButton===!0&&(_.closeButton=!ed(S.closeButton)||S.closeButton);let k=f;T.isValidElement(f)&&!Kr(f.type)?k=T.cloneElement(f,{closeToast:E,toastProps:_,data:b}):zt(f)&&(k=f({closeToast:E,toastProps:_,data:b})),S.limit&&S.limit>0&&a.count>S.limit&&x?a.queue.push({toastContent:k,toastProps:_,staleId:m}):Mi(g)?setTimeout(()=>{h(k,_,m)},g):h(k,_,m)}function h(f,p,g){const{toastId:m}=p;g&&i.delete(g);const v={content:f,props:p};i.set(m,v),r(C=>[...C,m].filter(w=>w!==g)),an.emit(4,Ty(v,v.props.updateId==null?"added":"updated"))}return T.useEffect(()=>(a.containerId=t.containerId,an.cancelEmit(3).on(0,d).on(1,f=>o.current&&c(f)).on(5,l).emit(2,a),()=>{i.clear(),an.emit(3,a)}),[]),T.useEffect(()=>{a.props=t,a.isToastActive=s,a.displayedToast=n.length}),{getToastToRender:function(f){const p=new Map,g=Array.from(i.values());return t.newestOnTop&&g.reverse(),g.forEach(m=>{const{position:v}=m.props;p.has(v)||p.set(v,[]),p.get(v).push(m)}),Array.from(p,m=>f(m[0],m[1]))},containerRef:o,isToastActive:s}}function Oy(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function ky(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function nT(t){const[e,n]=T.useState(!1),[r,o]=T.useState(!1),i=T.useRef(null),s=T.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=T.useRef(t),{autoClose:l,pauseOnHover:c,closeToast:u,onClick:d,closeOnClick:h}=t;function f(b){if(t.draggable){b.nativeEvent.type==="touchstart"&&b.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",v),document.addEventListener("mouseup",C),document.addEventListener("touchmove",v),document.addEventListener("touchend",C);const S=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=S.getBoundingClientRect(),S.style.transition="",s.x=Oy(b.nativeEvent),s.y=ky(b.nativeEvent),t.draggableDirection==="x"?(s.start=s.x,s.removalDistance=S.offsetWidth*(t.draggablePercent/100)):(s.start=s.y,s.removalDistance=S.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function p(b){if(s.boundingRect){const{top:S,bottom:E,left:x,right:_}=s.boundingRect;b.nativeEvent.type!=="touchend"&&t.pauseOnHover&&s.x>=x&&s.x<=_&&s.y>=S&&s.y<=E?m():g()}}function g(){n(!0)}function m(){n(!1)}function v(b){const S=i.current;s.canDrag&&S&&(s.didMove=!0,e&&m(),s.x=Oy(b),s.y=ky(b),s.delta=t.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),S.style.transform=`translate${t.draggableDirection}(${s.delta}px)`,S.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function C(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",C),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",C);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void t.closeToast();b.style.transition="transform 0.2s, opacity 0.2s",b.style.transform=`translate${t.draggableDirection}(0)`,b.style.opacity="1"}}T.useEffect(()=>{a.current=t}),T.useEffect(()=>(i.current&&i.current.addEventListener("d",g,{once:!0}),zt(t.onOpen)&&t.onOpen(T.isValidElement(t.children)&&t.children.props),()=>{const b=a.current;zt(b.onClose)&&b.onClose(T.isValidElement(b.children)&&b.children.props)}),[]),T.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",g),window.removeEventListener("blur",m))}),[t.pauseOnFocusLoss]);const w={onMouseDown:f,onTouchStart:f,onMouseUp:p,onTouchEnd:p};return l&&c&&(w.onMouseEnter=m,w.onMouseLeave=g),h&&(w.onClick=b=>{d&&d(b),s.canCloseOnClick&&u()}),{playToast:g,pauseToast:m,isRunning:e,preventExitTransition:r,toastRef:i,eventHandlers:w}}function My(t){let{closeToast:e,theme:n,ariaLabel:r="close"}=t;return T.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),e(o)},"aria-label":r},T.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},T.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function rT(t){let{delay:e,isRunning:n,closeToast:r,type:o="default",hide:i,className:s,style:a,controlledProgress:l,progress:c,rtl:u,isIn:d,theme:h}=t;const f=i||l&&c===0,p={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused",opacity:f?0:1};l&&(p.transform=`scaleX(${c})`);const g=ur("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),m=zt(s)?s({rtl:u,type:o,defaultClassName:g}):ur(g,s);return T.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:p,[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{d&&r()}})}const oT=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:o}=nT(t),{closeButton:i,children:s,autoClose:a,onClick:l,type:c,hideProgressBar:u,closeToast:d,transition:h,position:f,className:p,style:g,bodyClassName:m,bodyStyle:v,progressClassName:C,progressStyle:w,updateId:b,role:S,progress:E,rtl:x,toastId:_,deleteToast:A,isIn:O,isLoading:k,iconOut:M,closeOnClick:I,theme:P}=t,F=ur("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":I}),z=zt(p)?p({rtl:x,position:f,type:c,defaultClassName:F}):ur(F,p),V=!!E||!a,J={closeToast:d,type:c,theme:P};let K=null;return i===!1||(K=zt(i)?i(J):T.isValidElement(i)?T.cloneElement(i,J):My(J)),T.createElement(h,{isIn:O,done:A,position:f,preventExitTransition:n,nodeRef:r},T.createElement("div",{id:_,onClick:l,className:z,...o,style:g,ref:r},T.createElement("div",{...O&&{role:S},className:zt(m)?m({type:c}):ur("Toastify__toast-body",m),style:v},M!=null&&T.createElement("div",{className:ur("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),T.createElement("div",null,s)),K,T.createElement(rT,{...b&&!V?{key:`pb-${b}`}:{},rtl:x,theme:P,delay:a,isRunning:e,isIn:O,closeToast:d,hide:u,type:c,style:w,className:C,controlledProgress:V,progress:E||0})))},va=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},iT=ma(va("bounce",!0));ma(va("slide",!0)),ma(va("zoom")),ma(va("flip"));const Py=T.forwardRef((t,e)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=tT(t),{className:i,style:s,rtl:a,containerId:l}=t;function c(u){const d=ur("Toastify__toast-container",`Toastify__toast-container--${u}`,{"Toastify__toast-container--rtl":a});return zt(i)?i({position:u,rtl:a,defaultClassName:d}):ur(d,ga(i))}return T.useEffect(()=>{e&&(e.current=r.current)},[]),T.createElement("div",{ref:r,className:"Toastify",id:l},n((u,d)=>{const h=d.length?{...s}:{...s,pointerEvents:"none"};return T.createElement("div",{className:c(u),style:h,key:`container-${u}`},d.map((f,p)=>{let{content:g,props:m}=f;return T.createElement(oT,{...m,isIn:o(m.toastId),style:{...m.style,"--nth":p+1,"--len":d.length},key:`toast-${m.key}`},g)}))}))});Py.displayName="ToastContainer",Py.defaultProps={position:"top-right",transition:iT,autoClose:5e3,closeButton:My,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let nd,Gr=new Map,Pi=[],sT=1;function Iy(){return""+sT++}function aT(t){return t&&(Kr(t.toastId)||Mi(t.toastId))?t.toastId:Iy()}function Ii(t,e){return Gr.size>0?an.emit(0,t,e):Pi.push({content:t,options:e}),e.toastId}function ba(t,e){return{...e,type:e&&e.type||t,toastId:aT(e)}}function wa(t){return(e,n)=>Ii(e,ba(t,n))}function He(t,e){return Ii(t,ba("default",e))}He.loading=(t,e)=>Ii(t,ba("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),He.promise=function(t,e,n){let r,{pending:o,error:i,success:s}=e;o&&(r=Kr(o)?He.loading(o,n):He.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,d,h)=>{if(d==null)return void He.dismiss(r);const f={type:u,...a,...n,data:h},p=Kr(d)?{render:d}:d;return r?He.update(r,{...f,...p}):He(p.render,{...f,...p}),h},c=zt(t)?t():t;return c.then(u=>l("success",s,u)).catch(u=>l("error",i,u)),c},He.success=wa("success"),He.info=wa("info"),He.error=wa("error"),He.warning=wa("warning"),He.warn=He.warning,He.dark=(t,e)=>Ii(t,ba("default",{theme:"dark",...e})),He.dismiss=t=>{Gr.size>0?an.emit(1,t):Pi=Pi.filter(e=>t!=null&&e.options.toastId!==t)},He.clearWaitingQueue=function(t){return t===void 0&&(t={}),an.emit(5,t)},He.isActive=t=>{let e=!1;return Gr.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0)}),e},He.update=function(t,e){e===void 0&&(e={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const s=Gr.get(i||nd);return s&&s.getToast(r)}(t,e);if(n){const{props:r,content:o}=n,i={delay:100,...r,...e,toastId:e.toastId||t,updateId:Iy()};i.toastId!==t&&(i.staleId=t);const s=i.render||o;delete i.render,Ii(s,i)}},0)},He.done=t=>{He.update(t,{progress:1})},He.onChange=t=>(an.on(4,t),()=>{an.off(4,t)}),He.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},He.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},an.on(2,t=>{nd=t.containerId||t,Gr.set(nd,t),Pi.forEach(e=>{an.emit(0,e.content,e.options)}),Pi=[]}).on(3,t=>{Gr.delete(t.containerId||t),Gr.size===0&&an.off(0).off(1).off(5)});function Ly({status:t,queryId:e,api:n,...r}){const o=t=="draft",i=Re.useInvalidateMutation(o?n.publish:n.unpublish,n.queryKey,e,{networkMode:"always"}),s=T.useCallback(()=>{i.reset(),i.mutateAsync(e).then(()=>He.success(o?"Published!":"Unpublished!")).catch(a=>He.error(`Error: ${a}`))},[i,e]);return y.jsxs(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",px:"4",disabled:i.isLoading,onClick:s,dflex:!0,alignItems:"center",gap:"3",...r,children:[y.jsx(N.Icon,{path:o?nu:ix}),o?"Publish":"Switch to draft"]})}function lT({children:t,...e}){return y.jsx("div",{dflex:!0,flexCol:!0,gap:"3",w:"full",...e,children:t})}function dr({label:t,touched:e,error:n,customFeedbackLabel:r,showCorrectFeedback:o}){const i=e&&n!=null&&n!=="",s=o&&e&&!n&&o&&t!=null&&t!=="",a=N.usePrevious(n);return y.jsxs(y.Fragment,{children:[i&&y.jsxs("div",{mt:"2",children:[y.jsx("div",{className:"is-invalid"})," ",y.jsxs("div",{textColor:"#ff0000",textSize:"sm",fontWeight:"500",children:[n,!n&&`${a}`]})]}),o&&t&&y.jsx(y.Fragment,{children:s&&y.jsxs("div",{mt:"2",children:[y.jsx("div",{className:"is-valid"})," ",y.jsxs("div",{className:"valid-feedback m-0",textSize:"sm",fontWeight:"500",children:[t," was entered correct"]})]})}),r&&y.jsx(y.Fragment,{children:!i&&!s&&y.jsx("div",{mt:"2",textSize:"sm",fontWeight:"500",children:r})})]})}function cT(){}function Sa(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Dy(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Ny(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const uT="[object RegExp]",dT="[object String]",fT="[object Number]",hT="[object Boolean]",Ry="[object Arguments]",pT="[object Symbol]",gT="[object Date]",mT="[object Map]",yT="[object Set]",vT="[object Array]",bT="[object Function]",wT="[object ArrayBuffer]",rd="[object Object]",ST="[object Error]",CT="[object DataView]",ET="[object Uint8Array]",_T="[object Uint8ClampedArray]",xT="[object Uint16Array]",AT="[object Uint32Array]",TT="[object BigUint64Array]",OT="[object Int8Array]",kT="[object Int16Array]",MT="[object Int32Array]",PT="[object BigInt64Array]",IT="[object Float32Array]",LT="[object Float64Array]";function Li(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o],s=t[o];Array.isArray(i)?Array.isArray(s)?t[o]=Li(s,i):t[o]=Li([],i):Sa(i)?Sa(s)?t[o]=Li(s,i):t[o]=Li({},i):(s===void 0||i!==void 0)&&(t[o]=i)}return t}function DT(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function NT(t,e,n){return Di(t,e,void 0,void 0,void 0,void 0,n)}function Di(t,e,n,r,o,i,s){const a=s(t,e,n,r,o,i);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Ni(t,e,i,s)}return Ni(t,e,i,s)}function Ni(t,e,n,r){if(Object.is(t,e))return!0;let o=Ny(t),i=Ny(e);if(o===Ry&&(o=rd),i===Ry&&(i=rd),o!==i)return!1;switch(o){case dT:return t.toString()===e.toString();case fT:{const l=t.valueOf(),c=e.valueOf();return DT(l,c)}case hT:case gT:case pT:return Object.is(t.valueOf(),e.valueOf());case uT:return t.source===e.source&&t.flags===e.flags;case bT:return t===e}n=n??new Map;const s=n.get(t),a=n.get(e);if(s!=null&&a!=null)return s===e;n.set(t,e),n.set(e,t);try{switch(o){case mT:{if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!Di(c,e.get(l),l,t,e,n,r))return!1;return!0}case yT:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let u=0;u<l.length;u++){const d=l[u],h=c.findIndex(f=>Di(d,f,void 0,t,e,n,r));if(h===-1)return!1;c.splice(h,1)}return!0}case vT:case ET:case _T:case xT:case AT:case TT:case OT:case kT:case MT:case PT:case IT:case LT:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!Di(t[l],e[l],l,t,e,n,r))return!1;return!0}case wT:return t.byteLength!==e.byteLength?!1:Ni(new Uint8Array(t),new Uint8Array(e),n,r);case CT:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Ni(new Uint8Array(t),new Uint8Array(e),n,r);case ST:return t.name===e.name&&t.message===e.message;case rd:{if(!(Ni(t.constructor,e.constructor,n,r)||Sa(t)&&Sa(e)))return!1;const c=[...Object.keys(t),...Dy(t)],u=[...Object.keys(e),...Dy(e)];if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++){const h=c[d],f=t[h];if(!Object.hasOwn(e,h))return!1;const p=e[h];if(!Di(f,p,h,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Fy(t,e){return NT(t,e,cT)}function RT(t){return typeof t=="function"}function FT(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function HT(t){return Object.is(t,-0)?"-0":t.toString()}function BT(t){const e=[],n=t.length;if(n===0)return e;let r=0,o="",i="",s=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<n;){const a=t[r];i?a==="\\"&&r+1<n?(r++,o+=t[r]):a===i?i="":o+=a:s?a==='"'||a==="'"?i=a:a==="]"?(s=!1,e.push(o),o=""):o+=a:a==="["?(s=!0,o&&(e.push(o),o="")):a==="."?o&&(e.push(o),o=""):o+=a,r++}return o&&e.push(o),e}function No(t,e,n){if(t==null)return n;switch(typeof e){case"string":{const r=t[e];return r===void 0?FT(e)?No(t,BT(e),n):n:r}case"number":case"symbol":{typeof e=="number"&&(e=HT(e));const r=t[e];return r===void 0?n:r}default:{if(Array.isArray(e))return VT(t,e,n);Object.is(e==null?void 0:e.valueOf(),-0)?e="-0":e=String(e);const r=t[e];return r===void 0?n:r}}}function VT(t,e,n){if(e.length===0)return n;let r=t;for(let o=0;o<e.length;o++){if(r==null)return n;r=r[e[o]]}return r===void 0?n:r}function Hy(t){return Array.isArray(t)}function fr(t,e,n){const r=t!=null?No(e,t):!1,o=t!=null?No(n,t):!1,i=t!=null?No(e,t):void 0;return{isError:r,isTouched:o,error:i}}function By({withFeedbackLabel:t=!0,showCorrectFeedback:e=!1,customFeedbackLabel:n,children:r,...o}){const i=o.name??"";return y.jsx(Xe.Field,{name:i,type:"checkbox",children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c}=a,{isError:u,isTouched:d,error:h}=fr(i,l,c);return y.jsxs("div",{children:[y.jsx("input",{type:"checkbox",style:{display:"none"}}),y.jsx(N.Checkbox,{scheme:s.value?"default":"neutral",disabled:a.isSubmitting,borderColor:d&&u?"red":!1,...s,...o}),r,t&&y.jsx(dr,{error:h,touched:d,label:o.label,customFeedbackLabel:n,showCorrectFeedback:e})]})}})}function vn({name:t,label:e,required:n,...r}){if(e)return y.jsxs("label",{htmlFor:t,textSize:"xs",mb:"1",fontWeight:"500",letterSpacing:"wide",textColor:"gray-600",...r,children:[e,n&&y.jsx("span",{textSize:"xs",ms:"1",textColor:"red",verticalAlign:"top",children:"* "})]})}function $T(t){const[e,n,r]=Xe.useField(t),{error:o,touched:i}=n;return{isError:o!==void 0,isTouched:i,error:o}}function jT({name:t,options:e,label:n,withFeedbackLabel:r=!0,showCorrectFeedback:o=!1,customFeedbackLabel:i,required:s=!1}){const{isError:a,isTouched:l,error:c}=$T(t);return y.jsxs("div",{w:"full",dflex:!0,flexCol:!0,children:[n&&y.jsx(vn,{name:t,label:n,required:s}),e.length>0&&y.jsx("div",{rounded:!0,overflow:"hidden",border:"0.5",borderColor:l&&a?"red":"#F4F4F4",role:"group",children:e.map((u,d)=>y.jsx(zT,{name:t,label:u.label,value:u.id},d))}),e.length===0&&y.jsx("div",{rounded:!0,border:"0.5",bgColor:"#f4F4F4",borderColor:l&&a?"red":"#F4F4F4",py:"5",textAlign:"center",textSize:"md",fontWeight:"500",textColor:"slate-500",children:"No data"}),r&&y.jsx(dr,{error:c,touched:l,label:n,customFeedbackLabel:i,showCorrectFeedback:o})]})}function zT({name:t,label:e,value:n}){return y.jsx("label",{id:"parent_label",px:"4",py:"3",display:"block",hover_bgColor:"slate-50",cursor:"pointer",children:y.jsx(Xe.Field,{name:t,type:"checkbox",value:n,children:({field:r,form:o})=>y.jsx(By,{scheme:"neutral",disabled:o.isSubmitting,label:y.jsx("span",{flex:"1",w:"full",children:e}),labelPosition:"start",withFeedbackLabel:!1,...r})})})}function UT({name:t,value:e}){const{setFieldValue:n}=Xe.useFormikContext();return T.useEffect(()=>{n(t,e)},[e,n]),null}function od({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,fullWidth:s,...a}){const l=a.name??"";return y.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&y.jsx(vn,{name:l,label:t,required:i}),y.jsx(Xe.FastField,{name:l,children:({field:c,form:u})=>{c.value==null&&console.warn(`Input: Value for field ${c.name} is null`);const{errors:d,touched:h}=u,{isError:f,isTouched:p,error:g}=fr(l,d,h),m={...a,...p&&f?{borderColor:"red"}:{}};return y.jsxs(y.Fragment,{children:[y.jsx(N.Input,{w:s?"full":void 0,disabled:u.isSubmitting,scheme:"default",lineHeight:"normal",transition:"all",...c,...m}),e&&y.jsx(dr,{error:g,touched:p,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})]})}function qT(t){return Array.isArray(t)}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function WT(t,e,n){return t<e?n==="asc"?-1:1:t>e?n==="asc"?1:-1:0}function KT(t,e,n){return t.slice().sort((r,o)=>{const i=n.length;for(let s=0;s<e.length;s++){const a=i>s?n[s]:n[i-1],l=e[s],c=typeof l=="function",u=c?l(r):r[l],d=c?l(o):o[l],h=WT(u,d,a);if(h!==0)return h}return 0})}function GT(t,e){return KT(t,e,["asc"])}function JT({field:t,onChangeField:e,resetValue:n}){const{setFieldValue:r,values:o}=Xe.useFormikContext(),i=N.usePrevious(No(o,e)),s=N.useFirstRender();return T.useEffect(()=>{!s&&!Fy(No(o,e),i)&&(qT(t)?t.forEach(a=>r(a,n)):r(t,n))},[s,o,e,r,t,n]),null}function XT({label:t}){return y.jsx("div",{mt:"5",fontWeight:"500",textSize:"lg",children:t})}function YT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,placeholder:s,fullWidth:a,children:l,...c}){const u=c.name??"";return y.jsx(Xe.Field,{name:c.name,children:({field:d,form:h})=>{d.value==null&&console.warn(`Select: Value for field ${d.name} is null`);const{errors:f,touched:p}=h,{isError:g,isTouched:m,error:v}=fr(u,f,p),C={...m&&g?{borderColor:"red"}:{}};return y.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"baseline",...c,children:[t&&y.jsx(vn,{name:u,label:t,required:i,flex:"1"}),y.jsxs(N.Select,{disabled:h.isSubmitting||c.disabled,w:a?"full":void 0,...d,...C,children:[y.jsx("option",{value:"",children:s??"Select an option"}),l]}),e&&y.jsx(dr,{error:v,touched:m,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function QT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,children:o,onClick:i,...s}){const a=s.name??"";return y.jsx(Xe.Field,{name:a,type:"checkbox",children:({field:l,form:c})=>{l.value==null&&console.warn(`Switch: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=fr(a,u,d);return y.jsxs("label",{children:[y.jsx("input",{type:"checkbox",style:{display:"none"}}),y.jsx("div",{dflex:!0,alignItems:"center",w:"full",children:y.jsx(N.Switch,{scheme:l.value?"default":"neutral",disabled:c.isSubmitting,label:t,borderColor:f&&h?"red":!1,...l})}),o,e&&y.jsx(dr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function id({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,...s}){const a=s.name??"";return y.jsx(Xe.Field,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`TextArea : Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=fr(a,u,d),g={...s,...f&&h?{borderColor:"red"}:{}};return y.jsxs("div",{dflex:!0,flexCol:!0,w:"full",children:[t&&y.jsx(vn,{name:a,label:t,required:i}),y.jsx(N.TextArea,{disabled:c.isSubmitting,scheme:"default",...l,...g}),e&&y.jsx(dr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function ZT({children:t}){return y.jsx("div",{grid:!0,gridCols:"1",md_gridCols:"2",gap:"5",children:t})}function eO(t){const[{value:e}]=Xe.useField(t);return T.useMemo(()=>e,[e])}const tO=T.memo(function({field:t,condition:e,form:n,extensions:r}){const[o,i]=T.useState(),s=eO(t),a=T.useMemo(()=>RT(e)?e(s):s==e,[e,s]);return T.useEffect(()=>{a&&i(s)},[a,s,i]),T.useMemo(()=>y.jsx(N.Collapse,{in:a,children:y.jsx("div",{dflex:!0,flexCol:!0,gap:"5",children:y.jsx(Fd,{form:Fe.runIfFn(n,a?s:o),extensions:r})})}),[a,n,r,s,o])});function nO({field:t,form:e}){const[n]=Xe.useField(t),r=n.value;return y.jsx(Fd,{form:e(r)})}function rO({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,...s}){const a=s.name??"";return y.jsx(Xe.FastField,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`Rating: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=fr(a,u,d);return y.jsxs("div",{...s,children:[t&&y.jsx(vn,{name:a,label:t,required:i}),y.jsx(oO,{name:a,rating:l.value,setFieldValue:c.setFieldValue}),e&&y.jsx(dr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function oO({name:t,rating:e,setFieldValue:n}){const r=T.useRef(null),o=T.useRef(null),i=T.useRef(null),s=T.useRef(null),a=T.useRef(null),l=N.useHover(r),c=N.useHover(o),u=N.useHover(i),d=N.useHover(s),h=N.useHover(a);return y.jsxs("div",{dflex:!0,children:[y.jsx(Ri,{ref:r,index:0,rating:e,hover:l||c||u||d||h,onClick:()=>n(t,"1")}),y.jsx(Ri,{ref:o,index:1,rating:e,hover:c||u||d||h,onClick:()=>n(t,"2")}),y.jsx(Ri,{ref:i,index:2,rating:e,hover:u||d||h,onClick:()=>n(t,"3")}),y.jsx(Ri,{ref:s,index:3,rating:e,hover:d||h,onClick:()=>n(t,"4")}),y.jsx(Ri,{ref:a,index:4,rating:e,hover:h,onClick:()=>n(t,"5")})]})}const Ri=T.forwardRef(function({index:t,rating:e,hover:n,onClick:r},o){const i=e-t;let s=Ex;return i>=.5&&(s=Cx),(i>=1||n)&&(s=Sx),y.jsx("div",{ref:o,onClick:r,children:y.jsx(N.Icon,{path:s,size:"x2",textColor:"brand"})})});function iO({title:t,divider:e}){return y.jsxs("div",{mt:"3",children:[e&&y.jsx("div",{h:"px",bgColor:"slate-100",w:"full",mb:e?"5":"8"}),y.jsx("div",{textTransform:"uppercase",textSize:"sm",fontWeight:"600",textColor:"slate-700",children:t})]})}function sO({children:t}){return y.jsx("div",{dflex:!0,alignItems:"end",gap:"5",children:t})}function aO({name:t,addItemLabel:e,...n}){const{values:r}=Xe.useFormikContext(),o=r;return y.jsx(Xe.FieldArray,{name:t,render:i=>y.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",children:[o[t]&&o[t].length>0&&o[t].map((s,a)=>y.jsxs("div",{dflex:!0,alignItems:"start",gap:"2",children:[y.jsx(od,{flexGrow:"1",name:`${t}.${a}`,...n}),y.jsx(N.Button,{variant:"borderless",mt:"0.5",onClick:()=>i.remove(a),children:y.jsx(N.Icon,{path:Fg})})]},a)),y.jsxs(N.Button,{variant:"glass",onClick:()=>i.push(""),children:[" ",e??"Add item"]})]})})}function lO({name:t,label:e,addItemLabel:n,required:r,...o}){const{values:i,isSubmitting:s}=Xe.useFormikContext(),a=i;return y.jsx(Xe.FieldArray,{name:t,render:l=>y.jsxs("div",{children:[e&&y.jsx(vn,{name:t,label:e,required:r}),y.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",w:"full","data-class":"container",children:[a[t]&&a[t].length>0&&a[t].map((c,u)=>y.jsxs("div",{"data-class":"item",dflex:!0,alignItems:"center",gap:"1",flexGrow:!0,children:[y.jsx(id,{name:`${t}.${u}`,disabled:s,scheme:"default",flexGrow:"1",...o}),y.jsx(N.IconButton,{variant:"borderless",corners:"pill",icon:Fg,size:"xl",onClick:()=>l.remove(u)})]},u)),y.jsxs(N.Button,{onClick:()=>l.push(""),children:[" ",n??"Add item"]})]})]})})}function cO({icon:t,label:e,subtitle:n,...r}){const[o,i]=Fe.splitComponentProps(r);return y.jsx(Xe.Field,{name:r.name,type:"radio",value:r.value,children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c,values:u}=a,{isError:d,isTouched:h,error:f}=fr(r.name??"",l,c),p={...h&&d?{borderColor:"red"}:{}};return y.jsxs("label",{htmlFor:r.name,...o,children:[y.jsx("input",{type:"radio",display:"none",...s,...i}),y.jsxs(N.Button,{w:"full",scheme:s.checked?"secondary":"neutral",disabled:i.disabled,easing:s.checked?"out":"linear",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",px:"3",py:"5",rounded:"lg",onClick:()=>a.setFieldValue(r.name??"",r.value),...p,children:[y.jsx(N.Icon,{path:t,size:"x3",mb:"3"}),y.jsx("span",{children:e}),n&&y.jsx("span",{textSize:"sm",textColor:"white",textOpacity:"80",children:n})]})]})}})}function uO({name:t,label:e,provider:n,required:r}){return y.jsxs("div",{dflex:!0,flexCol:!0,children:[y.jsx(vn,{name:t,label:e,required:r,mb:"1"}),y.jsx("div",{grid:!0,gridCols:"2",gap:"3",children:n.map(o=>y.jsx(cO,{value:o.id,name:t,icon:o.icon,label:o.label,subtitle:o.subtitle,disabled:o.disabled},o.id))})]})}function dO(t,e){const[n,r]=T.useState(t);return T.useEffect(()=>{const o=setTimeout(()=>r(t),e||500);return()=>{clearTimeout(o)}},[t,e]),n}function Vy(t){return T.useCallback(e=>{(t||e)&&window.open(t??e,"_blank")},[t])}var Ca={exports:{}},sd={},Ea={exports:{}},ad={},$y;function fO(){return $y||($y=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(n,r){return r===void 0&&(r=""),(n==="/"?"/index":/^\/index(\/|$)/.test(n)?"/index"+n:n)+r}}(ad)),ad}var _a={exports:{}},jy;function hO(){return jy||(jy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"__unsafeCreateTrustedScriptURL",{enumerable:!0,get:function(){return o}});let n;function r(){if(typeof n>"u"&&typeof window<"u"){var i;n=((i=window.trustedTypes)==null?void 0:i.createPolicy("nextjs",{createHTML:s=>s,createScript:s=>s,createScriptURL:s=>s}))||null}return n}function o(i){var s;return((s=r())==null?void 0:s.createScriptURL(i))||i}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(_a,_a.exports)),_a.exports}var ld={},zy;function pO(){return zy||(zy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return e}});function e(){return process.env.NEXT_DEPLOYMENT_ID?`?dpl=${process.env.NEXT_DEPLOYMENT_ID}`:""}}(ld)),ld}var Uy;function gO(){return Uy||(Uy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(x,_){for(var A in _)Object.defineProperty(x,A,{enumerable:!0,get:_[A]})}n(e,{createRouteLoader:function(){return E},getClientBuildManifest:function(){return b},isAssetError:function(){return h},markAssetError:function(){return d}});const o=Ft._(fO()),i=hO(),s=Du(),a=pO(),l=3800;function c(x,_,A){let O=_.get(x);if(O)return"future"in O?O.future:Promise.resolve(O);let k;const M=new Promise(I=>{k=I});return _.set(x,O={resolve:k,future:M}),A?A().then(I=>(k(I),I)).catch(I=>{throw _.delete(x),I}):M}const u=Symbol("ASSET_LOAD_ERROR");function d(x){return Object.defineProperty(x,u,{})}function h(x){return x&&u in x}function f(x){try{return x=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||x.relList.supports("prefetch")}catch{return!1}}const p=f(),g=()=>(0,a.getDeploymentIdQueryOrEmptyString)();function m(x,_,A){return new Promise((O,k)=>{const M=`
10
- link[rel="prefetch"][href^="`+x+`"],
11
- link[rel="preload"][href^="`+x+`"],
12
- script[src^="`+x+'"]';if(document.querySelector(M))return O();A=document.createElement("link"),_&&(A.as=_),A.rel="prefetch",A.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,A.onload=O,A.onerror=()=>k(d(new Error("Failed to prefetch: "+x))),A.href=x,document.head.appendChild(A)})}function v(x,_){return new Promise((A,O)=>{_=document.createElement("script"),_.onload=A,_.onerror=()=>O(d(new Error("Failed to load script: "+x))),_.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,_.src=x,document.body.appendChild(_)})}let C;function w(x,_,A){return new Promise((O,k)=>{let M=!1;x.then(I=>{M=!0,O(I)}).catch(k),process.env.NODE_ENV==="development"&&(C||Promise.resolve()).then(()=>{(0,s.requestIdleCallback)(()=>setTimeout(()=>{M||k(A)},_))}),process.env.NODE_ENV!=="development"&&(0,s.requestIdleCallback)(()=>setTimeout(()=>{M||k(A)},_))})}function b(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);const x=new Promise(_=>{const A=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{_(self.__BUILD_MANIFEST),A&&A()}});return w(x,l,d(new Error("Failed to load client build manifest")))}function S(x,_){if(process.env.NODE_ENV==="development"){const A=x+"/_next/static/chunks/pages"+encodeURI((0,o.default)(_,".js"))+g();return Promise.resolve({scripts:[(0,i.__unsafeCreateTrustedScriptURL)(A)],css:[]})}return b().then(A=>{if(!(_ in A))throw d(new Error("Failed to lookup route: "+_));const O=A[_].map(k=>x+"/_next/"+encodeURI(k));return{scripts:O.filter(k=>k.endsWith(".js")).map(k=>(0,i.__unsafeCreateTrustedScriptURL)(k)+g()),css:O.filter(k=>k.endsWith(".css")).map(k=>k+g())}})}function E(x){const _=new Map,A=new Map,O=new Map,k=new Map;function M(P){if(process.env.NODE_ENV!=="development"){let F=A.get(P.toString());return F||(document.querySelector('script[src^="'+P+'"]')?Promise.resolve():(A.set(P.toString(),F=v(P)),F))}else return v(P)}function I(P){let F=O.get(P);return F||(O.set(P,F=fetch(P,{credentials:"same-origin"}).then(z=>{if(!z.ok)throw new Error("Failed to load stylesheet: "+P);return z.text().then(V=>({href:P,content:V}))}).catch(z=>{throw d(z)})),F)}return{whenEntrypoint(P){return c(P,_)},onEntrypoint(P,F){(F?Promise.resolve().then(()=>F()).then(z=>({component:z&&z.default||z,exports:z}),z=>({error:z})):Promise.resolve(void 0)).then(z=>{const V=_.get(P);V&&"resolve"in V?z&&(_.set(P,z),V.resolve(z)):(z?_.set(P,z):_.delete(P),k.delete(P))})},loadRoute(P,F){return c(P,k,()=>{let z;return process.env.NODE_ENV==="development"&&(C=new Promise(V=>{z=V})),w(S(x,P).then(V=>{let{scripts:J,css:K}=V;return Promise.all([_.has(P)?[]:Promise.all(J.map(M)),Promise.all(K.map(I))])}).then(V=>this.whenEntrypoint(P).then(J=>({entrypoint:J,styles:V[1]}))),l,d(new Error("Route did not complete loading: "+P))).then(V=>{let{entrypoint:J,styles:K}=V;const R=Object.assign({styles:K},J);return"error"in J?J:R}).catch(V=>{if(F)throw V;return{error:V}}).finally(()=>z==null?void 0:z())})},prefetch(P){let F;return(F=navigator.connection)&&(F.saveData||/2g/.test(F.effectiveType))?Promise.resolve():S(x,P).then(z=>Promise.all(p?z.scripts.map(V=>m(V.toString(),"script")):[])).then(()=>{(0,s.requestIdleCallback)(()=>this.loadRoute(P,!0).catch(()=>{}))}).catch(()=>{})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ea,Ea.exports)),Ea.exports}var xa={exports:{}},cd={},qy;function Wy(){return qy||(qy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});const r=Ft._(T).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="HeadManagerContext")}(cd)),cd}var Aa={exports:{}},Ky;function mO(){return Ky||(Ky=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}n(e,{DOMAttributeNames:function(){return r},default:function(){return a},isEqualNode:function(){return i}});const r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function o(l){let{type:c,props:u}=l;const d=document.createElement(c);for(const p in u){if(!u.hasOwnProperty(p)||p==="children"||p==="dangerouslySetInnerHTML"||u[p]===void 0)continue;const g=r[p]||p.toLowerCase();c==="script"&&(g==="async"||g==="defer"||g==="noModule")?d[g]=!!u[p]:d.setAttribute(g,u[p])}const{children:h,dangerouslySetInnerHTML:f}=u;return f?d.innerHTML=f.__html||"":h&&(d.textContent=typeof h=="string"?h:Array.isArray(h)?h.join(""):""),d}function i(l,c){if(l instanceof HTMLElement&&c instanceof HTMLElement){const u=c.getAttribute("nonce");if(u&&!l.getAttribute("nonce")){const d=c.cloneNode(!0);return d.setAttribute("nonce",""),d.nonce=u,u===l.nonce&&l.isEqualNode(d)}}return l.isEqualNode(c)}let s;process.env.__NEXT_STRICT_NEXT_HEAD?s=(l,c)=>{const u=document.querySelector("head");if(!u)return;const d=u.querySelectorAll('meta[name="next-head"]')||[],h=[];if(l==="meta"){const g=u.querySelector("meta[charset]");g&&h.push(g)}for(let g=0;g<d.length;g++){var f;const v=d[g].nextSibling;(v==null||(f=v.tagName)==null?void 0:f.toLowerCase())===l&&h.push(v)}const p=c.map(o).filter(g=>{for(let m=0,v=h.length;m<v;m++){const C=h[m];if(i(C,g))return h.splice(m,1),!1}return!0});h.forEach(g=>{var m;const v=g.previousSibling;if(v&&v.getAttribute("name")==="next-head"){var C;(C=g.parentNode)==null||C.removeChild(v)}(m=g.parentNode)==null||m.removeChild(g)}),p.forEach(g=>{var m;const v=document.createElement("meta");v.name="next-head",v.content="1",((m=g.tagName)==null?void 0:m.toLowerCase())==="meta"&&g.getAttribute("charset")||u.appendChild(v),u.appendChild(g)})}:s=(l,c)=>{const u=document.getElementsByTagName("head")[0],d=u.querySelector("meta[name=next-head-count]");if(process.env.NODE_ENV!=="production"&&!d){console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");return}const h=Number(d.content),f=[];for(let m=0,v=d.previousElementSibling;m<h;m++,v=(v==null?void 0:v.previousElementSibling)||null){var p;(v==null||(p=v.tagName)==null?void 0:p.toLowerCase())===l&&f.push(v)}const g=c.map(o).filter(m=>{for(let v=0,C=f.length;v<C;v++){const w=f[v];if(i(w,m))return f.splice(v,1),!1}return!0});f.forEach(m=>{var v;return(v=m.parentNode)==null?void 0:v.removeChild(m)}),g.forEach(m=>u.insertBefore(m,d)),d.content=(h-f.length+g.length).toString()};function a(){return{mountedInstances:new Set,updateHead:l=>{const c={};l.forEach(h=>{if(h.type==="link"&&h.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+h.props["data-href"]+'"]'))return;h.props.href=h.props["data-href"],h.props["data-href"]=void 0}const f=c[h.type]||[];f.push(h),c[h.type]=f});const u=c.title?c.title[0]:null;let d="";if(u){const{children:h}=u.props;d=typeof h=="string"?h:Array.isArray(h)?h.join(""):""}d!==document.title&&(document.title=d),["meta","base","link","style","script"].forEach(h=>{s(h,c[h]||[])})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Aa,Aa.exports)),Aa.exports}var Gy;function yO(){return Gy||(Gy=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(E,x){for(var _ in x)Object.defineProperty(E,_,{enumerable:!0,get:x[_]})}n(e,{default:function(){return S},handleClientScriptLoad:function(){return m},initScriptLoader:function(){return w}});const r=Ft,o=_i(),i=Ei,s=r._(Mo),a=o._(T),l=Wy(),c=mO(),u=Du(),d=new Map,h=new Set,f=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],p=E=>{if(s.default.preinit){E.forEach(x=>{s.default.preinit(x,{as:"style"})});return}if(typeof window<"u"){let x=document.head;E.forEach(_=>{let A=document.createElement("link");A.type="text/css",A.rel="stylesheet",A.href=_,x.appendChild(A)})}},g=E=>{const{src:x,id:_,onLoad:A=()=>{},onReady:O=null,dangerouslySetInnerHTML:k,children:M="",strategy:I="afterInteractive",onError:P,stylesheets:F}=E,z=_||x;if(z&&h.has(z))return;if(d.has(x)){h.add(z),d.get(x).then(A,P);return}const V=()=>{O&&O(),h.add(z)},J=document.createElement("script"),K=new Promise((R,Q)=>{J.addEventListener("load",function(se){R(),A&&A.call(this,se),V()}),J.addEventListener("error",function(se){Q(se)})}).catch(function(R){P&&P(R)});k?(J.innerHTML=k.__html||"",V()):M?(J.textContent=typeof M=="string"?M:Array.isArray(M)?M.join(""):"",V()):x&&(J.src=x,d.set(x,K));for(const[R,Q]of Object.entries(E)){if(Q===void 0||f.includes(R))continue;const se=c.DOMAttributeNames[R]||R.toLowerCase();J.setAttribute(se,Q)}I==="worker"&&J.setAttribute("type","text/partytown"),J.setAttribute("data-nscript",I),F&&p(F),document.body.appendChild(J)};function m(E){const{strategy:x="afterInteractive"}=E;x==="lazyOnload"?window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(E))}):g(E)}function v(E){document.readyState==="complete"?(0,u.requestIdleCallback)(()=>g(E)):window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(E))})}function C(){[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(x=>{const _=x.id||x.getAttribute("src");h.add(_)})}function w(E){E.forEach(m),C()}function b(E){const{id:x,src:_="",onLoad:A=()=>{},onReady:O=null,strategy:k="afterInteractive",onError:M,stylesheets:I,...P}=E,{updateScripts:F,scripts:z,getIsSsr:V,appDir:J,nonce:K}=(0,a.useContext)(l.HeadManagerContext),R=(0,a.useRef)(!1);(0,a.useEffect)(()=>{const se=x||_;R.current||(O&&se&&h.has(se)&&O(),R.current=!0)},[O,x,_]);const Q=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{Q.current||(k==="afterInteractive"?g(E):k==="lazyOnload"&&v(E),Q.current=!0)},[E,k]),(k==="beforeInteractive"||k==="worker")&&(F?(z[k]=(z[k]||[]).concat([{id:x,src:_,onLoad:A,onReady:O,onError:M,...P}]),F(z)):V&&V()?h.add(x||_):V&&!V()&&g(E)),J){if(I&&I.forEach(se=>{s.default.preinit(se,{as:"style"})}),k==="beforeInteractive")return _?(s.default.preload(_,P.integrity?{as:"script",integrity:P.integrity,nonce:K,crossOrigin:P.crossOrigin}:{as:"script",nonce:K,crossOrigin:P.crossOrigin}),(0,i.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([_,{...P,id:x}])+")"}})):(P.dangerouslySetInnerHTML&&(P.children=P.dangerouslySetInnerHTML.__html,delete P.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...P,id:x}])+")"}}));k==="afterInteractive"&&_&&s.default.preload(_,P.integrity?{as:"script",integrity:P.integrity,nonce:K,crossOrigin:P.crossOrigin}:{as:"script",nonce:K,crossOrigin:P.crossOrigin})}return null}Object.defineProperty(b,"__nextScript",{value:!0});const S=b;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(xa,xa.exports)),xa.exports}var ud={},dd={},Jy;function vO(){return Jy||(Jy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{getObjectClassLabel:function(){return n},isPlainObject:function(){return r}});function n(o){return Object.prototype.toString.call(o)}function r(o){if(n(o)!=="[object Object]")return!1;const i=Object.getPrototypeOf(o);return i===null||i.hasOwnProperty("isPrototypeOf")}}(dd)),dd}var Xy;function Yy(){return Xy||(Xy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{default:function(){return r},getProperError:function(){return o}});const n=vO();function r(i){return typeof i=="object"&&i!==null&&"name"in i&&"message"in i}function o(i){if(r(i))return i;if(process.env.NODE_ENV==="development"){if(typeof i>"u")return new Error("An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined");if(i===null)return new Error("A null error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined")}return new Error((0,n.isPlainObject)(i)?JSON.stringify(i):i+"")}}(ud)),ud}var fd={},hd={},Qy;function bO(){return Qy||(Qy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\\/g,"/")}}(hd)),hd}var Zy;function wO(){return Zy||(Zy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"denormalizePagePath",{enumerable:!0,get:function(){return r}});const e=ym(),n=bO();function r(o){let i=(0,n.normalizePathSep)(o);return i.startsWith("/index/")&&!(0,e.isDynamicRoute)(i)?i.slice(6):i!=="/index"?i:"/"}}(fd)),fd}var pd={},e0;function SO(){return e0||(e0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(){const n=Object.create(null);return{on(r,o){(n[r]||(n[r]=[])).push(o)},off(r,o){n[r]&&n[r].splice(n[r].indexOf(o)>>>0,1)},emit(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];(n[r]||[]).slice().map(a=>{a(...i)})}}}}(pd)),pd}var gd={},t0;function md(){return t0||(t0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return r}});const e=Po(),n=Us();function r(o,i){const s=new URL(typeof window>"u"?"http://n":(0,e.getLocationOrigin)()),a=i?new URL(i,s):o.startsWith(".")?new URL(typeof window>"u"?"http://n":window.location.href):s,{pathname:l,searchParams:c,search:u,hash:d,href:h,origin:f}=new URL(o,a);if(f!==s.origin)throw new Error("invariant: invalid relative URL, router received "+o);return{pathname:l,query:(0,n.searchParamsToUrlQuery)(c),search:u,hash:d,href:h.slice(s.origin.length)}}}(gd)),gd}var yd={},vd={},xn={},n0;function r0(){if(n0)return xn;n0=1,Object.defineProperty(xn,"__esModule",{value:!0});function t(f){for(var p=[],g=0;g<f.length;){var m=f[g];if(m==="*"||m==="+"||m==="?"){p.push({type:"MODIFIER",index:g,value:f[g++]});continue}if(m==="\\"){p.push({type:"ESCAPED_CHAR",index:g++,value:f[g++]});continue}if(m==="{"){p.push({type:"OPEN",index:g,value:f[g++]});continue}if(m==="}"){p.push({type:"CLOSE",index:g,value:f[g++]});continue}if(m===":"){for(var v="",C=g+1;C<f.length;){var w=f.charCodeAt(C);if(w>=48&&w<=57||w>=65&&w<=90||w>=97&&w<=122||w===95){v+=f[C++];continue}break}if(!v)throw new TypeError("Missing parameter name at "+g);p.push({type:"NAME",index:g,value:v}),g=C;continue}if(m==="("){var b=1,S="",C=g+1;if(f[C]==="?")throw new TypeError('Pattern cannot start with "?" at '+C);for(;C<f.length;){if(f[C]==="\\"){S+=f[C++]+f[C++];continue}if(f[C]===")"){if(b--,b===0){C++;break}}else if(f[C]==="("&&(b++,f[C+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+C);S+=f[C++]}if(b)throw new TypeError("Unbalanced pattern at "+g);if(!S)throw new TypeError("Missing pattern at "+g);p.push({type:"PATTERN",index:g,value:S}),g=C;continue}p.push({type:"CHAR",index:g,value:f[g++]})}return p.push({type:"END",index:g,value:""}),p}function e(f,p){p===void 0&&(p={});for(var g=t(f),m=p.prefixes,v=m===void 0?"./":m,C="[^"+s(p.delimiter||"/#?")+"]+?",w=[],b=0,S=0,E="",x=function(K){if(S<g.length&&g[S].type===K)return g[S++].value},_=function(K){var R=x(K);if(R!==void 0)return R;var Q=g[S],se=Q.type,ie=Q.index;throw new TypeError("Unexpected "+se+" at "+ie+", expected "+K)},A=function(){for(var K="",R;R=x("CHAR")||x("ESCAPED_CHAR");)K+=R;return K};S<g.length;){var O=x("CHAR"),k=x("NAME"),M=x("PATTERN");if(k||M){var I=O||"";v.indexOf(I)===-1&&(E+=I,I=""),E&&(w.push(E),E=""),w.push({name:k||b++,prefix:I,suffix:"",pattern:M||C,modifier:x("MODIFIER")||""});continue}var P=O||x("ESCAPED_CHAR");if(P){E+=P;continue}E&&(w.push(E),E="");var F=x("OPEN");if(F){var I=A(),z=x("NAME")||"",V=x("PATTERN")||"",J=A();_("CLOSE"),w.push({name:z||(V?b++:""),pattern:z&&!V?C:V,prefix:I,suffix:J,modifier:x("MODIFIER")||""});continue}_("END")}return w}xn.parse=e;function n(f,p){return r(e(f,p),p)}xn.compile=n;function r(f,p){p===void 0&&(p={});var g=a(p),m=p.encode,v=m===void 0?function(S){return S}:m,C=p.validate,w=C===void 0?!0:C,b=f.map(function(S){if(typeof S=="object")return new RegExp("^(?:"+S.pattern+")$",g)});return function(S){for(var E="",x=0;x<f.length;x++){var _=f[x];if(typeof _=="string"){E+=_;continue}var A=S?S[_.name]:void 0,O=_.modifier==="?"||_.modifier==="*",k=_.modifier==="*"||_.modifier==="+";if(Array.isArray(A)){if(!k)throw new TypeError('Expected "'+_.name+'" to not repeat, but got an array');if(A.length===0){if(O)continue;throw new TypeError('Expected "'+_.name+'" to not be empty')}for(var M=0;M<A.length;M++){var I=v(A[M],_);if(w&&!b[x].test(I))throw new TypeError('Expected all "'+_.name+'" to match "'+_.pattern+'", but got "'+I+'"');E+=_.prefix+I+_.suffix}continue}if(typeof A=="string"||typeof A=="number"){var I=v(String(A),_);if(w&&!b[x].test(I))throw new TypeError('Expected "'+_.name+'" to match "'+_.pattern+'", but got "'+I+'"');E+=_.prefix+I+_.suffix;continue}if(!O){var P=k?"an array":"a string";throw new TypeError('Expected "'+_.name+'" to be '+P)}}return E}}xn.tokensToFunction=r;function o(f,p){var g=[],m=h(f,g,p);return i(m,g,p)}xn.match=o;function i(f,p,g){g===void 0&&(g={});var m=g.decode,v=m===void 0?function(C){return C}:m;return function(C){var w=f.exec(C);if(!w)return!1;for(var b=w[0],S=w.index,E=Object.create(null),x=function(A){if(w[A]===void 0)return"continue";var O=p[A-1];O.modifier==="*"||O.modifier==="+"?E[O.name]=w[A].split(O.prefix+O.suffix).map(function(k){return v(k,O)}):E[O.name]=v(w[A],O)},_=1;_<w.length;_++)x(_);return{path:b,index:S,params:E}}}xn.regexpToFunction=i;function s(f){return f.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(f){return f&&f.sensitive?"":"i"}function l(f,p){if(!p)return f;var g=f.source.match(/\((?!\?)/g);if(g)for(var m=0;m<g.length;m++)p.push({name:m,prefix:"",suffix:"",modifier:"",pattern:""});return f}function c(f,p,g){var m=f.map(function(v){return h(v,p,g).source});return new RegExp("(?:"+m.join("|")+")",a(g))}function u(f,p,g){return d(e(f,g),p,g)}function d(f,p,g){g===void 0&&(g={});for(var m=g.strict,v=m===void 0?!1:m,C=g.start,w=C===void 0?!0:C,b=g.end,S=b===void 0?!0:b,E=g.encode,x=E===void 0?function(K){return K}:E,_="["+s(g.endsWith||"")+"]|$",A="["+s(g.delimiter||"/#?")+"]",O=w?"^":"",k=0,M=f;k<M.length;k++){var I=M[k];if(typeof I=="string")O+=s(x(I));else{var P=s(x(I.prefix)),F=s(x(I.suffix));if(I.pattern)if(p&&p.push(I),P||F)if(I.modifier==="+"||I.modifier==="*"){var z=I.modifier==="*"?"?":"";O+="(?:"+P+"((?:"+I.pattern+")(?:"+F+P+"(?:"+I.pattern+"))*)"+F+")"+z}else O+="(?:"+P+"("+I.pattern+")"+F+")"+I.modifier;else O+="("+I.pattern+")"+I.modifier;else O+="(?:"+P+F+")"+I.modifier}}if(S)v||(O+=A+"?"),O+=g.endsWith?"(?="+_+")":"$";else{var V=f[f.length-1],J=typeof V=="string"?A.indexOf(V[V.length-1])>-1:V===void 0;v||(O+="(?:"+A+"(?="+_+"))?"),J||(O+="(?="+A+"|"+_+")")}return new RegExp(O,a(g))}xn.tokensToRegexp=d;function h(f,p,g){return f instanceof RegExp?l(f,p):Array.isArray(f)?c(f,p,g):u(f,p,g)}return xn.pathToRegexp=h,xn}var o0;function CO(){return o0||(o0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return n}});const e=r0();function n(r,o){const i=[],s=(0,e.pathToRegexp)(r,i,{delimiter:"/",sensitive:typeof(o==null?void 0:o.sensitive)=="boolean"?o.sensitive:!1,strict:o==null?void 0:o.strict}),a=(0,e.regexpToFunction)(o!=null&&o.regexModifier?new RegExp(o.regexModifier(s.source),s.flags):s,i);return(l,c)=>{if(typeof l!="string")return!1;const u=a(l);if(!u)return!1;if(o!=null&&o.removeUnnamedParams)for(const d of i)typeof d.name=="number"&&delete u.params[d.name];return{...c,...u.params}}}}(vd)),vd}var bd={},wd={},i0;function EO(){return i0||(i0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return r}});const e=Us(),n=md();function r(o){if(o.startsWith("/"))return(0,n.parseRelativeUrl)(o);const i=new URL(o);return{hash:i.hash,hostname:i.hostname,href:i.href,pathname:i.pathname,port:i.port,protocol:i.protocol,query:(0,e.searchParamsToUrlQuery)(i.searchParams),search:i.search}}}(wd)),wd}var Ta={exports:{}},s0;function _O(){return s0||(s0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(h,f){for(var p in f)Object.defineProperty(h,p,{enumerable:!0,get:f[p]})}n(e,{ACTION:function(){return o},FLIGHT_PARAMETERS:function(){return c},NEXT_DID_POSTPONE_HEADER:function(){return d},NEXT_ROUTER_PREFETCH_HEADER:function(){return s},NEXT_ROUTER_STATE_TREE:function(){return i},NEXT_RSC_UNION_QUERY:function(){return u},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return l},RSC_HEADER:function(){return r}});const r="RSC",o="Next-Action",i="Next-Router-State-Tree",s="Next-Router-Prefetch",a="Next-Url",l="text/x-component",c=[[r],[i],[s]],u="_rsc",d="x-nextjs-postponed";(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ta,Ta.exports)),Ta.exports}var Sd={},Cd={exports:{}},a0;function xO(){return a0||(a0=1,(()=>{typeof __nccwpck_require__<"u"&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{var e=t;/*!
13
- * cookie
14
- * Copyright(c) 2012-2014 Roman Shtylman
15
- * Copyright(c) 2015 Douglas Christopher Wilson
16
- * MIT Licensed
17
- */e.parse=s,e.serialize=a;var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(c,u){if(typeof c!="string")throw new TypeError("argument str must be a string");for(var d={},h=u||{},f=c.split(o),p=h.decode||n,g=0;g<f.length;g++){var m=f[g],v=m.indexOf("=");if(!(v<0)){var C=m.substr(0,v).trim(),w=m.substr(++v,m.length).trim();w[0]=='"'&&(w=w.slice(1,-1)),d[C]==null&&(d[C]=l(w,p))}}return d}function a(c,u,d){var h=d||{},f=h.encode||r;if(typeof f!="function")throw new TypeError("option encode is invalid");if(!i.test(c))throw new TypeError("argument name is invalid");var p=f(u);if(p&&!i.test(p))throw new TypeError("argument val is invalid");var g=c+"="+p;if(h.maxAge!=null){var m=h.maxAge-0;if(isNaN(m)||!isFinite(m))throw new TypeError("option maxAge is invalid");g+="; Max-Age="+Math.floor(m)}if(h.domain){if(!i.test(h.domain))throw new TypeError("option domain is invalid");g+="; Domain="+h.domain}if(h.path){if(!i.test(h.path))throw new TypeError("option path is invalid");g+="; Path="+h.path}if(h.expires){if(typeof h.expires.toUTCString!="function")throw new TypeError("option expires is invalid");g+="; Expires="+h.expires.toUTCString()}if(h.httpOnly&&(g+="; HttpOnly"),h.secure&&(g+="; Secure"),h.sameSite){var v=typeof h.sameSite=="string"?h.sameSite.toLowerCase():h.sameSite;switch(v){case!0:g+="; SameSite=Strict";break;case"lax":g+="; SameSite=Lax";break;case"strict":g+="; SameSite=Strict";break;case"none":g+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return g}function l(c,u){try{return u(c)}catch{return c}}})(),Cd.exports=t})()),Cd.exports}var l0;function AO(){return l0||(l0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return e}});function e(n){return function(){const{cookie:o}=n;if(!o)return{};const{parse:i}=xO();return i(Array.isArray(o)?o.join("; "):o)}}}(Sd)),Sd}var c0;function TO(){return c0||(c0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(p,g){for(var m in g)Object.defineProperty(p,m,{enumerable:!0,get:g[m]})}e(t,{compileNonPath:function(){return h},matchHas:function(){return d},prepareDestination:function(){return f}});const n=r0(),r=Sm(),o=EO(),i=Eu(),s=_O(),a=AO();function l(p){let g="";for(let m=0;m<p.length;m++){const v=p.charCodeAt(m);(v>64&&v<91||v>96&&v<123)&&(g+=p[m])}return g}function c(p,g){return p.replace(new RegExp(":"+(0,r.escapeStringRegexp)(g),"g"),"__ESC_COLON_"+g)}function u(p){return p.replace(/__ESC_COLON_/gi,":")}function d(p,g,m,v){m===void 0&&(m=[]),v===void 0&&(v=[]);const C={},w=S=>{let E,x=S.key;switch(S.type){case"header":{x=x.toLowerCase(),E=p.headers[x];break}case"cookie":{"cookies"in p?E=p.cookies[S.key]:E=(0,a.getCookieParser)(p.headers)()[S.key];break}case"query":{E=g[x];break}case"host":{const{host:_}=(p==null?void 0:p.headers)||{};E=_==null?void 0:_.split(":",1)[0].toLowerCase();break}}if(!S.value&&E)return C[l(x)]=E,!0;if(E){const _=new RegExp("^"+S.value+"$"),A=Array.isArray(E)?E.slice(-1)[0].match(_):E.match(_);if(A)return Array.isArray(A)&&(A.groups?Object.keys(A.groups).forEach(O=>{C[O]=A.groups[O]}):S.type==="host"&&A[0]&&(C.host=A[0])),!0}return!1};return m.every(S=>w(S))&&!v.some(S=>w(S))?C:!1}function h(p,g){if(!p.includes(":"))return p;for(const m of Object.keys(g))p.includes(":"+m)&&(p=p.replace(new RegExp(":"+m+"\\*","g"),":"+m+"--ESCAPED_PARAM_ASTERISKS").replace(new RegExp(":"+m+"\\?","g"),":"+m+"--ESCAPED_PARAM_QUESTION").replace(new RegExp(":"+m+"\\+","g"),":"+m+"--ESCAPED_PARAM_PLUS").replace(new RegExp(":"+m+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+m));return p=p.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+p,{validate:!1})(g).slice(1)}function f(p){const g=Object.assign({},p.query);delete g.__nextLocale,delete g.__nextDefaultLocale,delete g.__nextDataReq,delete g.__nextInferredLocaleFromDefault,delete g[s.NEXT_RSC_UNION_QUERY];let m=p.destination;for(const M of Object.keys({...p.params,...g}))m=c(m,M);const v=(0,o.parseUrl)(m),C=v.query,w=u(""+v.pathname+(v.hash||"")),b=u(v.hostname||""),S=[],E=[];(0,n.pathToRegexp)(w,S),(0,n.pathToRegexp)(b,E);const x=[];S.forEach(M=>x.push(M.name)),E.forEach(M=>x.push(M.name));const _=(0,n.compile)(w,{validate:!1}),A=(0,n.compile)(b,{validate:!1});for(const[M,I]of Object.entries(C))Array.isArray(I)?C[M]=I.map(P=>h(u(P),p.params)):typeof I=="string"&&(C[M]=h(u(I),p.params));let O=Object.keys(p.params).filter(M=>M!=="nextInternalLocale");if(p.appendParamsToQuery&&!O.some(M=>x.includes(M)))for(const M of O)M in C||(C[M]=p.params[M]);let k;if((0,i.isInterceptionRouteAppPath)(w))for(const M of w.split("/")){const I=i.INTERCEPTION_ROUTE_MARKERS.find(P=>M.startsWith(P));if(I){p.params[0]=I;break}}try{k=_(p.params);const[M,I]=k.split("#",2);v.hostname=A(p.params),v.pathname=M,v.hash=(I?"#":"")+(I||""),delete v.search}catch(M){throw M.message.match(/Expected .*? to not repeat, but got an array/)?new Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"):M}return v.query={...g,...v.query},{newUrl:k,destQuery:C,parsedDestination:v}}}(bd)),bd}var Oa={exports:{}},u0;function d0(){return u0||(u0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeBasePath",{enumerable:!0,get:function(){return o}});const n=pu(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!(0,n.hasBasePath)(i)||r.length===0||(i=i.slice(r.length),i.startsWith("/")||(i="/"+i)),i}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Oa,Oa.exports)),Oa.exports}var f0;function OO(){return f0||(f0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const e=CO(),n=TO(),r=xi(),o=ta(),i=d0(),s=md();function a(l,c,u,d,h,f){let p=!1,g=!1,m=(0,s.parseRelativeUrl)(l),v=(0,r.removeTrailingSlash)((0,o.normalizeLocalePath)((0,i.removeBasePath)(m.pathname),f).pathname),C;const w=S=>{let x=(0,e.getPathMatch)(S.source+(process.env.__NEXT_TRAILING_SLASH?"(/)?":""),{removeUnnamedParams:!0,strict:!0})(m.pathname);if((S.has||S.missing)&&x){const _=(0,n.matchHas)({headers:{host:document.location.hostname,"user-agent":navigator.userAgent},cookies:document.cookie.split("; ").reduce((A,O)=>{const[k,...M]=O.split("=");return A[k]=M.join("="),A},{})},m.query,S.has,S.missing);_?Object.assign(x,_):x=!1}if(x){if(!S.destination)return g=!0,!0;const _=(0,n.prepareDestination)({appendParamsToQuery:!0,destination:S.destination,params:x,query:d});if(m=_.parsedDestination,l=_.newUrl,Object.assign(d,_.parsedDestination.query),v=(0,r.removeTrailingSlash)((0,o.normalizeLocalePath)((0,i.removeBasePath)(l),f).pathname),c.includes(v))return p=!0,C=v,!0;if(C=h(v),C!==l&&c.includes(C))return p=!0,!0}};let b=!1;for(let S=0;S<u.beforeFiles.length;S++)w(u.beforeFiles[S]);if(p=c.includes(v),!p){if(!b){for(let S=0;S<u.afterFiles.length;S++)if(w(u.afterFiles[S])){b=!0;break}}if(b||(C=h(v),p=c.includes(C),b=p),!b){for(let S=0;S<u.fallback.length;S++)if(w(u.fallback[S])){b=!0;break}}}return{asPath:l,parsedAs:m,matchedPage:p,resolvedHref:C,externalDest:g}}}(yd)),yd}var ka={exports:{}},h0;function kO(){return h0||(h0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeLocale",{enumerable:!0,get:function(){return r}});const n=Io();function r(o,i){if(process.env.__NEXT_I18N_SUPPORT){const{pathname:s}=(0,n.parsePath)(o),a=s.toLowerCase(),l=i==null?void 0:i.toLowerCase();return i&&(a.startsWith("/"+l+"/")||a==="/"+l)?(s.length===i.length+1?"/":"")+o.slice(i.length+1):o}return o}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ka,ka.exports)),ka.exports}var Ed={},p0;function MO(){return p0||(p0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAPIRoute",{enumerable:!0,get:function(){return e}});function e(n){return n==="/api"||!!(n!=null&&n.startsWith("/api/"))}}(Ed)),Ed}var _d={},xd={},g0;function PO(){return g0||(g0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return n}});const e=Js();function n(r,o){if(!(0,e.pathHasPrefix)(r,o))return r;const i=r.slice(o.length);return i.startsWith("/")?i:"/"+i}}(xd)),xd}var m0;function IO(){return m0||(m0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const e=ta(),n=PO(),r=Js();function o(i,s){var a;const{basePath:l,i18n:c,trailingSlash:u}=(a=s.nextConfig)!=null?a:{},d={pathname:i,trailingSlash:i!=="/"?i.endsWith("/"):u};l&&(0,r.pathHasPrefix)(d.pathname,l)&&(d.pathname=(0,n.removePathPrefix)(d.pathname,l),d.basePath=l);let h=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const p=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),g=p[0];d.buildId=g,h=p[1]!=="index"?"/"+p.slice(1).join("/"):"/",s.parseData===!0&&(d.pathname=h)}if(c){let p=s.i18nProvider?s.i18nProvider.analyze(d.pathname):(0,e.normalizeLocalePath)(d.pathname,c.locales);d.locale=p.detectedLocale;var f;d.pathname=(f=p.pathname)!=null?f:d.pathname,!p.detectedLocale&&d.buildId&&(p=s.i18nProvider?s.i18nProvider.analyze(h):(0,e.normalizeLocalePath)(h,c.locales),p.detectedLocale&&(d.locale=p.detectedLocale))}return d}}(_d)),_d}var Ad={},Td={},y0;function LO(){return y0||(y0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return n}});const e=Io();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:i,query:s,hash:a}=(0,e.parsePath)(r);return""+i+o+s+a}}(Td)),Td}var v0;function DO(){return v0||(v0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return i}});const e=xi(),n=Mu(),r=LO(),o=Mm();function i(s){let a=(0,o.addLocale)(s.pathname,s.locale,s.buildId?void 0:s.defaultLocale,s.ignorePrefix);return(s.buildId||!s.trailingSlash)&&(a=(0,e.removeTrailingSlash)(a)),s.buildId&&(a=(0,r.addPathSuffix)((0,n.addPathPrefix)(a,"/_next/data/"+s.buildId),s.pathname==="/"?"index.json":".json")),a=(0,n.addPathPrefix)(a,s.basePath),!s.buildId&&s.trailingSlash?a.endsWith("/")?a:(0,r.addPathSuffix)(a,"/"):(0,e.removeTrailingSlash)(a)}}(Ad)),Ad}var Od={},b0;function NO(){return b0||(b0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"compareRouterStates",{enumerable:!0,get:function(){return e}});function e(n,r){const o=Object.keys(n);if(o.length!==Object.keys(r).length)return!1;for(let i=o.length;i--;){const s=o[i];if(s==="query"){const a=Object.keys(n.query);if(a.length!==Object.keys(r.query).length)return!1;for(let l=a.length;l--;){const c=a[l];if(!r.query.hasOwnProperty(c)||n.query[c]!==r.query[c])return!1}}else if(!r.hasOwnProperty(s)||n[s]!==r[s])return!1}return!0}}(Od)),Od}var kd={},w0;function RO(){return w0||(w0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return e}});function e(n){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(n)}}(kd)),kd}var Md={},S0;function FO(){return S0||(S0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return e}});function e(n,r){if(r===void 0&&(r={}),r.onlyHashChange){n();return}const o=document.documentElement,i=o.style.scrollBehavior;o.style.scrollBehavior="auto",r.dontForceLayout||o.getClientRects(),n(),o.style.scrollBehavior=i}}(Md)),Md}var Ma={exports:{}},qe={};/**
18
- * @license React
19
- * react-is.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var C0;function HO(){if(C0)return qe;C0=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var v=m.$$typeof;switch(v){case t:switch(m=m.type,m){case n:case o:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case a:case s:case l:case h:case d:case i:return m;default:return v}}case e:return v}}}return qe.ContextConsumer=s,qe.ContextProvider=i,qe.Element=t,qe.ForwardRef=l,qe.Fragment=n,qe.Lazy=h,qe.Memo=d,qe.Portal=e,qe.Profiler=o,qe.StrictMode=r,qe.Suspense=c,qe.SuspenseList=u,qe.isAsyncMode=function(){return!1},qe.isConcurrentMode=function(){return!1},qe.isContextConsumer=function(m){return g(m)===s},qe.isContextProvider=function(m){return g(m)===i},qe.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},qe.isForwardRef=function(m){return g(m)===l},qe.isFragment=function(m){return g(m)===n},qe.isLazy=function(m){return g(m)===h},qe.isMemo=function(m){return g(m)===d},qe.isPortal=function(m){return g(m)===e},qe.isProfiler=function(m){return g(m)===o},qe.isStrictMode=function(m){return g(m)===r},qe.isSuspense=function(m){return g(m)===c},qe.isSuspenseList=function(m){return g(m)===u},qe.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===o||m===r||m===c||m===u||m===f||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===d||m.$$typeof===i||m.$$typeof===s||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},qe.typeOf=g,qe}var We={};/**
26
- * @license React
27
- * react-is.development.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var E0;function BO(){return E0||(E0=1,process.env.NODE_ENV!=="production"&&function(){var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=!1,g=!1,m=!1,v=!1,C=!1,w;w=Symbol.for("react.module.reference");function b(G){return!!(typeof G=="string"||typeof G=="function"||G===n||G===o||C||G===r||G===c||G===u||v||G===f||p||g||m||typeof G=="object"&&G!==null&&(G.$$typeof===h||G.$$typeof===d||G.$$typeof===i||G.$$typeof===s||G.$$typeof===l||G.$$typeof===w||G.getModuleId!==void 0))}function S(G){if(typeof G=="object"&&G!==null){var ne=G.$$typeof;switch(ne){case t:var X=G.type;switch(X){case n:case o:case r:case c:case u:return X;default:var W=X&&X.$$typeof;switch(W){case a:case s:case l:case h:case d:case i:return W;default:return ne}}case e:return ne}}}var E=s,x=i,_=t,A=l,O=n,k=h,M=d,I=e,P=o,F=r,z=c,V=u,J=!1,K=!1;function R(G){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Q(G){return K||(K=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function se(G){return S(G)===s}function ie(G){return S(G)===i}function de(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ue(G){return S(G)===l}function pe(G){return S(G)===n}function D(G){return S(G)===h}function ce(G){return S(G)===d}function ye(G){return S(G)===e}function be(G){return S(G)===o}function H(G){return S(G)===r}function L(G){return S(G)===c}function Ve(G){return S(G)===u}We.ContextConsumer=E,We.ContextProvider=x,We.Element=_,We.ForwardRef=A,We.Fragment=O,We.Lazy=k,We.Memo=M,We.Portal=I,We.Profiler=P,We.StrictMode=F,We.Suspense=z,We.SuspenseList=V,We.isAsyncMode=R,We.isConcurrentMode=Q,We.isContextConsumer=se,We.isContextProvider=ie,We.isElement=de,We.isForwardRef=ue,We.isFragment=pe,We.isLazy=D,We.isMemo=ce,We.isPortal=ye,We.isProfiler=be,We.isStrictMode=H,We.isSuspense=L,We.isSuspenseList=Ve,We.isValidElementType=b,We.typeOf=S}()),We}var _0;function VO(){return _0||(_0=1,process.env.NODE_ENV==="production"?Ma.exports=HO():Ma.exports=BO()),Ma.exports}var Pd={},Id={exports:{}};const Ld=Ax(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var x0;function $O(){return x0||(x0=1,(()=>{var t={154:(o,i,s)=>{var a=s(781),l=["write","end","destroy"],c=["resume","pause"],u=["data","close"],d=Array.prototype.slice;o.exports=f;function h(p,g){if(p.forEach)return p.forEach(g);for(var m=0;m<p.length;m++)g(p[m],m)}function f(p,g){var m=new a,v=!1;return h(l,C),h(c,w),h(u,b),g.on("end",S),p.on("drain",function(){m.emit("drain")}),p.on("error",E),g.on("error",E),m.writable=p.writable,m.readable=g.readable,m;function C(x){m[x]=_;function _(){return p[x].apply(p,arguments)}}function w(x){m[x]=_;function _(){m.emit(x);var A=g[x];if(A)return A.apply(g,arguments);g.emit(x)}}function b(x){g.on(x,_);function _(){var A=d.call(arguments);A.unshift(x),m.emit.apply(m,A)}}function S(){if(!v){v=!0;var x=d.call(arguments);x.unshift("end"),m.emit.apply(m,x)}}function E(x){m.emit("error",x)}}},349:(o,i,s)=>{const a=s(147),l=s(781),c=s(796),u=s(154),d=s(530),h=f=>Object.assign({level:9},f);o.exports=(f,p)=>f?d(c.gzip)(f,h(p)).then(g=>g.length).catch(g=>0):Promise.resolve(0),o.exports.sync=(f,p)=>c.gzipSync(f,h(p)).length,o.exports.stream=f=>{const p=new l.PassThrough,g=new l.PassThrough,m=u(p,g);let v=0;const C=c.createGzip(h(f)).on("data",w=>{v+=w.length}).on("error",()=>{m.gzipSize=0}).on("end",()=>{m.gzipSize=v,m.emit("gzip-size",v),g.end()});return p.pipe(C),p.pipe(g,{end:!1}),m},o.exports.file=(f,p)=>new Promise((g,m)=>{const v=a.createReadStream(f);v.on("error",m);const C=v.pipe(o.exports.stream(p));C.on("error",m),C.on("gzip-size",g)}),o.exports.fileSync=(f,p)=>o.exports.sync(a.readFileSync(f),p)},530:o=>{const i=(s,a)=>function(...l){const c=a.promiseModule;return new c((u,d)=>{a.multiArgs?l.push((...h)=>{a.errorFirst?h[0]?d(h):(h.shift(),u(h)):u(h)}):a.errorFirst?l.push((h,f)=>{h?d(h):u(f)}):l.push(u),s.apply(this,l)})};o.exports=(s,a)=>{a=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},a);const l=typeof s;if(!(s!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${s===null?"null":l}\``);const c=d=>{const h=f=>typeof f=="string"?d===f:f.test(d);return a.include?a.include.some(h):!a.exclude.some(h)};let u;l==="function"?u=function(...d){return a.excludeMain?s(...d):i(s,a).apply(this,d)}:u=Object.create(Object.getPrototypeOf(s));for(const d in s){const h=s[d];u[d]=typeof h=="function"&&c(d)?i(h,a):h}return u}},147:o=>{o.exports=Ld},781:o=>{o.exports=Ld},796:o=>{o.exports=Ld}},e={};function n(o){var i=e[o];if(i!==void 0)return i.exports;var s=e[o]={exports:{}},a=!0;try{t[o](s,s.exports,n),a=!1}finally{a&&delete e[o]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(349);Id.exports=r})()),Id.exports}var A0;function jO(){return A0||(A0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BloomFilter",{enumerable:!0,get:function(){return r}});function e(o){let i=0;for(let s=0;s<o.length;s++){const a=o.charCodeAt(s);i=Math.imul(i^a,1540483477),i^=i>>>13,i=Math.imul(i,1540483477)}return i>>>0}const n=1e-4;class r{static from(i,s){s===void 0&&(s=n);const a=new r(i.length,s);for(const l of i)a.add(l);return a}export(){const i={numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray};if(process.env.NEXT_RUNTIME==="nodejs"&&this.errorRate<n){const s=JSON.stringify(i),a=$O().sync(s);a>1024&&console.warn("Creating filter with error rate less than 0.1% (0.001) can increase the size dramatically proceed with caution. Received error rate "+this.errorRate+" resulted in size "+s.length+" bytes, "+a+" bytes (gzip)")}return i}import(i){this.numItems=i.numItems,this.errorRate=i.errorRate,this.numBits=i.numBits,this.numHashes=i.numHashes,this.bitArray=i.bitArray}add(i){this.getHashValues(i).forEach(a=>{this.bitArray[a]=1})}contains(i){return this.getHashValues(i).every(a=>this.bitArray[a])}getHashValues(i){const s=[];for(let a=1;a<=this.numHashes;a++){const l=e(""+i+a)%this.numBits;s.push(l)}return s}constructor(i,s=n){this.numItems=i,this.errorRate=s,this.numBits=Math.ceil(-(i*Math.log(s))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/i*Math.log(2)),this.bitArray=new Array(this.numBits).fill(0)}}}(Pd)),Pd}var T0;function zO(){return T0||(T0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(ne,X){for(var W in X)Object.defineProperty(ne,W,{enumerable:!0,get:X[W]})}e(t,{createKey:function(){return H},default:function(){return G},matchesMiddleware:function(){return R}});const n=Ft,r=_i(),o=xi(),i=gO(),s=yO(),a=r._(Yy()),l=wO(),c=ta(),u=n._(SO()),d=Po(),h=gm(),f=md(),p=n._(OO()),g=bm(),m=Em(),v=au(),C=$m(),w=Io(),b=Im(),S=kO(),E=d0(),x=Um(),_=pu(),A=Tm(),O=MO(),k=IO(),M=DO(),I=NO(),P=gu(),F=RO(),z=tm(),V=xm(),J=FO();function K(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}async function R(ne){const X=await Promise.resolve(ne.router.pageLoader.getMiddleware());if(!X)return!1;const{pathname:W}=(0,w.parsePath)(ne.asPath),$=(0,_.hasBasePath)(W)?(0,E.removeBasePath)(W):W,ee=(0,x.addBasePath)((0,b.addLocale)($,ne.locale));return X.some(Ce=>new RegExp(Ce.regexp).test(ee))}function Q(ne){const X=(0,d.getLocationOrigin)();return ne.startsWith(X)?ne.substring(X.length):ne}function se(ne,X,W){let[$,ee]=(0,A.resolveHref)(ne,X,!0);const Ce=(0,d.getLocationOrigin)(),we=$.startsWith(Ce),Z=ee&&ee.startsWith(Ce);$=Q($),ee=ee&&Q(ee);const Se=we?$:(0,x.addBasePath)($),U=W?Q((0,A.resolveHref)(ne,W)):ee||$;return{url:Se,as:Z?U:(0,x.addBasePath)(U)}}function ie(ne,X){const W=(0,o.removeTrailingSlash)((0,l.denormalizePagePath)(ne));return W==="/404"||W==="/_error"?ne:(X.includes(W)||X.some($=>{if((0,h.isDynamicRoute)($)&&(0,m.getRouteRegex)($).re.test(W))return ne=$,!0}),(0,o.removeTrailingSlash)(ne))}function de(ne,X,W){const $={basePath:W.router.basePath,i18n:{locales:W.router.locales},trailingSlash:!!process.env.__NEXT_TRAILING_SLASH},ee=X.headers.get("x-nextjs-rewrite");let Ce=ee||X.headers.get("x-nextjs-matched-path");const we=X.headers.get("x-matched-path");if(we&&!Ce&&!we.includes("__next_data_catchall")&&!we.includes("/_error")&&!we.includes("/404")&&(Ce=we),Ce){if(Ce.startsWith("/")||process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE){const B=(0,f.parseRelativeUrl)(Ce),re=(0,k.getNextPathnameInfo)(B.pathname,{nextConfig:$,parseData:!0});let j=(0,o.removeTrailingSlash)(re.pathname);return Promise.all([W.router.pageLoader.getPageList(),(0,i.getClientBuildManifest)()]).then(te=>{let[fe,{__rewrites:ve}]=te,Ee=(0,b.addLocale)(re.pathname,re.locale);if((0,h.isDynamicRoute)(Ee)||!ee&&fe.includes((0,c.normalizeLocalePath)((0,E.removeBasePath)(Ee),W.router.locales).pathname)){const Ue=(0,k.getNextPathnameInfo)((0,f.parseRelativeUrl)(ne).pathname,{nextConfig:process.env.__NEXT_HAS_REWRITES?void 0:$,parseData:!0});Ee=(0,x.addBasePath)(Ue.pathname),B.pathname=Ee}if(process.env.__NEXT_HAS_REWRITES){const Ue=(0,p.default)(Ee,fe,ve,B.query,q=>ie(q,fe),W.router.locales);Ue.matchedPage&&(B.pathname=Ue.parsedAs.pathname,Ee=B.pathname,Object.assign(B.query,Ue.parsedAs.query))}else if(!fe.includes(j)){const Ue=ie(j,fe);Ue!==j&&(j=Ue)}const je=fe.includes(j)?j:ie((0,c.normalizeLocalePath)((0,E.removeBasePath)(B.pathname),W.router.locales).pathname,fe);if((0,h.isDynamicRoute)(je)){const Ue=(0,g.getRouteMatcher)((0,m.getRouteRegex)(je))(Ee);Object.assign(B.query,Ue||{})}return{type:"rewrite",parsedAs:B,resolvedHref:je}})}const Se=(0,w.parsePath)(ne),U=(0,M.formatNextPathnameInfo)({...(0,k.getNextPathnameInfo)(Se.pathname,{nextConfig:$,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-external",destination:""+U+Se.query+Se.hash})}const Z=X.headers.get("x-nextjs-redirect");if(Z){if(Z.startsWith("/")){const Se=(0,w.parsePath)(Z),U=(0,M.formatNextPathnameInfo)({...(0,k.getNextPathnameInfo)(Se.pathname,{nextConfig:$,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-internal",newAs:""+U+Se.query+Se.hash,newUrl:""+U+Se.query+Se.hash})}return Promise.resolve({type:"redirect-external",destination:Z})}return Promise.resolve({type:"next"})}async function ue(ne){if(!await R(ne)||!ne.fetchData)return null;const W=await ne.fetchData(),$=await de(W.dataHref,W.response,ne);return{dataHref:W.dataHref,json:W.json,response:W.response,text:W.text,cacheKey:W.cacheKey,effect:$}}const pe=process.env.__NEXT_SCROLL_RESTORATION&&typeof window<"u"&&"scrollRestoration"in window.history&&!!function(){try{let ne="__next";return sessionStorage.setItem(ne,ne),sessionStorage.removeItem(ne),!0}catch{}}(),D=Symbol("SSG_DATA_NOT_FOUND");function ce(ne,X,W){return fetch(ne,{credentials:"same-origin",method:W.method||"GET",headers:Object.assign({},W.headers,{"x-nextjs-data":"1"})}).then($=>!$.ok&&X>1&&$.status>=500?ce(ne,X-1,W):$)}function ye(ne){try{return JSON.parse(ne)}catch{return null}}function be(ne){let{dataHref:X,inflightCache:W,isPrefetch:$,hasMiddleware:ee,isServerRender:Ce,parseJSON:we,persistCache:Z,isBackground:Se,unstable_skipClientCache:U}=ne;const{href:B}=new URL(X,window.location.href),re=j=>{var te;return ce(X,Ce?3:1,{headers:Object.assign({},$?{purpose:"prefetch"}:{},$&&ee?{"x-middleware-prefetch":"1"}:{}),method:(te=j==null?void 0:j.method)!=null?te:"GET"}).then(fe=>fe.ok&&(j==null?void 0:j.method)==="HEAD"?{dataHref:X,response:fe,text:"",json:{},cacheKey:B}:fe.text().then(ve=>{if(!fe.ok){if(ee&&[301,302,307,308].includes(fe.status))return{dataHref:X,response:fe,text:ve,json:{},cacheKey:B};if(fe.status===404){var Ee;if((Ee=ye(ve))!=null&&Ee.notFound)return{dataHref:X,json:{notFound:D},response:fe,text:ve,cacheKey:B}}const je=new Error("Failed to load static props");throw Ce||(0,i.markAssetError)(je),je}return{dataHref:X,json:we?ye(ve):null,response:fe,text:ve,cacheKey:B}})).then(fe=>((!Z||process.env.NODE_ENV!=="production"||fe.response.headers.get("x-middleware-cache")==="no-cache")&&delete W[B],fe)).catch(fe=>{throw U||delete W[B],(fe.message==="Failed to fetch"||fe.message==="NetworkError when attempting to fetch resource."||fe.message==="Load failed")&&(0,i.markAssetError)(fe),fe})};return U&&Z?re({}).then(j=>(j.response.headers.get("x-middleware-cache")!=="no-cache"&&(W[B]=Promise.resolve(j)),j)):W[B]!==void 0?W[B]:W[B]=re(Se?{method:"HEAD"}:{})}function H(){return Math.random().toString(36).slice(2,10)}function L(ne){let{url:X,router:W}=ne;if(X===(0,x.addBasePath)((0,b.addLocale)(W.asPath,W.locale)))throw new Error("Invariant: attempted to hard navigate to the same URL "+X+" "+location.href);window.location.href=X}const Ve=ne=>{let{route:X,router:W}=ne,$=!1;const ee=W.clc=()=>{$=!0};return()=>{if($){const we=new Error('Abort fetching component for route: "'+X+'"');throw we.cancelled=!0,we}ee===W.clc&&(W.clc=null)}};class G{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(X,W,$){if($===void 0&&($={}),process.env.__NEXT_SCROLL_RESTORATION&&pe)try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}return{url:X,as:W}=se(this,X,W),this.change("pushState",X,W,$)}replace(X,W,$){return $===void 0&&($={}),{url:X,as:W}=se(this,X,W),this.change("replaceState",X,W,$)}async _bfl(X,W,$,ee){if(process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){let Se=!1,U=!1;for(const B of[X,W])if(B){const re=(0,o.removeTrailingSlash)(new URL(B,"http://n").pathname),j=(0,x.addBasePath)((0,b.addLocale)(re,$||this.locale));if(re!==(0,o.removeTrailingSlash)(new URL(this.asPath,"http://n").pathname)){var Ce,we;Se=Se||!!((Ce=this._bfl_s)!=null&&Ce.contains(re))||!!((we=this._bfl_s)!=null&&we.contains(j));for(const te of[re,j]){const fe=te.split("/");for(let ve=0;!U&&ve<fe.length+1;ve++){var Z;const Ee=fe.slice(0,ve).join("/");if(Ee&&((Z=this._bfl_d)!=null&&Z.contains(Ee))){U=!0;break}}}if(Se||U)return ee?!0:(L({url:(0,x.addBasePath)((0,b.addLocale)(X,$||this.locale,this.defaultLocale)),router:this}),new Promise(()=>{}))}}}return!1}async change(X,W,$,ee,Ce){var we;if(!(0,P.isLocalURL)(W))return L({url:W,router:this}),!1;const Z=ee._h===1;!Z&&!ee.shallow&&await this._bfl($,void 0,ee.locale);let Se=Z||ee._shouldResolveHref||(0,w.parsePath)(W).pathname===(0,w.parsePath)($).pathname;const U={...this.state},B=this.isReady!==!0;this.isReady=!0;const re=this.isSsr;if(Z||(this.isSsr=!1),Z&&this.clc)return!1;const j=U.locale;if(process.env.__NEXT_I18N_SUPPORT){U.locale=ee.locale===!1?this.defaultLocale:ee.locale||U.locale,typeof ee.locale>"u"&&(ee.locale=U.locale);const _e=(0,f.parseRelativeUrl)((0,_.hasBasePath)($)?(0,E.removeBasePath)($):$),on=(0,c.normalizeLocalePath)(_e.pathname,this.locales);on.detectedLocale&&(U.locale=on.detectedLocale,_e.pathname=(0,x.addBasePath)(_e.pathname),$=(0,v.formatWithValidation)(_e),W=(0,x.addBasePath)((0,c.normalizeLocalePath)((0,_.hasBasePath)(W)?(0,E.removeBasePath)(W):W,this.locales).pathname));let jn=!1;if(process.env.__NEXT_I18N_SUPPORT){var te;(te=this.locales)!=null&&te.includes(U.locale)||(_e.pathname=(0,b.addLocale)(_e.pathname,U.locale),L({url:(0,v.formatWithValidation)(_e),router:this}),jn=!0)}const jt=(0,C.detectDomainLocale)(this.domainLocales,void 0,U.locale);if(process.env.__NEXT_I18N_SUPPORT&&!jn&&jt&&this.isLocaleDomain&&self.location.hostname!==jt.domain){const Oo=(0,E.removeBasePath)($);L({url:"http"+(jt.http?"":"s")+"://"+jt.domain+(0,x.addBasePath)((U.locale===jt.defaultLocale?"":"/"+U.locale)+(Oo==="/"?"":Oo)||"/"),router:this}),jn=!0}if(jn)return new Promise(()=>{})}d.ST&&performance.mark("routeChange");const{shallow:fe=!1,scroll:ve=!0}=ee,Ee={shallow:fe};this._inFlightRoute&&this.clc&&(re||G.events.emit("routeChangeError",K(),this._inFlightRoute,Ee),this.clc(),this.clc=null),$=(0,x.addBasePath)((0,b.addLocale)((0,_.hasBasePath)($)?(0,E.removeBasePath)($):$,ee.locale,this.defaultLocale));const je=(0,S.removeLocale)((0,_.hasBasePath)($)?(0,E.removeBasePath)($):$,U.locale);this._inFlightRoute=$;const Ue=j!==U.locale;if(!Z&&this.onlyAHashChange(je)&&!Ue){U.asPath=je,G.events.emit("hashChangeStart",$,Ee),this.changeState(X,W,$,{...ee,scroll:!1}),ve&&this.scrollToHash(je);try{await this.set(U,this.components[U.route],null)}catch(_e){throw(0,a.default)(_e)&&_e.cancelled&&G.events.emit("routeChangeError",_e,je,Ee),_e}return G.events.emit("hashChangeComplete",$,Ee),!0}let q=(0,f.parseRelativeUrl)(W),{pathname:ae,query:ge}=q,Me,ke;try{[Me,{__rewrites:ke}]=await Promise.all([this.pageLoader.getPageList(),(0,i.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch{return L({url:$,router:this}),!1}!this.urlIsNew(je)&&!Ue&&(X="replaceState");let ze=$;ae=ae&&(0,o.removeTrailingSlash)((0,E.removeBasePath)(ae));let Te=(0,o.removeTrailingSlash)(ae);const et=$.startsWith("/")&&(0,f.parseRelativeUrl)($).pathname;if((we=this.components[ae])!=null&&we.__appRouter)return L({url:$,router:this}),new Promise(()=>{});const $n=!!(et&&Te!==et&&(!(0,h.isDynamicRoute)(Te)||!(0,g.getRouteMatcher)((0,m.getRouteRegex)(Te))(et))),st=!ee.shallow&&await R({asPath:$,locale:U.locale,router:this});if(Z&&st&&(Se=!1),Se&&ae!=="/_error")if(ee._shouldResolveHref=!0,process.env.__NEXT_HAS_REWRITES&&$.startsWith("/")){const _e=(0,p.default)((0,x.addBasePath)((0,b.addLocale)(je,U.locale),!0),Me,ke,ge,on=>ie(on,Me),this.locales);if(_e.externalDest)return L({url:$,router:this}),!0;st||(ze=_e.asPath),_e.matchedPage&&_e.resolvedHref&&(ae=_e.resolvedHref,q.pathname=(0,x.addBasePath)(ae),st||(W=(0,v.formatWithValidation)(q)))}else q.pathname=ie(ae,Me),q.pathname!==ae&&(ae=q.pathname,q.pathname=(0,x.addBasePath)(ae),st||(W=(0,v.formatWithValidation)(q)));if(!(0,P.isLocalURL)($)){if(process.env.NODE_ENV!=="production")throw new Error('Invalid href: "'+W+'" and as: "'+$+`", received relative href and external as
34
- See more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);return L({url:$,router:this}),!1}ze=(0,S.removeLocale)((0,E.removeBasePath)(ze),U.locale),Te=(0,o.removeTrailingSlash)(ae);let Mt=!1;if((0,h.isDynamicRoute)(Te)){const _e=(0,f.parseRelativeUrl)(ze),on=_e.pathname,jn=(0,m.getRouteRegex)(Te);Mt=(0,g.getRouteMatcher)(jn)(on);const jt=Te===on,Oo=jt?(0,V.interpolateAs)(Te,on,ge):{};if(!Mt||jt&&!Oo.result){const ko=Object.keys(jn.groups).filter(Ci=>!ge[Ci]&&!jn.groups[Ci].optional);if(ko.length>0&&!st)throw process.env.NODE_ENV!=="production"&&console.warn((jt?"Interpolating href":"Mismatching `as` and `href`")+" failed to manually provide "+("the params: "+ko.join(", ")+" in the `href`'s `query`")),new Error((jt?"The provided `href` ("+W+") value is missing query values ("+ko.join(", ")+") to be interpolated properly. ":"The provided `as` value ("+on+") is incompatible with the `href` value ("+Te+"). ")+("Read more: https://nextjs.org/docs/messages/"+(jt?"href-interpolation-failed":"incompatible-href-as")))}else jt?$=(0,v.formatWithValidation)(Object.assign({},_e,{pathname:Oo.result,query:(0,z.omit)(ge,Oo.params)})):Object.assign(ge,Mt)}Z||G.events.emit("routeChangeStart",$,Ee);const ar=this.pathname==="/404"||this.pathname==="/_error";try{var at,lr,Si;let _e=await this.getRouteInfo({route:Te,pathname:ae,query:ge,as:$,resolvedAs:ze,routeProps:Ee,locale:U.locale,isPreview:U.isPreview,hasMiddleware:st,unstable_skipClientCache:ee.unstable_skipClientCache,isQueryUpdating:Z&&!this.isFallback,isMiddlewareRewrite:$n});if(!Z&&!ee.shallow&&await this._bfl($,"resolvedAs"in _e?_e.resolvedAs:void 0,U.locale),"route"in _e&&st){ae=_e.route||Te,Te=ae,Ee.shallow||(ge=Object.assign({},_e.query||{},ge));const bt=(0,_.hasBasePath)(q.pathname)?(0,E.removeBasePath)(q.pathname):q.pathname;if(Mt&&ae!==bt&&Object.keys(Mt).forEach(Yt=>{Mt&&ge[Yt]===Mt[Yt]&&delete ge[Yt]}),(0,h.isDynamicRoute)(ae)){let qr=!Ee.shallow&&_e.resolvedAs?_e.resolvedAs:(0,x.addBasePath)((0,b.addLocale)(new URL($,location.href).pathname,U.locale),!0);if((0,_.hasBasePath)(qr)&&(qr=(0,E.removeBasePath)(qr)),process.env.__NEXT_I18N_SUPPORT){const j_=(0,c.normalizeLocalePath)(qr,this.locales);U.locale=j_.detectedLocale||U.locale,qr=j_.pathname}const Mg=(0,m.getRouteRegex)(ae),$_=(0,g.getRouteMatcher)(Mg)(new URL(qr,location.href).pathname);$_&&Object.assign(ge,$_)}}if("type"in _e)return _e.type==="redirect-internal"?this.change(X,_e.newUrl,_e.newAs,ee):(L({url:_e.destination,router:this}),new Promise(()=>{}));const on=_e.Component;if(on&&on.unstable_scriptLoader&&[].concat(on.unstable_scriptLoader()).forEach(Yt=>{(0,s.handleClientScriptLoad)(Yt.props)}),(_e.__N_SSG||_e.__N_SSP)&&_e.props){if(_e.props.pageProps&&_e.props.pageProps.__N_REDIRECT){ee.locale=!1;const bt=_e.props.pageProps.__N_REDIRECT;if(bt.startsWith("/")&&_e.props.pageProps.__N_REDIRECT_BASE_PATH!==!1){const Yt=(0,f.parseRelativeUrl)(bt);Yt.pathname=ie(Yt.pathname,Me);const{url:qr,as:Mg}=se(this,bt,bt);return this.change(X,qr,Mg,ee)}return L({url:bt,router:this}),new Promise(()=>{})}if(U.isPreview=!!_e.props.__N_PREVIEW,_e.props.notFound===D){let bt;try{await this.fetchComponent("/404"),bt="/404"}catch{bt="/_error"}if(_e=await this.getRouteInfo({route:bt,pathname:bt,query:ge,as:$,resolvedAs:ze,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isNotFound:!0}),"type"in _e)throw new Error("Unexpected middleware effect on /404")}}Z&&this.pathname==="/_error"&&((lr=self.__NEXT_DATA__.props)==null||(at=lr.pageProps)==null?void 0:at.statusCode)===500&&((Si=_e.props)!=null&&Si.pageProps)&&(_e.props.pageProps.statusCode=500);var To;const jn=ee.shallow&&U.route===((To=_e.route)!=null?To:Te);var F_;const jt=(F_=ee.scroll)!=null?F_:!Z&&!jn,ko=Ce??(jt?{x:0,y:0}:null),Ci={...U,route:Te,pathname:ae,query:ge,asPath:je,isFallback:!1};if(Z&&ar){var H_,B_,V_;if(_e=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:ge,as:$,resolvedAs:ze,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isQueryUpdating:Z&&!this.isFallback}),"type"in _e)throw new Error("Unexpected middleware effect on "+this.pathname);this.pathname==="/_error"&&((B_=self.__NEXT_DATA__.props)==null||(H_=B_.pageProps)==null?void 0:H_.statusCode)===500&&((V_=_e.props)!=null&&V_.pageProps)&&(_e.props.pageProps.statusCode=500);try{await this.set(Ci,_e,ko)}catch(bt){throw(0,a.default)(bt)&&bt.cancelled&&G.events.emit("routeChangeError",bt,je,Ee),bt}return!0}if(G.events.emit("beforeHistoryChange",$,Ee),this.changeState(X,W,$,ee),!(Z&&!ko&&!B&&!Ue&&(0,I.compareRouterStates)(Ci,this.state))){try{await this.set(Ci,_e,ko)}catch(Yt){if(Yt.cancelled)_e.error=_e.error||Yt;else throw Yt}if(_e.error)throw Z||G.events.emit("routeChangeError",_e.error,je,Ee),_e.error;process.env.__NEXT_I18N_SUPPORT&&U.locale&&(document.documentElement.lang=U.locale),Z||G.events.emit("routeChangeComplete",$,Ee),jt&&/#.+$/.test($)&&this.scrollToHash($)}return!0}catch(_e){if((0,a.default)(_e)&&_e.cancelled)return!1;throw _e}}changeState(X,W,$,ee){if(ee===void 0&&(ee={}),process.env.NODE_ENV!=="production"){if(typeof window.history>"u"){console.error("Warning: window.history is not available.");return}if(typeof window.history[X]>"u"){console.error("Warning: window.history."+X+" is not available");return}}(X!=="pushState"||(0,d.getURL)()!==$)&&(this._shallow=ee.shallow,window.history[X]({url:W,as:$,options:ee,__N:!0,key:this._key=X!=="pushState"?this._key:H()},"",$))}async handleRouteInfoError(X,W,$,ee,Ce,we){if(console.error(X),X.cancelled)throw X;if((0,i.isAssetError)(X)||we)throw G.events.emit("routeChangeError",X,ee,Ce),L({url:ee,router:this}),K();try{let Z;const{page:Se,styleSheets:U}=await this.fetchComponent("/_error"),B={props:Z,Component:Se,styleSheets:U,err:X,error:X};if(!B.props)try{B.props=await this.getInitialProps(Se,{err:X,pathname:W,query:$})}catch(re){console.error("Error in error page `getInitialProps`: ",re),B.props={}}return B}catch(Z){return this.handleRouteInfoError((0,a.default)(Z)?Z:new Error(Z+""),W,$,ee,Ce,!0)}}async getRouteInfo(X){let{route:W,pathname:$,query:ee,as:Ce,resolvedAs:we,routeProps:Z,locale:Se,hasMiddleware:U,isPreview:B,unstable_skipClientCache:re,isQueryUpdating:j,isMiddlewareRewrite:te,isNotFound:fe}=X,ve=W;try{var Ee,je,Ue,q;let ae=this.components[ve];if(Z.shallow&&ae&&this.route===ve)return ae;const ge=Ve({route:ve,router:this});U&&(ae=void 0);let Me=ae&&!("initial"in ae)&&process.env.NODE_ENV!=="development"?ae:void 0;const ke=j,ze={dataHref:this.pageLoader.getDataHref({href:(0,v.formatWithValidation)({pathname:$,query:ee}),skipInterpolation:!0,asPath:fe?"/404":we,locale:Se}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:ke?this.sbc:this.sdc,persistCache:!B,isPrefetch:!1,unstable_skipClientCache:re,isBackground:ke};let Te=j&&!te?null:await ue({fetchData:()=>be(ze),asPath:fe?"/404":we,locale:Se,router:this}).catch(at=>{if(j)return null;throw at});if(Te&&($==="/_error"||$==="/404")&&(Te.effect=void 0),j&&(Te?Te.json=self.__NEXT_DATA__.props:Te={json:self.__NEXT_DATA__.props}),ge(),(Te==null||(Ee=Te.effect)==null?void 0:Ee.type)==="redirect-internal"||(Te==null||(je=Te.effect)==null?void 0:je.type)==="redirect-external")return Te.effect;if((Te==null||(Ue=Te.effect)==null?void 0:Ue.type)==="rewrite"){const at=(0,o.removeTrailingSlash)(Te.effect.resolvedHref),lr=await this.pageLoader.getPageList();if((!j||lr.includes(at))&&(ve=at,$=Te.effect.resolvedHref,ee={...ee,...Te.effect.parsedAs.query},we=(0,E.removeBasePath)((0,c.normalizeLocalePath)(Te.effect.parsedAs.pathname,this.locales).pathname),ae=this.components[ve],Z.shallow&&ae&&this.route===ve&&!U))return{...ae,route:ve}}if((0,O.isAPIRoute)(ve))return L({url:Ce,router:this}),new Promise(()=>{});const et=Me||await this.fetchComponent(ve).then(at=>({Component:at.page,styleSheets:at.styleSheets,__N_SSG:at.mod.__N_SSG,__N_SSP:at.mod.__N_SSP}));if(process.env.NODE_ENV!=="production"){const{isValidElementType:at}=VO();if(!at(et.Component))throw new Error('The default export is not a React Component in page: "'+$+'"')}const $n=Te==null||(q=Te.response)==null?void 0:q.headers.get("x-middleware-skip"),st=et.__N_SSG||et.__N_SSP;$n&&(Te!=null&&Te.dataHref)&&delete this.sdc[Te.dataHref];const{props:Mt,cacheKey:ar}=await this._getData(async()=>{if(st){if(Te!=null&&Te.json&&!$n)return{cacheKey:Te.cacheKey,props:Te.json};const at=Te!=null&&Te.dataHref?Te.dataHref:this.pageLoader.getDataHref({href:(0,v.formatWithValidation)({pathname:$,query:ee}),asPath:we,locale:Se}),lr=await be({dataHref:at,isServerRender:this.isSsr,parseJSON:!0,inflightCache:$n?{}:this.sdc,persistCache:!B,isPrefetch:!1,unstable_skipClientCache:re});return{cacheKey:lr.cacheKey,props:lr.json||{}}}return{headers:{},props:await this.getInitialProps(et.Component,{pathname:$,query:ee,asPath:Ce,locale:Se,locales:this.locales,defaultLocale:this.defaultLocale})}});return et.__N_SSP&&ze.dataHref&&ar&&delete this.sdc[ar],!this.isPreview&&et.__N_SSG&&process.env.NODE_ENV!=="development"&&!j&&be(Object.assign({},ze,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),Mt.pageProps=Object.assign({},Mt.pageProps),et.props=Mt,et.route=ve,et.query=ee,et.resolvedAs=we,this.components[ve]=et,et}catch(ae){return this.handleRouteInfoError((0,a.getProperError)(ae),$,ee,Ce,Z)}}set(X,W,$){return this.state=X,this.sub(W,this.components["/_app"].Component,$)}beforePopState(X){this._bps=X}onlyAHashChange(X){if(!this.asPath)return!1;const[W,$]=this.asPath.split("#",2),[ee,Ce]=X.split("#",2);return Ce&&W===ee&&$===Ce?!0:W!==ee?!1:$!==Ce}scrollToHash(X){const[,W=""]=X.split("#",2);(0,J.handleSmoothScroll)(()=>{if(W===""||W==="top"){window.scrollTo(0,0);return}const $=decodeURIComponent(W),ee=document.getElementById($);if(ee){ee.scrollIntoView();return}const Ce=document.getElementsByName($)[0];Ce&&Ce.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(X)})}urlIsNew(X){return this.asPath!==X}async prefetch(X,W,$){if(W===void 0&&(W=X),$===void 0&&($={}),process.env.NODE_ENV!=="production"||typeof window<"u"&&(0,F.isBot)(window.navigator.userAgent))return;let ee=(0,f.parseRelativeUrl)(X);const Ce=ee.pathname;let{pathname:we,query:Z}=ee;const Se=we;if(process.env.__NEXT_I18N_SUPPORT&&$.locale===!1){we=(0,c.normalizeLocalePath)(we,this.locales).pathname,ee.pathname=we,X=(0,v.formatWithValidation)(ee);let ve=(0,f.parseRelativeUrl)(W);const Ee=(0,c.normalizeLocalePath)(ve.pathname,this.locales);ve.pathname=Ee.pathname,$.locale=Ee.detectedLocale||this.defaultLocale,W=(0,v.formatWithValidation)(ve)}const U=await this.pageLoader.getPageList();let B=W;const re=typeof $.locale<"u"?$.locale||void 0:this.locale,j=await R({asPath:W,locale:re,router:this});if(process.env.__NEXT_HAS_REWRITES&&W.startsWith("/")){let ve;({__rewrites:ve}=await(0,i.getClientBuildManifest)());const Ee=(0,p.default)((0,x.addBasePath)((0,b.addLocale)(W,this.locale),!0),U,ve,ee.query,je=>ie(je,U),this.locales);if(Ee.externalDest)return;j||(B=(0,S.removeLocale)((0,E.removeBasePath)(Ee.asPath),this.locale)),Ee.matchedPage&&Ee.resolvedHref&&(we=Ee.resolvedHref,ee.pathname=we,j||(X=(0,v.formatWithValidation)(ee)))}ee.pathname=ie(ee.pathname,U),(0,h.isDynamicRoute)(ee.pathname)&&(we=ee.pathname,ee.pathname=we,Object.assign(Z,(0,g.getRouteMatcher)((0,m.getRouteRegex)(ee.pathname))((0,w.parsePath)(W).pathname)||{}),j||(X=(0,v.formatWithValidation)(ee)));const te=process.env.__NEXT_MIDDLEWARE_PREFETCH==="strict"?null:await ue({fetchData:()=>be({dataHref:this.pageLoader.getDataHref({href:(0,v.formatWithValidation)({pathname:Se,query:Z}),skipInterpolation:!0,asPath:B,locale:re}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:W,locale:re,router:this});if((te==null?void 0:te.effect.type)==="rewrite"&&(ee.pathname=te.effect.resolvedHref,we=te.effect.resolvedHref,Z={...Z,...te.effect.parsedAs.query},B=te.effect.parsedAs.pathname,X=(0,v.formatWithValidation)(ee)),(te==null?void 0:te.effect.type)==="redirect-external")return;const fe=(0,o.removeTrailingSlash)(we);await this._bfl(W,B,$.locale,!0)&&(this.components[Ce]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(fe).then(ve=>ve?be({dataHref:te!=null&&te.json?te==null?void 0:te.dataHref:this.pageLoader.getDataHref({href:X,asPath:B,locale:re}),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:$.unstable_skipClientCache||$.priority&&!!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE}).then(()=>!1).catch(()=>!1):!1),this.pageLoader[$.priority?"loadPage":"prefetch"](fe)])}async fetchComponent(X){const W=Ve({route:X,router:this});try{const $=await this.pageLoader.loadPage(X);return W(),$}catch($){throw W(),$}}_getData(X){let W=!1;const $=()=>{W=!0};return this.clc=$,X().then(ee=>{if($===this.clc&&(this.clc=null),W){const Ce=new Error("Loading initial props cancelled");throw Ce.cancelled=!0,Ce}return ee})}_getFlightData(X){return be({dataHref:X,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(W=>{let{text:$}=W;return{data:$}})}getInitialProps(X,W){const{Component:$}=this.components["/_app"],ee=this._wrapApp($);return W.AppTree=ee,(0,d.loadGetInitialProps)($,{AppTree:ee,Component:X,router:this,ctx:W})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(X,W,$,{initialProps:ee,pageLoader:Ce,App:we,wrapApp:Z,Component:Se,err:U,subscription:B,isFallback:re,locale:j,locales:te,defaultLocale:fe,domainLocales:ve,isPreview:Ee}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=H(),this.onPopState=q=>{const{isFirstPopStateEvent:ae}=this;this.isFirstPopStateEvent=!1;const ge=q.state;if(!ge){const{pathname:st,query:Mt}=this;this.changeState("replaceState",(0,v.formatWithValidation)({pathname:(0,x.addBasePath)(st),query:Mt}),(0,d.getURL)());return}if(ge.__NA){window.location.reload();return}if(!ge.__N||ae&&this.locale===ge.options.locale&&ge.as===this.asPath)return;let Me;const{url:ke,as:ze,options:Te,key:et}=ge;if(process.env.__NEXT_SCROLL_RESTORATION&&pe&&this._key!==et){try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}try{const st=sessionStorage.getItem("__next_scroll_"+et);Me=JSON.parse(st)}catch{Me={x:0,y:0}}}this._key=et;const{pathname:$n}=(0,f.parseRelativeUrl)(ke);this.isSsr&&ze===(0,x.addBasePath)(this.asPath)&&$n===(0,x.addBasePath)(this.pathname)||this._bps&&!this._bps(ge)||this.change("replaceState",ke,ze,Object.assign({},Te,{shallow:Te.shallow&&this._shallow,locale:Te.locale||this.defaultLocale,_h:0}),Me)};const je=(0,o.removeTrailingSlash)(X);if(this.components={},X!=="/_error"&&(this.components[je]={Component:Se,initial:!0,props:ee,err:U,__N_SSG:ee&&ee.__N_SSG,__N_SSP:ee&&ee.__N_SSP}),this.components["/_app"]={Component:we,styleSheets:[]},process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){const{BloomFilter:q}=jO(),ae=process.env.__NEXT_CLIENT_ROUTER_S_FILTER,ge=ae||void 0,Me=process.env.__NEXT_CLIENT_ROUTER_D_FILTER,ke=Me||void 0;ge!=null&&ge.numHashes&&(this._bfl_s=new q(ge.numItems,ge.errorRate),this._bfl_s.import(ge)),ke!=null&&ke.numHashes&&(this._bfl_d=new q(ke.numItems,ke.errorRate),this._bfl_d.import(ke))}this.events=G.events,this.pageLoader=Ce;const Ue=(0,h.isDynamicRoute)(X)&&self.__NEXT_DATA__.autoExport;if(this.basePath=process.env.__NEXT_ROUTER_BASEPATH||"",this.sub=B,this.clc=null,this._wrapApp=Z,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!Ue&&!self.location.search&&!process.env.__NEXT_HAS_REWRITES),process.env.__NEXT_I18N_SUPPORT&&(this.locales=te,this.defaultLocale=fe,this.domainLocales=ve,this.isLocaleDomain=!!(0,C.detectDomainLocale)(ve,self.location.hostname)),this.state={route:je,pathname:X,query:W,asPath:Ue?X:$,isPreview:!!Ee,locale:process.env.__NEXT_I18N_SUPPORT?j:void 0,isFallback:re},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),typeof window<"u"){if(!$.startsWith("//")){const q={locale:j},ae=(0,d.getURL)();this._initialMatchesMiddlewarePromise=R({router:this,locale:j,asPath:ae}).then(ge=>(q._shouldResolveHref=$!==X,this.changeState("replaceState",ge?ae:(0,v.formatWithValidation)({pathname:(0,x.addBasePath)(X),query:W}),ae,q),ge))}window.addEventListener("popstate",this.onPopState),process.env.__NEXT_SCROLL_RESTORATION&&pe&&(window.history.scrollRestoration="manual")}}}G.events=(0,u.default)()}(sd)),sd}var Pa={exports:{}},O0;function UO(){return O0||(O0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const n=Ei,r=M0();function o(i){function s(a){return(0,n.jsx)(i,{router:(0,r.useRouter)(),...a})}if(s.getInitialProps=i.getInitialProps,s.origGetInitialProps=i.origGetInitialProps,process.env.NODE_ENV!=="production"){const a=i.displayName||i.name||"Unknown";s.displayName="withRouter("+a+")"}return s}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Pa,Pa.exports)),Pa.exports}var k0;function M0(){return k0||(k0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(C,w){for(var b in w)Object.defineProperty(C,b,{enumerable:!0,get:w[b]})}n(e,{Router:function(){return i.default},createRouter:function(){return m},default:function(){return p},makePublicRouterInstance:function(){return v},useRouter:function(){return g},withRouter:function(){return l.default}});const r=Ft,o=r._(T),i=r._(zO()),s=Iu(),a=r._(Yy()),l=r._(UO()),c={router:null,readyCallbacks:[],ready(C){if(this.router)return C();typeof window<"u"&&this.readyCallbacks.push(C)}},u=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],d=["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"],h=["push","replace","reload","back","prefetch","beforePopState"];Object.defineProperty(c,"events",{get(){return i.default.events}});function f(){if(!c.router){const C=`No router instance found.
35
- You should only use "next/router" on the client side of your app.
36
- `;throw new Error(C)}return c.router}u.forEach(C=>{Object.defineProperty(c,C,{get(){return f()[C]}})}),h.forEach(C=>{c[C]=function(){for(var w=arguments.length,b=new Array(w),S=0;S<w;S++)b[S]=arguments[S];return f()[C](...b)}}),d.forEach(C=>{c.ready(()=>{i.default.events.on(C,function(){for(var w=arguments.length,b=new Array(w),S=0;S<w;S++)b[S]=arguments[S];const E="on"+C.charAt(0).toUpperCase()+C.substring(1),x=c;if(x[E])try{x[E](...b)}catch(_){console.error("Error when running the Router event: "+E),console.error((0,a.default)(_)?_.message+`
37
- `+_.stack:_+"")}})})});const p=c;function g(){const C=o.default.useContext(s.RouterContext);if(!C)throw new Error("NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return C}function m(){for(var C=arguments.length,w=new Array(C),b=0;b<C;b++)w[b]=arguments[b];return c.router=new i.default(...w),c.readyCallbacks.forEach(S=>S()),c.readyCallbacks=[],c.router}function v(C){const w=C,b={};for(const S of u){if(typeof w[S]=="object"){b[S]=Object.assign(Array.isArray(w[S])?[]:{},w[S]);continue}b[S]=w[S]}return b.events=i.default.events,h.forEach(S=>{b[S]=function(){for(var E=arguments.length,x=new Array(E),_=0;_<E;_++)x[_]=arguments[_];return w[S](...x)}}),b}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ca,Ca.exports)),Ca.exports}M0();function qO({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,fullWidth:s,...a}){const l=a.name??"";return y.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&y.jsx(vn,{name:l,label:t,required:i}),y.jsx(Xe.FastField,{name:l,children:({field:c,form:u})=>y.jsx(WO,{name:l,field:c,form:u,label:t,withFeedbackLabel:e,showCorrectFeedback:n,customFeedbackLabel:r,fullWidth:s,...a})})]})}function WO({name:t,field:e,form:n,label:r,withFeedbackLabel:o,showCorrectFeedback:i=!1,customFeedbackLabel:s,fullWidth:a,...l}){e.value==null&&console.warn(`Input: Value for field ${e.name} is null`);const[c,u]=T.useState(e.value),d=dO(c,300),{errors:h,touched:f}=n,{isError:p,isTouched:g,error:m}=fr(t,h,f),v={...l,...g&&p?{borderColor:"red"}:{}};return T.useEffect(()=>{n.setFieldValue(t,d)},[t,d,n]),y.jsxs(y.Fragment,{children:[y.jsx(N.Input,{w:a?"full":void 0,scheme:"default",lineHeight:"normal",transition:"all",...e,...v,value:c,onChange:C=>u(C.target.value)}),o&&y.jsx(dr,{error:m,touched:g,label:r,customFeedbackLabel:s,showCorrectFeedback:i})]})}function Ia({children:t,...e}){return y.jsx("div",{dflex:!0,placeContent:"center",alignItems:"center",...e,children:t})}function hr({...t}){const e=T.useCallback(n=>{n.preventDefault(),n.stopPropagation()},[]);return y.jsx("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",py:"16",cursor:"not-allowed",onClick:e,...t,children:y.jsx(N.Spinner,{size:"x2"})})}function Fi(){return y.jsx(hr,{bgColor:"black",bgOpacity:"30",position:"absolute",top:"0",start:"0",bottom:"0",w:"100%",h:"100%"})}const KO="Oops, something went wrong!";function Jr({label:t,onClick:e,...n}){const r=T.useCallback(o=>{o.preventDefault(),o.stopPropagation()},[]);return y.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",h:"full",onClick:r,children:y.jsxs(N.Tile,{scheme:"danger",variant:"light",p:"10",textAlign:"center",children:[y.jsx("div",{textSize:"lg",fontWeight:"600",children:t??KO}),y.jsx(N.Button,{mt:"5",onClick:e,scheme:"danger",children:"Retry"})]})})}var mt={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let GO=0;function P0(t,e){const n=`atom${++GO}`,r={toString:()=>n};return typeof t=="function"?r.read=t:(r.init=t,r.read=o=>o(r),r.write=(o,i,s)=>i(r,typeof s=="function"?s(o(r)):s)),e&&(r.write=e),r}const Dd=t=>"init"in t,Nd=t=>!!t.write,La=new WeakMap,JO=(t,e)=>{La.set(t,e),t.catch(()=>{}).finally(()=>La.delete(t))},I0=(t,e)=>{const n=La.get(t);n&&(La.delete(t),n(e))},L0=(t,e)=>{t.status="fulfilled",t.value=e},D0=(t,e)=>{t.status="rejected",t.reason=e},XO=t=>typeof(t==null?void 0:t.then)=="function",Da=(t,e)=>"v"in t&&"v"in e&&Object.is(t.v,e.v),N0=(t,e)=>"e"in t&&"e"in e&&Object.is(t.e,e.e),Hi=t=>"v"in t&&t.v instanceof Promise,YO=(t,e)=>"v"in t&&"v"in e&&t.v.orig&&t.v.orig===e.v.orig,Na=t=>{if("e"in t)throw t.e;return t.v},QO=()=>{const t=new WeakMap,e=new WeakMap,n=new Map;let r,o;(mt?"production":void 0)!=="production"&&(r=new Set,o=new Set);const i=_=>t.get(_),s=(_,A)=>{(mt?"production":void 0)!=="production"&&Object.freeze(A);const O=t.get(_);if(t.set(_,A),n.has(_)||n.set(_,O),O&&Hi(O)){const k="v"in A?A.v instanceof Promise?A.v:Promise.resolve(A.v):Promise.reject(A.e);I0(O.v,k)}},a=(_,A,O)=>{const k=new Map;let M=!1;O.forEach((I,P)=>{!I&&P===_&&(I=A),I?(k.set(P,I),A.d.get(P)!==I&&(M=!0)):(mt?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(M||A.d.size!==k.size)&&(A.d=k)},l=(_,A,O)=>{const k=i(_),M={d:(k==null?void 0:k.d)||new Map,v:A};if(O&&a(_,M,O),k&&Da(k,M)&&k.d===M.d)return k;if(k&&Hi(k)&&Hi(M)&&YO(k,M)){if(k.d===M.d)return k;M.v=k.v}return s(_,M),M},c=(_,A,O,k)=>{if(XO(A)){let M;const I=new Promise((P,F)=>{let z=!1;A.then(V=>{if(!z){z=!0;const J=i(_),K=l(_,I,O);L0(I,V),P(V),(J==null?void 0:J.d)!==K.d&&S(_,K,J==null?void 0:J.d)}},V=>{if(!z){z=!0;const J=i(_),K=l(_,I,O);D0(I,V),F(V),(J==null?void 0:J.d)!==K.d&&S(_,K,J==null?void 0:J.d)}}),M=V=>{z||(z=!0,V.then(J=>L0(I,J),J=>D0(I,J)),P(V))}});return I.orig=A,I.status="pending",JO(I,P=>{P&&M(P),k==null||k()}),l(_,I,O)}return l(_,A,O)},u=(_,A,O)=>{const k=i(_),M={d:(k==null?void 0:k.d)||new Map,e:A};return O&&a(_,M,O),k&&N0(k,M)&&k.d===M.d?k:(s(_,M),M)},d=(_,A)=>{const O=i(_);if(!A&&O&&(e.has(_)||Array.from(O.d).every(([V,J])=>V===_||d(V)===J)))return O;const k=new Map;let M=!0;const I=V=>{if(V===_){const K=i(V);if(K)return k.set(V,K),Na(K);if(Dd(V))return k.set(V,void 0),V.init;throw new Error("no atom init")}const J=d(V);return k.set(V,J),Na(J)};let P,F;const z={get signal(){return P||(P=new AbortController),P.signal},get setSelf(){return(mt?"production":void 0)!=="production"&&!Nd(_)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&Nd(_)&&(F=(...V)=>{if((mt?"production":void 0)!=="production"&&M&&console.warn("setSelf function cannot be called in sync"),!M)return C(_,...V)}),F}};try{const V=_.read(I,z);return c(_,V,k,()=>P==null?void 0:P.abort())}catch(V){return u(_,V,k)}finally{M=!1}},h=_=>Na(d(_)),f=_=>{let A=e.get(_);return A||(A=w(_)),A},p=(_,A)=>!A.l.size&&(!A.t.size||A.t.size===1&&A.t.has(_)),g=_=>{const A=e.get(_);A&&p(_,A)&&b(_)},m=_=>{const A=new Map,O=new WeakMap,k=I=>{const P=e.get(I);P==null||P.t.forEach(F=>{F!==I&&(A.set(F,(A.get(F)||new Set).add(I)),O.set(F,(O.get(F)||0)+1),k(F))})};k(_);const M=I=>{const P=e.get(I);P==null||P.t.forEach(F=>{var z;if(F!==I){let V=O.get(F);if(V&&O.set(F,--V),!V){let J=!!((z=A.get(F))!=null&&z.size);if(J){const K=i(F),R=d(F,!0);J=!K||!Da(K,R)}J||A.forEach(K=>K.delete(F))}M(F)}})};M(_)},v=(_,...A)=>{let O=!0;const k=P=>Na(d(P)),M=(P,...F)=>{let z;if(P===_){if(!Dd(P))throw new Error("atom not writable");const V=i(P),J=c(P,F[0]);(!V||!Da(V,J))&&m(P)}else z=v(P,...F);if(!O){const V=E();(mt?"production":void 0)!=="production"&&r.forEach(J=>J({type:"async-write",flushed:V}))}return z},I=_.write(k,M,...A);return O=!1,I},C=(_,...A)=>{const O=v(_,...A),k=E();return(mt?"production":void 0)!=="production"&&r.forEach(M=>M({type:"write",flushed:k})),O},w=(_,A)=>{var O;(O=i(_))==null||O.d.forEach((M,I)=>{const P=e.get(I);P?P.t.add(_):I!==_&&w(I,_)}),d(_);const k={t:new Set(A&&[A]),l:new Set};if(e.set(_,k),(mt?"production":void 0)!=="production"&&o.add(_),Nd(_)&&_.onMount){const M=_.onMount((...I)=>C(_,...I));M&&(k.u=M)}return k},b=_=>{var A;const O=(A=e.get(_))==null?void 0:A.u;O&&O(),e.delete(_),(mt?"production":void 0)!=="production"&&o.delete(_);const k=i(_);k?(Hi(k)&&I0(k.v),k.d.forEach((M,I)=>{if(I!==_){const P=e.get(I);P&&(P.t.delete(_),p(I,P)&&b(I))}})):(mt?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",_)},S=(_,A,O)=>{const k=new Set(A.d.keys());O==null||O.forEach((M,I)=>{if(k.has(I)){k.delete(I);return}const P=e.get(I);P&&(P.t.delete(_),p(I,P)&&b(I))}),k.forEach(M=>{const I=e.get(M);I?I.t.add(_):e.has(_)&&w(M,_)})},E=()=>{let _;for((mt?"production":void 0)!=="production"&&(_=new Set);n.size;){const A=Array.from(n);n.clear(),A.forEach(([O,k])=>{const M=i(O);if(M){M.d!==(k==null?void 0:k.d)&&S(O,M,k==null?void 0:k.d);const I=e.get(O);I&&!(k&&!Hi(k)&&(Da(k,M)||N0(k,M)))&&(I.l.forEach(P=>P()),(mt?"production":void 0)!=="production"&&_.add(O))}else(mt?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((mt?"production":void 0)!=="production")return _},x=(_,A)=>{const O=f(_),k=E(),M=O.l;return M.add(A),(mt?"production":void 0)!=="production"&&r.forEach(I=>I({type:"sub",flushed:k})),()=>{M.delete(A),g(_),(mt?"production":void 0)!=="production"&&r.forEach(I=>I({type:"unsub"}))}};return(mt?"production":void 0)!=="production"?{get:h,set:C,sub:x,dev_subscribe_store:(_,A)=>{if(A!==2)throw new Error("The current StoreListener revision is 2.");return r.add(_),()=>{r.delete(_)}},dev_get_mounted_atoms:()=>o.values(),dev_get_atom_state:_=>t.get(_),dev_get_mounted:_=>e.get(_),dev_restore_atoms:_=>{for(const[O,k]of _)Dd(O)&&(c(O,k),m(O));const A=E();r.forEach(O=>O({type:"restore",flushed:A}))}}:{get:h,set:C,sub:x}};let Rd;(mt?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const ZO=()=>(Rd||((mt?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),Rd=QO()),Rd);var ek={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const tk=T.createContext(void 0),R0=t=>{const e=T.useContext(tk);return(t==null?void 0:t.store)||e||ZO()},nk=t=>typeof(t==null?void 0:t.then)=="function",rk=T.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function ok(t,e){const n=R0(e),[[r,o,i],s]=T.useReducer(c=>{const u=n.get(t);return Object.is(c[0],u)&&c[1]===n&&c[2]===t?c:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;(o!==n||i!==t)&&(s(),a=n.get(t));const l=e==null?void 0:e.delay;return T.useEffect(()=>{const c=n.sub(t,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[n,t,l]),T.useDebugValue(a),nk(a)?rk(a):a}function ik(t,e){const n=R0(e);return T.useCallback((...o)=>{if((ek?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...o)},[n,t])}function sk(t,e){return[ok(t,e),ik(t,e)]}var ak={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const lk=Symbol(),ck=t=>typeof(t==null?void 0:t.then)=="function";function uk(t){let e,n;const r={getItem:(o,i)=>{var s,a;const l=u=>{if(u=u||"",e!==u){try{n=JSON.parse(u)}catch{return i}e=u}return n},c=(a=(s=t())==null?void 0:s.getItem(o))!=null?a:null;return ck(c)?c.then(l):l(c)},setItem:(o,i)=>{var s;return(s=t())==null?void 0:s.setItem(o,JSON.stringify(i))},removeItem:o=>{var i;return(i=t())==null?void 0:i.removeItem(o)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(r.subscribe=(o,i,s)=>{if(!(t()instanceof window.Storage))return()=>{};const a=l=>{if(l.storageArea===t()&&l.key===o){let c;try{c=JSON.parse(l.newValue||"")}catch{c=s}i(c)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),r}const dk=uk(()=>typeof window<"u"?window.localStorage:void 0);function fk(t,e,n=dk,r){const o=r==null?void 0:r.unstable_getOnInit,i=P0(o?n.getItem(t,e):e);return(ak?"production":void 0)!=="production"&&(i.debugPrivate=!0),i.onMount=a=>{o||a(n.getItem(t,e));let l;return n.subscribe&&(l=n.subscribe(t,a,e)),l},P0(a=>a(i),(a,l,c)=>{const u=typeof c=="function"?c(a(i)):c;return u===lk?(l(i,e),n.removeItem(t)):u instanceof Promise?u.then(d=>(l(i,d),n.setItem(t,d))):(l(i,u),n.setItem(t,u))})}function hk({tabs:t,initialTabIndex:e=0,saveKey:n,onChange:r,children:o,lazy:i=!1,tabStyle:s="buttons",...a}){const l=T.useMemo(()=>fk(n??"",e),[n]),[c,u]=sk(l),d=T.useCallback(h=>{u(h),r==null||r(h)},[u,r]);return y.jsxs("div",{children:[s==="google"&&y.jsx("div",{borderColor:"brand",borderB:"px",px:"5",children:t.map((h,f)=>y.jsxs(N.Button,{size:"md",rounded:"0",roundedT:"lg",flex:"1",px:"5",variant:"borderless",position:"relative",transition:"none",onClick:()=>d(f),children:[h,y.jsx("div",{bgColor:"brand",position:"absolute",bottom:"0",start:"0",end:"0",h:"1",opacity:c===f?"100 ":"0",transition:"opacity",duration:"300",easing:"in"})]},h))}),s==="buttons"&&y.jsx(N.Tile,{dflex:!0,flexRow:!0,gap:"2",mb:"5",scheme:"light",p:"1.5",w:"auto",children:t.map((h,f)=>y.jsx(N.Button,{size:"lg",scheme:c==f?"default":"neutral",hover_scheme:"default",flex:"1",variant:c==f?"default":"borderless",onClick:()=>d(f),children:h},h))}),!i&&o.map((h,f)=>y.jsx("div",{hidden:c!=f,children:h},f)),i&&o&&o.length>=c+1&&o[c]]})}function pk(t,e,n){var r=this,o=T.useRef(null),i=T.useRef(0),s=T.useRef(null),a=T.useRef([]),l=T.useRef(),c=T.useRef(),u=T.useRef(t),d=T.useRef(!0);T.useEffect(function(){u.current=t},[t]);var h=!e&&e!==0&&typeof window<"u";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var f=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,g="maxWait"in n,m=g?Math.max(+n.maxWait||0,e):null;T.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var v=T.useMemo(function(){var C=function(_){var A=a.current,O=l.current;return a.current=l.current=null,i.current=_,c.current=u.current.apply(O,A)},w=function(_,A){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(_):setTimeout(_,A)},b=function(_){if(!d.current)return!1;var A=_-o.current;return!o.current||A>=e||A<0||g&&_-i.current>=m},S=function(_){return s.current=null,p&&a.current?C(_):(a.current=l.current=null,c.current)},E=function _(){var A=Date.now();if(b(A))return S(A);if(d.current){var O=e-(A-o.current),k=g?Math.min(O,m-(A-i.current)):O;w(_,k)}},x=function(){var _=Date.now(),A=b(_);if(a.current=[].slice.call(arguments),l.current=r,o.current=_,A){if(!s.current&&d.current)return i.current=o.current,w(E,e),f?C(o.current):c.current;if(g)return w(E,e),C(o.current)}return s.current||w(E,e),c.current};return x.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,a.current=o.current=l.current=s.current=null},x.isPending=function(){return!!s.current},x.flush=function(){return s.current?S(Date.now()):c.current},x},[f,g,e,m,p,h]);return v}function gk({api:t,name:e,apiResultIdProp:n,apiResultLabelProp:r,searchKey:o,...i}){const{values:s,setFieldValue:a}=Xe.useFormikContext(),[l,c]=T.useState(!1),[u,d]=T.useState(""),[h,f]=T.useState(!1),p=N.useFirstRender(),g=s[e],{data:m,isError:v}=Re.useApiQuery(t.queryKey,t.get,g,{enabled:p}),{data:C,isFetching:w,isError:b}=Re.useApiQuery(t.queryKey,t.getAll,{[o??"title"]:u},{enabled:u!=""}),S=Re.useInvalidateQuery(t.queryKey),E=pk(M=>d(M),300),x=T.useCallback(M=>{E(M.target.value),a(`${e}-label`,M.target.value),f(!1),c(!0)},[E,f]),_=T.useCallback(M=>{a(e,M[n??"id"]),a(`${e}-label`,M[r??"title"]),f(!0),c(!1)},[a]),A=T.useCallback(()=>c(!1),[c]);T.useEffect(()=>{m&&(a(`${e}-label`,m[r??"title"]),f(!0)),v&&(a(`${e}-label`,"Couldn't find object"),f(!0))},[m,v]);const O=l&&!h&&(w||b||C!=null),k=r??"title";return y.jsxs(N.Popup,{show:O,position:"relative",side:"bottom-start",modal:!0,onHide:A,children:[y.jsx("div",{children:y.jsx(od,{name:`${e}-label`,onChange:x,...i,autoComplete:"off"})}),y.jsxs("div",{maxH:"64",minW:"48",bgColor:"white",overflowY:"auto",z:"9999",border:"0.5",borderColor:"slate-100",rounded:!0,children:[w&&y.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",py:"2",children:y.jsx(N.Spinner,{})}),b&&y.jsx(Jr,{w:"full",onClick:()=>S()}),C==null?void 0:C.sort((M,I)=>M[k].localeCompare(I[k])).map((M,I)=>y.jsx("div",{px:"5",py:"2",cursor:"pointer",hover_bgColor:"slate-100",onClick:()=>_(M),children:M[r??"title"]},I)),!w&&!b&&C!=null&&C.length===0&&y.jsx("div",{px:"5",py:"2",children:"No result"})]})]})}const Fd=T.memo(function({form:e,extensions:n}){return e.map((r,o)=>{if(!r){console.warn("Form Renderer: you have an undefined item",r);return}const i=Hd(r,o);if(i)return i;switch(r.type){case"twoColSection":return y.jsx(ZT,{children:r.children.map((s,a)=>Hd(s,a))},o);case"row":return y.jsx(sO,{children:r.children.map((s,a)=>Hd(s,a,!1))},o);case"hidden":return y.jsx(UT,{name:r.name,value:r.value},o);case"resetField":return y.jsx(JT,{field:r.resetKey,onChangeField:r.onChangeKey,resetValue:r.resetValue},o);case"sectionHeader":return y.jsx(XT,{label:r.label},o);case"condition":return y.jsx(tO,{field:r.field,condition:r.condition,form:r.form,extensions:n},o);case"dependsOnValue":return y.jsx(nO,{field:r.field,form:r.form},o);case"rating":return y.jsx(rO,{name:r.name,label:r.label,required:r.required},o);case"groupHeader":return y.jsx(iO,{title:r.title,divider:r.divider},o);case"inputArray":return y.jsx(aO,{...r},o??r.name);case"textArray":return y.jsx(lO,{...r},o??r.name);case"cardRadio":return y.jsx(uO,{...r},o??r.name);case"divider":return y.jsx("div",{my:"3",h:"px",bgColor:"slate-200",w:"full"},o);case"autocomplete":return y.jsx(gk,{...r},o??r.name)}return n&&n[r.type]?n[r.type](r,o):(console.warn("FormRenderer element not found: ",r.type),null)}).filter(r=>r!=null)});function Hd(t,e,n=!0){var r;switch(t.type){case"input":{const o={...t};return delete o.type,delete o.inputType,y.jsx(od,{type:t.inputType??"text",fullWidth:n,...o},e??t.name)}case"debouncedInput":{const o={...t};return delete o.type,delete o.inputType,y.jsx(qO,{type:t.inputType??"text",fullWidth:n,...o},e??t.name)}case"text":return y.jsx(id,{...t},e??t.name);case"select":{const{provider:o,idField:i,keyField:s,valueField:a,...l}=t;return y.jsx(YT,{fullWidth:n,...l,children:o==null?void 0:o.map(c=>y.jsx("option",{value:c[i??"id"],children:c[a??"label"]},c[s??i??"id"]))},e??t.name)}case"checklist":return y.jsx(jT,{name:t.name,label:t.label,required:t.required,options:((r=t.provider)==null?void 0:r.map(o=>({id:o[t.valueField??"id"],label:o[t.labelField??"label"]})))??[]},e??t.name);case"checkbox":return y.jsx(By,{...t},e??t.name);case"switch":return y.jsx(QT,{...t,type:"checkbox"},e??t.name);case"custom":return y.jsxs("div",{dflex:!0,flexCol:!0,children:[t.label&&y.jsx(vn,{name:t.name,label:t.label}),Fe.isFunction(t.render)?t.render(t.name):t.render]},e);case"hFillSpace":return y.jsx("div",{flexGrow:!0},e)}return null}function pr({form:t,extensions:e,...n}){return y.jsx(lT,{...n,children:y.jsx(Fd,{form:t,extensions:e})})}const F0={array:mk,cardRadio:yk,checkbox:Mk,checklist:Nk,color:vk,condition:bk,custom:Rk,date:Ok,datetime:kk,debouncedInput:_k,dependsOnValue:wk,groupHeader:jk,hFillSpace:Fk,hidden:Hk,input:Ek,inputArray:xk,row:Ck,number:Tk,rating:$k,reset:Bk,select:Dk,sectionHeader:Vk,switch:Pk,text:Ik,textArray:Lk,twoColSection:Sk,url:Ak};function mk(...t){return t}function yk(t,e,n,r){return{type:"cardRadio",name:t,label:e,provider:n,required:r}}function vk(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"color"}}function bk(t,e,n){return{type:"condition",field:t,condition:e,form:n}}function wk(t,e){return{type:"dependsOnValue",field:t,form:e}}function Sk(t,e){return{type:"twoColSection",children:[t,e]}}function Ck(...t){return{type:"row",children:t}}function Ek(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r}}function _k(t,e,n,r){return{type:"debouncedInput",name:t,label:e,required:n,placeholder:r}}function xk(t,e,n,r,o){return{type:"inputArray",name:t,label:e,required:n,placeholder:r,addItemLabel:o}}function Ak(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"url"}}function Tk(t,e,n,r,o,i){return{type:"input",name:t,label:e,required:o,placeholder:i,min:n,max:r,inputType:"number"}}function Ok(t,e,n,r,o,i){return{type:"input",name:t,label:e,required:o,placeholder:i,min:n,max:r,inputType:"date"}}function kk(t,e,n,r,o,i){return typeof n=="string"?{type:"input",inputType:"datetime-local",name:t,label:e,min:n,max:r,required:o,placeholder:i}:{type:"input",inputType:"datetime-local",name:t,label:e,...n}}function Mk(t,e,n){return typeof n=="boolean"?{type:"checkbox",name:t,label:e,required:n}:{type:"checkbox",name:t,label:e,...n}}function Pk(t,e,n){return{type:"switch",name:t,label:e,required:n}}function Ik(t,e,n,r){return{type:"text",name:t,label:e,rows:n,required:r}}function Lk(t,e,n,r,o){return{type:"textArray",name:t,label:e,rows:n,required:r,addItemLabel:o}}function Dk(t,e,n,r,o,i,s,a){return typeof s=="boolean"?{type:"select",name:t,label:e,provider:n,keyField:i,idField:r,valueField:o,required:s,placeholder:a}:{type:"select",name:t,label:e,provider:n,keyField:i,idField:r,valueField:o,...s}}function Nk(t,e,n,r,o,i){return{type:"checklist",name:t,label:e,provider:n,labelField:r,valueField:o,required:i}}function Rk(t,e,n){return{type:"custom",name:t,label:e,render:n}}function Fk(){return{type:"hFillSpace"}}function Hk(t,e){return{type:"hidden",name:t,value:e}}function Bk(t,e,n){return{type:"resetField",resetKey:t,onChangeKey:e,resetValue:n}}function Vk(t){return{type:"sectionHeader",label:t}}function $k(t,e,n){return{type:"rating",name:t,label:e,required:n}}function jk(t,e){return{type:"groupHeader",title:t,divider:e}}function zk(){const{isValid:t,values:e,dirty:n,submitForm:r}=Xe.useFormikContext();return T.useEffect(()=>{t&&n&&r()},[t,e,n,r]),null}function Uk(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function Ra({initialValues:t,autoSubmitOnChange:e,children:n,...r}){return y.jsx(Xe.Formik,{initialValues:Uk(t),...r,children:y.jsxs(y.Fragment,{children:[e&&y.jsx(zk,{}),Hy(n)?y.jsx(y.Fragment,{children:n}):n]})})}function Bd({useDirty:t,disabled:e,...n}){const{dirty:r,handleSubmit:o}=Xe.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}},i=T.useCallback(()=>o(),[o]);return y.jsx(N.Button,{disabled:t&&!r||e,onClick:i,...n})}function H0(t,e){if(t==null&&e==null)return"";if(t==null)return e;if(e==null)return t;const n=new Set(Object.keys(t).concat(Object.keys(e))),r={};return n.forEach(o=>{Fe.isObject(t[o])||Fe.isObject(e[o])?r[o]=H0(t[o],e[o]):r[o]=t[o]??e[o]??""}),r}function Vd(){return Vd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Vd.apply(this,arguments)}var B0=["shift","alt","meta","mod","ctrl"],qk={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function gr(t){return(qk[t]||t).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Wk(t){return B0.includes(t)}function $d(t,e){return e===void 0&&(e=","),t.split(e)}function jd(t,e,n){e===void 0&&(e="+");var r=t.toLocaleLowerCase().split(e).map(function(s){return gr(s)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(s){return!B0.includes(s)});return Vd({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(t){t.key!==void 0&&V0([gr(t.key),gr(t.code)])}),document.addEventListener("keyup",function(t){t.key!==void 0&&$0([gr(t.key),gr(t.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){mr.clear()})})();var mr=new Set;function zd(t){return Array.isArray(t)}function Kk(t,e){e===void 0&&(e=",");var n=zd(t)?t:t.split(e);return n.every(function(r){return mr.has(r.trim().toLowerCase())})}function V0(t){var e=Array.isArray(t)?t:[t];mr.has("meta")&&mr.forEach(function(n){return!Wk(n)&&mr.delete(n.toLowerCase())}),e.forEach(function(n){return mr.add(n.toLowerCase())})}function $0(t){var e=Array.isArray(t)?t:[t];t==="meta"?mr.clear():e.forEach(function(n){return mr.delete(n.toLowerCase())})}function Gk(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function Jk(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function Xk(t){return j0(t,["input","textarea","select"])}function j0(t,e){var n=t.target;e===void 0&&(e=!1);var r=n&&n.tagName;return zd(e)?!!(r&&e&&e.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&e&&e===!0)}function Yk(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(function(n){return e.includes(n)})||t.includes("*"):!0}var Qk=function(e,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,s=n.mod,a=n.shift,l=n.ctrl,c=n.keys,u=e.key,d=e.code,h=e.ctrlKey,f=e.metaKey,p=e.shiftKey,g=e.altKey,m=gr(d),v=u.toLowerCase();if(!(c!=null&&c.includes(m))&&!(c!=null&&c.includes(v))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(m))return!1;if(!r){if(o===!g&&v!=="alt"||a===!p&&v!=="shift")return!1;if(s){if(!f&&!h)return!1}else if(i===!f&&v!=="meta"&&v!=="os"||l===!h&&v!=="ctrl"&&v!=="control")return!1}return c&&c.length===1&&(c.includes(v)||c.includes(m))?!0:c?Kk(c):!c},Zk=T.createContext(void 0),eM=function(){return T.useContext(Zk)};function z0(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce(function(n,r){return n&&z0(t[r],e[r])},!0):t===e}var tM=T.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),nM=function(){return T.useContext(tM)};function rM(t){var e=T.useRef(void 0);return z0(e.current,t)||(e.current=t),e.current}var U0=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},oM=typeof window<"u"?T.useLayoutEffect:T.useEffect;function q0(t,e,n,r){var o=T.useRef(null),i=T.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,a=zd(t)?t.join(s==null?void 0:s.splitKey):t,l=n instanceof Array?n:r instanceof Array?r:void 0,c=T.useCallback(e,l??[]),u=T.useRef(c);l?u.current=c:u.current=e;var d=rM(s),h=nM(),f=h.enabledScopes,p=eM();return oM(function(){if(!((d==null?void 0:d.enabled)===!1||!Yk(f,d==null?void 0:d.scopes))){var g=function(b,S){var E;if(S===void 0&&(S=!1),!(Xk(b)&&!j0(b,d==null?void 0:d.enableOnFormTags))){if(o.current!==null){var x=o.current.getRootNode();if((x instanceof Document||x instanceof ShadowRoot)&&x.activeElement!==o.current&&!o.current.contains(x.activeElement)){U0(b);return}}(E=b.target)!=null&&E.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||$d(a,d==null?void 0:d.splitKey).forEach(function(_){var A,O=jd(_,d==null?void 0:d.combinationKey);if(Qk(b,O,d==null?void 0:d.ignoreModifiers)||(A=O.keys)!=null&&A.includes("*")){if(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(b)||S&&i.current)return;if(Gk(b,O,d==null?void 0:d.preventDefault),!Jk(b,O,d==null?void 0:d.enabled)){U0(b);return}u.current(b,O),S||(i.current=!0)}})}},m=function(b){b.key!==void 0&&(V0(gr(b.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&g(b))},v=function(b){b.key!==void 0&&($0(gr(b.code)),i.current=!1,d!=null&&d.keyup&&g(b,!0))},C=o.current||(s==null?void 0:s.document)||document;return C.addEventListener("keyup",v),C.addEventListener("keydown",m),p&&$d(a,d==null?void 0:d.splitKey).forEach(function(w){return p.addHotkey(jd(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){C.removeEventListener("keyup",v),C.removeEventListener("keydown",m),p&&$d(a,d==null?void 0:d.splitKey).forEach(function(w){return p.removeHotkey(jd(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[a,d,f]),o}function W0({...t}){const{dirty:e,handleSubmit:n}=Xe.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}};return q0("ctrl+s",()=>{e&&!t.disabled&&n()},{preventDefault:!0},[e,t,n]),y.jsxs(Bd,{type:"submit",corners:"pill",px:"4",dflex:!0,alignItems:"center",gap:"3",...t,children:[y.jsx(N.Icon,{path:nx}),"Update"]})}function K0({path:t,icon:e,...n}){const r=T.useCallback(()=>{window.open(t,"_blank")},[t]);return y.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...n,children:y.jsx(N.Icon,{path:e??ru})})}function iM({api:t,postId:e,order:n}){const r=Re.useInvalidateMutation(t.moveDown,t.queryKey),o=Re.useInvalidateMutation(t.moveUp,t.queryKey),i=T.useCallback(a=>{a.stopPropagation(),r.mutateAsync(e).catch(l=>{He.error(`Error: ${l}`)})},[r,e]),s=T.useCallback(a=>{a.stopPropagation(),o.mutateAsync(e).catch(l=>{He.error(`Error: ${l}`)})},[o,e]);return y.jsxs(Ia,{placeContent:"start",numericFontVariant:"tabular-nums",children:[n,y.jsx(N.Button,{ms:"3",variant:"borderless",scheme:"dark",onClick:s,children:y.jsx(N.Icon,{path:J_})}),y.jsx(N.Button,{variant:"borderless",scheme:"dark",onClick:i,children:y.jsx(N.Icon,{path:G_})})]})}function Fa({children:t,...e}){return y.jsx(N.Container,{center:!0,dflex:!0,flexCol:!0,gap:"8",...e,children:t})}function xt(t){this.content=t}xt.prototype={constructor:xt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new xt(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new xt(n)},addToStart:function(t,e){return new xt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new xt(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new xt(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=xt.from(t),t.size?new xt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=xt.from(t),t.size?new xt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=xt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},xt.from=function(t){if(t instanceof xt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new xt(e)};function G0(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=G0(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function J0(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=J0(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class le{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new le(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new le(r,o)}cutByIndex(e,n){return e==n?le.empty:e==0&&n==this.content.length?this:new le(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new le(o,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return G0(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return J0(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ha(0,e);if(e==this.size)return Ha(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Ha(r+1,s):Ha(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return le.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new le(n||e,r)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const Ud={index:0,offset:0};function Ha(t,e){return Ud.index=t,Ud.offset=e,Ud}function Ba(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ba(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ba(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Qe=class Pg{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ba(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Pg.none;if(e instanceof Pg)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Qe.none=[];class Va extends Error{}class me{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Y0(this.content,e+this.openStart,n);return r&&new me(r,this.openStart,this.openEnd)}removeBetween(e,n){return new me(X0(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return me.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new me(le.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new me(e,r,o)}}me.empty=new me(le.empty,0,0);function X0(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(X0(i.content,e-o-1,n-o-1)))}function Y0(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=Y0(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function sM(t,e,n){if(n.openStart>t.depth)throw new Va("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Va("Inconsistent open depths");return Q0(t,e,n,0)}function Q0(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Q0(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Yr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=aM(n,t);return Yr(i,e1(t,s,a,e,r))}else return Yr(i,$a(t,e,r))}function Z0(t,e){if(!e.type.compatibleContent(t.type))throw new Va("Cannot join "+e.type.name+" onto "+t.type.name)}function qd(t,e,n){let r=t.node(n);return Z0(r,e.node(n)),r}function Xr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Bi(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Xr(t.nodeAfter,r),i++));for(let a=i;a<s;a++)Xr(o.child(a),r);e&&e.depth==n&&e.textOffset&&Xr(e.nodeBefore,r)}function Yr(t,e){return t.type.checkContent(e),t.copy(e)}function e1(t,e,n,r,o){let i=t.depth>o&&qd(t,e,o+1),s=r.depth>o&&qd(n,r,o+1),a=[];return Bi(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(Z0(i,s),Xr(Yr(i,e1(t,e,n,r,o+1)),a)):(i&&Xr(Yr(i,$a(t,e,o+1)),a),Bi(e,n,o,a),s&&Xr(Yr(s,$a(n,r,o+1)),a)),Bi(r,null,o,a),new le(a)}function $a(t,e,n){let r=[];if(Bi(null,t,n,r),t.depth>n){let o=qd(t,e,n+1);Xr(Yr(o,$a(t,e,n+1)),r)}return Bi(e,null,n,r),new le(r)}function aM(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(le.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Vi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Qe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ja(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Vi(n,r,i)}static resolveCached(e,n){let r=t1.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else t1.set(e,r=new lM);let o=r.elts[r.i]=Vi.resolve(e,n);return r.i=(r.i+1)%cM,o}}class lM{constructor(){this.elts=[],this.i=0}}const cM=12,t1=new WeakMap;class ja{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uM=Object.create(null);let yr=class Ig{constructor(e,n,r,o=Qe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||le.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ba(this.attrs,n||e.defaultAttrs||uM)&&Qe.sameSet(this.marks,r||Qe.none)}copy(e=null){return e==this.content?this:new Ig(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ig(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return me.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new me(c,o.depth-s,i.depth-s)}replace(e,n,r){return sM(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return Vi.resolveCached(this,e)}resolveNoCache(e){return Vi.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),n1(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=le.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Qe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=le.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};yr.prototype.text=void 0;class za extends yr{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):n1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new za(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new za(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function n1(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Qr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new dM(e,n);if(r.next==null)return Qr.empty;let o=r1(r);r.next&&r.err("Unexpected trailing text");let i=vM(yM(o));return bM(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return le.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let h=i(d,a.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
38
- `)}}Qr.empty=new Qr(!0);class dM{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function r1(t){let e=[];do e.push(fM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function fM(t){let e=[];do e.push(hM(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function hM(t){let e=mM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=pM(t,e);else break;return e}function o1(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function pM(t,e){let n=o1(t),r=n;return t.eat(",")&&(t.next!="}"?r=o1(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function gM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function mM(t){if(t.eat("(")){let e=r1(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=gM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function yM(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function i1(t,e){return e-t}function s1(t,e){let n=[];return r(e),n.sort(i1);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function vM(t){let e=Object.create(null);return n(s1(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);s1(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Qr(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(i1);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function bM(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function a1(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function l1(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function c1(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function u1(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new SM(t,r,e[r]);return n}let d1=class U_{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=u1(e,r.attrs),this.defaultAttrs=a1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Qr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:l1(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new yr(this,this.computeAttrs(e),le.from(n),Qe.setFrom(r))}createChecked(e=null,n,r){return n=le.from(n),this.checkContent(n),new yr(this,this.computeAttrs(e),n,Qe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=le.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(le.empty,!0);return i?new yr(this,e,n.append(i),Qe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){c1(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Qe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new U_(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function wM(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class SM{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?wM(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ua{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=u1(e,o.attrs),this.excluded=null;let i=a1(this.attrs);this.instance=i?new Qe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Qe(this,l1(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ua(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){c1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class f1{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=xt.from(e.nodes),n.marks=xt.from(e.marks||{}),this.nodes=d1.compile(this.spec.nodes,this),this.marks=Ua.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Qr.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?h1(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:h1(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof d1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new za(r,r.defaultAttrs,e,Qe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return yr.fromJSON(this,e)}markFromJSON(e){return Qe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function h1(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function CM(t){return t.tag!=null}function EM(t){return t.style!=null}let $i=class Lg{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(CM(o))this.tags.push(o);else if(EM(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new y1(this,n,!1);return r.addAll(e,Qe.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new y1(this,n,!0);return r.addAll(e,Qe.none,n.from,n.to),me.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(AM(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=v1(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=v1(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Lg(e,Lg.schemaRules(e)))}};const p1={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},_M={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},g1={ol:!0,ul:!0},ji=1,Wd=2,zi=4;function m1(t,e,n){return e!=null?(e?ji:0)|(e==="full"?Wd:0):t&&t.whitespace=="pre"?ji|Wd:n&~zi}class qa{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Qe.none,this.match=i||(s&zi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(le.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ji)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=le.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!p1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class y1{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=m1(null,n.preserveWhitespace,0)|(r?zi:0);o?i=new qa(o.type,o.attrs,Qe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new qa(null,null,Qe.none,!0,null,s):i=new qa(e.schema.topNodeType,null,Qe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&Wd?"full":this.localPreserveWS||(o.options&ji)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
39
- `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;g1.hasOwnProperty(s)&&this.parser.normalizeLists&&xM(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:_M.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(p1.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
40
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Qe.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):b1(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=m1(e,i,s.options);s.options&zi&&s.content.length==0&&(a|=zi);let l=Qe.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):b1(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new qa(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=ji)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function xM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&g1.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function AM(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function v1(t){let e={};for(let n in t)e[n]=t[n];return e}function b1(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class Zr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Kd(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Wa(Kd(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Wa(Kd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Wa(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Zr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=w1(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return w1(e.marks)}}function w1(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Kd(t){return t.document||window.document}const S1=new WeakMap;function TM(t){let e=S1.get(t);return e===void 0&&S1.set(t,e=OM(t)),e}function OM(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Wa(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=TM(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Wa(t,h,n,r);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const C1=65535,E1=Math.pow(2,16);function kM(t,e){return t+e*E1}function _1(t){return t&C1}function MM(t){return(t-(t&C1))/E1}const x1=1,A1=2,Ka=4,T1=8;class Gd{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&T1)>0}get deletedBefore(){return(this.delInfo&(x1|Ka))>0}get deletedAfter(){return(this.delInfo&(A1|Ka))>0}get deletedAcross(){return(this.delInfo&Ka)>0}}class Zt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Zt.empty)return Zt.empty}recover(e){let n=0,r=_1(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+MM(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:n:n,f=l+o+(h<0?0:u);if(r)return f;let p=e==(n<0?l:d)?null:kM(a/3,e-l),g=e==l?A1:e==d?x1:Ka;return(n<0?e!=l:e!=d)&&(g|=T1),new Gd(f,g,p)}o+=u-c}return r?e+o:new Gd(e+o,0,null)}touches(e,n){let r=0,o=_1(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new Zt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Zt.empty:new Zt(e<0?[0,-e,0]:[0,0,e])}}Zt.empty=new Zt([]);class Ui{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Ui(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Ui;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Gd(e,o,null)}}const Jd=Object.create(null);class Pt{getMap(){return Zt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Jd[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Jd)throw new RangeError("Duplicate use of step JSON ID "+e);return Jd[e]=n,n.prototype.jsonID=e,n}}class pt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new pt(e,null)}static fail(e){return new pt(null,e)}static fromReplace(e,n,r,o){try{return pt.ok(e.replace(n,r,o))}catch(i){if(i instanceof Va)return pt.fail(i.message);throw i}}}function Xd(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Xd(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return le.fromArray(r)}class vr extends Pt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new me(Xd(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return pt.fromReplace(e,this.from,this.to,i)}invert(){return new An(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new vr(n.pos,r.pos,this.mark)}merge(e){return e instanceof vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new vr(n.from,n.to,e.markFromJSON(n.mark))}}Pt.jsonID("addMark",vr);class An extends Pt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new me(Xd(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return pt.fromReplace(e,this.from,this.to,r)}invert(){return new vr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new An(n.pos,r.pos,this.mark)}merge(e){return e instanceof An&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new An(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new An(n.from,n.to,e.markFromJSON(n.mark))}}Pt.jsonID("removeMark",An);class br extends Pt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return pt.fromReplace(e,this.pos,this.pos+1,new me(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new br(this.pos,n.marks[o]);return new br(this.pos,this.mark)}}return new Ro(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new br(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new br(n.pos,e.markFromJSON(n.mark))}}Pt.jsonID("addNodeMark",br);class Ro extends Pt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return pt.fromReplace(e,this.pos,this.pos+1,new me(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new br(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ro(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ro(n.pos,e.markFromJSON(n.mark))}}Pt.jsonID("removeNodeMark",Ro);class wt extends Pt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Yd(e,this.from,this.to)?pt.fail("Structure replace would overwrite content"):pt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zt([this.from,this.to-this.from,this.slice.size])}invert(e){return new wt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new wt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof wt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?me.empty:new me(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new wt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?me.empty:new me(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new wt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new wt(n.from,n.to,me.fromJSON(e,n.slice),!!n.structure)}}Pt.jsonID("replace",wt);class St extends Pt{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Yd(e,this.from,this.gapFrom)||Yd(e,this.gapTo,this.to)))return pt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return pt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?pt.fromReplace(e,this.from,this.to,r):pt.fail("Content does not fit in gap")}getMap(){return new Zt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new St(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new St(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new St(n.from,n.to,n.gapFrom,n.gapTo,me.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pt.jsonID("replaceAround",St);function Yd(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function PM(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==h&&s.mark.eq(d[g])?s.to=f:o.push(s=new An(h,f,d[g])));a&&a.to==h?a.to=f:i.push(a=new vr(h,f,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function IM(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Ua){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<o.length;f++){let p=o[f];p.step==i-1&&d.eq(o[f].style)&&(h=p)}h?(h.to=c,h.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new An(s.from,s.to,s.style)))}function Qd(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new wt(a,u,me.empty));else{r=d;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new An(a,u,c.marks[h]));if(o&&c.isText&&n.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new me(le.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new wt(a+h.index,a+h.index+h[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(le.empty,!0);t.replace(a,a,new me(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function LM(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Fo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!LM(o,i,s))break}return null}function DM(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=le.empty,d=0;for(let p=i,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=le.from(r.node(p).copy(u)),d++):l--;let h=le.empty,f=0;for(let p=i,g=!1;p>n;p--)g||o.after(p+1)<o.end(p)?(g=!0,h=le.from(o.node(p).copy(h)),f++):c++;t.step(new St(l,c,s,a,new me(u.append(h),d,f),u.size-d,!0))}function Zd(t,e,n=null,r=t){let o=NM(t,e),i=o&&RM(r,e);return i?o.map(O1).concat({type:e,attrs:n}).concat(i.map(O1)):null}function O1(t){return{type:t,attrs:null}}function NM(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function RM(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function FM(t,e,n){let r=le.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new St(o,i,o,i,new me(r,0,0),n.length,!0))}function HM(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&BM(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&M1(t,s,a,i),Qd(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new St(d,h,d+1,h-1,new me(le.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&k1(t,s,a,i),!1}})}function k1(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function M1(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
41
- `))}})}function BM(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function VM(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new St(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new me(le.from(s),0,0),1,!0))}function Ho(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),h=o.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),p=r&&r[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!g.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function $M(t,e,n=1,r){let o=t.doc.resolve(e),i=le.empty,s=le.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=le.from(o.node(a).copy(i));let u=r&&r[c];s=le.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new wt(e,e,new me(i.append(s),n,n),!0))}function wr(t,e){let n=t.resolve(e),r=n.index();return P1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function jM(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function P1(t,e){return!!(t&&e&&!t.isLeaf&&jM(t,e))}function Ga(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&P1(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function zM(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);M1(t,u.node(),u.before(),a)}s.inlineContent&&Qd(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new wt(c,l.map(e+n,-1),me.empty,!0)),r===!0){let u=t.doc.resolve(c);k1(t,u.node(),u.before(),t.steps.length)}return t}function UM(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function I1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ja(t,e,n=e,r=me.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return L1(o,i,r)?new wt(e,n,r):new qM(o,i,r).fit()}function L1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class qM{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=le.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=le.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new me(i,s,a);return e>-1?new St(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new wt(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=ef(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(le.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ef(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new me(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=ef(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new me(qi(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new me(qi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:h}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let f=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),m=d.matchType(g.type);if(!m)break;c++,(c>1||l==0||g.content.size)&&(d=m,u.push(D1(g.mark(h.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let p=c==a.childCount;p||(f=-1),this.placed=Wi(this.placed,n,le.from(u)),this.frontier[n].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g<f;g++){let v=m.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),m=v.content}this.unplaced=p?e==0?me.empty:new me(qi(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new me(qi(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!tf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=tf(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=tf(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Wi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Wi(this.placed,this.depth,le.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(le.empty,!0);n.childCount&&(this.placed=Wi(this.placed,this.frontier.length,n))}}function qi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(qi(t.firstChild.content,e-1,n)))}function Wi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Wi(t.lastChild.content,e-1,n)))}function ef(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function D1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,D1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),t.copy(r)}function tf(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!WM(n,i.content,s)?a:null}function WM(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function KM(t){return t.spec.defining||t.spec.definingForContent}function GM(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(L1(o,i,r))return t.step(new wt(e,n,r));let s=R1(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let h=o.depth,f=o.pos-1;h>0;h--,f--){let p=o.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(h)>-1?a=h:o.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let p=h.firstChild;if(c.push(p),f==r.openStart)break;h=p.content}for(let h=u-1;h>=0;h--){let f=c[h],p=KM(f.type);if(p&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=h;else if(p||!f.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let f=(h+u+1)%(r.openStart+1),p=c[f];if(p)for(let g=0;g<s.length;g++){let m=s[(g+l)%s.length],v=!0;m<0&&(v=!1,m=-m);let C=o.node(m-1),w=o.index(m-1);if(C.canReplaceWith(w,w,p.type,p.marks))return t.replace(o.before(m),v?i.after(m):n,new me(N1(r.content,0,r.openStart,f),f,r.openEnd))}}let d=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let f=s[h];f<0||(e=o.before(f),n=i.after(f))}}function N1(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(N1(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(le.empty,!0))}return t}function JM(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=UM(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new me(le.from(r),0,0))}function XM(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=R1(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function R1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Bo extends Pt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return pt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return pt.fromReplace(e,this.pos,this.pos+1,new me(le.from(o),0,n.isLeaf?0:1))}getMap(){return Zt.empty}invert(e){return new Bo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bo(n.pos,n.attr,n.value)}}Pt.jsonID("attr",Bo);class Ki extends Pt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return pt.ok(r)}getMap(){return Zt.empty}invert(e){return new Ki(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ki(n.attr,n.value)}}Pt.jsonID("docAttr",Ki);let Vo=class extends Error{};Vo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Vo.prototype=Object.create(Error.prototype),Vo.prototype.constructor=Vo,Vo.prototype.name="TransformError";class F1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ui}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Vo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=me.empty){let o=Ja(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new me(le.from(r),0,0))}delete(e,n){return this.replace(e,n,me.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return GM(this,e,n,r),this}replaceRangeWith(e,n,r){return JM(this,e,n,r),this}deleteRange(e,n){return XM(this,e,n),this}lift(e,n){return DM(this,e,n),this}join(e,n=1){return zM(this,e,n),this}wrap(e,n){return FM(this,e,n),this}setBlockType(e,n=e,r,o=null){return HM(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return VM(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Bo(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ki(e,n)),this}addNodeMark(e,n){return this.step(new br(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Qe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ro(e,n)),this}split(e,n=1,r){return $M(this,e,n,r),this}addMark(e,n,r){return PM(this,e,n,r),this}removeMark(e,n,r){return IM(this,e,n,r),this}clearIncompatible(e,n,r){return Qd(this,e,n,r),this}}const nf=Object.create(null);class De{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new YM(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=me.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?me.empty:n),a==0&&V1(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),V1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Le(e):$o(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?$o(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):$o(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new ln(e.node(0))}static atStart(e){return $o(e,e,0,0,1)||new ln(e)}static atEnd(e){return $o(e,e,e.content.size,e.childCount,-1)||new ln(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=nf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in nf)throw new RangeError("Duplicate use of selection JSON ID "+e);return nf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Le.between(this.$anchor,this.$head).getBookmark()}}De.prototype.visible=!0;class YM{constructor(e,n){this.$from=e,this.$to=n}}let H1=!1;function B1(t){!H1&&!t.parent.inlineContent&&(H1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Le extends De{constructor(e,n=e){B1(e),B1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return De.near(r);let o=e.resolve(n.map(this.anchor));return new Le(o.parent.inlineContent?o:r,r)}replace(e,n=me.empty){if(super.replace(e,n),n==me.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xa(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=De.findFrom(n,r,!0)||De.findFrom(n,-r,!0);if(i)n=i.$head;else return De.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(De.findFrom(e,-r,!0)||De.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Le(e,n)}}De.jsonID("text",Le);class Xa{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Xa(e.map(this.anchor),e.map(this.head))}resolve(e){return Le.between(e.resolve(this.anchor),e.resolve(this.head))}}class Oe extends De{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?De.near(i):new Oe(i)}content(){return new me(le.from(this.node),0,0)}eq(e){return e instanceof Oe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new rf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Oe(e.resolve(n.anchor))}static create(e,n){return new Oe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Oe.prototype.visible=!1,De.jsonID("node",Oe);class rf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Xa(r,r):new rf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Oe.isSelectable(r)?new Oe(n):De.near(n)}}class ln extends De{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=me.empty){if(n==me.empty){e.delete(0,e.doc.content.size);let r=De.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ln(e)}map(e){return new ln(e)}eq(e){return e instanceof ln}getBookmark(){return QM}}De.jsonID("all",ln);const QM={map(){return this},resolve(t){return new ln(t)}};function $o(t,e,n,r,o,i=!1){if(e.inlineContent)return Le.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Oe.isSelectable(a))return Oe.create(t,n-(o<0?a.nodeSize:0))}else{let l=$o(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function V1(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof wt||o instanceof St))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(De.near(t.doc.resolve(s),n))}const $1=1,Ya=2,j1=4;let ZM=class extends F1{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|$1)&~Ya,this.storedMarks=null,this}get selectionSet(){return(this.updated&$1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ya,this}ensureMarks(e){return Qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ya)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ya,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Qe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(De.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=j1,this}get scrolledIntoView(){return(this.updated&j1)>0}};function z1(t,e){return!e||!t?t:t.bind(e)}class Gi{constructor(e,n,r){this.name=e,this.init=z1(n.init,r),this.apply=z1(n.apply,r)}}const eP=[new Gi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Gi("selection",{init(t,e){return t.selection||De.atStart(e.doc)},apply(t){return t.selection}}),new Gi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Gi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class of{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eP.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Gi(r.key,r.spec.state,r))})}}class jo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new jo(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new ZM(this)}static create(e){let n=new of(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new jo(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new of(this.schema,e.plugins),r=n.fields,o=new jo(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new of(e.schema,e.plugins),i=new jo(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=yr.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=De.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function U1(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=U1(o,e,{})),n[r]=o}return n}class lt{constructor(e){this.spec=e,this.props={},e.props&&U1(e.props,this,this.props),this.key=e.key?e.key.key:q1("plugin")}getState(e){return e[this.key]}}const sf=Object.create(null);function q1(t){return t in sf?t+"$"+ ++sf[t]:(sf[t]=0,t+"$")}class yt{constructor(e="key"){this.key=q1(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const At=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},zo=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let af=null;const Un=function(t,e,n){let r=af||(af=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},tP=function(){af=null},eo=function(t,e,n,r){return n&&(W1(t,e,n,r,-1)||W1(t,e,n,r,1))},nP=/^(img|br|input|textarea|hr)$/i;function W1(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:cn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Ji(t)||nP.test(t.nodeName)||t.contentEditable=="false")return!1;e=At(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?cn(t):0}else return!1}}function cn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function rP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=cn(t)}else if(t.parentNode&&!Ji(t))e=At(t),t=t.parentNode;else return null}}function oP(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ji(t))e=At(t)+1,t=t.parentNode;else return null}}function iP(t,e,n){for(let r=e==0,o=e==cn(t);r||o;){if(t==n)return!0;let i=At(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==cn(t)}}function Ji(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Qa=function(t){return t.focusNode&&eo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function to(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function sP(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function aP(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(cn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(cn(r.startContainer),r.startOffset)}}}const Tn=typeof navigator<"u"?navigator:null,K1=typeof document<"u"?document:null,Sr=Tn&&Tn.userAgent||"",lf=/Edge\/(\d+)/.exec(Sr),G1=/MSIE \d/.exec(Sr),cf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Sr),Ut=!!(G1||cf||lf),Cr=G1?document.documentMode:cf?+cf[1]:lf?+lf[1]:0,bn=!Ut&&/gecko\/(\d+)/i.test(Sr);bn&&+(/Firefox\/(\d+)/.exec(Sr)||[0,0])[1];const uf=!Ut&&/Chrome\/(\d+)/.exec(Sr),It=!!uf,J1=uf?+uf[1]:0,Ht=!Ut&&!!Tn&&/Apple Computer/.test(Tn.vendor),Uo=Ht&&(/Mobile\/\w+/.test(Sr)||!!Tn&&Tn.maxTouchPoints>2),un=Uo||(Tn?/Mac/.test(Tn.platform):!1),lP=Tn?/Win/.test(Tn.platform):!1,qn=/Android \d/.test(Sr),Xi=!!K1&&"webkitFontSmoothing"in K1.documentElement.style,cP=Xi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function uP(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Wn(t,e){return typeof t=="number"?t:t[e]}function dP(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function X1(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=zo(s);continue}let a=s,l=a==i.body,c=l?uP(i):dP(a),u=0,d=0;if(e.top<c.top+Wn(r,"top")?d=-(c.top-e.top+Wn(o,"top")):e.bottom>c.bottom-Wn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Wn(o,"top")-c.top:e.bottom-c.bottom+Wn(o,"bottom")),e.left<c.left+Wn(r,"left")?u=-(c.left-e.left+Wn(o,"left")):e.right>c.right-Wn(r,"right")&&(u=e.right-c.right+Wn(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let g=a.scrollLeft-f,m=a.scrollTop-p;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let h=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:zo(s)}}function fP(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Y1(t.dom)}}function Y1(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=zo(r));return e}function hP({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Q1(n,r==0?0:r-e)}function Q1(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let qo=null;function pP(t){if(t.setActive)return t.setActive();if(qo)return t.focus(qo);let e=Y1(t);t.focus(qo==null?{get preventScroll(){return qo={preventScroll:!0},!0}}:void 0),qo||(qo=!1,Q1(e,0))}function Z1(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Un(u).getClientRects();else continue;for(let f=0;f<h.length;f++){let p=h[f];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?gP(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Z1(n,o)}function gP(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=Er(r,1);if(i.top!=i.bottom&&df(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function df(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function mP(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function yP(t,e,n){let{node:r,offset:o}=Z1(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function vP(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function ev(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(df(e,c))return ev(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function bP(t,e){let n=t.dom.ownerDocument,r,o=0,i=aP(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!df(e,c)||(s=ev(t.dom,e,c),!s))return null}if(Ht)for(let c=s;r&&c;c=zo(c))c.draggable&&(r=void 0);if(s=mP(s,e),r){if(bn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;Xi&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=vP(t,r,o,e))}a==null&&(a=yP(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function tv(t){return t.top<t.bottom||t.left<t.right}function Er(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(tv(r))return r}return Array.prototype.find.call(n,tv)||t.getBoundingClientRect()}const wP=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nv(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Xi||bn;if(r.nodeType==3)if(s&&(wP.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Er(Un(r,o,o),n);if(bn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Er(Un(r,o-1,o-1),-1);if(c.top==l.top){let u=Er(Un(r,o,o+1),-1);if(u.top!=l.top)return Yi(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Yi(Er(Un(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==cn(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return ff(l.getBoundingClientRect(),!1)}if(i==null&&o<cn(r)){let l=r.childNodes[o];if(l.nodeType==1)return ff(l.getBoundingClientRect(),!0)}return ff(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==cn(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Un(l,cn(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Yi(Er(c,1),!1)}if(i==null&&o<cn(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Un(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Yi(Er(c,-1),!0)}return Yi(Er(r.nodeType==3?Un(r):r,-n),n>=0)}function Yi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function ff(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function rv(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function SP(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return rv(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=nv(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Un(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const CP=/[\u0590-\u08ac]/;function EP(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!CP.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:rv(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),m=p&&!f.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),m}):r.pos==r.start()||r.pos==r.end()}let ov=null,iv=null,sv=!1;function _P(t,e,n){return ov==e&&iv==n?sv:(ov=e,iv=n,sv=n=="up"||n=="down"?SP(t,e,n):EP(t,e,n))}const dn=0,av=1,no=2,On=3;class Qi{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=dn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>At(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof uv){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof lv&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?At(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?At(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=At(h.dom)+1;break}e-=h.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=At(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let g=this.children[f],m=p+g.size;if(i>p&&s<m)return g.setSelection(e-p-g.border,n-p-g.border,r,o);p=m}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((bn||Ht)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(d=!!(p&&f.nodeValue[p-1]==`
42
- `),d&&p==f.nodeValue.length)for(let g=f,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:At(m)+1});break}let v=g.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let g=f.childNodes[p-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(bn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||d&&Ht)&&eo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&eo(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||e==n)&&!d){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?no:av,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=On:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?no:On}r=s}this.dirty=no}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?no:av;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class lv extends Qi{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==dn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class xP extends Qi{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ro extends Qi{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=Zr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ro(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&On||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=On&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=dn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=dn}}slice(e,n,r){let o=ro.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=pf(i,n,s,r)),e>0&&(i=pf(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class _r extends Qi{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Zr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=hv(u,r,n),c?l=new AP(e,n,r,o,u,d||null,h,c,i,s+1):n.isText?new Za(e,n,r,o,u,h,i):new _r(e,n,r,o,u,d||null,h,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}return e}matchesNode(e,n,r){return this.dirty==dn&&e.eq(this.node)&&el(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new OP(this,s&&s.node,e);PP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Qe.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,h)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,h)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(f=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,h,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==no)&&(s&&this.protectLocalComposition(e,s),dv(this.contentDOM,this.children,e),Uo&&IP(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Le)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=LP(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new xP(this,i,n,o);e.input.compositionNodes.push(s),this.children=pf(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==On||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=dn}updateOuterDeco(e){if(el(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=fv(this.dom,this.nodeDOM,hf(this.outerDeco,this.node,n),hf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function cv(t,e,n,r,o){hv(r,e,t);let i=new _r(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Za extends _r{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==On||this.dirty!=dn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=dn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=dn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Za(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=On)}get domAtom(){return!1}isText(e){return this.node.text==e}}class uv extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class AP extends _r{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==On)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function dv(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=pv(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof ro){let l=r?r.previousSibling:t.lastChild;dv(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=pv(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Zi=function(t){t&&(this.nodeName=t)};Zi.prototype=Object.create(null);const oo=[new Zi];function hf(t,e,n){if(t.length==0)return oo;let r=n?oo[0]:new Zi,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Zi(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Zi(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function fv(t,e,n,r){if(n==oo&&r==oo)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=oo[0]),o=l}TP(o,a||oo[0],s)}return o}function TP(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function hv(t,e,n){return fv(t,t,oo,hf(e,n,t.nodeType!=1))}function el(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function pv(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class OP{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=kP(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=dn,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ro.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==On&&s.dom==s.contentDOM&&(s.dirty=no),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof _r){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=On&&el(n,l.outerDeco));if(!h&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=no,d.updateChildren(o,s+1),d.dirty=dn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!el(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=_r.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=_r.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new lv(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ro;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Za)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ht||It)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new uv(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function kP(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ro)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function MP(t,e){return t.type.side-e.type.side}function PP(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let m=o[s++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(MP);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(c<t.childCount)f=c,h=t.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=i&&a.splice(m--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+h.nodeSize;if(h.isText){let m=p;s<o.length&&o[s].from<m&&(m=o[s].from);for(let v=0;v<a.length;v++)a[v].to<m&&(m=a[v].to);m<p&&(l=h.cut(m-i),h=h.cut(0,m-i),p=m,f=-1)}else for(;s<o.length&&o[s].to<p;)s++;let g=h.isInline&&!h.isLeaf?a.filter(m=>!m.inline):a.slice();r(h,g,e.forChild(i,h),f),i=p}}function IP(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function LP(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function pf(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function gf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Qa(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Oe.isSelectable(d)&&o.parent&&!(d.isInline&&iP(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;c=new Oe(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,h=s;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,s]=h==t.state.selection.anchor?[h,d]:[d,h],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=yf(t,u,a,d)}return c}function gv(t){return t.editable?t.hasFocus():Cv(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Kn(t,e=!1){let n=t.state.selection;if(bv(t,n),!!gv(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&It){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&eo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)NP(t);else{let{anchor:r,head:o}=n,i,s;mv&&!(n instanceof Le)&&(n.$from.parent.inlineContent||(i=yv(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=yv(t,n.to))),t.docView.setSelection(r,o,t,e),mv&&(i&&vv(i),s&&vv(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&DP(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const mv=Ht||It&&J1<63;function yv(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Ht&&o&&o.contentEditable=="false")return mf(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return mf(o);if(i)return mf(i)}}function mf(t){return t.contentEditable="true",Ht&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vv(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function DP(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!gv(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function NP(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,At(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Ut&&Cr<=11&&(r.disabled=!0,r.disabled=!1)}function bv(t,e){if(e instanceof Oe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(wv(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else wv(t)}function wv(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function yf(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Le.between(e,n,r)}function Sv(t){return t.editable&&!t.hasFocus()?!1:Cv(t)}function Cv(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function RP(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return eo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function vf(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&De.findFrom(i,e)}function xr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ev(t,e,n){let r=t.state.selection;if(r instanceof Le)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return xr(t,new Le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=vf(t.state,e);return o&&o instanceof Oe?xr(t,o):!1}else if(!(un&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Oe.isSelectable(i)?xr(t,new Oe(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Xi?xr(t,new Le(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Oe&&r.node.isInline)return xr(t,new Le(e>0?r.$to:r.$from));{let o=vf(t.state,e);return o?xr(t,o):!1}}}function tl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function es(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Wo(t,e){return e<0?FP(t):HP(t)}function FP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(bn&&n.nodeType==1&&r<tl(n)&&es(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(es(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(_v(n))break;{let a=n.previousSibling;for(;a&&es(a,-1);)o=n.parentNode,i=At(a),a=a.previousSibling;if(a)n=a,r=tl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?bf(t,n,r):o&&bf(t,o,i)}function HP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=tl(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(es(a,1))i=n,s=++r;else break}else{if(_v(n))break;{let a=n.nextSibling;for(;a&&es(a,1);)i=a.parentNode,s=At(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=tl(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&bf(t,i,s)}function _v(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function BP(t,e){for(;t&&e==t.childNodes.length&&!Ji(t);)e=At(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function VP(t,e){for(;t&&!e&&!Ji(t);)e=At(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function bf(t,e,n){if(e.nodeType!=3){let i,s;(s=BP(e,n))?(e=s,n=0):(i=VP(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Qa(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Kn(t)},50)}function xv(t,e){let n=t.state.doc.resolve(e);if(!(It||lP)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Av(t,e,n){let r=t.state.selection;if(r instanceof Le&&!r.empty||n.indexOf("s")>-1||un&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=vf(t.state,e);if(s&&s instanceof Oe)return xr(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof ln?De.near(s,e):De.findFrom(s,e);return a?xr(t,a):!1}return!1}function Tv(t,e){if(!(t.state.selection instanceof Le))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Ov(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function $P(t){if(!Ht||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ov(t,r,"true"),setTimeout(()=>Ov(t,r,"false"),20)}return!1}function jP(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function zP(t,e){let n=e.keyCode,r=jP(e);if(n==8||un&&n==72&&r=="c")return Tv(t,-1)||Wo(t,-1);if(n==46&&!e.shiftKey||un&&n==68&&r=="c")return Tv(t,1)||Wo(t,1);if(n==13||n==27)return!0;if(n==37||un&&n==66&&r=="c"){let o=n==37?xv(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ev(t,o,r)||Wo(t,o)}else if(n==39||un&&n==70&&r=="c"){let o=n==39?xv(t,t.state.selection.from)=="ltr"?1:-1:1;return Ev(t,o,r)||Wo(t,o)}else{if(n==38||un&&n==80&&r=="c")return Av(t,-1,r)||Wo(t,-1);if(n==40||un&&n==78&&r=="c")return $P(t)||Av(t,1,r)||Wo(t,1);if(r==(un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wf(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||Zr.fromSchema(t.state.schema),a=Rv(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Dv[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=a.createElement(u[f]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
43
-
44
- `);return{dom:l,text:h,slice:e}}function kv(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,i||r,t)}),i)return e?new me(le.from(t.state.schema.text(e.replace(/\r\n?/g,`
45
- `))),0,0):me.empty;let d=t.someProp("clipboardTextParser",h=>h(e,o,r,t));if(d)a=d;else{let h=o.marks(),{schema:f}=t.state,p=Zr.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=KP(n),Xi&&GP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||$i.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!UP.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=JP(Lv(a,+u[1],+u[2]),u[4]);else if(a=me.maxOpen(qP(a.content,o),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Lv(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const UP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function qP(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Pv(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Iv(s[s.length-1],i.length));let u=Mv(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return le.from(s)}return t}function Mv(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,le.from(t));return t}function Pv(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Pv(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(le.from(Mv(n,t,o+1))))}}function Iv(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Iv(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(le.empty,!0);return t.copy(n.append(r))}function Sf(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Sf(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Lv(t,e,n){return e<t.openStart&&(t=new me(Sf(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new me(Sf(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Dv={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Nv=null;function Rv(){return Nv||(Nv=document.implementation.createHTMLDocument("title"))}let Cf=null;function WP(t){let e=window.trustedTypes;return e?(Cf||(Cf=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Cf.createHTML(t)):t}function KP(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Rv().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Dv[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=WP(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function GP(t){let e=t.querySelectorAll(It?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function JP(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=le.from(l.create(r[a+1],o)),i++,s++}return new me(o,i,s)}const Bt={},Vt={},XP={touchstart:!0,touchmove:!0};class YP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function QP(t){for(let e in Bt){let n=Bt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eI(t,r)&&!_f(t,r)&&(t.editable||!(r.type in Vt))&&n(t,r)},XP[e]?{passive:!0}:void 0)}Ht&&t.dom.addEventListener("input",()=>null),Ef(t)}function Ar(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function ZP(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ef(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>_f(t,r))})}function _f(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tI(t,e){!_f(t,e)&&Bt[e.type]&&(t.editable||!(e.type in Vt))&&Bt[e.type](t,e)}Vt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Hv(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(qn&&It&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Uo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,to(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||zP(t,n)?n.preventDefault():Ar(t,"key")},Vt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Vt.keypress=(t,e)=>{let n=e;if(Hv(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||un&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Le)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function nl(t){return{left:t.clientX,top:t.clientY}}function nI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function xf(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Ko(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function rI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Oe.isSelectable(r)?(Ko(t,new Oe(n),"pointer"),!0):!1}function oI(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Oe&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Oe.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Ko(t,Oe.create(t.state.doc,o),"pointer"),!0):!1}function iI(t,e,n,r,o){return xf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?oI(t,n):rI(t,n))}function sI(t,e,n,r){return xf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function aI(t,e,n,r){return xf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||lI(t,n,r)}function lI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ko(t,Le.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Ko(t,Le.create(r,a+1,a+1+s.content.size),"pointer");else if(Oe.isSelectable(s))Ko(t,Oe.create(r,a),"pointer");else continue;return!0}}function Af(t){return rl(t)}const Fv=un?"metaKey":"ctrlKey";Bt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Af(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&nI(n,t.input.lastClick)&&!n[Fv]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(nl(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new cI(t,s,n,!!r)):(i=="doubleClick"?sI:aI)(t,s.pos,s.inside,n)?n.preventDefault():Ar(t,"pointer"))};class cI{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Fv],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Oe&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&bn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ar(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Kn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(nl(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ar(this.view,"pointer"):iI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ht&&this.mightDrag&&!this.mightDrag.node.isAtom||It&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ko(this.view,De.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Ar(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ar(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Bt.touchstart=t=>{t.input.lastTouch=Date.now(),Af(t),Ar(t,"pointer")},Bt.touchmove=t=>{t.input.lastTouch=Date.now(),Ar(t,"pointer")},Bt.contextmenu=t=>Af(t);function Hv(t,e){return t.composing?!0:Ht&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const uI=qn?5e3:-1;Vt.compositionstart=Vt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),rl(t,!0),t.markCursor=null;else if(rl(t,!e.selection.empty),bn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}Bv(t,uI)},Vt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Bv(t,20))};function Bv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>rl(t),e))}function Vv(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=fI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function dI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=rP(e.focusNode,e.focusOffset),r=oP(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function fI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function rl(t,e=!1){if(!(qn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Vv(t),e||t.docView&&t.docView.dirty){let n=gf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function hI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ts=Ut&&Cr<15||Uo&&cP<604;Bt.copy=Vt.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=ts?null:n.clipboardData,s=r.content(),{dom:a,text:l}=wf(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):hI(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function gI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ns(t,r.value,null,o,e):ns(t,r.textContent,r.innerHTML,o,e)},50)}function ns(t,e,n,r,o){let i=kv(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||me.empty)))return!0;if(!i)return!1;let s=pI(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function $v(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Vt.paste=(t,e)=>{let n=e;if(t.composing&&!qn)return;let r=ts?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ns(t,$v(r),r.getData("text/html"),o,n)?n.preventDefault():gI(t,n)};class jv{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zv=un?"altKey":"ctrlKey";Bt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(nl(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Oe?o.to-1:o.to))){if(r&&r.mightDrag)s=Oe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Oe.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=wf(t,a);(!n.dataTransfer.files.length||!It||J1>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ts?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ts||n.dataTransfer.setData("text/plain",c),t.dragging=new jv(u,!n[zv],s)},Bt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Vt.dragover=Vt.dragenter=(t,e)=>e.preventDefault(),Vt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(nl(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=kv(t,$v(n.dataTransfer),ts?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[zv]);if(t.someProp("handleDrop",p=>p(t,n,s||me.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?I1(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Oe.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Oe(f));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,v,C)=>p=C),c.setSelection(yf(t,f,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Bt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kn(t)},20))},Bt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Bt.beforeinput=(t,e)=>{if(It&&qn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,to(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Vt)Bt[t]=Vt[t];function rs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class ol{constructor(e,n){this.toDOM=e,this.spec=n||io,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new qt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ol&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Tr{constructor(e,n){this.attrs=e,this.spec=n||io}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new qt(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Tr&&rs(this.attrs,e.attrs)&&rs(this.spec,e.spec)}static is(e){return e.type instanceof Tr}destroy(){}}class Tf{constructor(e,n){this.attrs=e,this.spec=n||io}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new qt(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Tf&&rs(this.attrs,e.attrs)&&rs(this.spec,e.spec)}destroy(){}}class qt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new qt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new qt(e,e,new ol(n,r))}static inline(e,n,r,o){return new qt(e,n,new Tr(r,o))}static node(e,n,r,o){return new qt(e,n,new Tf(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Tr}get widget(){return this.type instanceof ol}}const Go=[],io={};class dt{constructor(e,n){this.local=e.length?e:Go,this.children=n.length?n:Go}static create(e,n){return n.length?il(n,e,0,io):Lt}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==Lt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||io)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?mI(this.children,s||[],e,n,r,o,i):s?new dt(s.sort(so),Go):Lt}add(e,n){return n.length?this==Lt?dt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=qv(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,il(u,a,c+1,io)),i+=3}});let s=Uv(i?Wv(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new dt(s.length?this.local.concat(s).sort(so):this.local,o||this.children)}remove(e){return e.length==0||this==Lt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Lt?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new dt(o,r):Lt}forChild(e,n){if(this==Lt)return this;if(n.isLeaf)return dt.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Tr){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new dt(o.sort(so),Go);return r?new Or([a,r]):a}return r||Lt}eq(e){if(this==e)return!0;if(!(e instanceof dt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Of(this.localsInner(e))}localsInner(e){if(this==Lt)return Go;if(e.inlineContent||!this.local.some(Tr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Tr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}dt.empty=new dt([],[]),dt.removeOverlap=Of;const Lt=dt.empty;class Or{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,io));return Or.from(r)}forChild(e,n){if(n.isLeaf)return dt.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Lt&&(i instanceof Or?r=r.concat(i.members):r.push(i))}return Or.from(r)}eq(e){if(!(e instanceof Or)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Of(r?n:n.sort(so)):Go}static from(e){switch(e.length){case 0:return Lt;case 1:return e[0];default:return new Or(e.every(n=>n instanceof dt)?e:e.reduce((n,r)=>n.concat(r instanceof dt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function mI(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((h,f,p,g)=>{let m=g-p-(f-h);for(let v=0;v<a.length;v+=3){let C=a[v+1];if(C<0||h>C+u-d)continue;let w=a[v]+u-d;f>=w?a[v+1]=h<=w?-2:-1:h>=u&&m&&(a[v]+=m,a[v+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+i,-1),f=h-o,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==f){let v=a[c+2].mapInner(n,m,u+1,t[c]+i+1,s);v!=Lt?(a[c]=d,a[c+1]=f,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=yI(a,t,e,n,o,i,s),u=il(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<u.children.length;d+=3){let f=u.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,u.children[d],u.children[d+1],u.children[d+2])}}return new dt(e.sort(so),a)}function Uv(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new qt(o.from+e,o.to+e,o.type))}return n}function yI(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function qv(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Wv(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function il(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=qv(t,a,l+n);if(c){i=!0;let u=il(c,a,n+l+1,r);u!=Lt&&o.push(l,l+a.nodeSize,u)}});let s=Uv(i?Wv(t):t,-n).sort(so);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new dt(s,o):Lt}function so(t,e){return t.from-e.from||t.to-e.to}function Of(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Kv(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Kv(e,o,r.copy(i.from,r.to)));break}}}return e}function Kv(t,e,n){for(;e<t.length&&so(n,t[e])>0;)e++;t.splice(e,0,n)}function kf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Lt&&e.push(r)}),t.cursorWrapper&&e.push(dt.create(t.state.doc,[t.cursorWrapper.deco])),Or.from(e)}const vI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},bI=Ut&&Cr<=11;class wI{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class SI{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new wI,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Ut&&Cr<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),bI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,vI)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Sv(this.view)){if(this.suppressingSelectionUpdates)return Kn(this.view);if(Ut&&Cr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&eo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=zo(i))n.add(i);for(let i=e.anchorNode;i;i=zo(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Sv(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(bn&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,h]=u;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of u){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||_I(e,d)!=f)&&h.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Qa(r)&&(c=gf(e))&&c.eq(De.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Kn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),CI(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(Ut&&Cr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:h}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h)}let s=o&&o.parentNode==e.target?At(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?At(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Gv=new WeakMap,Jv=!1;function CI(t){if(!Gv.has(t)&&(Gv.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=bn,Jv)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Jv=!0}}function Xv(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return eo(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function EI(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Xv(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Xv(t,n):null}function _I(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function xI(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Qa(l)||c.push({node:l.focusNode,offset:l.focusOffset})),It&&t.input.lastKeyCode===8)for(let m=i;m>o;m--){let v=r.childNodes[m-1],C=v.pmViewDesc;if(v.nodeName=="BR"&&!C){i=m;break}if(!C||C.size)break}let d=t.state.doc,h=t.someProp("domParser")||$i.fromSchema(t.state.schema),f=d.resolve(s),p=null,g=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:AI,context:f});if(c&&c[0].pos!=null){let m=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=m),p={anchor:m+s,head:v+s}}return{doc:g,sel:p,from:s,to:a}}function AI(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ht&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Ht&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const TI=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function OI(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=gf(t,A);if(O&&!t.state.selection.eq(O)){if(It&&qn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,to(13,"Enter"))))return;let k=t.state.tr.setSelection(O);A=="pointer"?k.setMeta("pointer",!0):A=="key"&&k.scrollIntoView(),i&&k.setMeta("composition",i),t.dispatch(k)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=xI(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),h,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,f="end"):(h=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=PI(d.content,c.doc.content,c.from,h,f);if(p&&t.input.domChangeCount++,(Uo&&t.input.lastIOSEnter>Date.now()-225||qn)&&o.some(A=>A.nodeType==1&&!TI.test(A.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",A=>A(t,to(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof Le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let A=Yv(t,t.state.doc,c.sel);if(A&&!A.eq(t.state.selection)){let O=t.state.tr.setSelection(A);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Le&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),Ut&&Cr<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),v=u.resolve(p.start),C=g.sameParent(m)&&g.parent.inlineContent&&v.end()>=p.endA,w;if((Uo&&t.input.lastIOSEnter>Date.now()-225&&(!C||o.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!C&&g.pos<c.doc.content.size&&!g.sameParent(m)&&(w=De.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==m.pos)&&t.someProp("handleKeyDown",A=>A(t,to(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&MI(u,p.start,p.endA,g,m)&&t.someProp("handleKeyDown",A=>A(t,to(8,"Backspace")))){qn&&It&&t.domObserver.suppressSelectionUpdates();return}It&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),qn&&!C&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,to(13,"Enter"))})},20));let b=p.start,S=p.endA,E,x,_;if(C){if(g.pos==m.pos)Ut&&Cr<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Kn(t),20)),E=t.state.tr.delete(b,S),x=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(_=kI(g.parent.content.cut(g.parentOffset,m.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start()))))E=t.state.tr,_.type=="add"?E.addMark(b,S,_.mark):E.removeMark(b,S,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,S,A)))return;E=t.state.tr.insertText(A,b,S)}}if(E||(E=t.state.tr.replace(b,S,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let A=Yv(t,E.doc,c.sel);A&&!(It&&t.composing&&A.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==b||A.head==E.mapping.map(S)-1)||Ut&&A.empty&&A.head==b)&&E.setSelection(A)}x&&E.ensureMarks(x),i&&E.setMeta("composition",i),t.dispatch(E.scrollIntoView())}function Yv(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:yf(t,e.resolve(n.anchor),e.resolve(n.head))}function kI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(le.from(c).eq(t))return{mark:a,type:s}}function MI(t,e,n,r,o){if(n-e<=o.pos-r.pos||Mf(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Mf(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Mf(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Mf(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function PI(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&Qv(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&Qv(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Qv(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class II{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new YP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(rb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tb(this),eb(this),this.nodeViews=nb(this),this.docView=cv(this.state.doc,Zv(this),kf(this),this.dom,this),this.domObserver=new SI(this,(r,o,i,s)=>OI(this,r,o,i,s)),this.domObserver.start(),QP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ef(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rb),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Vv(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=nb(this);DI(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ef(this),this.editable=tb(this),eb(this);let l=kf(this),c=Zv(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&fP(this);if(s){this.domObserver.stop();let f=d&&(Ut||It)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&LI(o.selection,e.selection);if(d){let p=It?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=dI(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=cv(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&RP(this))?Kn(this,f):(bv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&hP(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Oe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&X1(this,n.getBoundingClientRect(),e)}else X1(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new jv(e.slice,e.move,o<0?void 0:Oe.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(Ut){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&pP(this.dom),Kn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return bP(this,e)}coordsAtPos(e,n=1){return nv(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return _P(this,n||this.state,e)}pasteHTML(e,n){return ns(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ns(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return wf(this,e)}destroy(){this.docView&&(ZP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],kf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tI(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Ht&&this.root.nodeType===11&&sP(this.dom.ownerDocument)==this.dom&&EI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Zv(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[qt.node(0,t.state.doc.content.size,e)]}function eb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:qt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function tb(t){return!t.someProp("editable",e=>e(t.state)===!1)}function LI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function nb(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function DI(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function rb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var kr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},sl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},NI=typeof navigator<"u"&&/Mac/.test(navigator.platform),RI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Tt=0;Tt<10;Tt++)kr[48+Tt]=kr[96+Tt]=String(Tt);for(var Tt=1;Tt<=24;Tt++)kr[Tt+111]="F"+Tt;for(var Tt=65;Tt<=90;Tt++)kr[Tt]=String.fromCharCode(Tt+32),sl[Tt]=String.fromCharCode(Tt);for(var Pf in kr)sl.hasOwnProperty(Pf)||(sl[Pf]=kr[Pf]);function FI(t){var e=NI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||RI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?sl:kr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const HI=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function BI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))HI?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function VI(t){let e=Object.create(null);for(let n in t)e[BI(n)]=t[n];return e}function If(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function $I(t){return new lt({props:{handleKeyDown:ob(t)}})}function ob(t){let e=VI(t);return function(n,r){let o=FI(r),i,s=e[If(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[If(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=kr[r.keyCode])&&i!=o){let a=e[If(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const jI=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ib(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const zI=(t,e,n)=>{let r=ib(t,n);if(!r)return!1;let o=Lf(r);if(!o){let s=r.blockRange(),a=s&&Fo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(cb(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Jo(i,"end")||Oe.isSelectable(i)))for(let s=r.depth;;s--){let a=Ja(t.doc,r.before(s),r.after(s),me.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Jo(i,"end")?De.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Oe.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},UI=(t,e,n)=>{let r=ib(t,n);if(!r)return!1;let o=Lf(r);return o?sb(t,o,e):!1},qI=(t,e,n)=>{let r=ab(t,n);if(!r)return!1;let o=Df(r);return o?sb(t,o,e):!1};function sb(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Ja(t.doc,i,l,me.empty);if(!c||c.from!=i||c instanceof wt&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Le.create(u.doc,i)),n(u.scrollIntoView())}return!0}function Jo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const WI=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Lf(r)}let s=i&&i.nodeBefore;return!s||!Oe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Oe.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Lf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ab(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const KI=(t,e,n)=>{let r=ab(t,n);if(!r)return!1;let o=Df(r);if(!o)return!1;let i=o.nodeAfter;if(cb(t,o,e,1))return!0;if(r.parent.content.size==0&&(Jo(i,"start")||Oe.isSelectable(i))){let s=Ja(t.doc,r.before(),r.after(),me.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Jo(i,"start")?De.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Oe.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},GI=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Df(r)}let s=i&&i.nodeAfter;return!s||!Oe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Oe.create(t.doc,i.pos)).scrollIntoView()),!0)};function Df(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const JI=(t,e)=>{let n=t.selection,r=n instanceof Oe,o;if(r){if(n.node.isTextblock||!wr(t.doc,n.from))return!1;o=n.from}else if(o=Ga(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Oe.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},XI=(t,e)=>{let n=t.selection,r;if(n instanceof Oe){if(n.node.isTextblock||!wr(t.doc,n.to))return!1;r=n.to}else if(r=Ga(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},YI=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Fo(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},QI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
46
- `).scrollIntoView()),!0)};function lb(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ZI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=lb(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(De.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},e2=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof ln||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=lb(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Le.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},t2=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ho(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Fo(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},n2=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Oe.create(t.doc,o))),!0)};function r2(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||wr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function cb(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&r2(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,p=le.empty;for(let v=s.length-1;v>=0;v--)p=le.from(s[v].create(null,p));p=le.from(o.copy(p));let g=t.tr.step(new St(e.pos-1,f,e.pos,f,new me(p,1,0),s.length,!0)),m=g.doc.resolve(f+2*s.length);m.nodeAfter&&m.nodeAfter.type==o.type&&wr(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:De.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&Fo(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(c&&Jo(i,"start",!0)&&Jo(o,"end")){let f=o,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let g=i,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let v=le.empty;for(let w=p.length-1;w>=0;w--)v=le.from(p[w].copy(v));let C=t.tr.step(new St(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new me(v,p.length,0),0,!0));n(C.scrollIntoView())}return!0}}return!1}function ub(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Le.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const o2=ub(-1),i2=ub(1);function s2(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Zd(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function db(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function a2(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return l2(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function l2(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new ja(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new ja(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Zd(i,n,r,e);return a?(t&&c2(t,e,a,o,n),!0):!1}function c2(t,e,n,r,o){let i=le.empty;for(let u=n.length-1;u>=0;u--)i=le.from(n[u].type.create(n[u].attrs,i));t.step(new St(e.start-(r?2:0),e.end,e.start,e.end,new me(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,h=!0;u<d;u++,h=!1)!h&&Ho(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function u2(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?d2(e,n,t,i):f2(e,n,i):!0:!1}}function d2(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new St(i-1,s,i,s,new me(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ja(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Fo(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return wr(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function f2(t,e,n){let r=t.tr,o=n.parent;for(let f=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?le.empty:le.from(o))))return!1;let d=i.pos,h=d+s.nodeSize;return r.step(new St(d-(a?1:0),h+(l?1:0),d+1,h-1,new me((a?le.empty:le.from(o.copy(le.empty))).append(l?le.empty:le.from(o.copy(le.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function h2(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=le.from(c?t.create():null),d=new me(le.from(t.create(null,le.from(a.type.create(null,u)))),c?3:1,0),h=i.start,f=i.end;n(e.tr.step(new St(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}function al(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class ll{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(r).map(([h,f])=>[h,(...g)=>{const m=this.buildProps(c,n),v=f(...g)(m);return a.push(v),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:al({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class p2{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function xe(t,e,n){return t.config[e]===void 0&&t.parent?xe(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?xe(t.parent,e,n):null}):t.config[e]}function cl(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function fb(t){const e=[],{nodeExtensions:n,markExtensions:r}=cl(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=xe(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([h,f])=>{e.push({type:d,name:h,attribute:{...i,...f}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=xe(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const h={...i,...d};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Ct(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ot(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?String(i).split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),a.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),r[o]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=i}),r},{})}function ul(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ot(n,r),{})}function hb(t){return typeof t=="function"}function Ne(t,e=void 0,...n){return hb(t)?e?t.bind(e)(...n):t(...n):t}function g2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function m2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function pb(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):m2(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function gb(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&g2(n)?!1:n!=null))}function y2(t,e){var n;const r=fb(t),{nodeExtensions:o,markExtensions:i}=cl(t),s=(n=o.find(c=>xe(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(v=>v.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((v,C)=>{const w=xe(C,"extendNodeSchema",d);return{...v,...w?w(c):{}}},{}),f=gb({...h,content:Ne(xe(c,"content",d)),marks:Ne(xe(c,"marks",d)),group:Ne(xe(c,"group",d)),inline:Ne(xe(c,"inline",d)),atom:Ne(xe(c,"atom",d)),selectable:Ne(xe(c,"selectable",d)),draggable:Ne(xe(c,"draggable",d)),code:Ne(xe(c,"code",d)),whitespace:Ne(xe(c,"whitespace",d)),linebreakReplacement:Ne(xe(c,"linebreakReplacement",d)),defining:Ne(xe(c,"defining",d)),isolating:Ne(xe(c,"isolating",d)),attrs:Object.fromEntries(u.map(v=>{var C;return[v.name,{default:(C=v==null?void 0:v.attribute)===null||C===void 0?void 0:C.default}]}))}),p=Ne(xe(c,"parseHTML",d));p&&(f.parseDOM=p.map(v=>pb(v,u)));const g=xe(c,"renderHTML",d);g&&(f.toDOM=v=>g({node:v,HTMLAttributes:ul(v,u)}));const m=xe(c,"renderText",d);return m&&(f.toText=m),[c.name,f]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((m,v)=>{const C=xe(v,"extendMarkSchema",d);return{...m,...C?C(c):{}}},{}),f=gb({...h,inclusive:Ne(xe(c,"inclusive",d)),excludes:Ne(xe(c,"excludes",d)),group:Ne(xe(c,"group",d)),spanning:Ne(xe(c,"spanning",d)),code:Ne(xe(c,"code",d)),attrs:Object.fromEntries(u.map(m=>{var v;return[m.name,{default:(v=m==null?void 0:m.attribute)===null||v===void 0?void 0:v.default}]}))}),p=Ne(xe(c,"parseHTML",d));p&&(f.parseDOM=p.map(m=>pb(m,u)));const g=xe(c,"renderHTML",d);return g&&(f.toDOM=m=>g({mark:m,HTMLAttributes:ul(m,u)})),[c.name,f]}));return new f1({topNode:s,nodes:a,marks:l})}function Nf(t,e){return e.nodes[t]||e.marks[t]||null}function mb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Rf(t,e){const n=Zr.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const v2=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Ff(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class dl{constructor(e){this.find=e.find,this.handler=e.handler}}const b2=(t,e)=>{if(Ff(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function fl(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const d=v2(c)+i;return s.forEach(h=>{if(u)return;const f=b2(d,h.find);if(!f)return;const p=l.state.tr,g=al({state:l.state,transaction:p}),m={from:r-(f[0].length-i.length),to:o},{commands:v,chain:C,can:w}=new ll({editor:n,state:g});h.handler({state:g,range:m,match:f,commands:v,chain:C,can:w})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:o,text:i}),l.dispatch(p),u=!0)}),u}function w2(t){const{editor:e,rules:n}=t,r=new lt({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=Rf(le.from(u),s.schema);const{from:d}=l,h=d+u.length;fl({editor:e,from:d,to:h,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return fl({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&fl({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?fl({editor:e,from:s.pos,to:s.pos,text:`
47
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function S2(t){return Object.prototype.toString.call(t).slice(8,-1)}function hl(t){return S2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function pl(t,e){const n={...t};return hl(t)&&hl(e)&&Object.keys(e).forEach(r=>{hl(e[r])&&hl(t[r])?n[r]=pl(t[r],e[r]):n[r]=e[r]}),n}class Dt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Dt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>pl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Dt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function C2(t){return typeof t=="number"}class yb{constructor(e){this.find=e.find,this.handler=e.handler}}const E2=(t,e,n)=>{if(Ff(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function _2(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new ll({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,p)=>{if(!f.isTextblock||f.type.spec.code)return;const g=Math.max(r,p),m=Math.min(o,p+f.content.size),v=f.textBetween(g-p,m-p,void 0,"");E2(v,i.find,s).forEach(w=>{if(w.index===void 0)return;const b=g+w.index+1,S=b+w[0].length,E={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},x=i.handler({state:n,range:E,match:w,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(x)})}),d.every(f=>f!==null)}let gl=null;const x2=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function A2(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const g=u.tr,m=al({state:u,transaction:g});if(!(!_2({editor:e,state:m,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new lt({view(d){const h=p=>{var g;r=!((g=d.dom.parentElement)===null||g===void 0)&&g.contains(p.target)?d.dom.parentElement:null,r&&(gl=e)},f=()=>{gl&&(gl=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(i=r===d.dom.parentElement,a=h,!i){const f=gl;f&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=h,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],g=p.getMeta("uiEvent")==="paste"&&!o,m=p.getMeta("uiEvent")==="drop"&&!i,v=p.getMeta("applyPasteRules"),C=!!v;if(!g&&!m&&!C)return;if(C){let{text:S}=v;typeof S=="string"?S=S:S=Rf(le.from(S),f.schema);const{from:E}=v,x=E+S.length,_=x2(S);return l({rule:u,state:f,from:E,to:{b:x},pasteEvt:_})}const w=h.doc.content.findDiffStart(f.doc.content),b=h.doc.content.findDiffEnd(f.doc.content);if(!(!C2(w)||!b||w===b.b))return l({rule:u,state:f,from:w,to:b,pasteEvt:s})}}))}function T2(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Xo{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Xo.resolve(e),this.schema=y2(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Xo.sort(Xo.flatten(e)),r=T2(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=xe(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=xe(r,"priority")||100,s=xe(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Nf(n.name,this.schema)},o=xe(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Xo.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Nf(s.name,this.schema)},l=[],c=xe(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&xe(s,"exitable",a)&&(u.ArrowRight=()=>Dt.handleExit({editor:e,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([m,v])=>[m,()=>v({editor:e})]));u={...u,...g}}const d=$I(u);l.push(d);const h=xe(s,"addInputRules",a);mb(s,e.options.enableInputRules)&&h&&r.push(...h());const f=xe(s,"addPasteRules",a);mb(s,e.options.enablePasteRules)&&f&&o.push(...f());const p=xe(s,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[w2({editor:e,rules:r}),...A2({editor:e,rules:o}),...i]}get attributes(){return fb(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=cl(this.extensions);return Object.fromEntries(n.filter(r=>!!xe(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ct(r.name,this.schema)},s=xe(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,h)=>{const f=ul(l,o);return s()({node:l,view:c,getPos:u,decorations:d,innerDecorations:h,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Nf(e.name,this.schema)};e.type==="mark"&&(!((n=Ne(xe(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=xe(e,"onBeforeCreate",r),i=xe(e,"onCreate",r),s=xe(e,"onUpdate",r),a=xe(e,"onSelectionUpdate",r),l=xe(e,"onTransaction",r),c=xe(e,"onFocus",r),u=xe(e,"onBlur",r),d=xe(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class gt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new gt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>pl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new gt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}}function vb(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=`
48
-
49
- `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,d)=>{var h;l.isBlock&&c>r&&(a+=i);const f=s==null?void 0:s[l.type.name];if(f)return u&&(a+=f({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c))}),a}function bb(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const O2=gt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new lt({key:new yt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=bb(n);return vb(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),k2=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),M2=(t=!1)=>({commands:e})=>e.setContent("",t),P2=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),h=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const p=Fo(f);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,g)}(p||p===0)&&e.lift(f,p)})}),!0},I2=t=>e=>t(e),L2=()=>({state:t,dispatch:e})=>e2(t,e),D2=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Le(r.doc.resolve(s-1))),!0},N2=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},R2=t=>({tr:e,state:n,dispatch:r})=>{const o=Ct(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},F2=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},H2=()=>({state:t,dispatch:e})=>jI(t,e),B2=()=>({commands:t})=>t.keyboardShortcut("Enter"),V2=()=>({state:t,dispatch:e})=>ZI(t,e);function ml(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Ff(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function wb(t,e,n={}){return t.find(r=>r.type===e&&ml(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function Sb(t,e,n={}){return!!wb(t,e,n)}function Hf(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!wb([...o.node.marks],e,n)))return;let s=o.index,a=t.start()+o.offset,l=s+1,c=a+o.node.nodeSize;for(;s>0&&Sb([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&Sb([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Mr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const $2=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Mr(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=Hf(l,i,e);if(d&&d.from<=c&&d.to>=u){const h=Le.create(s,d.from,d.to);n.setSelection(h)}}return!0},j2=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Bf(t){return t instanceof Le}function Gn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Cb(t,e=null){if(!e)return null;const n=De.atStart(t),r=De.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?Le.create(t,Gn(0,o,i),Gn(t.content.size,o,i)):Le.create(t,Gn(e,o,i),Gn(e,o,i))}function Eb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function yl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const z2=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(yl()||Eb())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Bf(n.state.selection))return s(),!0;const a=Cb(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},U2=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),q2=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),_b=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&_b(r)}return t};function vl(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return _b(n)}function bl(t,e,n){if(t instanceof yr||t instanceof le)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return le.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),bl("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new f1({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?$i.fromSchema(l).parseSlice(vl(t),n.parseOptions):$i.fromSchema(l).parse(vl(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=$i.fromSchema(e);return n.slice?i.parseSlice(vl(t),n.parseOptions).content:i.parse(vl(t),n.parseOptions)}return bl("",e,n)}function W2(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof wt||o instanceof St))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(De.near(t.doc.resolve(s),n))}const K2=t=>!("type"in t),G2=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=bl(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(p){return i.emit("contentError",{editor:i,error:p,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((K2(a)?a:[a]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),l===c&&d){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}let f;if(u){if(Array.isArray(e))f=e.map(p=>p.text||"").join("");else if(e instanceof le){let p="";e.forEach(g=>{g.text&&(p+=g.text)}),f=p}else typeof e=="object"&&e&&e.text?f=e.text:f=e;r.insertText(f,l,c)}else f=a,r.replaceWith(l,c,f);n.updateSelection&&W2(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},J2=()=>({state:t,dispatch:e})=>JI(t,e),X2=()=>({state:t,dispatch:e})=>XI(t,e),Y2=()=>({state:t,dispatch:e})=>zI(t,e),Q2=()=>({state:t,dispatch:e})=>KI(t,e),Z2=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ga(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},eL=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ga(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},tL=()=>({state:t,dispatch:e})=>UI(t,e),nL=()=>({state:t,dispatch:e})=>qI(t,e);function xb(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function rL(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))yl()||xb()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const oL=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=rL(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function is(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?Ct(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(o,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=o-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>ml(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=l}const iL=(t,e={})=>({state:n,dispatch:r})=>{const o=Ct(t,n.schema);return is(n,o,e)?YI(n,r):!1},sL=()=>({state:t,dispatch:e})=>t2(t,e),aL=t=>({state:e,dispatch:n})=>{const r=Ct(t,e.schema);return u2(r)(e,n)},lL=()=>({state:t,dispatch:e})=>QI(t,e);function wl(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ab(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const cL=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=wl(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=Ct(t,r.schema)),a==="mark"&&(s=Mr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,Ab(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(Ab(d.attrs,e)))})})}),!0):!1},uL=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),dL=()=>({tr:t,dispatch:e})=>{if(e){const n=new ln(t.doc);t.setSelection(n)}return!0},fL=()=>({state:t,dispatch:e})=>WI(t,e),hL=()=>({state:t,dispatch:e})=>GI(t,e),pL=()=>({state:t,dispatch:e})=>n2(t,e),gL=()=>({state:t,dispatch:e})=>i2(t,e),mL=()=>({state:t,dispatch:e})=>o2(t,e);function Vf(t,e,n={},r={}){return bl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const yL=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=Vf(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Tb(t,e){const n=Mr(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function vL(t,e){const n=new F1(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function bL(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function wL(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function SL(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function $f(t){return e=>SL(e.$from,t)}function CL(t,e){const n={from:0,to:t.content.size};return vb(t,n,e)}function EL(t,e){const n=Ct(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Ob(t,e){const n=wl(typeof e=="string"?e:e.name,t.schema);return n==="node"?EL(t,e):n==="mark"?Tb(t,e):{}}function _L(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function xL(t){const e=_L(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function AL(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),d=e.invert().map(c,-1),h=e.invert().map(u);r.push({oldRange:{from:d,to:h},newRange:{from:c,to:u}})})}),xL(r)}function jf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Hf(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Sl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function zf(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Mr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>ml(d.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(g,m)=>{if(!g.isText&&!g.marks.length)return;const v=Math.max(f,m),C=Math.min(p,m+g.nodeSize),w=C-v;s+=w,a.push(...g.marks.map(b=>({mark:b,from:v,to:C})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>ml(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+c:l)>=s}function TL(t,e,n={}){if(!e)return is(t,null,n)||zf(t,null,n);const r=wl(e,t.schema);return r==="node"?is(t,e,n):r==="mark"?zf(t,e,n):!1}function kb(t,e){const{nodeExtensions:n}=cl(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Ne(xe(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Uf(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Uf(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function Mb(t){return t instanceof Oe}function OL(t,e,n){const o=t.state.doc.content.size,i=Gn(e,0,o),s=Gn(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,p=u-c,v={top:c,bottom:u,left:d,right:h,width:f,height:p,x:d,y:c};return{...v,toJSON:()=>v}}function kL(t,e,n){var r;const{selection:o}=e;let i=null;if(Bf(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,h)=>{if(c)return!1;if(u.isInline){const f=!h||h.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&p}return!c}),c})}const ML=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Mr(t,r.schema);if(o)if(s){const c=Tb(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(h,f)=>{const p=Math.max(f,u),g=Math.min(f+h.nodeSize,d);h.marks.find(v=>v.type===l)?h.marks.forEach(v=>{l===v.type&&n.addMark(p,g,l.create({...v.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return kL(r,n,l)},PL=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),IL=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=Ct(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>db(i,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>db(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LL=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Gn(t,0,r.content.size),i=Oe.create(r,o);e.setSelection(i)}return!0},DL=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=Le.atStart(r).from,a=Le.atEnd(r).to,l=Gn(o,s,a),c=Gn(i,s,a),u=Le.create(r,l,c);e.setSelection(u)}return!0},NL=t=>({state:e,dispatch:n})=>{const r=Ct(t,e.schema);return h2(r)(e,n)};function Pb(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const RL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Sl(c,a.node().type.name,a.node().attrs);if(i instanceof Oe&&i.node.isBlock)return!a.parentOffset||!Ho(s,a.pos)?!1:(r&&(t&&Pb(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:bL(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:u}]:void 0,p=Ho(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!p&&Ho(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(p&&(i instanceof Le&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),m=e.doc.resolve(g);a.node(-1).canReplaceWith(m.index(),m.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Pb(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return p},FL=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=Ct(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let v=le.empty;const C=l.index(-1)?1:l.index(-2)?2:3;for(let _=l.depth-C;_>=l.depth-3;_-=1)v=le.from(l.node(_).copy(v));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,b={...Sl(h,l.node().type.name,l.node().attrs),...e},S=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;v=v.append(le.from(a.createAndFill(null,S)||void 0));const E=l.before(l.depth-(C-1));n.replace(E,l.after(-w),new me(v,4-C,0));let x=-1;n.doc.nodesBetween(E,n.doc.content.size,(_,A)=>{if(x>-1)return!1;_.isTextblock&&_.content.size===0&&(x=A+1)}),x>-1&&n.setSelection(Le.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...Sl(h,d.type.name,d.attrs),...e},g={...Sl(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:p},{type:f,attrs:g}]:[{type:a,attrs:p}];if(!Ho(n.doc,l.pos,2))return!1;if(o){const{selection:v,storedMarks:C}=r,{splittableMarks:w}=i.extensionManager,b=C||v.$to.parentOffset&&v.$from.marks();if(n.split(l.pos,2,m).scrollIntoView(),!b||!o)return!0;const S=b.filter(E=>w.includes(E.type.name));n.ensureMarks(S)}return!0},qf=(t,e)=>{const n=$f(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&wr(t.doc,n.pos)&&t.join(n.pos),!0},Wf=(t,e)=>{const n=$f(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&wr(t.doc,r)&&t.join(r),!0};var HL=Object.freeze({__proto__:null,blur:k2,clearContent:M2,clearNodes:P2,command:I2,createParagraphNear:L2,cut:D2,deleteCurrentNode:N2,deleteNode:R2,deleteRange:F2,deleteSelection:H2,enter:B2,exitCode:V2,extendMarkRange:$2,first:j2,focus:z2,forEach:U2,insertContent:q2,insertContentAt:G2,joinBackward:Y2,joinDown:X2,joinForward:Q2,joinItemBackward:Z2,joinItemForward:eL,joinTextblockBackward:tL,joinTextblockForward:nL,joinUp:J2,keyboardShortcut:oL,lift:iL,liftEmptyBlock:sL,liftListItem:aL,newlineInCode:lL,resetAttributes:cL,scrollIntoView:uL,selectAll:dL,selectNodeBackward:fL,selectNodeForward:hL,selectParentNode:pL,selectTextblockEnd:gL,selectTextblockStart:mL,setContent:yL,setMark:ML,setMeta:PL,setNode:IL,setNodeSelection:LL,setTextSelection:DL,sinkListItem:NL,splitBlock:RL,splitListItem:FL,toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:h}=o.extensionManager,f=Ct(t,s.schema),p=Ct(e,s.schema),{selection:g,storedMarks:m}=s,{$from:v,$to:C}=g,w=v.blockRange(C),b=m||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=$f(E=>kb(E.type.name,d))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===f)return c.liftListItem(p);if(kb(S.node.type.name,d)&&f.validContent(S.node.content)&&a)return l().command(()=>(i.setNodeMarkup(S.pos,f),!0)).command(()=>qf(i,f)).command(()=>Wf(i,f)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>qf(i,f)).command(()=>Wf(i,f)).run():l().command(()=>{const E=u().wrapInList(f,r),x=b.filter(_=>h.includes(_.type.name));return i.ensureMarks(x),E?!0:c.clearNodes()}).wrapInList(f,r).command(()=>qf(i,f)).command(()=>Wf(i,f)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Mr(t,r.schema);return zf(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=Ct(t,r.schema),s=Ct(e,r.schema),a=is(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=Ct(t,n.schema);return is(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Mr(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:h,to:f}=a;const p=(i=c.marks().find(m=>m.type===l))===null||i===void 0?void 0:i.attrs,g=Hf(c,l,p);g&&(h=g.from,f=g.to),n.removeMark(h,f,l)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=wl(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=Ct(t,r.schema)),a==="mark"&&(s=Mr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let d,h,f,p;n.selection.empty?r.doc.nodesBetween(c,u,(g,m)=>{i&&i===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g)}):r.doc.nodesBetween(c,u,(g,m)=>{m<c&&i&&i===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g),m>=c&&m<=u&&(i&&i===g.type&&n.setNodeMarkup(m,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(v=>{if(s===v.type){const C=Math.max(m,c),w=Math.min(m+g.nodeSize,u);n.addMark(C,w,s.create({...v.attrs,...e}))}}))}),h&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(f,p,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=Ct(t,n.schema);return s2(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=Ct(t,n.schema);return a2(o,e)(n,r)}});const BL=gt.create({name:"commands",addCommands(){return{...HL}}}),VL=gt.create({name:"drop",addProseMirrorPlugins(){return[new lt({key:new yt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),$L=gt.create({name:"editable",addProseMirrorPlugins(){return[new lt({key:new yt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),jL=gt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new lt({key:new yt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),zL=gt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,g=p.parent.type.spec.isolating,m=d.pos-d.parentOffset,v=g&&p.parent.childCount===1?m===d.pos:De.atStart(c).from===h;return!u||!f.type.isTextblock||f.textContent.length||!v||v&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return yl()||xb()?i:o},addProseMirrorPlugins(){return[new lt({key:new yt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),o=t.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=De.atStart(e.doc).from,c=De.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!Uf(n.doc))return;const h=n.tr,f=al({state:n,transaction:h}),{commands:p}=new ll({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),UL=gt.create({name:"paste",addProseMirrorPlugins(){return[new lt({key:new yt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),qL=gt.create({name:"tabindex",addProseMirrorPlugins(){return[new lt({key:new yt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class ao{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new ao(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new ao(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new ao(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new ao(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new ao(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(i[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const WL=`.ProseMirror {
50
- position: relative;
51
- }
52
-
53
- .ProseMirror {
54
- word-wrap: break-word;
55
- white-space: pre-wrap;
56
- white-space: break-spaces;
57
- -webkit-font-variant-ligatures: none;
58
- font-variant-ligatures: none;
59
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
60
- }
61
-
62
- .ProseMirror [contenteditable="false"] {
63
- white-space: normal;
64
- }
65
-
66
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
67
- white-space: pre-wrap;
68
- }
69
-
70
- .ProseMirror pre {
71
- white-space: pre-wrap;
72
- }
73
-
74
- img.ProseMirror-separator {
75
- display: inline !important;
76
- border: none !important;
77
- margin: 0 !important;
78
- width: 0 !important;
79
- height: 0 !important;
80
- }
81
-
82
- .ProseMirror-gapcursor {
83
- display: none;
84
- pointer-events: none;
85
- position: absolute;
86
- margin: 0;
87
- }
88
-
89
- .ProseMirror-gapcursor:after {
90
- content: "";
91
- display: block;
92
- position: absolute;
93
- top: -2px;
94
- width: 20px;
95
- border-top: 1px solid black;
96
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
97
- }
98
-
99
- @keyframes ProseMirror-cursor-blink {
100
- to {
101
- visibility: hidden;
102
- }
103
- }
104
-
105
- .ProseMirror-hideselection *::selection {
106
- background: transparent;
107
- }
108
-
109
- .ProseMirror-hideselection *::-moz-selection {
110
- background: transparent;
111
- }
112
-
113
- .ProseMirror-hideselection * {
114
- caret-color: transparent;
115
- }
116
-
117
- .ProseMirror-focused .ProseMirror-gapcursor {
118
- display: block;
119
- }
120
-
121
- .tippy-box[data-animation=fade][data-state=hidden] {
122
- opacity: 0
123
- }`;function KL(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let GL=class extends p2{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=KL(WL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=hb(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[$L,O2.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),BL,jL,zL,qL,VL,UL].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Xo(o,this)}createCommandManager(){this.commandManager=new ll({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Vf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Vf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Cb(n,this.options.autofocus);this.view=new II(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:jo.create({doc:n,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Ob(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return TL(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Rf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
124
-
125
- `,textSerializers:r={}}=e||{};return CL(this.state.doc,{blockSeparator:n,textSerializers:{...bb(this.schema),...r}})}get isEmpty(){return Uf(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new ao(n,this)}get $doc(){return this.$pos(0)}};function lo(t){return new dl({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ne(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(jf(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const h=n.from+l+s.length;i.addMark(n.from+l,h,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function JL(t){return new dl({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ne(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function Kf(t){return new dl({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Ne(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function ss(t){return new dl({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Ne(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Zd(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(m=>f.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&wr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class $t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new $t(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>pl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new $t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}}class XL{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let h=0,f=0;if(this.dom!==d){const v=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),w=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,b=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;h=C.x-v.x+w,f=C.y-v.y+b}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,h,f);const p=this.getPos();if(typeof p!="number")return;const g=Oe.create(c.state.doc,p),m=c.state.tr.setSelection(g);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Oe.isSelectable(this.node),h=e.type==="copy",f=e.type==="paste",p=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&i&&e.target===this.dom&&e.preventDefault(),u&&i&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&g){const m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||h||f||p||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(yl()||Eb())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Pr(t){return new yb({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=Ne(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(jf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function YL(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function QL(t){return new yb({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:o}){const i=Ne(t.getAttributes,void 0,e,o),s=Ne(t.getContent,void 0,i);if(i===!1||i===null)return null;const a={type:t.type.name,attrs:i};s&&(a.content=s),e.input&&n().deleteRange(r).insertContentAt(r.from,a)}})}var Wt="top",fn="bottom",hn="right",Kt="left",Gf="auto",as=[Wt,fn,hn,Kt],Yo="start",ls="end",ZL="clippingParents",Ib="viewport",cs="popper",eD="reference",Lb=as.reduce(function(t,e){return t.concat([e+"-"+Yo,e+"-"+ls])},[]),Db=[].concat(as,[Gf]).reduce(function(t,e){return t.concat([e,e+"-"+Yo,e+"-"+ls])},[]),tD="beforeRead",nD="read",rD="afterRead",oD="beforeMain",iD="main",sD="afterMain",aD="beforeWrite",lD="write",cD="afterWrite",uD=[tD,nD,rD,oD,iD,sD,aD,lD,cD];function kn(t){return t?(t.nodeName||"").toLowerCase():null}function en(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function co(t){var e=en(t).Element;return t instanceof e||t instanceof Element}function pn(t){var e=en(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Jf(t){if(typeof ShadowRoot>"u")return!1;var e=en(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dD(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!pn(i)||!kn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function fD(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!pn(o)||!kn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Nb={name:"applyStyles",enabled:!0,phase:"write",fn:dD,effect:fD,requires:["computeStyles"]};function Mn(t){return t.split("-")[0]}var uo=Math.max,Cl=Math.min,Qo=Math.round;function Xf(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Rb(){return!/^((?!chrome|android).)*safari/i.test(Xf())}function Zo(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&pn(t)&&(o=t.offsetWidth>0&&Qo(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Qo(r.height)/t.offsetHeight||1);var s=co(t)?en(t):window,a=s.visualViewport,l=!Rb()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,h=r.height/i;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function Yf(t){var e=Zo(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Fb(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Jf(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jn(t){return en(t).getComputedStyle(t)}function hD(t){return["table","td","th"].indexOf(kn(t))>=0}function Ir(t){return((co(t)?t.ownerDocument:t.document)||window.document).documentElement}function El(t){return kn(t)==="html"?t:t.assignedSlot||t.parentNode||(Jf(t)?t.host:null)||Ir(t)}function Hb(t){return!pn(t)||Jn(t).position==="fixed"?null:t.offsetParent}function pD(t){var e=/firefox/i.test(Xf()),n=/Trident/i.test(Xf());if(n&&pn(t)){var r=Jn(t);if(r.position==="fixed")return null}var o=El(t);for(Jf(o)&&(o=o.host);pn(o)&&["html","body"].indexOf(kn(o))<0;){var i=Jn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function us(t){for(var e=en(t),n=Hb(t);n&&hD(n)&&Jn(n).position==="static";)n=Hb(n);return n&&(kn(n)==="html"||kn(n)==="body"&&Jn(n).position==="static")?e:n||pD(t)||e}function Qf(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ds(t,e,n){return uo(t,Cl(e,n))}function gD(t,e,n){var r=ds(t,e,n);return r>n?n:r}function Bb(){return{top:0,right:0,bottom:0,left:0}}function Vb(t){return Object.assign({},Bb(),t)}function $b(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var mD=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Vb(typeof e!="number"?e:$b(e,as))};function yD(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Mn(n.placement),l=Qf(a),c=[Kt,hn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=mD(o.padding,n),h=Yf(i),f=l==="y"?Wt:Kt,p=l==="y"?fn:hn,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=us(i),C=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,w=g/2-m/2,b=d[f],S=C-h[u]-d[p],E=C/2-h[u]/2+w,x=ds(b,E,S),_=l;n.modifiersData[r]=(e={},e[_]=x,e.centerOffset=x-E,e)}}function vD(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||Fb(e.elements.popper,o)&&(e.elements.arrow=o))}const bD={name:"arrow",enabled:!0,phase:"main",fn:yD,effect:vD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ei(t){return t.split("-")[1]}var wD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function SD(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Qo(n*o)/o||0,y:Qo(r*o)/o||0}}function jb(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=s.x,f=h===void 0?0:h,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var v=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),w=Kt,b=Wt,S=window;if(c){var E=us(n),x="clientHeight",_="clientWidth";if(E===en(n)&&(E=Ir(n),Jn(E).position!=="static"&&a==="absolute"&&(x="scrollHeight",_="scrollWidth")),E=E,o===Wt||(o===Kt||o===hn)&&i===ls){b=fn;var A=d&&E===S&&S.visualViewport?S.visualViewport.height:E[x];g-=A-r.height,g*=l?1:-1}if(o===Kt||(o===Wt||o===fn)&&i===ls){w=hn;var O=d&&E===S&&S.visualViewport?S.visualViewport.width:E[_];f-=O-r.width,f*=l?1:-1}}var k=Object.assign({position:a},c&&wD),M=u===!0?SD({x:f,y:g},en(n)):{x:f,y:g};if(f=M.x,g=M.y,l){var I;return Object.assign({},k,(I={},I[b]=C?"0":"",I[w]=v?"0":"",I.transform=(S.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",I))}return Object.assign({},k,(e={},e[b]=C?g+"px":"",e[w]=v?f+"px":"",e.transform="",e))}function CD(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Mn(e.placement),variation:ei(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,jb(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,jb(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const ED={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:CD,data:{}};var _l={passive:!0};function _D(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=en(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,_l)}),a&&l.addEventListener("resize",n.update,_l),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,_l)}),a&&l.removeEventListener("resize",n.update,_l)}}const xD={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:_D,data:{}};var AD={left:"right",right:"left",bottom:"top",top:"bottom"};function xl(t){return t.replace(/left|right|bottom|top/g,function(e){return AD[e]})}var TD={start:"end",end:"start"};function zb(t){return t.replace(/start|end/g,function(e){return TD[e]})}function Zf(t){var e=en(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function eh(t){return Zo(Ir(t)).left+Zf(t).scrollLeft}function OD(t,e){var n=en(t),r=Ir(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=Rb();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+eh(t),y:l}}function kD(t){var e,n=Ir(t),r=Zf(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=uo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=uo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+eh(t),l=-r.scrollTop;return Jn(o||n).direction==="rtl"&&(a+=uo(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function th(t){var e=Jn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ub(t){return["html","body","#document"].indexOf(kn(t))>=0?t.ownerDocument.body:pn(t)&&th(t)?t:Ub(El(t))}function fs(t,e){var n;e===void 0&&(e=[]);var r=Ub(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=en(r),s=o?[i].concat(i.visualViewport||[],th(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(fs(El(s)))}function nh(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function MD(t,e){var n=Zo(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function qb(t,e,n){return e===Ib?nh(OD(t,n)):co(e)?MD(e,n):nh(kD(Ir(t)))}function PD(t){var e=fs(El(t)),n=["absolute","fixed"].indexOf(Jn(t).position)>=0,r=n&&pn(t)?us(t):t;return co(r)?e.filter(function(o){return co(o)&&Fb(o,r)&&kn(o)!=="body"}):[]}function ID(t,e,n,r){var o=e==="clippingParents"?PD(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=qb(t,c,r);return l.top=uo(u.top,l.top),l.right=Cl(u.right,l.right),l.bottom=Cl(u.bottom,l.bottom),l.left=uo(u.left,l.left),l},qb(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Wb(t){var e=t.reference,n=t.element,r=t.placement,o=r?Mn(r):null,i=r?ei(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case Wt:l={x:s,y:e.y-n.height};break;case fn:l={x:s,y:e.y+e.height};break;case hn:l={x:e.x+e.width,y:a};break;case Kt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?Qf(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Yo:l[c]=l[c]-(e[u]/2-n[u]/2);break;case ls:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function hs(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?ZL:a,c=n.rootBoundary,u=c===void 0?Ib:c,d=n.elementContext,h=d===void 0?cs:d,f=n.altBoundary,p=f===void 0?!1:f,g=n.padding,m=g===void 0?0:g,v=Vb(typeof m!="number"?m:$b(m,as)),C=h===cs?eD:cs,w=t.rects.popper,b=t.elements[p?C:h],S=ID(co(b)?b:b.contextElement||Ir(t.elements.popper),l,u,s),E=Zo(t.elements.reference),x=Wb({reference:E,element:w,strategy:"absolute",placement:o}),_=nh(Object.assign({},w,x)),A=h===cs?_:E,O={top:S.top-A.top+v.top,bottom:A.bottom-S.bottom+v.bottom,left:S.left-A.left+v.left,right:A.right-S.right+v.right},k=t.modifiersData.offset;if(h===cs&&k){var M=k[o];Object.keys(O).forEach(function(I){var P=[hn,fn].indexOf(I)>=0?1:-1,F=[Wt,fn].indexOf(I)>=0?"y":"x";O[I]+=M[F]*P})}return O}function LD(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Db:l,u=ei(r),d=u?a?Lb:Lb.filter(function(p){return ei(p)===u}):as,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,g){return p[g]=hs(t,{placement:g,boundary:o,rootBoundary:i,padding:s})[Mn(g)],p},{});return Object.keys(f).sort(function(p,g){return f[p]-f[g]})}function DD(t){if(Mn(t)===Gf)return[];var e=xl(t);return[zb(t),e,zb(e)]}function ND(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,g=n.allowedAutoPlacements,m=e.options.placement,v=Mn(m),C=v===m,w=l||(C||!p?[xl(m)]:DD(m)),b=[m].concat(w).reduce(function(de,ue){return de.concat(Mn(ue)===Gf?LD(e,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):ue)},[]),S=e.rects.reference,E=e.rects.popper,x=new Map,_=!0,A=b[0],O=0;O<b.length;O++){var k=b[O],M=Mn(k),I=ei(k)===Yo,P=[Wt,fn].indexOf(M)>=0,F=P?"width":"height",z=hs(e,{placement:k,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),V=P?I?hn:Kt:I?fn:Wt;S[F]>E[F]&&(V=xl(V));var J=xl(V),K=[];if(i&&K.push(z[M]<=0),a&&K.push(z[V]<=0,z[J]<=0),K.every(function(de){return de})){A=k,_=!1;break}x.set(k,K)}if(_)for(var R=p?3:1,Q=function(ue){var pe=b.find(function(D){var ce=x.get(D);if(ce)return ce.slice(0,ue).every(function(ye){return ye})});if(pe)return A=pe,"break"},se=R;se>0;se--){var ie=Q(se);if(ie==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const RD={name:"flip",enabled:!0,phase:"main",fn:ND,requiresIfExists:["offset"],data:{_skip:!1}};function Kb(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Gb(t){return[Wt,hn,fn,Kt].some(function(e){return t[e]>=0})}function FD(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=hs(e,{elementContext:"reference"}),a=hs(e,{altBoundary:!0}),l=Kb(s,r),c=Kb(a,o,i),u=Gb(l),d=Gb(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const HD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FD};function BD(t,e,n){var r=Mn(t),o=[Kt,Wt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Kt,hn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function VD(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=Db.reduce(function(u,d){return u[d]=BD(d,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const $D={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:VD};function jD(t){var e=t.state,n=t.name;e.modifiersData[n]=Wb({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const zD={name:"popperOffsets",enabled:!0,phase:"read",fn:jD,data:{}};function UD(t){return t==="x"?"y":"x"}function qD(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,g=p===void 0?0:p,m=hs(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Mn(e.placement),C=ei(e.placement),w=!C,b=Qf(v),S=UD(b),E=e.modifiersData.popperOffsets,x=e.rects.reference,_=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),k=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(E){if(i){var I,P=b==="y"?Wt:Kt,F=b==="y"?fn:hn,z=b==="y"?"height":"width",V=E[b],J=V+m[P],K=V-m[F],R=f?-_[z]/2:0,Q=C===Yo?x[z]:_[z],se=C===Yo?-_[z]:-x[z],ie=e.elements.arrow,de=f&&ie?Yf(ie):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Bb(),pe=ue[P],D=ue[F],ce=ds(0,x[z],de[z]),ye=w?x[z]/2-R-ce-pe-O.mainAxis:Q-ce-pe-O.mainAxis,be=w?-x[z]/2+R+ce+D+O.mainAxis:se+ce+D+O.mainAxis,H=e.elements.arrow&&us(e.elements.arrow),L=H?b==="y"?H.clientTop||0:H.clientLeft||0:0,Ve=(I=k==null?void 0:k[b])!=null?I:0,G=V+ye-Ve-L,ne=V+be-Ve,X=ds(f?Cl(J,G):J,V,f?uo(K,ne):K);E[b]=X,M[b]=X-V}if(a){var W,$=b==="x"?Wt:Kt,ee=b==="x"?fn:hn,Ce=E[S],we=S==="y"?"height":"width",Z=Ce+m[$],Se=Ce-m[ee],U=[Wt,Kt].indexOf(v)!==-1,B=(W=k==null?void 0:k[S])!=null?W:0,re=U?Z:Ce-x[we]-_[we]-B+O.altAxis,j=U?Ce+x[we]+_[we]-B-O.altAxis:Se,te=f&&U?gD(re,Ce,j):ds(f?re:Z,Ce,f?j:Se);E[S]=te,M[S]=te-Ce}e.modifiersData[r]=M}}const WD={name:"preventOverflow",enabled:!0,phase:"main",fn:qD,requiresIfExists:["offset"]};function KD(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function GD(t){return t===en(t)||!pn(t)?Zf(t):KD(t)}function JD(t){var e=t.getBoundingClientRect(),n=Qo(e.width)/t.offsetWidth||1,r=Qo(e.height)/t.offsetHeight||1;return n!==1||r!==1}function XD(t,e,n){n===void 0&&(n=!1);var r=pn(e),o=pn(e)&&JD(e),i=Ir(e),s=Zo(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((kn(e)!=="body"||th(i))&&(a=GD(e)),pn(e)?(l=Zo(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=eh(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function YD(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function QD(t){var e=YD(t);return uD.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function ZD(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function eN(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Jb={placement:"bottom",modifiers:[],strategy:"absolute"};function Xb(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function tN(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Jb:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jb,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(v){var C=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},i,u.options,C),u.scrollParents={reference:co(a)?fs(a):a.contextElement?fs(a.contextElement):[],popper:fs(l)};var w=QD(eN([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(b){return b.enabled}),p(),f.update()},forceUpdate:function(){if(!h){var v=u.elements,C=v.reference,w=v.popper;if(Xb(C,w)){u.rects={reference:XD(C,us(w),u.options.strategy==="fixed"),popper:Yf(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],E=S.fn,x=S.options,_=x===void 0?{}:x,A=S.name;typeof E=="function"&&(u=E({state:u,options:_,name:A,instance:f})||u)}}}},update:ZD(function(){return new Promise(function(m){f.forceUpdate(),m(u)})}),destroy:function(){g(),h=!0}};if(!Xb(a,l))return f;f.setOptions(c).then(function(m){!h&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var v=m.name,C=m.options,w=C===void 0?{}:C,b=m.effect;if(typeof b=="function"){var S=b({state:u,name:v,instance:f,options:w}),E=function(){};d.push(S||E)}})}function g(){d.forEach(function(m){return m()}),d=[]}return f}}var nN=[xD,zD,ED,Nb,$D,RD,WD,bD,HD],rN=tN({defaultModifiers:nN}),oN="tippy-box",Yb="tippy-content",iN="tippy-backdrop",Qb="tippy-arrow",Zb="tippy-svg-arrow",fo={passive:!0,capture:!0},ew=function(){return document.body};function sN(t,e){return{}.hasOwnProperty.call(t,e)}function rh(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function oh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function tw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function nw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function aN(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function lN(t){return t.split(/\s+/).filter(Boolean)}function ti(t){return[].concat(t)}function rw(t,e){t.indexOf(e)===-1&&t.push(e)}function cN(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function uN(t){return t.split("-")[0]}function Al(t){return[].slice.call(t)}function ow(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ps(){return document.createElement("div")}function gs(t){return["Element","Fragment"].some(function(e){return oh(t,e)})}function dN(t){return oh(t,"NodeList")}function fN(t){return oh(t,"MouseEvent")}function hN(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function pN(t){return gs(t)?[t]:dN(t)?Al(t):Array.isArray(t)?t:Al(document.querySelectorAll(t))}function ih(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function iw(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function gN(t){var e,n=ti(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function mN(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=uN(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=i.top-r+d>l,m=r-i.bottom-h>l,v=i.left-n+f>l,C=n-i.right-p>l;return g||m||v||C})}function sh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function sw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Pn={isTouch:!1},aw=0;function yN(){Pn.isTouch||(Pn.isTouch=!0,window.performance&&document.addEventListener("mousemove",lw))}function lw(){var t=performance.now();t-aw<20&&(Pn.isTouch=!1,document.removeEventListener("mousemove",lw)),aw=t}function vN(){var t=document.activeElement;if(hN(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function bN(){document.addEventListener("touchstart",yN,fo),window.addEventListener("blur",vN)}var wN=typeof window<"u"&&typeof document<"u",SN=wN?!!window.msCrypto:!1;function ni(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function cw(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function CN(t){return cw(`
126
- %ctippy.js
127
-
128
- %c`+cw(t)+`
129
-
130
- %c👷‍ This is a development-only message. It will be removed in production.
131
- `)}function uw(t){return[CN(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ms;process.env.NODE_ENV!=="production"&&EN();function EN(){ms=new Set}function Xn(t,e){if(t&&!ms.has(e)){var n;ms.add(e),(n=console).warn.apply(n,uw(e))}}function ah(t,e){if(t&&!ms.has(e)){var n;ms.add(e),(n=console).error.apply(n,uw(e))}}function _N(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;ah(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),ah(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var dw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xN={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},tn=Object.assign({appendTo:ew,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},dw,xN),AN=Object.keys(tn),TN=function(e){process.env.NODE_ENV!=="production"&&pw(e,[]);var n=Object.keys(e);n.forEach(function(r){tn[r]=e[r]})};function fw(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=t[i]!==void 0?t[i]:(a=tn[i])!=null?a:s}return r},{});return Object.assign({},t,n)}function ON(t,e){var n=e?Object.keys(fw(Object.assign({},tn,{plugins:e}))):AN,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function hw(t,e){var n=Object.assign({},e,{content:tw(e.content,[t])},e.ignoreAttributes?{}:ON(t,e.plugins));return n.aria=Object.assign({},tn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function pw(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=aN(tn,Object.keys(dw)),i=!sN(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),Xn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
132
-
133
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
134
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var kN=function(){return"innerHTML"};function lh(t,e){t[kN()]=e}function gw(t){var e=ps();return t===!0?e.className=Qb:(e.className=Zb,gs(t)?e.appendChild(t):lh(e,t)),e}function mw(t,e){gs(e.content)?(lh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?lh(t,e.content):t.textContent=e.content)}function ch(t){var e=t.firstElementChild,n=Al(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Yb)}),arrow:n.find(function(r){return r.classList.contains(Qb)||r.classList.contains(Zb)}),backdrop:n.find(function(r){return r.classList.contains(iN)})}}function yw(t){var e=ps(),n=ps();n.className=oN,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ps();r.className=Yb,r.setAttribute("data-state","hidden"),mw(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var a=ch(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&mw(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(gw(s.arrow))):l.appendChild(gw(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}yw.$$tippy=!0;var MN=1,Tl=[],uh=[];function PN(t,e){var n=hw(t,Object.assign({},tn,fw(ow(e)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],p=nw(G,n.interactiveDebounce),g,m=MN++,v=null,C=cN(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:t,popper:ps(),popperInstance:v,props:n,state:w,plugins:C,clearDelayTimeouts:re,setProps:j,setContent:te,show:fe,hide:ve,hideWithInteractivity:Ee,enable:U,disable:B,unmount:je,destroy:Ue};if(!n.render)return process.env.NODE_ENV!=="production"&&ah(!0,"render() function has not been supplied."),b;var S=n.render(b),E=S.popper,x=S.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+b.id,b.popper=E,t._tippy=b,E._tippy=b;var _=C.map(function(q){return q.fn(b)}),A=t.hasAttribute("aria-expanded");return H(),R(),V(),J("onCreate",[b]),n.showOnCreate&&Z(),E.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",p)}),b;function O(){var q=b.props.touch;return Array.isArray(q)?q:[q,0]}function k(){return O()[0]==="hold"}function M(){var q;return!!((q=b.props.render)!=null&&q.$$tippy)}function I(){return g||t}function P(){var q=I().parentNode;return q?gN(q):document}function F(){return ch(E)}function z(q){return b.state.isMounted&&!b.state.isVisible||Pn.isTouch||u&&u.type==="focus"?0:rh(b.props.delay,q?0:1,tn.delay)}function V(q){q===void 0&&(q=!1),E.style.pointerEvents=b.props.interactive&&!q?"":"none",E.style.zIndex=""+b.props.zIndex}function J(q,ae,ge){if(ge===void 0&&(ge=!0),_.forEach(function(ke){ke[q]&&ke[q].apply(ke,ae)}),ge){var Me;(Me=b.props)[q].apply(Me,ae)}}function K(){var q=b.props.aria;if(q.content){var ae="aria-"+q.content,ge=E.id,Me=ti(b.props.triggerTarget||t);Me.forEach(function(ke){var ze=ke.getAttribute(ae);if(b.state.isVisible)ke.setAttribute(ae,ze?ze+" "+ge:ge);else{var Te=ze&&ze.replace(ge,"").trim();Te?ke.setAttribute(ae,Te):ke.removeAttribute(ae)}})}}function R(){if(!(A||!b.props.aria.expanded)){var q=ti(b.props.triggerTarget||t);q.forEach(function(ae){b.props.interactive?ae.setAttribute("aria-expanded",b.state.isVisible&&ae===I()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function Q(){P().removeEventListener("mousemove",p),Tl=Tl.filter(function(q){return q!==p})}function se(q){if(!(Pn.isTouch&&(l||q.type==="mousedown"))){var ae=q.composedPath&&q.composedPath()[0]||q.target;if(!(b.props.interactive&&sw(E,ae))){if(ti(b.props.triggerTarget||t).some(function(ge){return sw(ge,ae)})){if(Pn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else J("onClickOutside",[b,q]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||pe())}}}function ie(){l=!0}function de(){l=!1}function ue(){var q=P();q.addEventListener("mousedown",se,!0),q.addEventListener("touchend",se,fo),q.addEventListener("touchstart",de,fo),q.addEventListener("touchmove",ie,fo)}function pe(){var q=P();q.removeEventListener("mousedown",se,!0),q.removeEventListener("touchend",se,fo),q.removeEventListener("touchstart",de,fo),q.removeEventListener("touchmove",ie,fo)}function D(q,ae){ye(q,function(){!b.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&ae()})}function ce(q,ae){ye(q,ae)}function ye(q,ae){var ge=F().box;function Me(ke){ke.target===ge&&(sh(ge,"remove",Me),ae())}if(q===0)return ae();sh(ge,"remove",d),sh(ge,"add",Me),d=Me}function be(q,ae,ge){ge===void 0&&(ge=!1);var Me=ti(b.props.triggerTarget||t);Me.forEach(function(ke){ke.addEventListener(q,ae,ge),f.push({node:ke,eventType:q,handler:ae,options:ge})})}function H(){k()&&(be("touchstart",Ve,{passive:!0}),be("touchend",ne,{passive:!0})),lN(b.props.trigger).forEach(function(q){if(q!=="manual")switch(be(q,Ve),q){case"mouseenter":be("mouseleave",ne);break;case"focus":be(SN?"focusout":"blur",X);break;case"focusin":be("focusout",X);break}})}function L(){f.forEach(function(q){var ae=q.node,ge=q.eventType,Me=q.handler,ke=q.options;ae.removeEventListener(ge,Me,ke)}),f=[]}function Ve(q){var ae,ge=!1;if(!(!b.state.isEnabled||W(q)||a)){var Me=((ae=u)==null?void 0:ae.type)==="focus";u=q,g=q.currentTarget,R(),!b.state.isVisible&&fN(q)&&Tl.forEach(function(ke){return ke(q)}),q.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?ge=!0:Z(q),q.type==="click"&&(s=!ge),ge&&!Me&&Se(q)}}function G(q){var ae=q.target,ge=I().contains(ae)||E.contains(ae);if(!(q.type==="mousemove"&&ge)){var Me=we().concat(E).map(function(ke){var ze,Te=ke._tippy,et=(ze=Te.popperInstance)==null?void 0:ze.state;return et?{popperRect:ke.getBoundingClientRect(),popperState:et,props:n}:null}).filter(Boolean);mN(Me,q)&&(Q(),Se(q))}}function ne(q){var ae=W(q)||b.props.trigger.indexOf("click")>=0&&s;if(!ae){if(b.props.interactive){b.hideWithInteractivity(q);return}Se(q)}}function X(q){b.props.trigger.indexOf("focusin")<0&&q.target!==I()||b.props.interactive&&q.relatedTarget&&E.contains(q.relatedTarget)||Se(q)}function W(q){return Pn.isTouch?k()!==q.type.indexOf("touch")>=0:!1}function $(){ee();var q=b.props,ae=q.popperOptions,ge=q.placement,Me=q.offset,ke=q.getReferenceClientRect,ze=q.moveTransition,Te=M()?ch(E).arrow:null,et=ke?{getBoundingClientRect:ke,contextElement:ke.contextElement||I()}:t,$n={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ar){var at=ar.state;if(M()){var lr=F(),Si=lr.box;["placement","reference-hidden","escaped"].forEach(function(To){To==="placement"?Si.setAttribute("data-placement",at.placement):at.attributes.popper["data-popper-"+To]?Si.setAttribute("data-"+To,""):Si.removeAttribute("data-"+To)}),at.attributes.popper={}}}},st=[{name:"offset",options:{offset:Me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ze}},$n];M()&&Te&&st.push({name:"arrow",options:{element:Te,padding:3}}),st.push.apply(st,(ae==null?void 0:ae.modifiers)||[]),b.popperInstance=rN(et,E,Object.assign({},ae,{placement:ge,onFirstUpdate:h,modifiers:st}))}function ee(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ce(){var q=b.props.appendTo,ae,ge=I();b.props.interactive&&q===ew||q==="parent"?ae=ge.parentNode:ae=tw(q,[ge]),ae.contains(E)||ae.appendChild(E),b.state.isMounted=!0,$(),process.env.NODE_ENV!=="production"&&Xn(b.props.interactive&&q===tn.appendTo&&ge.nextElementSibling!==E,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
135
-
136
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
137
-
138
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
139
-
140
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function we(){return Al(E.querySelectorAll("[data-tippy-root]"))}function Z(q){b.clearDelayTimeouts(),q&&J("onTrigger",[b,q]),ue();var ae=z(!0),ge=O(),Me=ge[0],ke=ge[1];Pn.isTouch&&Me==="hold"&&ke&&(ae=ke),ae?r=setTimeout(function(){b.show()},ae):b.show()}function Se(q){if(b.clearDelayTimeouts(),J("onUntrigger",[b,q]),!b.state.isVisible){pe();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&s)){var ae=z(!1);ae?o=setTimeout(function(){b.state.isVisible&&b.hide()},ae):i=requestAnimationFrame(function(){b.hide()})}}function U(){b.state.isEnabled=!0}function B(){b.hide(),b.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function j(q){if(process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("setProps")),!b.state.isDestroyed){J("onBeforeUpdate",[b,q]),L();var ae=b.props,ge=hw(t,Object.assign({},ae,ow(q),{ignoreAttributes:!0}));b.props=ge,H(),ae.interactiveDebounce!==ge.interactiveDebounce&&(Q(),p=nw(G,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?ti(ae.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):ge.triggerTarget&&t.removeAttribute("aria-expanded"),R(),V(),x&&x(ae,ge),b.popperInstance&&($(),we().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),J("onAfterUpdate",[b,q])}}function te(q){b.setProps({content:q})}function fe(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("show"));var q=b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,Me=Pn.isTouch&&!b.props.touch,ke=rh(b.props.duration,0,tn.duration);if(!(q||ae||ge||Me)&&!I().hasAttribute("disabled")&&(J("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,M()&&(E.style.visibility="visible"),V(),ue(),b.state.isMounted||(E.style.transition="none"),M()){var ze=F(),Te=ze.box,et=ze.content;ih([Te,et],0)}h=function(){var st;if(!(!b.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=b.props.moveTransition,M()&&b.props.animation){var Mt=F(),ar=Mt.box,at=Mt.content;ih([ar,at],ke),iw([ar,at],"visible")}K(),R(),rw(uh,b),(st=b.popperInstance)==null||st.forceUpdate(),J("onMount",[b]),b.props.animation&&M()&&ce(ke,function(){b.state.isShown=!0,J("onShown",[b])})}},Ce()}}function ve(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("hide"));var q=!b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,Me=rh(b.props.duration,1,tn.duration);if(!(q||ae||ge)&&(J("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,M()&&(E.style.visibility="hidden"),Q(),pe(),V(!0),M()){var ke=F(),ze=ke.box,Te=ke.content;b.props.animation&&(ih([ze,Te],Me),iw([ze,Te],"hidden"))}K(),R(),b.props.animation?M()&&D(Me,b.unmount):b.unmount()}}function Ee(q){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("hideWithInteractivity")),P().addEventListener("mousemove",p),rw(Tl,p),p(q)}function je(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ee(),we().forEach(function(q){q._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),uh=uh.filter(function(q){return q!==b}),b.state.isMounted=!1,J("onHidden",[b]))}function Ue(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ni("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),L(),delete t._tippy,b.state.isDestroyed=!0,J("onDestroy",[b]))}}function ri(t,e){e===void 0&&(e={});var n=tn.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(_N(t),pw(e,n)),bN();var r=Object.assign({},e,{plugins:n}),o=pN(t);if(process.env.NODE_ENV!=="production"){var i=gs(r.content),s=o.length>1;Xn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
141
-
142
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
143
-
144
- `,`1) content: element.innerHTML
145
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&PN(c,r);return u&&l.push(u),l},[]);return gs(t)?a[0]:a}ri.defaultProps=tn,ri.setDefaultProps=TN,ri.currentInput=Pn,Object.assign({},Nb,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ri.setDefaultProps({render:yw});class IN{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:h}=l,{empty:f}=h,p=!d.textBetween(c,u).length&&Bf(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||f||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,h,f;const{state:p,composing:g}=a,{selection:m}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:C}=m,w=Math.min(...C.map(E=>E.$from.pos)),b=Math.max(...C.map(E=>E.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:p,oldState:u,from:w,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(Mb(p.selection)){let E=a.nodeDOM(w);if(E){const x=E.dataset.nodeViewWrapper?E:E.querySelector("[data-node-view-wrapper]");if(x&&(E=x.firstChild),E)return E.getBoundingClientRect()}}return OL(a,w,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ri(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const vw=t=>new lt({key:typeof t.pluginKey=="string"?new yt(t.pluginKey):t.pluginKey,view:e=>new IN({view:e,...t})});gt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[vw({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function LN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dh={exports:{}},fh={};/**
146
- * @license React
147
- * use-sync-external-store-shim.production.min.js
148
- *
149
- * Copyright (c) Facebook, Inc. and its affiliates.
150
- *
151
- * This source code is licensed under the MIT license found in the
152
- * LICENSE file in the root directory of this source tree.
153
- */var bw;function DN(){if(bw)return fh;bw=1;var t=T;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),g=p[0].inst,m=p[1];return i(function(){g.value=f,g.getSnapshot=h,l(g)&&m({inst:g})},[d,f,h]),o(function(){return l(g)&&m({inst:g}),d(function(){l(g)&&m({inst:g})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return fh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,fh}var hh={};/**
154
- * @license React
155
- * use-sync-external-store-shim.development.js
156
- *
157
- * Copyright (c) Facebook, Inc. and its affiliates.
158
- *
159
- * This source code is licensed under the MIT license found in the
160
- * LICENSE file in the root directory of this source tree.
161
- */var ww;function NN(){return ww||(ww=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=T,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var b=arguments.length,S=new Array(b>1?b-1:0),E=1;E<b;E++)S[E-1]=arguments[E];r("error",w,S)}}function r(w,b,S){{var E=e.ReactDebugCurrentFrame,x=E.getStackAddendum();x!==""&&(b+="%s",S=S.concat([x]));var _=S.map(function(A){return String(A)});_.unshift("Warning: "+b),Function.prototype.apply.call(console[w],console,_)}}function o(w,b){return w===b&&(w!==0||1/w===1/b)||w!==w&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function h(w,b,S){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=b();if(!d){var x=b();i(E,x)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var _=s({inst:{value:E,getSnapshot:b}}),A=_[0].inst,O=_[1];return l(function(){A.value=E,A.getSnapshot=b,f(A)&&O({inst:A})},[w,E,b]),a(function(){f(A)&&O({inst:A});var k=function(){f(A)&&O({inst:A})};return w(k)},[w]),c(E),E}function f(w){var b=w.getSnapshot,S=w.value;try{var E=b();return!i(S,E)}catch{return!0}}function p(w,b,S){return b()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",m=!g,v=m?p:h,C=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v;hh.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),hh}process.env.NODE_ENV==="production"?dh.exports=DN():dh.exports=NN();var Ol=dh.exports;const RN=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},FN=({contentComponent:t})=>{const e=Ol.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return T.createElement(T.Fragment,null,Object.values(e))};function HN(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Mo.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class BN extends T.Component{constructor(e){var n;super(e),this.editorContentRef=T.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=HN(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return T.createElement(T.Fragment,null,T.createElement("div",{ref:RN(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&T.createElement(FN,{contentComponent:e.contentComponent}))}}const VN=T.forwardRef((t,e)=>{const n=T.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return T.createElement(BN,{key:n,innerRef:e,...t})}),$N=T.memo(VN);var jN=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},zN=LN(jN),ph={exports:{}},gh={};/**
162
- * @license React
163
- * use-sync-external-store-shim/with-selector.production.min.js
164
- *
165
- * Copyright (c) Facebook, Inc. and its affiliates.
166
- *
167
- * This source code is licensed under the MIT license found in the
168
- * LICENSE file in the root directory of this source tree.
169
- */var Sw;function UN(){if(Sw)return gh;Sw=1;var t=T,e=Ol;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return gh.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function v(E){if(!C){if(C=!0,w=E,E=h(E),f!==void 0&&g.hasValue){var x=g.value;if(f(x,E))return b=x}return b=E}if(x=b,r(w,E))return x;var _=h(E);return f!==void 0&&f(x,_)?x:(w=E,b=_)}var C=!1,w,b,S=d===void 0?null:d;return[function(){return v(u())},S===null?void 0:function(){return v(S())}]},[u,d,h,f]);var m=o(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=m},[m]),l(m),m},gh}var mh={};/**
170
- * @license React
171
- * use-sync-external-store-shim/with-selector.development.js
172
- *
173
- * Copyright (c) Facebook, Inc. and its affiliates.
174
- *
175
- * This source code is licensed under the MIT license found in the
176
- * LICENSE file in the root directory of this source tree.
177
- */var Cw;function qN(){return Cw||(Cw=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=T,e=Ol;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;function c(u,d,h,f,p){var g=i(null),m;g.current===null?(m={hasValue:!1,value:null},g.current=m):m=g.current;var v=a(function(){var S=!1,E,x,_=function(M){if(!S){S=!0,E=M;var I=f(M);if(p!==void 0&&m.hasValue){var P=m.value;if(p(P,I))return x=P,P}return x=I,I}var F=E,z=x;if(r(F,M))return z;var V=f(M);return p!==void 0&&p(z,V)?z:(E=M,x=V,V)},A=h===void 0?null:h,O=function(){return _(d())},k=A===null?void 0:function(){return _(A())};return[O,k]},[d,h,f,p]),C=v[0],w=v[1],b=o(u,C,w);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b}mh.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mh}process.env.NODE_ENV==="production"?ph.exports=UN():ph.exports=qN();var WN=ph.exports;const KN=typeof window<"u"?T.useLayoutEffect:T.useEffect;class GN{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function JN(t){var e;const[n]=T.useState(()=>new GN(t.editor)),r=WN.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:zN);return KN(()=>n.watch(t.editor),[t.editor,n]),T.useDebugValue(r),r}const Ew=process.env.NODE_ENV!=="production",yh=typeof window>"u",XN=yh||!!(typeof window<"u"&&window.next);class vh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return yh||XN?(Ew&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&yh&&Ew)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)===null||i===void 0?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)===null||i===void 0?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)===null||i===void 0?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)===null||i===void 0?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return(i=(o=this.options.current).onDrop)===null||i===void 0?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return(i=(o=this.options.current).onPaste)===null||i===void 0?void 0:i.call(o,...r)}};return new GL(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,i)=>{var s;return o===((s=n.extensions)===null||s===void 0?void 0:s[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?vh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function YN(t={},e=[]){const n=T.useRef(t);n.current=t;const[r]=T.useState(()=>new vh(n)),o=Ol.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return T.useDebugValue(o),T.useEffect(r.onRender(e)),JN({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const _w=T.createContext({editor:null});_w.Consumer;const QN=()=>T.useContext(_w),ZN=t=>{const[e,n]=T.useState(null),{editor:r}=QN();return T.useEffect(()=>{var o;if(!e||!((o=t.editor)===null||o===void 0)&&o.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:i="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=vw({updateDelay:l,editor:u,element:e,pluginKey:i,shouldShow:c,tippyOptions:a});return u.registerPlugin(d),()=>{u.unregisterPlugin(i)}},[t.editor,r,e]),T.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},xw=T.createContext({onDragStart:void 0}),Aw=()=>T.useContext(xw),ys=t=>{const e=t.as||"div",{nodeViewContentRef:n}=Aw();return T.createElement(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};T.forwardRef((t,e)=>{const{onDragStart:n}=Aw(),r=t.as||"div";return T.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function eR(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function tR(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class Tw{constructor(e,{editor:n,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Mo.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,o=this.editor;(eR(n)||tR(n))&&(r.ref=i=>{this.ref=i}),this.reactElement=T.createElement(n,{...r}),(e=o==null?void 0:o.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class nR extends XL{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},i=this.component,s=T.memo(c=>T.createElement(xw.Provider,{value:o},T.createElement(i,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Tw(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const o=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,o({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=ul(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function ho(t,e){return n=>n.editor.contentComponent?new nR(t,n,e):{}}function Ow({...t}){return y.jsx(N.Button,{scheme:"light",variant:"borderless",corners:"square",size:"sm",...t})}function rR({children:t,...e}){return y.jsxs(N.Button,{scheme:"light",variant:"borderless",size:"sm",dflex:!0,alignItems:"center",whiteSpace:"nowrap",fontWeight:"500",corners:"square",...e,children:[t,y.jsx(N.Icon,{path:Q_})]})}function oR({children:t,...e}){return y.jsx(N.Tile,{scheme:"light",position:"fixed",top:"100%",dflex:!0,flexCol:!0,z:"99999",mt:"1",p:"1.5",overflow:"hidden",rounded:!0,border:!0,borderColor:"stone-200",shadow:"xl",...e,children:t})}function po({icon:t,name:e,isActive:n,...r}){return y.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",justifyContent:"between",spaceX:"2",rounded:"sm",px:"2",py:"2",w:"48",textSize:"sm",textColor:"stone-600",...r,children:[t,y.jsx("span",{flex:"1",children:e}),n&&y.jsx(N.Icon,{path:eu})]})}const kw=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function iR(t){const e=kw.find(({color:n})=>t.isActive("highlight",{color:n}));return{textColor:e==null?void 0:e.color}}function sR({editor:t,onHide:e}){return kw.map(({name:n,color:r},o)=>y.jsx(po,{icon:y.jsx(N.Icon,{path:Ng,textColor:r}),name:n,isActive:t.isActive("highlight",{color:r}),onClick:()=>{t.commands.unsetHighlight(),n!=="Default"&&t.chain().focus().setHighlight({color:r}).run(),e()}},o))}const Mw=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function aR(t){const e=Mw.find(({color:n})=>t.isActive("textStyle",{color:n}));return{textColor:e==null?void 0:e.color}}function lR({editor:t,onHide:e}){return Mw.map(({name:n,color:r},o)=>y.jsx(po,{icon:y.jsx(N.Icon,{path:Ng,textColor:r}),name:n,isActive:t.isActive("textStyle",{color:r}),onClick:()=>{t.commands.unsetColor(),n!=="Default"&&t.chain().focus().setColor(r).run(),e()}},o))}function cR({editor:t,onHide:e}){const n=T.useRef(null);T.useEffect(()=>{var o;n.current&&((o=n.current)==null||o.focus())});const r=T.useCallback(o=>{var i,s;o.preventDefault(),(i=n.current)!=null&&i.checkValidity()&&(t.commands.setLink({href:(s=n.current)==null?void 0:s.value}),e())},[n,e,t]);return y.jsxs("div",{dflex:!0,alignItems:"center",w:"full",children:[y.jsx(N.Input,{ref:n,type:"url",size:"sm",variant:"default",minW:"64",placeholder:"Paste a link",textColor:"slate-700",flexGrow:!0,defaultValue:t.getAttributes("link").href||"",border:"0"}),y.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",type:"submit",onClick:r,children:y.jsx(N.Icon,{path:eu})}),t.getAttributes("link").href&&y.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",onClick:()=>{t.chain().focus().unsetLink().run(),e()},children:y.jsx(N.Icon,{path:Jg})})]})}const Pw="M11 7h2v10h-2v-4H7v4H5V7h2v4h4V7zm6.57 0c-.594.95-1.504 1.658-2.57 2v1h2v7h2V7h-1.43z",Iw="M9 7h2v10H9v-4H5v4H3V7h2v4h4V7zm8 8c.51-.41.6-.62 1.06-1.05.437-.4.848-.828 1.23-1.28.334-.39.62-.82.85-1.28.2-.39.305-.822.31-1.26.005-.44-.087-.878-.27-1.28-.177-.385-.437-.726-.76-1-.346-.283-.743-.497-1.17-.63-.485-.153-.99-.227-1.5-.22-.36 0-.717.033-1.07.1-.343.06-.678.158-1 .29-.304.13-.593.295-.86.49-.287.21-.56.437-.82.68l1.24 1.22c.308-.268.643-.502 1-.7.35-.2.747-.304 1.15-.3.455-.03.906.106 1.27.38.31.278.477.684.45 1.1-.014.396-.14.78-.36 1.11-.285.453-.62.872-1 1.25-.44.43-.98.92-1.59 1.43-.61.51-1.41 1.06-2.16 1.65V17h8v-2h-4z",Lw="M14.11 14.218c.355.287.75.523 1.17.7.434.18.9.273 1.37.27.484.017.965-.086 1.4-.3.333-.146.55-.476.55-.84.003-.203-.05-.403-.15-.58-.123-.19-.3-.34-.51-.43-.32-.137-.655-.228-1-.27-.503-.073-1.012-.106-1.52-.1v-1.57c.742.052 1.485-.07 2.17-.36.37-.164.615-.525.63-.93.026-.318-.12-.627-.38-.81-.34-.203-.734-.3-1.13-.28-.395.013-.784.108-1.14.28-.375.167-.73.375-1.06.62l-1.22-1.39c.5-.377 1.053-.68 1.64-.9.608-.224 1.252-.336 1.9-.33.525-.007 1.05.05 1.56.17.43.1.84.277 1.21.52.325.21.595.495.79.83.19.342.287.73.28 1.12.01.48-.177.943-.52 1.28-.417.39-.916.685-1.46.86v.06c.61.14 1.175.425 1.65.83.437.382.68.94.66 1.52.005.42-.113.835-.34 1.19-.23.357-.538.657-.9.88-.408.253-.853.44-1.32.55-.514.128-1.04.192-1.57.19-.786.02-1.57-.106-2.31-.37-.59-.214-1.126-.556-1.57-1l1.12-1.41zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z",Dw="M11 17H9v-4H5v4H3V7h2v4h4V7h2v10zm10-2h-1v2h-2v-2h-5v-2l4.05-6H20v6h1v2zm-3-2V9l-2.79 4H18z";function uR(t){const n=Nw(t).filter(r=>{var o;return(o=r.isActive)==null?void 0:o.call(r,t)});return n.length>1?_x:n.length==0?px:n[0].icon}function Nw(t){return[{type:"basic",name:"Text",icon:Gg,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").run(),isActive:()=>t.isActive("paragraph")&&!t.isActive("bulletList")&&!t.isActive("orderedList")},{type:"basic",name:"Heading 1",icon:Pw,command:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:()=>t.isActive("heading",{level:1})},{type:"basic",name:"Heading 2",icon:Iw,command:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:()=>t.isActive("heading",{level:2})},{type:"basic",name:"Heading 3",icon:Lw,command:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:()=>t.isActive("heading",{level:3})},{type:"basic",name:"Heading 4",icon:Dw,command:()=>t.chain().focus().toggleHeading({level:4}).run(),isActive:()=>t.isActive("heading",{level:4})},{type:"basic",name:"Bullet List",icon:$g,command:()=>t.chain().focus().toggleBulletList().run(),isActive:()=>t.isActive("bulletList")},{type:"basic",name:"Numbered List",icon:jg,command:()=>t.chain().focus().toggleOrderedList().run(),isActive:()=>t.isActive("orderedList")},{type:"basic",name:"Quote",icon:zg,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").toggleBlockquote().run(),isActive:()=>t.isActive("blockquote")}]}function dR({editor:t,onHide:e}){const{items:n,activeItems:r}=T.useMemo(()=>{const o=Nw(t),i=o.filter(s=>{var a;return(a=s.isActive)==null?void 0:a.call(s,t)}).map(s=>s.name);return{items:o,activeItems:i}},[t]);return n.map((o,i)=>o.type=="basic"&&y.jsx(po,{icon:y.jsx(N.Icon,{path:o.icon}),name:o.name,isActive:r.includes(o.name),onClick:()=>{var s;(s=o.command)==null||s.call(o,t),e()}},i))}function fR(t){return t.isActive("uppercase")?Vg:t.isActive("lowercase")?Bg:Hg}function hR({editor:t,onHide:e}){return y.jsxs(y.Fragment,{children:[y.jsx(po,{icon:y.jsx(N.Icon,{path:Hg}),name:"Capitalize",isActive:!1,onClick:()=>{t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleCapitalize().run(),e()}}),y.jsx(po,{icon:y.jsx(N.Icon,{path:Vg}),name:"Uppercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleUppercase().run(),e()}}),y.jsx(po,{icon:y.jsx(N.Icon,{path:Bg}),name:"Lowercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().toggleLowercase().run(),e()}}),y.jsx(po,{icon:y.jsx(N.Icon,{path:Rg}),name:"None",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run()}})]})}function pR(){return[{type:"popupMenu",icon:t=>uR(t),name:"nodeSelector",excludeFromNodeType:["link"],renderPopupMenu:(t,e)=>y.jsx(dR,{editor:t,onHide:e})},{type:"basic",name:"bold",isActive:t=>t.isActive("bold"),command:t=>t.chain().focus().toggleBold().run(),icon:lx,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"italic",isActive:t=>t.isActive("italic"),command:t=>t.chain().focus().toggleItalic().run(),icon:ux,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"underline",isActive:t=>t.isActive("underline"),command:t=>t.chain().focus().toggleUnderline().run(),icon:hx,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"strike",isActive:t=>t.isActive("strike"),command:t=>t.chain().focus().toggleStrike().run(),icon:dx,excludeFromNodeType:["heading","blockquote","link"]},{type:"popupMenu",icon:t=>fR(t),isActive:t=>t.isActive("capitalize")||t.isActive("uppercase")||t.isActive("lowercase"),name:"caseSelector",renderPopupMenu:(t,e)=>y.jsx(hR,{editor:t,onHide:e})},{type:"popupMenu",icon:fx,iconProps:t=>aR(t),name:"colorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>y.jsx(lR,{editor:t,onHide:e})},{type:"popupMenu",icon:cx,iconProps:t=>iR(t),name:"bgColorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>y.jsx(sR,{editor:t,onHide:e})},{type:"popupMenu",icon:vx,name:"linkSelector",isActive:t=>t.isActive("link"),renderPopupMenu:(t,e)=>y.jsx(cR,{editor:t,onHide:e}),popupMenuPosition:"end",popupMenuWidth:"full"}]}function gR({editor:t,menuItems:e,...n}){var u;const[r,o]=T.useState(""),[i,s]=T.useState(""),a=T.useCallback(()=>s(""),[s]),l=T.useMemo(()=>pR().concat(e??[]),[e]),c={editor:t,...n,shouldShow:({editor:d})=>{var h,f;return d.isActive("image")||(f=(h=d.state.selection.node)==null?void 0:h.type)!=null&&f.isAtom?!1:d.view.state.selection.content().size>0},tippyOptions:{moveTransition:"transform 0.15s ease-out",maxWidth:600,zIndex:1e3,onHidden:()=>{s("")}}};return y.jsxs(y.Fragment,{children:[y.jsx(ZN,{...c,children:y.jsx("div",{dflex:!0,w:"fit",divideX:!0,divideColor:"stone-200",rounded:!0,border:!0,borderColor:"stone-200",bgColor:"white",shadow:"xl",children:l.map((d,h)=>{var f,p,g,m,v,C,w,b,S;return y.jsx(T.Fragment,{children:!((f=d.excludeFromNodeType)!=null&&f.find(E=>t.isActive(E)))&&y.jsxs(y.Fragment,{children:[d.type=="basic"&&y.jsx(Ow,{disabled:(p=d.isDisabled)==null?void 0:p.call(d,t),onClick:()=>{var E;return(E=d.command)==null?void 0:E.call(d,t)},children:y.jsx("span",{textColor:(g=d.isActive)!=null&&g.call(d,t)?"sky-500":void 0,children:y.jsx(N.Icon,{path:Fe.runIfFn(d.icon,t)})})}),d.type=="dialog"&&y.jsx(Ow,{disabled:(m=d.isDisabled)==null?void 0:m.call(d,t),onClick:()=>o(d.name),children:y.jsx("span",{textColor:(v=d.isActive)!=null&&v.call(d,t)?"sky-500":void 0,children:y.jsx(N.Icon,{path:Fe.runIfFn(d.icon,t)})})}),d.type=="popupMenu"&&y.jsxs("div",{position:"relative",children:[y.jsx(rR,{disabled:(C=d.isDisabled)==null?void 0:C.call(d,t),onClick:()=>s(d.name),h:"full",children:y.jsx(N.Icon,{mt:"0.5",path:Fe.runIfFn(d.icon,t),textColor:(w=d.isActive)!=null&&w.call(d,t)?"sky-500":void 0,...((b=d.iconProps)==null?void 0:b.call(d,t))??{}})}),i===d.name&&y.jsx(oR,{start:d.popupMenuPosition==="start"?0:void 0,end:d.popupMenuPosition==="end"?0:void 0,w:d.popupMenuWidth==="full"?"full":void 0,minW:d.popupMenuWidth==="full"?"96":void 0,children:(S=d.renderPopupMenu)==null?void 0:S.call(d,t,a)})]})]})},h)})})}),r&&((u=l.find(d=>d.type=="dialog"&&d.name==r))==null?void 0:u.renderDialog(t,()=>o("")))]})}const mR=/^\s*>\s$/,Rw=$t.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ss({find:mR,type:this.type})]}}),yR="listItem",Fw="textStyle",Hw=/^\s*([-+*])\s$/,Bw=$t.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yR,this.editor.getAttributes(Fw)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ss({find:Hw,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ss({find:Hw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fw),editor:this.editor})),[t]}}),vR=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,o;const i=n.getAttribute("style"),s=(o=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||o===void 0?void 0:o.getAttribute("style");n.setAttribute("style",`${s};${i}`)})},bR=Dt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&vR(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),wR=gt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Vw=$t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Kf({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),SR=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,CR=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,ER=Dt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[lo({find:SR,type:this.type})]},addPasteRules(){return[Pr({find:CR,type:this.type})]}}),_R="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",xR="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",oi=(t,e)=>{for(const n in e)t[n]=e[n];return t},bh="numeric",wh="ascii",Sh="alpha",vs="asciinumeric",bs="alphanumeric",Ch="domain",$w="emoji",AR="scheme",TR="slashscheme",Eh="whitespace";function OR(t,e){return t in e||(e[t]=[]),e[t]}function go(t,e,n){e[bh]&&(e[vs]=!0,e[bs]=!0),e[wh]&&(e[vs]=!0,e[Sh]=!0),e[vs]&&(e[bs]=!0),e[Sh]&&(e[bs]=!0),e[bs]&&(e[Ch]=!0),e[$w]&&(e[Ch]=!0);for(const r in e){const o=OR(r,n);o.indexOf(t)<0&&o.push(t)}}function kR(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Gt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Gt.groups={},Gt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||Gt.groups;let o;return e&&e.j?o=e:(o=new Gt(e),n&&r&&go(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||Gt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new Gt,oi(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Gt,i){if(r)if(s.t&&typeof s.t=="string"){const l=oi(kR(s.t,r),n);go(i,l,r)}else n&&go(i,n,r);s.t=i}return o.j[t]=s,s}};const Be=(t,e,n,r,o)=>t.ta(e,n,r,o),ct=(t,e,n,r,o)=>t.tr(e,n,r,o),jw=(t,e,n,r,o)=>t.ts(e,n,r,o),he=(t,e,n,r,o)=>t.tt(e,n,r,o),Yn="WORD",_h="UWORD",zw="ASCIINUMERICAL",Uw="ALPHANUMERICAL",ws="LOCALHOST",xh="TLD",Ah="UTLD",kl="SCHEME",ii="SLASH_SCHEME",Th="NUM",Oh="WS",kh="NL",Ss="OPENBRACE",Cs="CLOSEBRACE",Ml="OPENBRACKET",Pl="CLOSEBRACKET",Il="OPENPAREN",Ll="CLOSEPAREN",Dl="OPENANGLEBRACKET",Nl="CLOSEANGLEBRACKET",Rl="FULLWIDTHLEFTPAREN",Fl="FULLWIDTHRIGHTPAREN",Hl="LEFTCORNERBRACKET",Bl="RIGHTCORNERBRACKET",Vl="LEFTWHITECORNERBRACKET",$l="RIGHTWHITECORNERBRACKET",jl="FULLWIDTHLESSTHAN",zl="FULLWIDTHGREATERTHAN",Ul="AMPERSAND",Mh="APOSTROPHE",ql="ASTERISK",Lr="AT",Wl="BACKSLASH",Kl="BACKTICK",Gl="CARET",Dr="COLON",Ph="COMMA",Jl="DOLLAR",In="DOT",Xl="EQUALS",Ih="EXCLAMATION",gn="HYPHEN",Es="PERCENT",Yl="PIPE",Ql="PLUS",Zl="POUND",_s="QUERY",Lh="QUOTE",qw="FULLWIDTHMIDDLEDOT",Dh="SEMI",Ln="SLASH",xs="TILDE",ec="UNDERSCORE",Ww="EMOJI",tc="SYM";var Kw=Object.freeze({__proto__:null,WORD:Yn,UWORD:_h,ASCIINUMERICAL:zw,ALPHANUMERICAL:Uw,LOCALHOST:ws,TLD:xh,UTLD:Ah,SCHEME:kl,SLASH_SCHEME:ii,NUM:Th,WS:Oh,NL:kh,OPENBRACE:Ss,CLOSEBRACE:Cs,OPENBRACKET:Ml,CLOSEBRACKET:Pl,OPENPAREN:Il,CLOSEPAREN:Ll,OPENANGLEBRACKET:Dl,CLOSEANGLEBRACKET:Nl,FULLWIDTHLEFTPAREN:Rl,FULLWIDTHRIGHTPAREN:Fl,LEFTCORNERBRACKET:Hl,RIGHTCORNERBRACKET:Bl,LEFTWHITECORNERBRACKET:Vl,RIGHTWHITECORNERBRACKET:$l,FULLWIDTHLESSTHAN:jl,FULLWIDTHGREATERTHAN:zl,AMPERSAND:Ul,APOSTROPHE:Mh,ASTERISK:ql,AT:Lr,BACKSLASH:Wl,BACKTICK:Kl,CARET:Gl,COLON:Dr,COMMA:Ph,DOLLAR:Jl,DOT:In,EQUALS:Xl,EXCLAMATION:Ih,HYPHEN:gn,PERCENT:Es,PIPE:Yl,PLUS:Ql,POUND:Zl,QUERY:_s,QUOTE:Lh,FULLWIDTHMIDDLEDOT:qw,SEMI:Dh,SLASH:Ln,TILDE:xs,UNDERSCORE:ec,EMOJI:Ww,SYM:tc});const Qn=/[a-z]/,As=new RegExp("\\p{L}","u"),Nh=new RegExp("\\p{Emoji}","u"),Zn=/\d/,Rh=/\s/,Gw="\r",Fh=`
178
- `,MR="️",PR="‍",Hh="";let nc=null,rc=null;function IR(t=[]){const e={};Gt.groups=e;const n=new Gt;nc==null&&(nc=Xw(_R)),rc==null&&(rc=Xw(xR)),he(n,"'",Mh),he(n,"{",Ss),he(n,"}",Cs),he(n,"[",Ml),he(n,"]",Pl),he(n,"(",Il),he(n,")",Ll),he(n,"<",Dl),he(n,">",Nl),he(n,"(",Rl),he(n,")",Fl),he(n,"「",Hl),he(n,"」",Bl),he(n,"『",Vl),he(n,"』",$l),he(n,"<",jl),he(n,">",zl),he(n,"&",Ul),he(n,"*",ql),he(n,"@",Lr),he(n,"`",Kl),he(n,"^",Gl),he(n,":",Dr),he(n,",",Ph),he(n,"$",Jl),he(n,".",In),he(n,"=",Xl),he(n,"!",Ih),he(n,"-",gn),he(n,"%",Es),he(n,"|",Yl),he(n,"+",Ql),he(n,"#",Zl),he(n,"?",_s),he(n,'"',Lh),he(n,"/",Ln),he(n,";",Dh),he(n,"~",xs),he(n,"_",ec),he(n,"\\",Wl),he(n,"・",qw);const r=ct(n,Zn,Th,{[bh]:!0});ct(r,Zn,r);const o=ct(r,Qn,zw,{[vs]:!0}),i=ct(r,As,Uw,{[bs]:!0}),s=ct(n,Qn,Yn,{[wh]:!0});ct(s,Zn,o),ct(s,Qn,s),ct(o,Zn,o),ct(o,Qn,o);const a=ct(n,As,_h,{[Sh]:!0});ct(a,Qn),ct(a,Zn,i),ct(a,As,a),ct(i,Zn,i),ct(i,Qn),ct(i,As,i);const l=he(n,Fh,kh,{[Eh]:!0}),c=he(n,Gw,Oh,{[Eh]:!0}),u=ct(n,Rh,Oh,{[Eh]:!0});he(n,Hh,u),he(c,Fh,l),he(c,Hh,u),ct(c,Rh,u),he(u,Gw),he(u,Fh),ct(u,Rh,u),he(u,Hh,u);const d=ct(n,Nh,Ww,{[$w]:!0});he(d,"#"),ct(d,Nh,d),he(d,MR,d);const h=he(d,PR);he(h,"#"),ct(h,Nh,d);const f=[[Qn,s],[Zn,o]],p=[[Qn,null],[As,a],[Zn,i]];for(let g=0;g<nc.length;g++)Nr(n,nc[g],xh,Yn,f);for(let g=0;g<rc.length;g++)Nr(n,rc[g],Ah,_h,p);go(xh,{tld:!0,ascii:!0},e),go(Ah,{utld:!0,alpha:!0},e),Nr(n,"file",kl,Yn,f),Nr(n,"mailto",kl,Yn,f),Nr(n,"http",ii,Yn,f),Nr(n,"https",ii,Yn,f),Nr(n,"ftp",ii,Yn,f),Nr(n,"ftps",ii,Yn,f),go(kl,{scheme:!0,ascii:!0},e),go(ii,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){const m=t[g][0],C=t[g][1]?{[AR]:!0}:{[TR]:!0};m.indexOf("-")>=0?C[Ch]=!0:Qn.test(m)?Zn.test(m)?C[vs]=!0:C[wh]=!0:C[bh]=!0,jw(n,m,m,C)}return jw(n,"localhost",ws,{ascii:!0}),n.jd=new Gt(tc),{start:n,tokens:oi({groups:e},Kw)}}function Jw(t,e){const n=LR(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,d=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,h=0,u=a):d>=0&&(d+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=h,c-=d,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function LR(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Nr(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new Gt(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new Gt(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Xw(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ts={defaultProtocol:"http",events:null,format:Yw,formatHref:Yw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Bh(t,e=null){let n=oi({},Ts);t&&(n=oi(n,t instanceof Bh?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Bh.prototype={o:Ts,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Ts[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Yw(t){return t}function Qw(t,e){this.t="token",this.v=t,this.tk=e}Qw.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ts.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&oi(s,u),{tagName:o,attributes:s,content:i,eventListeners:d}}};function oc(t,e){class n extends Qw{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Zw=oc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eS=oc("text"),DR=oc("nl"),ic=oc("url",{isLink:!0,toHref(t=Ts.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ws&&t[1].t===Dr}}),mn=t=>new Gt(t);function NR({groups:t}){const e=t.domain.concat([Ul,ql,Lr,Wl,Kl,Gl,Jl,Xl,gn,Th,Es,Yl,Ql,Zl,Ln,tc,xs,ec]),n=[Dr,Ph,In,Ih,Es,_s,Lh,Dh,Dl,Nl,Ss,Cs,Pl,Ml,Il,Ll,Rl,Fl,Hl,Bl,Vl,$l,jl,zl],r=[Ul,Mh,ql,Wl,Kl,Gl,Jl,Xl,gn,Ss,Cs,Es,Yl,Ql,Zl,_s,Ln,tc,xs,ec],o=mn(),i=he(o,xs);Be(i,r,i),Be(i,t.domain,i);const s=mn(),a=mn(),l=mn();Be(o,t.domain,s),Be(o,t.scheme,a),Be(o,t.slashscheme,l),Be(s,r,i),Be(s,t.domain,s);const c=he(s,Lr);he(i,Lr,c),he(a,Lr,c),he(l,Lr,c);const u=he(i,In);Be(u,r,i),Be(u,t.domain,i);const d=mn();Be(c,t.domain,d),Be(d,t.domain,d);const h=he(d,In);Be(h,t.domain,d);const f=mn(Zw);Be(h,t.tld,f),Be(h,t.utld,f),he(c,ws,f);const p=he(d,gn);he(p,gn,p),Be(p,t.domain,d),Be(f,t.domain,d),he(f,In,h),he(f,gn,p);const g=he(f,Dr);Be(g,t.numeric,Zw);const m=he(s,gn),v=he(s,In);he(m,gn,m),Be(m,t.domain,s),Be(v,r,i),Be(v,t.domain,s);const C=mn(ic);Be(v,t.tld,C),Be(v,t.utld,C),Be(C,t.domain,s),Be(C,r,i),he(C,In,v),he(C,gn,m),he(C,Lr,c);const w=he(C,Dr),b=mn(ic);Be(w,t.numeric,b);const S=mn(ic),E=mn();Be(S,e,S),Be(S,n,E),Be(E,e,S),Be(E,n,E),he(C,Ln,S),he(b,Ln,S);const x=he(a,Dr),_=he(l,Dr),A=he(_,Ln),O=he(A,Ln);Be(a,t.domain,s),he(a,In,v),he(a,gn,m),Be(l,t.domain,s),he(l,In,v),he(l,gn,m),Be(x,t.domain,S),he(x,Ln,S),he(x,_s,S),Be(O,t.domain,S),Be(O,e,S),he(O,Ln,S);const k=[[Ss,Cs],[Ml,Pl],[Il,Ll],[Dl,Nl],[Rl,Fl],[Hl,Bl],[Vl,$l],[jl,zl]];for(let M=0;M<k.length;M++){const[I,P]=k[M],F=he(S,I);he(E,I,F),he(F,P,S);const z=mn(ic);Be(F,e,z);const V=mn();Be(F,n),Be(z,e,z),Be(z,n,V),Be(V,e,z),Be(V,n,V),he(z,P,S),he(V,P,S)}return he(o,ws,C),he(o,kh,DR),{start:o,tokens:Kw}}function RR(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,d=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,d=a):h>=0&&h++,o++,u++;if(h<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(Vh(eS,e,s)),s=[]),o-=h,u-=h;const f=d.t,p=n.slice(o-u,o);i.push(Vh(f,e,p))}}return s.length>0&&i.push(Vh(eS,e,s)),i}function Vh(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const FR=typeof console<"u"&&console&&console.warn||(()=>{}),HR="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",rt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function BR(){return Gt.groups={},rt.scanner=null,rt.parser=null,rt.tokenQueue=[],rt.pluginQueue=[],rt.customSchemes=[],rt.initialized=!1,rt}function tS(t,e=!1){if(rt.initialized&&FR(`linkifyjs: already initialized - will not register custom scheme "${t}" ${HR}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
179
- 1. Must only contain digits, lowercase ASCII letters or "-"
180
- 2. Cannot start or end with "-"
181
- 3. "-" cannot repeat`);rt.customSchemes.push([t,e])}function VR(){rt.scanner=IR(rt.customSchemes);for(let t=0;t<rt.tokenQueue.length;t++)rt.tokenQueue[t][1]({scanner:rt.scanner});rt.parser=NR(rt.scanner.tokens);for(let t=0;t<rt.pluginQueue.length;t++)rt.pluginQueue[t][1]({scanner:rt.scanner,parser:rt.parser});return rt.initialized=!0,rt}function $h(t){return rt.initialized||VR(),RR(rt.parser.start,t,Jw(rt.scanner.start,t))}$h.scan=Jw;function nS(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Bh(n),o=$h(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}function $R(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function jR(t){return new lt({key:new yt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=vL(n.doc,[...e]);if(AL(a).forEach(({newRange:c})=>{const u=wL(r.doc,c,f=>f.isTextblock);let d,h;if(u.length>1?(d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],h=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&h){const f=h.split(" ").filter(v=>v!=="");if(f.length<=0)return!1;const p=f[f.length-1],g=d.pos+h.lastIndexOf(p);if(!p)return!1;const m=$h(p).map(v=>v.toObject(t.defaultProtocol));if(!$R(m))return!1;m.filter(v=>v.isLink).map(v=>({...v,from:g+v.start+1,to:g+v.end+1})).filter(v=>r.schema.marks.code?!r.doc.rangeHasMark(v.from,v.to,r.schema.marks.code):!0).filter(v=>t.validate(v.value)).filter(v=>t.shouldAutoLink(v.value)).forEach(v=>{jf(v.from,v.to,r.doc).some(C=>C.mark.type===t.type)||s.addMark(v.from,v.to,t.type.create({href:v.href}))})}}),!!s.steps.length)return s}})}function zR(t){return new lt({key:new yt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(h=>h.nodeName==="A"))return!1;const l=Ob(e.state,t.type.name),c=r.target,u=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:l.href,d=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:l.target;return c&&u?(window.open(u,d),!0):!1}}})}function UR(t){return new lt({key:new yt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=nS(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const qR=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function mo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(qR,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const WR=Dt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){tS(t);return}tS(t.scheme,t.optionalSlashes)})},onDestroy(){BR()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!mo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!mo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!mo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ot(this.options.HTMLAttributes,t),0]:["a",ot(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!mo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!mo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Pr({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=nS(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!mo(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(jR({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!mo(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(zR({type:this.type})),this.options.linkOnPaste&&t.push(UR({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),rS=$t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ot(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),KR="listItem",oS="textStyle",iS=/^(\d+)\.\s$/,sS=$t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ot(this.options.HTMLAttributes,n),0]:["ol",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(KR,this.editor.getAttributes(oS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ss({find:iS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ss({find:iS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(oS)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),aS=$t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),GR=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,JR=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,lS=t=>t.match(GR),cS=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",XR=t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:o,ccLoadPolicy:i,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:u,ivLoadPolicy:d,loop:h,modestBranding:f,nocookie:p,origin:g,playlist:m,progressBarColor:v,startAt:C}=t;if(!lS(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const x=e.split("/").pop();return x?`${cS(p)}${x}`:null}const b=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!b||!b[1])return null;let S=`${cS(p)}${b[1]}`;const E=[];return n===!1&&E.push("fs=0"),r&&E.push("autoplay=1"),o&&E.push(`cc_lang_pref=${o}`),i&&E.push("cc_load_policy=1"),s||E.push("controls=0"),a&&E.push("disablekb=1"),l&&E.push("enablejsapi=1"),c&&E.push(`end=${c}`),u&&E.push(`hl=${u}`),d&&E.push(`iv_load_policy=${d}`),h&&E.push("loop=1"),f&&E.push("modestbranding=1"),g&&E.push(`origin=${g}`),m&&E.push(`playlist=${m}`),C&&E.push(`start=${C}`),v&&E.push(`color=${v}`),E.length&&(S+=`?${E.join("&")}`),S},YR=$t.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>lS(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[QL({find:JR,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=XR({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=e,["div",{"data-youtube-video":""},["iframe",ot(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),QR=Dt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ZR=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,eF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,tF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,nF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,rF=Dt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[lo({find:ZR,type:this.type}),lo({find:tF,type:this.type})]},addPasteRules(){return[Pr({find:eF,type:this.type}),Pr({find:nF,type:this.type})]}}),oF=/(^|[^`])`([^`]+)`(?!`)/,iF=/(^|[^`])`([^`]+)`(?!`)/g,sF=Dt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[lo({find:oF,type:this.type})]},addPasteRules(){return[Pr({find:iF,type:this.type})]}}),aF=/^```([a-z]+)?[\s\n]$/,lF=/^~~~([a-z]+)?[\s\n]$/,cF=$t.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ot(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
182
-
183
- `);return!i||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(De.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Kf({find:aF,type:this.type,getAttributes:t=>({language:t[1]})}),Kf({find:lF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new lt({key:new yt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
184
- `));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),uF=$t.create({name:"doc",topNode:!0,content:"block+"});function dF(t={}){return new lt({view(e){return new fF(e,t)}})}class fF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=I1(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const hF=gt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[dF(this.options)]}});class ut extends De{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ut.valid(r)?new ut(r):De.near(r)}content(){return me.empty}eq(e){return e instanceof ut&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ut(e.resolve(n.pos))}getBookmark(){return new jh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!pF(e)||!gF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ut.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(ut.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Oe.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(ut.valid(a))return a}return null}}}ut.prototype.visible=!1,ut.findFrom=ut.findGapCursorFrom,De.jsonID("gapcursor",ut);class jh{constructor(e){this.pos=e}map(e){return new jh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ut.valid(n)?new ut(n):De.near(n)}}function pF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function gF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function mF(){return new lt({props:{decorations:wF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ut.valid(n)?new ut(n):null},handleClick:vF,handleKeyDown:yF,handleDOMEvents:{beforeinput:bF}}})}const yF=ob({ArrowLeft:sc("horiz",-1),ArrowRight:sc("horiz",1),ArrowUp:sc("vert",-1),ArrowDown:sc("vert",1)});function sc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Le){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=ut.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new ut(c))),!0):!1}}function vF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ut.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Oe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ut(r))),!0)}function bF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ut))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=le.empty;for(let s=r.length-1;s>=0;s--)o=le.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new me(o,0,0));return i.setSelection(Le.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function wF(t){if(!(t.selection instanceof ut))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",dt.create(t.doc,[qt.widget(t.selection.head,e,{key:"gapcursor"})])}const SF=gt.create({name:"gapCursor",addProseMirrorPlugins(){return[mF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ne(xe(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),CF=$t.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ot(this.options.HTMLAttributes,t)]},renderText(){return`
185
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var ac=200,Et=function(){};Et.prototype.append=function(e){return e.length?(e=Et.from(e),!this.length&&e||e.length<ac&&this.leafAppend(e)||this.length<ac&&e.leafPrepend(this)||this.appendInner(e)):this},Et.prototype.prepend=function(e){return e.length?Et.from(e).append(this):this},Et.prototype.appendInner=function(e){return new EF(this,e)},Et.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Et.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Et.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Et.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Et.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o},Et.from=function(e){return e instanceof Et?e:e&&e.length?new uS(e):Et.empty};var uS=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=ac)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=ac)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Et);Et.empty=new uS([]);var EF=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Et);const _F=500;class wn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){o||(o=this.remapping(r,h+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Rr(d.map));let f=d.step.map(o.slice(i)),p;f&&s.maybeStep(f).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Rr(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new wn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new Rr(e.mapping.maps[u],d,n),f;(f=l&&l.merge(h))&&(h=f,u?i.pop():a=a.slice(0,a.length-1)),i.push(h),n&&(s++,n=void 0),o||(l=h)}let c=s-r.depth;return c>AF&&(a=xF(a,c),s-=c),new wn(a.append(i),s)}remapping(e,n){let r=new Ui;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new wn(this.items.append(e.map(n=>new Rr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},o);let l=n;this.items.forEach(h=>{let f=i.getMirror(--l);if(f==null)return;s=Math.min(s,f);let p=i.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),m=h.selection&&h.selection.map(i.slice(l+1,f));m&&a++,r.push(new Rr(p,g,m))}else r.push(new Rr(p))},o);let c=[];for(let h=n;h<s;h++)c.push(new Rr(i.maps[h]));let u=this.items.slice(0,o).append(c).append(r),d=new wn(u,a);return d.emptyItemCount()>_F&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Rr(c.invert(),l,u),h,f=o.length-1;(h=o.length&&o[f].merge(d))?o[f]=h:o.push(d)}}else s.map&&r--},this.items.length,0),new wn(Et.from(o.reverse()),i)}}wn.empty=new wn(Et.empty,0);function xF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let Rr=class q_{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new q_(n.getMap().invert(),n,this.selection)}}};class Fr{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const AF=20;function TF(t,e,n,r){let o=n.getMeta(yo),i;if(o)return o.historyState;n.getMeta(MF)&&(t=new Fr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(yo))return s.getMeta(yo).redo?new Fr(t.done.addTransform(n,void 0,r,lc(e)),t.undone,dS(n.mapping.maps),t.prevTime,t.prevComposition):new Fr(t.done,t.undone.addTransform(n,void 0,r,lc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!OF(n,t.prevRanges)),c=s?zh(t.prevRanges,n.mapping):dS(n.mapping.maps);return new Fr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,lc(e)),wn.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Fr(t.done.rebased(n,i),t.undone.rebased(n,i),zh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Fr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),zh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function OF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function dS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function zh(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function kF(t,e,n){let r=lc(e),o=yo.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new Fr(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(yo,{redo:n,historyState:l})}let Uh=!1,fS=null;function lc(t){let e=t.plugins;if(fS!=e){Uh=!1,fS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Uh=!0;break}}return Uh}const yo=new yt("history"),MF=new yt("closeHistory");function PF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new lt({key:yo,state:{init(){return new Fr(wn.empty,wn.empty,null,0,-1)},apply(e,n,r){return TF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?pS:r=="historyRedo"?gS:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function hS(t,e){return(n,r)=>{let o=yo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=kF(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const pS=hS(!1,!0),gS=hS(!0,!0),mS=gt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>pS(t,e),redo:()=>({state:t,dispatch:e})=>gS(t,e)}},addProseMirrorPlugins(){return[PF(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),IF=$t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ot(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):Mb(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(Le.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(Oe.create(s.doc,c.pos)):s.setSelection(Le.create(s.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(s.insert(u,d),s.setSelection(Le.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[JL({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),LF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,DF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,NF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,RF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,FF=Dt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[lo({find:LF,type:this.type}),lo({find:NF,type:this.type})]},addPasteRules(){return[Pr({find:DF,type:this.type}),Pr({find:RF,type:this.type})]}}),HF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,BF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VF=Dt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[lo({find:HF,type:this.type})]},addPasteRules(){return[Pr({find:BF,type:this.type})]}}),$F=$t.create({name:"text",group:"inline"}),jF=gt.create({name:"starterKit",addExtensions(){var t,e,n,r,o,i,s,a,l,c,u,d,h,f,p,g,m,v;const C=[];return this.options.bold!==!1&&C.push(rF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&C.push(Rw.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&C.push(Bw.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&C.push(sF.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(cF.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&C.push(uF.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&C.push(hF.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&C.push(SF.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&C.push(CF.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&C.push(Vw.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&C.push(mS.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(IF.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&C.push(FF.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&C.push(rS.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&C.push(sS.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&C.push(aS.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&C.push(VF.configure((m=this.options)===null||m===void 0?void 0:m.strike)),this.options.text!==!1&&C.push($F.configure((v=this.options)===null||v===void 0?void 0:v.text)),C}});function zF(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,c=YL(n),u=new RegExp(`\\s${c}$`),d=s?"^":"",h=o?"":c,f=l?new RegExp(`${d}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${d}(?:^)?${c}[^\\s${h}]*`,"gm"),p=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!p)return null;const g=a.pos-p.length,m=Array.from(p.matchAll(f)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const v=m.input.slice(Math.max(0,m.index-1),m.index),C=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(v);if(i!==null&&!C)return null;const w=g+m.index;let b=w+m[0].length;return l&&u.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),w<a.pos&&b>=a.pos?{range:{from:w,to:b},query:m[0].slice(n.length),text:m[0]}:null}const UF=new yt("suggestion");function qF({pluginKey:t=UF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:c=()=>null,items:u=()=>[],render:d=()=>({}),allow:h=()=>!0,findSuggestionMatch:f=zF}){let p;const g=d==null?void 0:d(),m=new lt({key:t,view(){return{update:async(v,C)=>{var w,b,S,E,x,_,A;const O=(w=this.key)===null||w===void 0?void 0:w.getState(C),k=(b=this.key)===null||b===void 0?void 0:b.getState(v.state),M=O.active&&k.active&&O.range.from!==k.range.from,I=!O.active&&k.active,P=O.active&&!k.active,F=!I&&!P&&O.query!==k.query,z=I||M&&F,V=F||M,J=P||M&&F;if(!z&&!V&&!J)return;const K=J&&!z?O:k,R=v.dom.querySelector(`[data-decoration-id="${K.decorationId}"]`);p={editor:e,range:K.range,query:K.query,text:K.text,items:[],command:Q=>c({editor:e,range:K.range,props:Q}),decorationNode:R,clientRect:R?()=>{var Q;const{decorationId:se}=(Q=this.key)===null||Q===void 0?void 0:Q.getState(e.state),ie=v.dom.querySelector(`[data-decoration-id="${se}"]`);return(ie==null?void 0:ie.getBoundingClientRect())||null}:null},z&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,p)),V&&((E=g==null?void 0:g.onBeforeUpdate)===null||E===void 0||E.call(g,p)),(V||z)&&(p.items=await u({editor:e,query:K.query})),J&&((x=g==null?void 0:g.onExit)===null||x===void 0||x.call(g,p)),V&&((_=g==null?void 0:g.onUpdate)===null||_===void 0||_.call(g,p)),z&&((A=g==null?void 0:g.onStart)===null||A===void 0||A.call(g,p))},destroy:()=>{var v;p&&((v=g==null?void 0:g.onExit)===null||v===void 0||v.call(g,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,C,w,b){const{isEditable:S}=e,{composing:E}=e.view,{selection:x}=v,{empty:_,from:A}=x,O={...C};if(O.composing=E,S&&(_||e.view.composing)){(A<C.range.from||A>C.range.to)&&!E&&!C.composing&&(O.active=!1);const k=f({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:x.$from}),M=`id_${Math.floor(Math.random()*4294967295)}`;k&&h({editor:e,state:b,range:k.range,isActive:C.active})?(O.active=!0,O.decorationId=C.decorationId?C.decorationId:M,O.range=k.range,O.query=k.query,O.text=k.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(v,C){var w;const{active:b,range:S}=m.getState(v.state);return b&&((w=g==null?void 0:g.onKeyDown)===null||w===void 0?void 0:w.call(g,{view:v,event:C,range:S}))||!1},decorations(v){const{active:C,range:w,decorationId:b}=m.getState(v);return C?dt.create(v.doc,[qt.inline(w.from,w.to,{nodeName:a,class:l,"data-decoration-id":b})]):null}}});return m}function WF({icon:t,title:e,description:n,...r}){return y.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",spaceX:"3",p:"2",...r,children:[y.jsx("div",{dflex:!0,alignItems:"center",justifyContent:"center",h:"10",w:"10",rounded:!0,border:!0,borderColor:"stone-200",textColor:"stone-500",bgColor:"white",children:y.jsx(N.Icon,{path:t})}),y.jsxs("div",{children:[y.jsx("p",{fontWeight:"600",userSelect:"none",children:e}),y.jsx("p",{textSize:"xs",textColor:"stone-500",userSelect:"none",children:n})]})]})}function KF(t,e,...n){const[r,o]=T.useState(0),i=T.useCallback(s=>{const a=t[s];a&&e(a)},[t,e,...n]);return T.useEffect(()=>{const s=["ArrowUp","ArrowDown","Enter"],a=l=>{if(s.includes(l.key)){switch(l.preventDefault(),l.key){case"ArrowUp":return o((r+t.length-1)%t.length),!0;case"ArrowDown":return o((r+1)%t.length),!0;case"Enter":return i(r),!0}return!1}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,r,o,i]),T.useEffect(()=>o(0),[t]),r}function GF({items:t,command:e,editor:n,...r}){const o=T.useRef(null),i=T.useCallback(a=>e(a),[e]),s=KF(t,i,n);return T.useLayoutEffect(()=>{const a=o==null?void 0:o.current,l=a==null?void 0:a.children[s];l&&a&&JF(a,l)},[s]),t.length>0?y.jsx(N.Tile,{scheme:"light",id:"slash-command",ref:o,z:"50",h:"auto",maxH:"96",w:"80",p:"2",overflowY:"auto",border:"px",borderColor:"stone-200",shadow:"md",transition:"all",children:t.map((a,l)=>y.jsx(WF,{onClick:c=>{c.preventDefault(),e(t[l])},active:l==s,icon:a.icon,title:a.title,description:a.description},l))}):null}function JF(t,e){const n=t.offsetHeight,r=e?e.offsetHeight:0,o=e.offsetTop,i=o+r;o<t.scrollTop?t.scrollTop-=t.scrollTop-o+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)}const XF=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","text","paragraph"],icon:Gg,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Image",description:"Upload an image from your computer.",searchTerms:["image","img","photo","picture","media"],icon:gx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setImage({src:""}).setNode("paragraph").run()}},{title:"Youtube",description:"Insert a Youtube video",searchTerms:["youtube","yt","video"],icon:xx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setYoutubeVideo({src:"https://www.youtube.com/embed/5vheNbQlsyU?si=g_Max_pgn7AgEZVc"}).setNode("paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["heading","h1","title","big","large"],icon:Pw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["h2","subtitle","medium"],icon:Iw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["h3","subtitle","small"],icon:Lw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Heading 4",description:"X-Small section heading.",searchTerms:["h4","subtitle","small"],icon:Dw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:4}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["ul","unordered","point"],icon:$g,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ol","ordered"],icon:jg,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["quote","blockquote"],icon:zg,command:({editor:t,range:e})=>t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").toggleBlockquote().run()}],YF=t=>({query:e})=>XF.concat(t??[]).filter(n=>{if(typeof e=="string"&&e.length>0){const r=e.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(o=>o.includes(r))}return!0}),QF=gt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>n.command({editor:t,range:e})}}},addProseMirrorPlugins(){return[qF({editor:this.editor,...this.options.suggestion})]}}),ZF=t=>QF.configure({suggestion:{items:YF(t),render:()=>{let e=null,n=null;return{onStart:r=>{e=new Tw(GF,{props:r,editor:r.editor}),n=ri("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:r=>{e==null||e.updateProps(r),n&&n[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var o;return r.event.key==="Escape"?(n==null||n[0].hide(),!0):(o=e==null?void 0:e.ref)==null?void 0:o.onKeyDown(r)},onExit:()=>{n==null||n[0].destroy(),e==null||e.destroy()}}}}});function Nt(t){return t.toFixed(7).replace(/(\.[0-9]+?)0+$/,"$1").replace(/\.0$/,"")}function Y(t,e){return`${Nt(t/e)}em`}const yS={defaultProps:{fontWeight:"500",italic:!0,textColor:"var(--tw-prose-quotes)",borderS:"0.25rem",borderSColor:"var(--tw-prose-quote-borders)",style:{quotes:'"\\201C""\\201D""\\2018""\\2019"'},css:{"& p:first-of-type::before":{content:"open-quote"},"& p:last-of-type::after":{content:"close-quote"}},mt:Y(32,20),mb:Y(32,20),ps:Y(20,20),sm_mt:Y(24,18),sm_mb:Y(24,18),sm_ps:Y(20,18),lg_mt:Y(40,24),lg_mb:Y(40,24),lg_ps:Y(24,24),xl_mt:Y(48,30),xl_mb:Y(48,30),xl_ps:Y(32,30),x2_mt:Y(64,36),x2_mb:Y(64,36),x2_ps:Y(40,36)}},e3=T.createContext({onDragStart:void 0}),vS=()=>T.useContext(e3),vo=T.forwardRef((t,e)=>{const{onDragStart:n}=vS(),r=t.as||"div";return y.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function cc(t,e){var r,o,i,s;const n=((r=t.decorations)==null?void 0:r.length)>0?(s=(i=(o=t.decorations[0])==null?void 0:o.type)==null?void 0:i.attrs)==null?void 0:s["data-placeholder"]:null;return{css:{"&:before":{content:`"${n?e??n:""}"`,float:"left",color:"gray",pointerEvents:"none",height:0}}}}N.ComponentManager.registerComponent("Editor.BlockQuote",yS);function t3({...t}){const e=N.useComponentConfig("Editor.BlockQuote",void 0,{},{});return y.jsx(vo,{as:"blockquote",...e,...cc(t,"Quote"),children:y.jsx(ys,{})})}const bS={defaultProps:{listStyle:"disc",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}};N.ComponentManager.registerComponent("Editor.BulletList",bS);function n3(){const t=N.useComponentConfig("Editor.BulletList",void 0,{},{});return y.jsx(vo,{as:"ul",...t,children:y.jsx(ys,{})})}const wS={defaultProps:{fontWeight:"700",textColor:"slate-800",textSize:Y(20,16),mt:Y(48,24),mb:Y(24,24),lineHeight:Nt(32/24),sm_textSize:Y(20,14),sm_mt:Y(32,20),sm_mb:Y(16,20),sm_lineHeight:Nt(28/20),lg_textSize:Y(30,18),lg_mt:Y(56,30),lg_mb:Y(32,30),lg_lineHeight:Nt(40/30),xl_textSize:Y(36,20),xl_mt:Y(56,36),xl_mb:Y(32,36),xl_lineHeight:Nt(40/36),x2_textSize:Y(48,24),x2_mt:Y(72,48),x2_mb:Y(40,48),x2_lineHeight:Nt(52/48)}},SS={defaultProps:{fontWeight:"600",textColor:"slate-800",textSize:Y(18,16),mt:Y(32,20),mb:Y(12,20),lineHeight:Nt(32/20),sm_textSize:Y(18,14),sm_mt:Y(28,18),sm_mb:Y(8,18),sm_lineHeight:Nt(28/18),lg_textSize:Y(24,18),lg_mt:Y(40,24),lg_mb:Y(16,24),lg_lineHeight:Nt(36/24),xl_textSize:Y(30,20),xl_mt:Y(48,30),xl_mb:Y(20,30),xl_lineHeight:Nt(40/30),x2_textSize:Y(36,24),x2_mt:Y(56,36),x2_mb:Y(24,36),x2_lineHeight:Nt(44/36)}},CS={defaultProps:{fontWeight:"600",textColor:"slate-800",mt:Y(24,16),mb:Y(8,16),lineHeight:Nt(24/16),sm_mt:Y(20,14),sm_mb:Y(8,14),sm_lineHeight:Nt(20/14),lg_mt:Y(32,18),lg_mb:Y(8,18),lg_lineHeight:Nt(28/18),xl_mt:Y(36,20),xl_mb:Y(12,20),xl_lineHeight:Nt(32/20),x2_mt:Y(40,24),x2_mb:Y(16,24),x2_lineHeight:Nt(36/24)}};N.ComponentManager.registerComponent("Editor.H1",wS),N.ComponentManager.registerComponent("Editor.H2",SS),N.ComponentManager.registerComponent("Editor.H3",CS);function r3({...t}){const e=t.node.attrs.level,n=N.useComponentConfig(`Editor.H${e}`,void 0,{},{}),r=`h${e}`;return y.jsx(vo,{as:r,...n,...cc(t),children:y.jsx(ys,{})})}var qh={exports:{}},uc={exports:{}},Ke={};/** @license React v16.13.1
186
- * react-is.production.min.js
187
- *
188
- * Copyright (c) Facebook, Inc. and its affiliates.
189
- *
190
- * This source code is licensed under the MIT license found in the
191
- * LICENSE file in the root directory of this source tree.
192
- */var ES;function o3(){if(ES)return Ke;ES=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var E=S.$$typeof;switch(E){case e:switch(S=S.type,S){case l:case c:case r:case i:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case p:case f:case s:return S;default:return E}}case n:return E}}}function b(S){return w(S)===c}return Ke.AsyncMode=l,Ke.ConcurrentMode=c,Ke.ContextConsumer=a,Ke.ContextProvider=s,Ke.Element=e,Ke.ForwardRef=u,Ke.Fragment=r,Ke.Lazy=p,Ke.Memo=f,Ke.Portal=n,Ke.Profiler=i,Ke.StrictMode=o,Ke.Suspense=d,Ke.isAsyncMode=function(S){return b(S)||w(S)===l},Ke.isConcurrentMode=b,Ke.isContextConsumer=function(S){return w(S)===a},Ke.isContextProvider=function(S){return w(S)===s},Ke.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},Ke.isForwardRef=function(S){return w(S)===u},Ke.isFragment=function(S){return w(S)===r},Ke.isLazy=function(S){return w(S)===p},Ke.isMemo=function(S){return w(S)===f},Ke.isPortal=function(S){return w(S)===n},Ke.isProfiler=function(S){return w(S)===i},Ke.isStrictMode=function(S){return w(S)===o},Ke.isSuspense=function(S){return w(S)===d},Ke.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===i||S===o||S===d||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===p||S.$$typeof===f||S.$$typeof===s||S.$$typeof===a||S.$$typeof===u||S.$$typeof===m||S.$$typeof===v||S.$$typeof===C||S.$$typeof===g)},Ke.typeOf=w,Ke}var Ge={};/** @license React v16.13.1
193
- * react-is.development.js
194
- *
195
- * Copyright (c) Facebook, Inc. and its affiliates.
196
- *
197
- * This source code is licensed under the MIT license found in the
198
- * LICENSE file in the root directory of this source tree.
199
- */var _S;function i3(){return _S||(_S=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===c||L===i||L===o||L===d||L===h||typeof L=="object"&&L!==null&&(L.$$typeof===p||L.$$typeof===f||L.$$typeof===s||L.$$typeof===a||L.$$typeof===u||L.$$typeof===m||L.$$typeof===v||L.$$typeof===C||L.$$typeof===g)}function b(L){if(typeof L=="object"&&L!==null){var Ve=L.$$typeof;switch(Ve){case e:var G=L.type;switch(G){case l:case c:case r:case i:case o:case d:return G;default:var ne=G&&G.$$typeof;switch(ne){case a:case u:case p:case f:case s:return ne;default:return Ve}}case n:return Ve}}}var S=l,E=c,x=a,_=s,A=e,O=u,k=r,M=p,I=f,P=n,F=i,z=o,V=d,J=!1;function K(L){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(L)||b(L)===l}function R(L){return b(L)===c}function Q(L){return b(L)===a}function se(L){return b(L)===s}function ie(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function de(L){return b(L)===u}function ue(L){return b(L)===r}function pe(L){return b(L)===p}function D(L){return b(L)===f}function ce(L){return b(L)===n}function ye(L){return b(L)===i}function be(L){return b(L)===o}function H(L){return b(L)===d}Ge.AsyncMode=S,Ge.ConcurrentMode=E,Ge.ContextConsumer=x,Ge.ContextProvider=_,Ge.Element=A,Ge.ForwardRef=O,Ge.Fragment=k,Ge.Lazy=M,Ge.Memo=I,Ge.Portal=P,Ge.Profiler=F,Ge.StrictMode=z,Ge.Suspense=V,Ge.isAsyncMode=K,Ge.isConcurrentMode=R,Ge.isContextConsumer=Q,Ge.isContextProvider=se,Ge.isElement=ie,Ge.isForwardRef=de,Ge.isFragment=ue,Ge.isLazy=pe,Ge.isMemo=D,Ge.isPortal=ce,Ge.isProfiler=ye,Ge.isStrictMode=be,Ge.isSuspense=H,Ge.isValidElementType=w,Ge.typeOf=b}()),Ge}var xS;function AS(){return xS||(xS=1,process.env.NODE_ENV==="production"?uc.exports=o3():uc.exports=i3()),uc.exports}/*
200
- object-assign
201
- (c) Sindre Sorhus
202
- @license MIT
203
- */var Wh,TS;function s3(){if(TS)return Wh;TS=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Wh=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)e.call(a,d)&&(l[d]=a[d]);if(t){c=t(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Wh}var Kh,OS;function Gh(){if(OS)return Kh;OS=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Kh=t,Kh}var Jh,kS;function MS(){return kS||(kS=1,Jh=Function.call.bind(Object.prototype.hasOwnProperty)),Jh}var Xh,PS;function a3(){if(PS)return Xh;PS=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Gh(),n={},r=MS();t=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=i[u](s,u,l,a,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";t("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Xh=o,Xh}var Yh,IS;function l3(){if(IS)return Yh;IS=1;var t=AS(),e=s3(),n=Gh(),r=MS(),o=a3(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Yh=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(R){var Q=R&&(c&&R[c]||R[u]);if(typeof Q=="function")return Q}var h="<<anonymous>>",f={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:C(),arrayOf:w,element:b(),elementType:S(),instanceOf:E,node:O(),objectOf:_,oneOf:x,oneOfType:A,shape:M,exact:I};function p(R,Q){return R===Q?R!==0||1/R===1/Q:R!==R&&Q!==Q}function g(R,Q){this.message=R,this.data=Q&&typeof Q=="object"?Q:{},this.stack=""}g.prototype=Error.prototype;function m(R){if(process.env.NODE_ENV!=="production")var Q={},se=0;function ie(ue,pe,D,ce,ye,be,H){if(ce=ce||h,be=be||D,H!==n){if(l){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ve=ce+":"+D;!Q[Ve]&&se<3&&(i("You are manually calling a React.PropTypes validation function for the `"+be+"` prop on `"+ce+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Q[Ve]=!0,se++)}}return pe[D]==null?ue?pe[D]===null?new g("The "+ye+" `"+be+"` is marked as required "+("in `"+ce+"`, but its value is `null`.")):new g("The "+ye+" `"+be+"` is marked as required in "+("`"+ce+"`, but its value is `undefined`.")):null:R(pe,D,ce,ye,be)}var de=ie.bind(null,!1);return de.isRequired=ie.bind(null,!0),de}function v(R){function Q(se,ie,de,ue,pe,D){var ce=se[ie],ye=z(ce);if(ye!==R){var be=V(ce);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+be+"` supplied to `"+de+"`, expected ")+("`"+R+"`."),{expectedType:R})}return null}return m(Q)}function C(){return m(s)}function w(R){function Q(se,ie,de,ue,pe){if(typeof R!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside arrayOf.");var D=se[ie];if(!Array.isArray(D)){var ce=z(D);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an array."))}for(var ye=0;ye<D.length;ye++){var be=R(D,ye,de,ue,pe+"["+ye+"]",n);if(be instanceof Error)return be}return null}return m(Q)}function b(){function R(Q,se,ie,de,ue){var pe=Q[se];if(!a(pe)){var D=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+D+"` supplied to `"+ie+"`, expected a single ReactElement."))}return null}return m(R)}function S(){function R(Q,se,ie,de,ue){var pe=Q[se];if(!t.isValidElementType(pe)){var D=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+D+"` supplied to `"+ie+"`, expected a single ReactElement type."))}return null}return m(R)}function E(R){function Q(se,ie,de,ue,pe){if(!(se[ie]instanceof R)){var D=R.name||h,ce=K(se[ie]);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected ")+("instance of `"+D+"`."))}return null}return m(Q)}function x(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function Q(se,ie,de,ue,pe){for(var D=se[ie],ce=0;ce<R.length;ce++)if(p(D,R[ce]))return null;var ye=JSON.stringify(R,function(H,L){var Ve=V(L);return Ve==="symbol"?String(L):L});return new g("Invalid "+ue+" `"+pe+"` of value `"+String(D)+"` "+("supplied to `"+de+"`, expected one of "+ye+"."))}return m(Q)}function _(R){function Q(se,ie,de,ue,pe){if(typeof R!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside objectOf.");var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an object."));for(var ye in D)if(r(D,ye)){var be=R(D,ye,de,ue,pe+"."+ye,n);if(be instanceof Error)return be}return null}return m(Q)}function A(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Q=0;Q<R.length;Q++){var se=R[Q];if(typeof se!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(se)+" at index "+Q+"."),s}function ie(de,ue,pe,D,ce){for(var ye=[],be=0;be<R.length;be++){var H=R[be],L=H(de,ue,pe,D,ce,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&ye.push(L.data.expectedType)}var Ve=ye.length>0?", expected one of type ["+ye.join(", ")+"]":"";return new g("Invalid "+D+" `"+ce+"` supplied to "+("`"+pe+"`"+Ve+"."))}return m(ie)}function O(){function R(Q,se,ie,de,ue){return P(Q[se])?null:new g("Invalid "+de+" `"+ue+"` supplied to "+("`"+ie+"`, expected a ReactNode."))}return m(R)}function k(R,Q,se,ie,de){return new g((R||"React class")+": "+Q+" type `"+se+"."+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+de+"`.")}function M(R){function Q(se,ie,de,ue,pe){var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));for(var ye in R){var be=R[ye];if(typeof be!="function")return k(de,ue,pe,ye,V(be));var H=be(D,ye,de,ue,pe+"."+ye,n);if(H)return H}return null}return m(Q)}function I(R){function Q(se,ie,de,ue,pe){var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));var ye=e({},se[ie],R);for(var be in ye){var H=R[be];if(r(R,be)&&typeof H!="function")return k(de,ue,pe,be,V(H));if(!H)return new g("Invalid "+ue+" `"+pe+"` key `"+be+"` supplied to `"+de+"`.\nBad object: "+JSON.stringify(se[ie],null," ")+`
204
- Valid keys: `+JSON.stringify(Object.keys(R),null," "));var L=H(D,be,de,ue,pe+"."+be,n);if(L)return L}return null}return m(Q)}function P(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(P);if(R===null||a(R))return!0;var Q=d(R);if(Q){var se=Q.call(R),ie;if(Q!==R.entries){for(;!(ie=se.next()).done;)if(!P(ie.value))return!1}else for(;!(ie=se.next()).done;){var de=ie.value;if(de&&!P(de[1]))return!1}}else return!1;return!0;default:return!1}}function F(R,Q){return R==="symbol"?!0:Q?Q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Q instanceof Symbol:!1}function z(R){var Q=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":F(Q,R)?"symbol":Q}function V(R){if(typeof R>"u"||R===null)return""+R;var Q=z(R);if(Q==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return Q}function J(R){var Q=V(R);switch(Q){case"array":case"object":return"an "+Q;case"boolean":case"date":case"regexp":return"a "+Q;default:return Q}}function K(R){return!R.constructor||!R.constructor.name?h:R.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},Yh}var Qh,LS;function c3(){if(LS)return Qh;LS=1;var t=Gh();function e(){}function n(){}return n.resetWarningCache=e,Qh=function(){function r(s,a,l,c,u,d){if(d!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return i.PropTypes=i,i},Qh}if(process.env.NODE_ENV!=="production"){var u3=AS(),d3=!0;qh.exports=l3()(u3.isElement,d3)}else qh.exports=c3()();var f3=qh.exports;const Ze=Xg(f3);function si(t,e,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):o(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function ai(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function DS(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function NS(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var h3=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Os(t,e){var n=p3(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function p3(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),o=h3.get(r);o&&Object.defineProperty(t,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return t}var g3=[".DS_Store","Thumbs.db"];function m3(t){return si(this,void 0,void 0,function(){return ai(this,function(e){return dc(t)&&y3(t.dataTransfer)?[2,S3(t.dataTransfer,t.type)]:v3(t)?[2,b3(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,w3(t)]:[2,[]]})})}function y3(t){return dc(t)}function v3(t){return dc(t)&&dc(t.target)}function dc(t){return typeof t=="object"&&t!==null}function b3(t){return Zh(t.target.files).map(function(e){return Os(e)})}function w3(t){return si(this,void 0,void 0,function(){var e;return ai(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Os(r)})]}})})}function S3(t,e){return si(this,void 0,void 0,function(){var n,r;return ai(this,function(o){switch(o.label){case 0:return t.items?(n=Zh(t.items).filter(function(i){return i.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(C3))]):[3,2];case 1:return r=o.sent(),[2,RS(FS(r))];case 2:return[2,RS(Zh(t.files).map(function(i){return Os(i)}))]}})})}function RS(t){return t.filter(function(e){return g3.indexOf(e.name)===-1})}function Zh(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r)}return e}function C3(t){if(typeof t.webkitGetAsEntry!="function")return HS(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?BS(e):HS(t)}function FS(t){return t.reduce(function(e,n){return NS(NS([],DS(e),!1),DS(Array.isArray(n)?FS(n):[n]),!1)},[])}function HS(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=Os(e);return Promise.resolve(n)}function E3(t){return si(this,void 0,void 0,function(){return ai(this,function(e){return[2,t.isDirectory?BS(t):_3(t)]})})}function BS(t){var e=t.createReader();return new Promise(function(n,r){var o=[];function i(){var s=this;e.readEntries(function(a){return si(s,void 0,void 0,function(){var l,c,u;return ai(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(E3)),o.push(u),i(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}i()})}function _3(t){return si(this,void 0,void 0,function(){return ai(this,function(e){return[2,new Promise(function(n,r){t.file(function(o){var i=Os(o,t.fullPath);n(i)},function(o){r(o)})})]})})}var x3=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",o=(t.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?i===a.replace(/\/.*$/,""):o===a})}return!0};function VS(t){return O3(t)||T3(t)||US(t)||A3()}function A3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
205
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function O3(t){if(Array.isArray(t))return ep(t)}function $S(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function jS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$S(Object(n),!0).forEach(function(r){zS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ks(t,e){return P3(t)||M3(t,e)||US(t,e)||k3()}function k3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
206
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function US(t,e){if(t){if(typeof t=="string")return ep(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ep(t,e)}}function ep(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function M3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function P3(t){if(Array.isArray(t))return t}var I3="file-invalid-type",L3="file-too-large",D3="file-too-small",N3="too-many-files",R3=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:I3,message:"File type must be ".concat(n)}},qS=function(e){return{code:L3,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},WS=function(e){return{code:D3,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},F3={code:N3,message:"Too many files"};function KS(t,e){var n=t.type==="application/x-moz-file"||x3(t,e);return[n,n?null:R3(e)]}function GS(t,e,n){if(bo(t.size))if(bo(e)&&bo(n)){if(t.size>n)return[!1,qS(n)];if(t.size<e)return[!1,WS(e)]}else{if(bo(e)&&t.size<e)return[!1,WS(e)];if(bo(n)&&t.size>n)return[!1,qS(n)]}return[!0,null]}function bo(t){return t!=null}function H3(t){var e=t.files,n=t.accept,r=t.minSize,o=t.maxSize,i=t.multiple,s=t.maxFiles,a=t.validator;return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(function(l){var c=KS(l,n),u=ks(c,1),d=u[0],h=GS(l,r,o),f=ks(h,1),p=f[0],g=a?a(l):null;return d&&p&&!g})}function fc(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function hc(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function JS(t){t.preventDefault()}function B3(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function V3(t){return t.indexOf("Edge/")!==-1}function $3(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return B3(t)||V3(t)}function Dn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];return e.some(function(a){return!fc(r)&&a&&a.apply(void 0,[r].concat(i)),fc(r)})}}function j3(){return"showOpenFilePicker"in window}function z3(t){if(bo(t)){var e=Object.entries(t).filter(function(n){var r=ks(n,2),o=r[0],i=r[1],s=!0;return XS(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(i)||!i.every(YS))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var o=ks(r,2),i=o[0],s=o[1];return jS(jS({},n),{},zS({},i,s))},{});return[{description:"Files",accept:e}]}return t}function U3(t){if(bo(t))return Object.entries(t).reduce(function(e,n){var r=ks(n,2),o=r[0],i=r[1];return[].concat(VS(e),[o],VS(i))},[]).filter(function(e){return XS(e)||YS(e)}).join(",")}function q3(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function W3(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function XS(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function YS(t){return/^.*\.[\w]+$/.test(t)}var K3=["children"],G3=["open"],J3=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],X3=["refKey","onChange","onClick"];function Y3(t){return e5(t)||Z3(t)||QS(t)||Q3()}function Q3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
207
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function e5(t){if(Array.isArray(t))return np(t)}function tp(t,e){return r5(t)||n5(t,e)||QS(t,e)||t5()}function t5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
208
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QS(t,e){if(t){if(typeof t=="string")return np(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return np(t,e)}}function np(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function n5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function r5(t){if(Array.isArray(t))return t}function ZS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ZS(Object(n),!0).forEach(function(r){rp(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ZS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pc(t,e){if(t==null)return{};var n=o5(t,e),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function o5(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var op=T.forwardRef(function(t,e){var n=t.children,r=pc(t,K3),o=tC(r),i=o.open,s=pc(o,G3);return T.useImperativeHandle(e,function(){return{open:i}},[i]),T.createElement(T.Fragment,null,n(it(it({},s),{},{open:i})))});op.displayName="Dropzone";var eC={disabled:!1,getFilesFromEvent:m3,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};op.defaultProps=eC,op.propTypes={children:Ze.func,accept:Ze.objectOf(Ze.arrayOf(Ze.string)),multiple:Ze.bool,preventDropOnDocument:Ze.bool,noClick:Ze.bool,noKeyboard:Ze.bool,noDrag:Ze.bool,noDragEventsBubbling:Ze.bool,minSize:Ze.number,maxSize:Ze.number,maxFiles:Ze.number,disabled:Ze.bool,getFilesFromEvent:Ze.func,onFileDialogCancel:Ze.func,onFileDialogOpen:Ze.func,useFsAccessApi:Ze.bool,autoFocus:Ze.bool,onDragEnter:Ze.func,onDragLeave:Ze.func,onDragOver:Ze.func,onDrop:Ze.func,onDropAccepted:Ze.func,onDropRejected:Ze.func,onError:Ze.func,validator:Ze.func};var ip={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function tC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=it(it({},eC),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,i=e.maxSize,s=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,h=e.onDrop,f=e.onDropAccepted,p=e.onDropRejected,g=e.onFileDialogCancel,m=e.onFileDialogOpen,v=e.useFsAccessApi,C=e.autoFocus,w=e.preventDropOnDocument,b=e.noClick,S=e.noKeyboard,E=e.noDrag,x=e.noDragEventsBubbling,_=e.onError,A=e.validator,O=T.useMemo(function(){return U3(n)},[n]),k=T.useMemo(function(){return z3(n)},[n]),M=T.useMemo(function(){return typeof m=="function"?m:nC},[m]),I=T.useMemo(function(){return typeof g=="function"?g:nC},[g]),P=T.useRef(null),F=T.useRef(null),z=T.useReducer(i5,ip),V=tp(z,2),J=V[0],K=V[1],R=J.isFocused,Q=J.isFileDialogActive,se=T.useRef(typeof window<"u"&&window.isSecureContext&&v&&j3()),ie=function(){!se.current&&Q&&setTimeout(function(){if(F.current){var B=F.current.files;B.length||(K({type:"closeDialog"}),I())}},300)};T.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[F,Q,I,se]);var de=T.useRef([]),ue=function(B){P.current&&P.current.contains(B.target)||(B.preventDefault(),de.current=[])};T.useEffect(function(){return w&&(document.addEventListener("dragover",JS,!1),document.addEventListener("drop",ue,!1)),function(){w&&(document.removeEventListener("dragover",JS),document.removeEventListener("drop",ue))}},[P,w]),T.useEffect(function(){return!r&&C&&P.current&&P.current.focus(),function(){}},[P,C,r]);var pe=T.useCallback(function(U){_?_(U):console.error(U)},[_]),D=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U),de.current=[].concat(Y3(de.current),[U.target]),hc(U)&&Promise.resolve(o(U)).then(function(B){if(!(fc(U)&&!x)){var re=B.length,j=re>0&&H3({files:B,accept:O,minSize:s,maxSize:i,multiple:a,maxFiles:l,validator:A}),te=re>0&&!j;K({isDragAccept:j,isDragReject:te,isDragActive:!0,type:"setDraggedFiles"}),c&&c(U)}}).catch(function(B){return pe(B)})},[o,c,pe,x,O,s,i,a,l,A]),ce=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U);var B=hc(U);if(B&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return B&&d&&d(U),!1},[d,x]),ye=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U);var B=de.current.filter(function(j){return P.current&&P.current.contains(j)}),re=B.indexOf(U.target);re!==-1&&B.splice(re,1),de.current=B,!(B.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),hc(U)&&u&&u(U))},[P,u,x]),be=T.useCallback(function(U,B){var re=[],j=[];U.forEach(function(te){var fe=KS(te,O),ve=tp(fe,2),Ee=ve[0],je=ve[1],Ue=GS(te,s,i),q=tp(Ue,2),ae=q[0],ge=q[1],Me=A?A(te):null;if(Ee&&ae&&!Me)re.push(te);else{var ke=[je,ge];Me&&(ke=ke.concat(Me)),j.push({file:te,errors:ke.filter(function(ze){return ze})})}}),(!a&&re.length>1||a&&l>=1&&re.length>l)&&(re.forEach(function(te){j.push({file:te,errors:[F3]})}),re.splice(0)),K({acceptedFiles:re,fileRejections:j,type:"setFiles"}),h&&h(re,j,B),j.length>0&&p&&p(j,B),re.length>0&&f&&f(re,B)},[K,a,O,s,i,l,h,f,p,A]),H=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U),de.current=[],hc(U)&&Promise.resolve(o(U)).then(function(B){fc(U)&&!x||be(B,U)}).catch(function(B){return pe(B)}),K({type:"reset"})},[o,be,pe,x]),L=T.useCallback(function(){if(se.current){K({type:"openDialog"}),M();var U={multiple:a,types:k};window.showOpenFilePicker(U).then(function(B){return o(B)}).then(function(B){be(B,null),K({type:"closeDialog"})}).catch(function(B){q3(B)?(I(B),K({type:"closeDialog"})):W3(B)?(se.current=!1,F.current?(F.current.value=null,F.current.click()):pe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):pe(B)});return}F.current&&(K({type:"openDialog"}),M(),F.current.value=null,F.current.click())},[K,M,I,v,be,pe,k,a]),Ve=T.useCallback(function(U){!P.current||!P.current.isEqualNode(U.target)||(U.key===" "||U.key==="Enter"||U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),L())},[P,L]),G=T.useCallback(function(){K({type:"focus"})},[]),ne=T.useCallback(function(){K({type:"blur"})},[]),X=T.useCallback(function(){b||($3()?setTimeout(L,0):L())},[b,L]),W=function(B){return r?null:B},$=function(B){return S?null:W(B)},ee=function(B){return E?null:W(B)},Ce=function(B){x&&B.stopPropagation()},we=T.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=U.refKey,re=B===void 0?"ref":B,j=U.role,te=U.onKeyDown,fe=U.onFocus,ve=U.onBlur,Ee=U.onClick,je=U.onDragEnter,Ue=U.onDragOver,q=U.onDragLeave,ae=U.onDrop,ge=pc(U,J3);return it(it(rp({onKeyDown:$(Dn(te,Ve)),onFocus:$(Dn(fe,G)),onBlur:$(Dn(ve,ne)),onClick:W(Dn(Ee,X)),onDragEnter:ee(Dn(je,D)),onDragOver:ee(Dn(Ue,ce)),onDragLeave:ee(Dn(q,ye)),onDrop:ee(Dn(ae,H)),role:typeof j=="string"&&j!==""?j:"presentation"},re,P),!r&&!S?{tabIndex:0}:{}),ge)}},[P,Ve,G,ne,X,D,ce,ye,H,S,E,r]),Z=T.useCallback(function(U){U.stopPropagation()},[]),Se=T.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=U.refKey,re=B===void 0?"ref":B,j=U.onChange,te=U.onClick,fe=pc(U,X3),ve=rp({accept:O,multiple:a,type:"file",style:{display:"none"},onChange:W(Dn(j,H)),onClick:W(Dn(te,Z)),tabIndex:-1},re,F);return it(it({},ve),fe)}},[F,n,a,H,r]);return it(it({},J),{},{isFocused:R&&!r,getRootProps:we,getInputProps:Se,rootRef:P,inputRef:F,open:W(L)})}function i5(t,e){switch(e.type){case"focus":return it(it({},t),{},{isFocused:!0});case"blur":return it(it({},t),{},{isFocused:!1});case"openDialog":return it(it({},ip),{},{isFileDialogActive:!0});case"closeDialog":return it(it({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return it(it({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return it(it({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return it({},ip);default:return t}}function nC(){}function sp({children:t}){return y.jsx("div",{position:"absolute",top:"3",end:"3",dflex:!0,spaceX:"3",children:t})}function gc({...t}){return y.jsx(N.Button,{variant:"glass",corners:"pill",scheme:"secondary",w:"10",h:"10",...t})}function rC({...t}){return y.jsx(gc,{title:"Reset Image",...t,children:y.jsx(N.Icon,{path:mx})})}function oC({cancelable:t,onCancel:e,progress:n}){return y.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"black",bgOpacity:"50",flexCol:!0,spaceY:"5",children:[y.jsx(N.Spinner,{size:"x2",thickness:"1"}),t&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{textSize:"lg",fontWeight:"600",textColor:"white",children:[Math.round(n??0)," %"]}),y.jsxs(N.Button,{scheme:"danger",variant:"glass",corners:"pill",size:"sm",pe:"3",onClick:e,gap:"2",dflex:!0,alignItems:"center",children:[y.jsx(N.Icon,{path:Rg}),"Abort"]})]})]})}function iC({onRetry:t,msg:e,...n}){return y.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"#ff0000",bgOpacity:"50",flexCol:!0,spaceY:"5",...n,children:[y.jsx("div",{textColor:"white",children:e}),y.jsxs(N.Button,{onClick:t,shadow:!0,dflex:!0,alignItems:"center",gap:"3",children:[y.jsx(N.Icon,{path:Kg}),"Retry"]})]})}function s5({src:t,srcWidth:e,srcHeight:n,onReset:r,imgAspectRatio:o,children:i}){const[s,a]=T.useState(!0),[l,c]=T.useState(!1),u=T.useCallback(()=>{a(!1),c(!1)},[a,c]),d=T.useCallback(()=>{c(!0),a(!1)},[c,a]),h=T.useCallback(()=>{const f=new Image;f.onload=u,f.onerror=d,c(!1),a(!0),f.src=t},[u,d,c,a]);return y.jsxs("div",{position:"relative",aspectRatio:o,children:[!l&&y.jsx("img",{onLoad:u,onError:d,src:t,width:e,height:n,objectFit:"cover",aspectRatio:o}),s&&y.jsx(oC,{}),l&&y.jsx(iC,{msg:"Oops, couldn't load the image.",onRetry:h}),y.jsxs(sp,{children:[y.jsx(rC,{onClick:r}),i]})]})}const a5=T.memo(function({src:t,state:e,onReset:n,onCancel:r,onRetry:o,imgAspectRatio:i,children:s,...a}){return y.jsxs("div",{position:"relative",aspectRatio:i,...a,children:[y.jsx("img",{src:t,objectFit:"cover",alt:"",aspectRatio:i}),e.state=="loading"&&y.jsx(oC,{cancelable:!0,onCancel:r,progress:e.progress}),e.state=="error"&&y.jsx(iC,{onRetry:o,msg:"Oops, there was an error uploading your image, please retry."}),e.state=="error"&&y.jsxs(sp,{children:[y.jsx(rC,{onClick:n}),s]})]})});function l5(t){if(t.type.includes("image/")){if(t.size/1024/1024>7)return He.error("File size too big, max image size allowed is 7 Mb"),!1}else return He.error("Only image files are allowed"),!1;return!0}T.memo(function({type:t="image",state:e,onFileSelected:n,onResetImage:r,onCancel:o,onRetry:i,emptyStateProps:s,showMediaLibraryButton:a,onMediaLibraryButtonClick:l,children:c,...u}){const d=T.useCallback(C=>{const w=C[0];l5(w)&&n(w)},[n]),{getRootProps:h,getInputProps:f,isDragActive:p,open:g}=tC({onDrop:d,multiple:!1,accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/webp":[".webp"]}}),m=T.useCallback(C=>{C.preventDefault(),C.stopPropagation(),g()},[g]),v=T.useCallback(C=>{C.preventDefault(),C.stopPropagation(),l==null||l()},[l]);return y.jsxs("div",{bgColor:"slate-500",...u,children:[e.state=="complete"&&y.jsx(s5,{src:e.src,srcWidth:e.srcWidth,srcHeight:e.srcHeight,onReset:r,imgAspectRatio:u.aspectRatio,children:c}),(e.state=="loading"||e.state=="error")&&y.jsx(a5,{src:e.src,state:e,onReset:r,onCancel:o,onRetry:i,imgAspectRatio:u.aspectRatio,children:c}),e.state=="empty"&&y.jsxs("div",{h:"100%",bgColor:p?"slate-500":void 0,w:"full",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",id:"kqhdfbq",position:"relative",textColor:"white",...s,...h(),children:[y.jsx("input",{...f()}),y.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",spaceY:"3",children:[y.jsx(N.Icon,{size:"x5",path:yx}),y.jsxs("p",{textTransform:"capitalize",children:["Drag and drop your ",t," here"]}),y.jsx("p",{opacity:"80",children:"— or select from —"}),y.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:m,children:"Local file"}),a&&y.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:v,children:"Media Library"})]}),c&&y.jsx(sp,{children:c})]})]})});const c5={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};N.ComponentManager.registerComponent("Editor.Image",c5);function u5({...t}){var p,g;const e=t.editor,r=t.node.attrs,o=t.deleteNode,i=t.getPos,s=r.ychange,[a,l]=T.useState(!1),c=zE(e,i);T.useCallback(m=>{c({...r,...m})},[zE]);const u=N.useComponentConfig("Editor.Youtube",void 0,{},{}),d=T.useCallback(()=>{o()},[o]);let h=r.aspectRatio;h&&(h=="default"&&(h=void 0),h=="custom"&&(h=r.customAspectRatio));const f={};return s&&(s.type=="added"||s.type=="removed")&&(f.border="1",f.rounded="lg",f.borderColor=s.type=="added"?(p=s.color)==null?void 0:p.light:(g=s.color)==null?void 0:g.dark),y.jsx(vo,{as:"div","data-drag-handle":!0,...f,...u,children:y.jsxs("div",{bgColor:"slate-700",outline:t.selected?"1":!1,outlineColor:"sky-500",position:"relative",rounded:"lg",overflow:"hidden",border:r.showBorder?"0.5":void 0,borderColor:r.showBorder?r.borderColor:void 0,aspectRatio:"16/9",children:[r.src&&y.jsx("iframe",{src:r.src,aspectRatio:"16/9",w:"full",allow:"*"}),(!r.src||a)&&y.jsx(d5,{src:r.src}),y.jsx("div",{position:"absolute",bgColor:"black",bgOpacity:"30",top:"0",bottom:"0",start:"0",end:"0"}),e.view.editable&&!a&&y.jsxs("div",{position:"absolute",dflex:!0,gap:"3",top:"3",end:"3",children:[y.jsx(gc,{title:"Settings",onClick:()=>l(!0),children:y.jsx(N.Icon,{path:rx})}),y.jsx(gc,{title:"Delete Youtube Block",onClick:m=>{m.preventDefault(),m.stopPropagation(),d()},children:y.jsx(N.Icon,{path:Jg})})]})]},r.src)})}function d5({src:t}){const e=T.useCallback(n=>{},[]);return y.jsx("div",{position:"absolute",top:"0",start:"0",end:"0",bottom:"0",p:"3",bgColor:"slate-100",children:y.jsxs(Ia,{position:"relative",w:"full",h:"full",children:[y.jsx(Ra,{initialValues:{src:t??""},onSubmit:e,children:y.jsx(pr,{form:F0.array(F0.url("src","Youtube URL",!1,"https://www.youtube.com/watch?v=dQw4w9WgXcQ"))})}),y.jsx(gc,{type:"submit",title:"Save",position:"absolute",variant:"default",top:"3",end:"3",children:y.jsx(N.Icon,{path:eu})})]})})}const sC={defaultProps:{mt:Y(8,16),mb:Y(8,16),sm_mt:Y(4,14),sm_mb:Y(4,14),lg_mt:Y(12,18),lg_mb:Y(12,18),xl_mt:Y(12,20),xl_mb:Y(12,20),x2_mt:Y(12,24),x2_mb:Y(12,24)}};N.ComponentManager.registerComponent("Editor.ListItem",sC);function f5({...t}){const e=N.useComponentConfig("Editor.ListItem",void 0,{},{});return y.jsx(vo,{as:"li",...e,...cc(t,"List item"),children:y.jsx(ys,{})})}const aC={defaultProps:{listStyle:"decimal",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}},h5=t=>{const e=t.as||"div",{nodeViewContentRef:n}=vS();return y.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};N.ComponentManager.registerComponent("Editor.OrderedList",aC);function p5(){const t=N.useComponentConfig("Editor.OrderedList",void 0,{},{});return y.jsx(vo,{as:"ol",...t,children:y.jsx(h5,{})})}const lC={defaultProps:{mt:Y(20,16),mb:Y(20,16),sm_mt:Y(16,14),sm_mb:Y(16,14),lg_mt:Y(24,18),lg_mb:Y(24,18),xl_mt:Y(24,20),xl_mb:Y(24,20),x2_mt:Y(32,24),x2_mb:Y(32,24),textSize:"md",textColor:"#242424",css:{"& a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all"},insert:{color:"#33FF33"},"& delete":{color:"#FF3333",textDecoration:"strike-through"}}}};N.ComponentManager.registerComponent("Editor.Paragraph",lC);function g5({...t}){const e=N.useComponentConfig("Editor.Paragraph",void 0,{},{});return y.jsx(vo,{as:"p",...e,...cc(t),children:y.jsx(ys,{as:"span"})})}const m5=["bulletList","orderedList","taskList","image"],y5=gt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new lt({key:new yt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=t.type.createAndFill(),s=(i==null?void 0:i.sameMarkup(t))&&i.content.findDiffStart(t.content)===null;return t.descendants((a,l)=>{const c=m5.includes(a.type.name),u=r>=l&&r<=l+a.nodeSize,d=!c&&cC(a);//!node.isLeaf && !node.childCount;
209
- if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const f=qt.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});o.push(f)}return c||this.options.includeChildren}),dt.create(t,o)}}})]}});function cC(t){if(t.text)return!1;const e=t.content;let n=!0;return Hy(e.content)&&e.content.forEach(o=>n=n&&cC(o)),n}const v5=Dt.create({name:"capitalize",addOptions(){return{HTMLAttributes:{style:"text-transform: capitalize"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setCapitalize:()=>({commands:t})=>t.setMark(this.name),toggleCapitalize:()=>({commands:t})=>t.toggleMark(this.name),unsetCapitalize:()=>({commands:t})=>t.unsetMark(this.name)}}}),b5=Dt.create({name:"lowercase",addOptions(){return{HTMLAttributes:{style:"text-transform: lowercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setLowercase:()=>({commands:t})=>t.setMark(this.name),toggleLowercase:()=>({commands:t})=>t.toggleMark(this.name),unsetLowercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),w5=Dt.create({name:"uppercase",addOptions(){return{HTMLAttributes:{style:"text-transform: uppercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setUppercase:()=>({commands:t})=>t.setMark(this.name),toggleUppercase:()=>({commands:t})=>t.toggleMark(this.name),unsetUppercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),S5=Dt.create({name:"ychange",inclusive:!1,addAttributes(){return{user:{default:null},type:{default:null},color:{default:null}}},parseHTML(){return[{tag:"ychange"}]},renderHTML({mark:t}){return["ychange",{ychange_user:t.attrs.user,ychange_type:t.attrs.type,style:C5(t.attrs),ychange_color:t.attrs.color.light}]}}),C5=t=>{switch(t.type){case"removed":return`color:${t.color.dark}; text-decoration: line-through`;case"added":return"background-color:#bef264";case null:return""}},E5=(t,e)=>[jF.configure({heading:!1,paragraph:!1,blockquote:!1,bulletList:!1,orderedList:!1,listItem:!1,codeBlock:{HTMLAttributes:{class:"rounded-sm bg-stone-100 p-5 font-mono font-medium text-stone-800"}},code:{HTMLAttributes:{class:"rounded-md bg-stone-200 px-1.5 py-1 font-mono font-medium text-stone-900",spellcheck:"false"}},horizontalRule:!1,dropcursor:{color:"#DBEAFE",width:4},gapcursor:!1,hardBreak:{keepMarks:!0},history:!1}),Vw.extend({addNodeView(){return ho(r3)},draggable:!0}),aS.extend({addAttributes(){return{ychange:{default:null}}},addNodeView(){return ho(g5)},draggable:!0}),Rw.extend({addNodeView(){return ho(t3)}}),rS.extend({addNodeView(){return ho(f5)}}),Bw.extend({addNodeView(){return ho(n3)}}),sS.extend({addNodeView(){return ho(p5)}}),WR.configure({openOnClick:!1,autolink:!0,linkOnPaste:!0}),y5.configure({placeholder:({node:n})=>{switch(n.type.name){case"heading":return`Heading ${n.attrs.level}`;case"quote":return"Quote";case"listItem":return"List item";case"taskItem":return"Task item"}return(e==null?void 0:e.placeHolderText)??"Press '/' for commands"},includeChildren:!1,emptyEditorClass:"my-class"}),ZF(t),mS,QR,bR,w5,b5,v5,wR,ER.configure({multicolor:!0}),YR.extend({addNodeView(){return ho(u5)},draggable:!0}),S5],Nn=typeof navigator<"u"?navigator:null,uC=typeof document<"u"?document:null,wo=Nn&&Nn.userAgent||"",ap=/Edge\/(\d+)/.exec(wo),dC=/MSIE \d/.exec(wo),lp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(wo),cp=!!(dC||lp||ap);dC?document.documentMode:lp?+lp[1]:ap&&+ap[1],!cp&&/gecko\/(\d+)/i.test(wo)&&+(/Firefox\/(\d+)/.exec(wo)||[0,0])[1];const fC=!cp&&/Chrome\/(\d+)/.exec(wo);fC&&+fC[1],!cp&&!!Nn&&/Apple Computer/.test(Nn.vendor)&&(/Mobile\/\w+/.test(wo)||!!Nn&&Nn.maxTouchPoints>2)||Nn&&/Mac/.test(Nn.platform),Nn&&/Win/.test(Nn.platform),!!uC&&"webkitFontSmoothing"in uC.documentElement.style&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];const _5={handleDOMEvents:{keydown:(t,e,...n)=>{if(["ArrowUp","ArrowDown","Enter"].includes(e.key)&&document.querySelector("#slash-command"))return!0}},handlePaste:(t,e)=>{if(e.clipboardData&&e.clipboardData.files&&e.clipboardData.files[0]){e.preventDefault();const n=e.clipboardData.files[0],r=t.state.selection.from,{schema:o}=t.state,i=o.nodes.image.create({file:n}),s=t.state.tr;return s.insert(r,i),t.dispatch(s)}return!1},handleDrop:(t,e,n,r)=>{if(!r&&e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files[0]){e.preventDefault();const o=e.dataTransfer.files[0],i=t.posAtCoords({left:e.clientX,top:e.clientY})??{pos:0,inside:0},{schema:s}=t.state,a=s.nodes.image.create({file:o}),l=t.state.tr;return l.selection.empty||l.deleteSelection(),l.insert(i.pos,a),t.dispatch(l)}return!1}},Rn=()=>new Map,up=t=>{const e=Rn();return t.forEach((n,r)=>{e.set(r,n)}),e},So=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},x5=(t,e)=>{const n=[];for(const[r,o]of t)n.push(e(o,r));return n},A5=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},Co=()=>new Set,dp=t=>t[t.length-1],T5=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Eo=Array.from,O5=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},fp=Array.isArray;class hC{constructor(){this._observers=Rn()}on(e,n){return So(this._observers,e,Co).add(n),n}once(e,n){const r=(...o)=>{this.off(e,r),n(...o)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Eo((this._observers.get(e)||Rn()).values()).forEach(r=>r(...n))}destroy(){this._observers=Rn()}}const Hr=Math.floor,mc=Math.abs,yc=(t,e)=>t<e?t:e,li=(t,e)=>t>e?t:e,k5=t=>t!==0?t<0:1/t<0,pC=1,gC=2,hp=4,pp=8,M5=32,mC=64,Ms=128,P5=31,yC=63,ci=127,I5=2147483647,L5=Number.MAX_SAFE_INTEGER,D5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Hr(t)===t),N5=t=>t.toLowerCase(),R5=/^\s*/g,F5=t=>t.replace(R5,""),H5=/([A-Z])/g,vC=(t,e)=>F5(t.replace(H5,n=>`${e}${N5(n)}`)),B5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=e.codePointAt(o);return r},Ps=typeof TextEncoder<"u"?new TextEncoder:null,V5=Ps?t=>Ps.encode(t):B5;let gp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});gp&&gp.decode(new Uint8Array).length===1&&(gp=null);class Is{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const mp=()=>new Is,$5=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},er=t=>{const e=new Uint8Array($5(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},j5=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(li(n,e)*2),t.cpos=0)},_t=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},yp=_t,Je=(t,e)=>{for(;e>ci;)_t(t,Ms|ci&e),e=Hr(e/128);_t(t,ci&e)},vp=(t,e)=>{const n=k5(e);for(n&&(e=-e),_t(t,(e>yC?Ms:0)|(n?mC:0)|yC&e),e=Hr(e/64);e>0;)_t(t,(e>ci?Ms:0)|ci&e),e=Hr(e/128)},bp=new Uint8Array(3e4),z5=bp.length/3,U5=(t,e)=>{if(e.length<z5){const n=Ps.encodeInto(e,bp).written||0;Je(t,n);for(let r=0;r<n;r++)_t(t,bp[r])}else nn(t,V5(e))},q5=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Je(t,r);for(let o=0;o<r;o++)_t(t,n.codePointAt(o))},ui=Ps&&Ps.encodeInto?U5:q5,wp=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=yc(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(li(n*2,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},nn=(t,e)=>{Je(t,e.byteLength),wp(t,e)},Sp=(t,e)=>{j5(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},W5=(t,e)=>Sp(t,4).setFloat32(0,e,!1),K5=(t,e)=>Sp(t,8).setFloat64(0,e,!1),G5=(t,e)=>Sp(t,8).setBigInt64(0,e,!1),bC=new DataView(new ArrayBuffer(4)),J5=t=>(bC.setFloat32(0,t),bC.getFloat32(0)===t),Ls=(t,e)=>{switch(typeof e){case"string":_t(t,119),ui(t,e);break;case"number":D5(e)&&mc(e)<=I5?(_t(t,125),vp(t,e)):J5(e)?(_t(t,124),W5(t,e)):(_t(t,123),K5(t,e));break;case"bigint":_t(t,122),G5(t,e);break;case"object":if(e===null)_t(t,126);else if(fp(e)){_t(t,117),Je(t,e.length);for(let n=0;n<e.length;n++)Ls(t,e[n])}else if(e instanceof Uint8Array)_t(t,116),nn(t,e);else{_t(t,118);const n=Object.keys(e);Je(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];ui(t,o),Ls(t,e[o])}}break;case"boolean":_t(t,e?120:121);break;default:_t(t,127)}};class wC extends Is{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Je(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const SC=t=>{t.count>0&&(vp(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Je(t.encoder,t.count-2))};class vc{constructor(){this.encoder=new Is,this.s=0,this.count=0}write(e){this.s===e?this.count++:(SC(this),this.count=1,this.s=e)}toUint8Array(){return SC(this),er(this.encoder)}}const CC=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);vp(t.encoder,e),t.count>1&&Je(t.encoder,t.count-2)}};class Cp{constructor(){this.encoder=new Is,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(CC(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return CC(this),er(this.encoder)}}class X5{constructor(){this.sarr=[],this.s="",this.lensE=new vc}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Is;return this.sarr.push(this.s),this.s="",ui(e,this.sarr.join("")),wp(e,this.lensE.toUint8Array()),er(e)}}const Br=t=>new Error(t),Sn=()=>{throw Br("Method unimplemented")},tr=()=>{throw Br("Unexpected case")},Y5=Br("Unexpected end of array"),Q5=Br("Integer out of Range");class Z5{constructor(e){this.arr=e,this.pos=0}}const bc=t=>new Z5(t),Fn=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const o=t.arr[t.pos++];if(e=e+(o&ci)*n,n*=128,o<Ms)return e;if(e>L5)throw Q5}throw Y5},eH=crypto.getRandomValues.bind(crypto),tH=Math.random,EC=()=>eH(new Uint32Array(1))[0],nH=t=>t[Hr(tH()*t.length)],rH="10000000-1000-4000-8000"+-1e11,oH=()=>rH.replace(/[018]/g,t=>(t^EC()&15>>t/4).toString(16)),iH=Date.now,_C=t=>new Promise(t);Promise.all.bind(Promise);const xC=t=>t===void 0?null:t;class sH{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let AC=new sH,aH=!0;try{typeof localStorage<"u"&&localStorage&&(AC=localStorage,aH=!1)}catch{}const lH=AC,cH=Object.assign,TC=Object.keys,uH=(t,e)=>{for(const n in t)e(t[n],n)},OC=t=>TC(t).length,dH=t=>{for(const e in t)return!1;return!0},fH=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},hH=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),pH=(t,e)=>t===e||OC(t)===OC(e)&&fH(t,(n,r)=>(n!==void 0||hH(e,r))&&e[r]===n),Ep=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Ep(t,e,n+1)}},gH=(t,e)=>e.includes(t),di=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",mH=typeof window<"u"&&typeof document<"u"&&!di;let Hn;const yH=()=>{if(Hn===void 0)if(di){Hn=Rn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Hn.set(e,""),e=r):e!==null&&(Hn.set(e,r),e=null)}e!==null&&Hn.set(e,"")}else typeof location=="object"?(Hn=Rn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Hn.set(`--${vC(e,"-")}`,n),Hn.set(`-${vC(e,"-")}`,n)}})):Hn=Rn();return Hn},_p=t=>yH().has(t),xp=t=>xC(di?process.env[t.toUpperCase().replaceAll("-","_")]:lH.getItem(t));(t=>_p("--"+t)||xp(t)!==null)("production");const kC=di&&gH(process.env.FORCE_COLOR,["true","1","2"]),vH=!_p("no-colors")&&(!di||process.stdout.isTTY||kC)&&(!di||_p("color")||kC||xp("COLORTERM")!==null||(xp("TERM")||"").includes("color"));class bH{constructor(e,n){this.left=e,this.right=n}}const nr=(t,e)=>new bH(t,e),wH=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const SH=t=>x5(t,(e,n)=>`${n}:${e};`).join(""),CH=(t=>class{constructor(n){this._=n}destroy(){t(this._)}})(clearTimeout),Ap=(t,e)=>new CH(setTimeout(e,t)),rr=Symbol,MC=rr(),PC=rr(),EH=rr(),_H=rr(),xH=rr(),IC=rr(),AH=rr(),Tp=rr(),TH=rr(),OH=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[];let n=0;for(;n<t.length;n++){const o=t[n];o===void 0||o.constructor===String||o.constructor===Number||o.constructor===Object&&e.push(JSON.stringify(o))}return e},kH={[MC]:nr("font-weight","bold"),[PC]:nr("font-weight","normal"),[EH]:nr("color","blue"),[xH]:nr("color","green"),[_H]:nr("color","grey"),[IC]:nr("color","red"),[AH]:nr("color","purple"),[Tp]:nr("color","orange"),[TH]:nr("color","black")},LC=vH?t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Rn();let o=[],i=0;for(;i<t.length;i++){const a=t[i],l=kH[a];if(l!==void 0)r.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=SH(r);i>0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(i>0&&(o=n,o.unshift(e.join("")));i<t.length;i++){const a=t[i];a instanceof Symbol||o.push(a)}return o}:OH,MH=(...t)=>{console.log(...LC(t)),DC.forEach(e=>e.print(t))},PH=(...t)=>{console.warn(...LC(t)),t.unshift(Tp),DC.forEach(e=>e.print(t))},DC=Co(),NC=t=>({[Symbol.iterator](){return this},next:t}),IH=(t,e)=>NC(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Op=(t,e)=>NC(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class kp{constructor(e,n){this.clock=e,this.len=n}}class Ds{constructor(){this.clients=new Map}}const Vr=(t,e,n)=>e.clients.forEach((r,o)=>{const i=t.doc.store.clients.get(o);for(let s=0;s<r.length;s++){const a=r[s];qC(t,i,a.clock,a.len,n)}}),LH=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const o=Hr((n+r)/2),i=t[o],s=i.clock;if(s<=e){if(e<s+i.len)return o;n=o+1}else r=o-1}return null},_o=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&LH(n,e.clock)!==null},Mp=t=>{t.clients.forEach(e=>{e.sort((o,i)=>o.clock-i.clock);let n,r;for(n=1,r=1;n<e.length;n++){const o=e[r-1],i=e[n];o.clock+o.len>=i.clock?o.len=li(o.len,i.clock+i.len-o.clock):(r<n&&(e[r]=i),r++)}e.length=r})},wc=t=>{const e=new Ds;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,o)=>{if(!e.clients.has(o)){const i=r.slice();for(let s=n+1;s<t.length;s++)T5(i,t[s].clients.get(o)||[]);e.clients.set(o,i)}});return Mp(e),e},Pp=(t,e,n,r)=>{So(t.clients,e,()=>[]).push(new kp(n,r))},Sc=()=>new Ds,DH=t=>{const e=Sc();return t.clients.forEach((n,r)=>{const o=[];for(let i=0;i<n.length;i++){const s=n[i];if(s.deleted){const a=s.id.clock;let l=s.length;if(i+1<n.length)for(let c=n[i+1];i+1<n.length&&c.deleted;c=n[++i+1])l+=c.length;o.push(new kp(a,l))}}o.length>0&&e.clients.set(r,o)}),e},Cc=(t,e)=>{Je(t.restEncoder,e.clients.size),Eo(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Je(t.restEncoder,n);const o=r.length;Je(t.restEncoder,o);for(let i=0;i<o;i++){const s=r[i];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},Ip=t=>{const e=new Ds,n=Fn(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const o=Fn(t.restDecoder),i=Fn(t.restDecoder);if(i>0){const s=So(e.clients,o,()=>[]);for(let a=0;a<i;a++)s.push(new kp(t.readDsClock(),t.readDsLen()))}}return e},RC=EC;class fi extends hC{constructor({guid:e=oH(),collectionid:n=null,gc:r=!0,gcFilter:o=()=>!0,meta:i=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=o,this.clientID=RC(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new ZH,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=_C(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>_C(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&tt(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Eo(this.subdocs).map(e=>e.guid))}transact(e,n=null){return tt(this,e,n)}get(e,n=kt){const r=So(this.share,e,()=>{const i=new n;return i._integrate(this,null),i}),o=r.constructor;if(n!==kt&&o!==n)if(o===kt){const i=new n;i._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=i}),i._start=r._start;for(let s=i._start;s!==null;s=s.right)s.parent=i;return i._length=r._length,this.share.set(e,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ao)}getText(e=""){return this.get(e,gi)}getMap(e=""){return this.get(e,Bs)}getXmlElement(e=""){return this.get(e,Xt)}getXmlFragment(e=""){return this.get(e,mi)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Eo(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new fi({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,tt(e.parent.doc,r=>{const o=n.doc;e.deleted||r.subdocsAdded.add(o),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Lp{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Fn(this.restDecoder)}readDsLen(){return Fn(this.restDecoder)}}class NH{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Fn(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Fn(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Ec{constructor(){this.restEncoder=mp()}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Je(this.restEncoder,e)}writeDsLen(e){Je(this.restEncoder,e)}}class RH extends Ec{writeLeftID(e){Je(this.restEncoder,e.client),Je(this.restEncoder,e.clock)}writeRightID(e){Je(this.restEncoder,e.client),Je(this.restEncoder,e.clock)}writeClient(e){Je(this.restEncoder,e)}writeInfo(e){yp(this.restEncoder,e)}writeString(e){ui(this.restEncoder,e)}writeParentInfo(e){Je(this.restEncoder,e?1:0)}writeTypeRef(e){Je(this.restEncoder,e)}writeLen(e){Je(this.restEncoder,e)}writeAny(e){Ls(this.restEncoder,e)}writeBuf(e){nn(this.restEncoder,e)}writeJSON(e){ui(this.restEncoder,JSON.stringify(e))}writeKey(e){ui(this.restEncoder,e)}}class FC{constructor(){this.restEncoder=mp(),this.dsCurrVal=0}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,Je(this.restEncoder,n)}writeDsLen(e){e===0&&tr(),Je(this.restEncoder,e-1),this.dsCurrVal+=e}}class FH extends FC{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Cp,this.clientEncoder=new vc,this.leftClockEncoder=new Cp,this.rightClockEncoder=new Cp,this.infoEncoder=new wC(yp),this.stringEncoder=new X5,this.parentInfoEncoder=new wC(yp),this.typeRefEncoder=new vc,this.lenEncoder=new vc}toUint8Array(){const e=mp();return Je(e,0),nn(e,this.keyClockEncoder.toUint8Array()),nn(e,this.clientEncoder.toUint8Array()),nn(e,this.leftClockEncoder.toUint8Array()),nn(e,this.rightClockEncoder.toUint8Array()),nn(e,er(this.infoEncoder)),nn(e,this.stringEncoder.toUint8Array()),nn(e,er(this.parentInfoEncoder)),nn(e,this.typeRefEncoder.toUint8Array()),nn(e,this.lenEncoder.toUint8Array()),wp(e,er(this.restEncoder)),er(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Ls(this.restEncoder,e)}writeBuf(e){nn(this.restEncoder,e)}writeJSON(e){Ls(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const HH=(t,e,n,r)=>{r=li(r,e[0].id.clock);const o=or(e,r);Je(t.restEncoder,e.length-o),t.writeClient(n),Je(t.restEncoder,r);const i=e[o];i.write(t,r-i.id.clock);for(let s=o+1;s<e.length;s++)e[s].write(t,0)},BH=(t,e,n)=>{const r=new Map;n.forEach((o,i)=>{Ot(e,i)>o&&r.set(i,o)}),kc(e).forEach((o,i)=>{n.has(i)||r.set(i,0)}),Je(t.restEncoder,r.size),Eo(r.entries()).sort((o,i)=>i[0]-o[0]).forEach(([o,i])=>{HH(t,e.clients.get(o),o,i)})},VH=(t,e)=>BH(t,e.doc.store,e.beforeState),$H=t=>{const e=new Map,n=Fn(t.restDecoder);for(let r=0;r<n;r++){const o=Fn(t.restDecoder),i=Fn(t.restDecoder);e.set(o,i)}return e},jH=(t,e)=>(Je(t.restEncoder,e.size),Eo(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Je(t.restEncoder,n),Je(t.restEncoder,r)}),t);class zH{constructor(){this.l=[]}}const HC=()=>new zH,BC=(t,e)=>t.l.push(e),VC=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(o=>e!==o),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},$C=(t,e,n)=>Ep(t.l,[e,n]);class _c{constructor(e,n){this.client=e,this.clock=n}}const xc=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ye=(t,e)=>new _c(t,e),Ns=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw tr()},Rs=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class UH{constructor(e,n=e.getMap("users")){const r=new Map;this.yusers=n,this.doc=e,this.clients=new Map,this.dss=r;const o=(i,s)=>{const a=i.get("ds"),l=i.get("ids"),c=u=>this.clients.set(u,s);a.observe(u=>{u.changes.added.forEach(d=>{d.content.getContent().forEach(h=>{h instanceof Uint8Array&&this.dss.set(s,wc([this.dss.get(s)||Sc(),Ip(new Lp(bc(h)))]))})})}),this.dss.set(s,wc(a.map(u=>Ip(new Lp(bc(u)))))),l.observe(u=>u.changes.added.forEach(d=>d.content.getContent().forEach(c))),l.forEach(c)};n.observe(i=>{i.keysChanged.forEach(s=>o(n.get(s),s))}),n.forEach(o)}setUserMapping(e,n,r,{filter:o=()=>!0}={}){const i=this.yusers;let s=i.get(r);s||(s=new Bs,s.set("ids",new Ao),s.set("ds",new Ao),i.set(r,s)),s.get("ids").push([n]),i.observe(a=>{setTimeout(()=>{const l=i.get(r);if(l!==s){s=l,this.clients.forEach((d,h)=>{r===d&&s.get("ids").push([h])});const c=new Ec,u=this.dss.get(r);u&&(Cc(c,u),s.get("ds").push([c.toUint8Array()]))}},0)}),e.on("afterTransaction",a=>{setTimeout(()=>{const l=s.get("ds"),c=a.deleteSet;if(a.local&&c.clients.size>0&&o(a,c)){const u=new Ec;Cc(u,c),l.push([u.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(const[n,r]of this.dss.entries())if(_o(r,e))return n;return null}}class Ac{constructor(e,n,r,o=0){this.type=e,this.tname=n,this.item=r,this.assoc=o}}class qH{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const WH=(t,e,n=0)=>new qH(t,e,n),Tc=(t,e,n)=>{let r=null,o=null;return t._item===null?o=Ns(t):r=Ye(t._item.id.client,t._item.id.clock),new Ac(r,o,e,n)},Dp=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Tc(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Tc(t,Ye(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Tc(t,r.lastId,n);r=r.right}return Tc(t,null,n)},KH=(t,e,n=!0)=>{const r=e.store,o=t.item,i=t.type,s=t.tname,a=t.assoc;let l=null,c=0;if(o!==null){if(Ot(r,o.client)<=o.clock)return null;const u=n?qp(r,o):{item:hi(r,o),diff:0},d=u.item;if(!(d instanceof nt))return null;if(l=d.parent,l._item===null||!l._item.deleted){c=d.deleted||!d.countable?0:u.diff+(a>=0?0:1);let h=d.left;for(;h!==null;)!h.deleted&&h.countable&&(c+=h.length),h=h.left}}else{if(s!==null)l=e.get(s);else if(i!==null){if(Ot(r,i.client)<=i.clock)return null;const{item:u}=n?qp(r,i):{item:hi(r,i)};if(u instanceof nt&&u.content instanceof Vn)l=u.content.type;else return null}else throw tr();a>=0?c=l._length:c=0}return WH(l,c,t.assoc)};class Oc{constructor(e,n){this.ds=e,this.sv=n}}const GH=(t,e)=>{const n=t.ds.clients,r=e.ds.clients,o=t.sv,i=e.sv;if(o.size!==i.size||n.size!==r.size)return!1;for(const[s,a]of o.entries())if(i.get(s)!==a)return!1;for(const[s,a]of n.entries()){const l=r.get(s)||[];if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++){const u=a[c],d=l[c];if(u.clock!==d.clock||u.len!==d.len)return!1}}return!0},JH=(t,e=new FC)=>(Cc(e,t.ds),jH(e,t.sv),e.toUint8Array()),XH=t=>JH(t,new Ec),YH=(t,e=new NH(bc(t)))=>new Oc(Ip(e),$H(e)),Np=t=>YH(t,new Lp(bc(t))),Rp=(t,e)=>new Oc(t,e),QH=Rp(Sc(),new Map),jC=t=>Rp(DH(t.store),kc(t.store)),xo=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!_o(e.ds,t.id),Fp=(t,e)=>{const n=So(t.meta,Fp,Co),r=t.doc.store;n.has(e)||(e.sv.forEach((o,i)=>{o<Ot(r,i)&&Jt(t,Ye(i,o))}),Vr(t,e.ds,o=>{}),n.add(e))};class ZH{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const kc=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const o=n[n.length-1];e.set(r,o.id.clock+o.length)}),e},Ot=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},zC=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw tr()}n.push(e)},or=(t,e)=>{let n=0,r=t.length-1,o=t[r],i=o.id.clock;if(i===e)return r;let s=Hr(e/(i+o.length-1)*r);for(;n<=r;){if(o=t[s],i=o.id.clock,i<=e){if(e<i+o.length)return s;n=s+1}else r=s-1;s=Hr((n+r)/2)}throw tr()},hi=(t,e)=>{const n=t.clients.get(e.client);return n[or(n,e.clock)]},Hp=(t,e,n)=>{const r=or(e,n),o=e[r];return o.id.clock<n&&o instanceof nt?(e.splice(r+1,0,bE(t,o,n-o.id.clock)),r+1):r},Jt=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Hp(t,n,e.clock)]},UC=(t,e,n)=>{const r=e.clients.get(n.client),o=or(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==jr&&r.splice(o+1,0,bE(t,i,n.clock-i.id.clock+1)),i},e4=(t,e,n)=>{const r=t.clients.get(e.id.client);r[or(r,e.id.clock)]=n},qC=(t,e,n,r,o)=>{if(r===0)return;const i=n+r;let s=Hp(t,e,n),a;do a=e[s++],i<a.id.clock+a.length&&Hp(t,e,i),o(a);while(s<e.length&&e[s].id.clock<i)};class t4{constructor(e,n,r){this.doc=e,this.deleteSet=new Ds,this.beforeState=kc(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const WC=(t,e)=>e.deleteSet.clients.size===0&&!A5(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Mp(e.deleteSet),VH(t,e),Cc(t,e.deleteSet),!0),KC=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&So(t.changed,e,Co).add(n)},Mc=(t,e)=>{let n=t[e],r=t[e-1],o=e;for(;o>0;n=r,r=t[--o-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof nt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const i=e-o;return i&&t.splice(e+1-i,i),i},n4=(t,e,n)=>{for(const[r,o]of t.clients.entries()){const i=e.clients.get(r);for(let s=o.length-1;s>=0;s--){const a=o[s],l=a.clock+a.len;for(let c=or(i,a.clock),u=i[c];c<i.length&&u.id.clock<l;u=i[++c]){const d=i[c];if(a.clock+a.len<=d.id.clock)break;d instanceof nt&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},r4=(t,e)=>{t.clients.forEach((n,r)=>{const o=e.clients.get(r);for(let i=n.length-1;i>=0;i--){const s=n[i],a=yc(o.length-1,1+or(o,s.clock+s.len-1));for(let l=a,c=o[l];l>0&&c.id.clock>=s.clock;c=o[l])l-=1+Mc(o,l)}})},GC=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{Mp(i),n.afterState=kc(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,d)=>u.path.length-d.path.length),$C(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),Ep(a,[]),n._needFormattingCleanup&&m4(n)}finally{r.gc&&n4(i,o,r.gcFilter),r4(i,o),n.afterState.forEach((u,d)=>{const h=n.beforeState.get(d)||0;if(h!==u){const f=o.clients.get(d),p=li(or(f,h),1);for(let g=f.length-1;g>=p;)g-=1+Mc(f,g)}});for(let u=s.length-1;u>=0;u--){const{client:d,clock:h}=s[u].id,f=o.clients.get(d),p=or(f,h);p+1<f.length&&Mc(f,p+1)>1||p>0&&Mc(f,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(MH(Tp,MC,"[yjs] ",PC,IC,"Changed the client-id because another client seems to be using it."),r.clientID=RC()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new RH;WC(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new FH;WC(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):GC(t,e+1)}}},tt=(t,e,n=null,r=!0)=>{const o=t._transactionCleanups;let i=!1,s=null;t._transaction===null&&(i=!0,t._transaction=new t4(t,n,r),o.push(t._transaction),o.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(i){const a=t._transaction===o[0];t._transaction=null,a&&GC(o,0)}}return s};class o4{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const JC=(t,e,n)=>{Vr(t,n.deletions,r=>{r instanceof nt&&e.scope.some(o=>Rs(o,r))&&Wp(r,!1)})},XC=(t,e,n)=>{let r=null;const o=t.doc,i=t.scope;if(tt(o,s=>{for(;e.length>0&&t.currStackItem===null;){const a=o.store,l=e.pop(),c=new Set,u=[];let d=!1;Vr(s,l.insertions,h=>{if(h instanceof nt){if(h.redone!==null){let{item:f,diff:p}=qp(a,h.id);p>0&&(f=Jt(s,Ye(f.id.client,f.id.clock+p))),h=f}!h.deleted&&i.some(f=>Rs(f,h))&&u.push(h)}}),Vr(s,l.deletions,h=>{h instanceof nt&&i.some(f=>Rs(f,h))&&!_o(l.insertions,h.id)&&c.add(h)}),c.forEach(h=>{d=SE(s,h,c,l.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let h=u.length-1;h>=0;h--){const f=u[h];t.deleteFilter(f)&&(f.delete(s),d=!0)}t.currStackItem=d?l:null}s.changed.forEach((a,l)=>{a.has(null)&&l._searchMarker&&(l._searchMarker.length=0)}),r=s},t),t.currStackItem!=null){const s=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:t.currStackItem,type:n,changedParentTypes:s,origin:t},t]),t.currStackItem=null}return t.currStackItem};class YC extends hC{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:o=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:s=!1,doc:a=fp(e)?e[0].doc:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=o,i.add(this),this.trackedOrigins=i,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=s,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(m=>l.changedParentTypes.has(m))||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const c=this.undoing,u=this.redoing,d=c?this.redoStack:this.undoStack;c?this.stopCapturing():u||this.clear(!1,!0);const h=new Ds;l.afterState.forEach((m,v)=>{const C=l.beforeState.get(v)||0,w=m-C;w>0&&Pp(h,v,C,w)});const f=iH();let p=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&d.length>0&&!c&&!u){const m=d[d.length-1];m.deletions=wc([m.deletions,l.deleteSet]),m.insertions=wc([m.insertions,h])}else d.push(new o4(l.deleteSet,h)),p=!0;!c&&!u&&(this.lastChange=f),Vr(l,l.deleteSet,m=>{m instanceof nt&&this.scope.some(v=>Rs(v,m))&&Wp(m,!0)});const g=[{stackItem:d[d.length-1],origin:l.origin,type:c?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){e=fp(e)?e:[e],e.forEach(n=>{this.scope.every(r=>r!==n)&&(n.doc!==this.doc&&PH("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(o=>JC(r,this,o)),this.undoStack=[]),n&&(this.redoStack.forEach(o=>JC(r,this,o)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=XC(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=XC(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}const QC="You must not compute changes after the event-handler fired.";class Pc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=i4(this.currentTarget,this.target))}deletes(e){return _o(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Br(QC);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(o=>{if(o!==null){const i=n._map.get(o);let s,a;if(this.adds(i)){let l=i.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))s="delete",a=dp(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=dp(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(i))s="delete",a=dp(i.content.getContent());else return;e.set(o,{action:s,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Br(QC);const n=this.target,r=Co(),o=Co(),i=[];if(e={added:r,deleted:o,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&i.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,o.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const i4=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,o=e._item.parent._start;for(;o!==e._item&&o!==null;)o.deleted||r++,o=o.right;n.unshift(r)}e=e._item.parent}return n},ZC=80;let Bp=0;class s4{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Bp++}}const a4=t=>{t.timestamp=Bp++},eE=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Bp++},l4=(t,e,n)=>{if(t.length>=ZC){const r=t.reduce((o,i)=>o.timestamp<i.timestamp?o:i);return eE(r,e,n),r}else{const r=new s4(e,n);return t.push(r),r}},Ic=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((i,s)=>mc(e-i.index)<mc(e-s.index)?i:s);let r=t._start,o=0;for(n!==null&&(r=n.p,o=n.index,a4(n));r.right!==null&&o<e;){if(!r.deleted&&r.countable){if(e<o+r.length)break;o+=r.length}r=r.right}for(;r.left!==null&&o>e;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return n!==null&&mc(n.index-o)<r.parent.length/ZC?(eE(n,r,o),n):l4(t._searchMarker,r,o)},Fs=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const o=t[r];if(n>0){let i=o.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(o.index-=i.length);if(i===null||i.marker===!0){t.splice(r,1);continue}o.p=i,i.marker=!0}(e<o.index||n>0&&e===o.index)&&(o.index=li(e,o.index+n))}},Lc=(t,e,n)=>{const r=t,o=e.changedParentTypes;for(;So(o,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;$C(r._eH,n,e)};class kt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=HC(),this._dEH=HC(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw Sn()}clone(){throw Sn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){BC(this._eH,e)}observeDeep(e){BC(this._dEH,e)}unobserve(e){VC(this._eH,e)}unobserveDeep(e){VC(this._dEH,e)}toJSON(){}}const tE=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const o=[];let i=t._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){const s=i.content.getContent();if(s.length<=e)e-=s.length;else{for(let a=e;a<s.length&&r>0;a++)o.push(s[a]),r--;e=0}}i=i.right}return o},nE=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let o=0;o<r.length;o++)e.push(r[o])}n=n.right}return e},rE=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&xo(r,e)){const o=r.content.getContent();for(let i=0;i<o.length;i++)n.push(o[i])}r=r.right}return n},Hs=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let i=0;i<o.length;i++)e(o[i],n++,t)}r=r.right}},oE=(t,e)=>{const n=[];return Hs(t,(r,o)=>{n.push(e(r,o,t))}),n},c4=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const o=n[r++];return n.length<=r&&(n=null),{done:!1,value:o}}}},iE=(t,e)=>{const n=Ic(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Dc=(t,e,n,r)=>{let o=n;const i=t.doc,s=i.clientID,a=i.store,l=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new nt(Ye(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new vi(c)),o.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:o=new nt(Ye(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Hc(new Uint8Array(d))),o.integrate(t,0);break;case fi:o=new nt(Ye(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Vc(d)),o.integrate(t,0);break;default:if(d instanceof kt)o=new nt(Ye(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Vn(d)),o.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},sE=()=>Br("Length exceeded!"),aE=(t,e,n,r)=>{if(n>e._length)throw sE();if(n===0)return e._searchMarker&&Fs(e._searchMarker,n,r.length),Dc(t,e,null,r);const o=n,i=Ic(e,n);let s=e._start;for(i!==null&&(s=i.p,n-=i.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&Jt(t,Ye(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&Fs(e._searchMarker,o,r.length),Dc(t,e,s,r)},u4=(t,e,n)=>{let o=(e._searchMarker||[]).reduce((i,s)=>s.index>i.index?s:i,{index:0,p:e._start}).p;if(o)for(;o.right;)o=o.right;return Dc(t,e,o,n)},lE=(t,e,n,r)=>{if(r===0)return;const o=n,i=r,s=Ic(e,n);let a=e._start;for(s!==null&&(a=s.p,n-=s.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&Jt(t,Ye(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&Jt(t,Ye(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw sE();e._searchMarker&&Fs(e._searchMarker,o,-i+r)},Nc=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},Vp=(t,e,n,r)=>{const o=e._map.get(n)||null,i=t.doc,s=i.clientID;let a;if(r==null)a=new vi([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new vi([r]);break;case Uint8Array:a=new Hc(r);break;case fi:a=new Vc(r);break;default:if(r instanceof kt)a=new Vn(r);else throw new Error("Unexpected content type")}new nt(Ye(s,Ot(i.store,s)),o,o&&o.lastId,null,null,e,n,a).integrate(t,0)},$p=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},cE=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},uE=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},d4=(t,e)=>{const n={};return t._map.forEach((r,o)=>{let i=r;for(;i!==null&&(!e.sv.has(i.id.client)||i.id.clock>=(e.sv.get(i.id.client)||0));)i=i.left;i!==null&&xo(i,e)&&(n[o]=i.content.getContent()[i.length-1])}),n},Rc=t=>IH(t.entries(),e=>!e[1].deleted);class f4 extends Pc{constructor(e,n){super(e,n),this._transaction=n}}class Ao extends kt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Ao;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ao}clone(){const e=new Ao;return e.insert(0,this.toArray().map(n=>n instanceof kt?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Lc(this,e,new f4(this,e))}insert(e,n){this.doc!==null?tt(this.doc,r=>{aE(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?tt(this.doc,n=>{u4(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?tt(this.doc,r=>{lE(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return iE(this,e)}toArray(){return nE(this)}slice(e=0,n=this.length){return tE(this,e,n)}toJSON(){return this.map(e=>e instanceof kt?e.toJSON():e)}map(e){return oE(this,e)}forEach(e){Hs(this,e)}[Symbol.iterator](){return c4(this)}_write(e){e.writeTypeRef(S4)}}class h4 extends Pc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Bs extends kt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,o)=>{this.set(o,r)}),this._prelimContent=null}_copy(){return new Bs}clone(){const e=new Bs;return this.forEach((n,r)=>{e.set(r,n instanceof kt?n.clone():n)}),e}_callObserver(e,n){Lc(this,e,new h4(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const o=n.content.getContent()[n.length-1];e[r]=o instanceof kt?o.toJSON():o}}),e}get size(){return[...Rc(this._map)].length}keys(){return Op(Rc(this._map),e=>e[0])}values(){return Op(Rc(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Op(Rc(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?tt(this.doc,n=>{Nc(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?tt(this.doc,r=>{Vp(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return $p(this,e)}has(e){return uE(this,e)}clear(){this.doc!==null?tt(this.doc,e=>{this.forEach(function(n,r,o){Nc(e,o,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(C4)}}const $r=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&pH(t,e);class jp{constructor(e,n,r,o){this.left=e,this.right=n,this.index=r,this.currentAttributes=o}forward(){switch(this.right===null&&tr(),this.right.content.constructor){case vt:this.right.deleted||pi(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const dE=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case vt:e.right.deleted||pi(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Jt(t,Ye(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Fc=(t,e,n,r)=>{const o=new Map,i=r?Ic(e,n):null;if(i){const s=new jp(i.p.left,i.p,i.index,o);return dE(t,s,n-i.index)}else{const s=new jp(null,e._start,0,o);return dE(t,s,n)}},fE=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===vt&&$r(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=t.doc,i=o.clientID;r.forEach((s,a)=>{const l=n.left,c=n.right,u=new nt(Ye(i,Ot(o.store,i)),l,l&&l.lastId,c,c&&c.id,e,null,new vt(a,s));u.integrate(t,0),n.right=u,n.forward()})},pi=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},hE=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===vt&&$r(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},pE=(t,e,n,r)=>{const o=t.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!$r(c,l)){s.set(a,c);const{left:u,right:d}=n;n.right=new nt(Ye(i,Ot(o.store,i)),u,u&&u.lastId,d,d&&d.id,e,null,new vt(a,l)),n.right.integrate(t,0),n.forward()}}return s},zp=(t,e,n,r,o)=>{n.currentAttributes.forEach((h,f)=>{o[f]===void 0&&(o[f]=null)});const i=t.doc,s=i.clientID;hE(n,o);const a=pE(t,e,n,o),l=r.constructor===String?new Bn(r):r instanceof kt?new Vn(r):new yi(r);let{left:c,right:u,index:d}=n;e._searchMarker&&Fs(e._searchMarker,n.index,l.getLength()),u=new nt(Ye(s,Ot(i.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,l),u.integrate(t,0),n.right=u,n.index=d,n.forward(),fE(t,e,n,a)},gE=(t,e,n,r,o)=>{const i=t.doc,s=i.clientID;hE(n,o);const a=pE(t,e,n,o);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===vt));){if(!n.right.deleted)switch(n.right.content.constructor){case vt:{const{key:l,value:c}=n.right.content,u=o[l];if(u!==void 0){if($r(u,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r<n.right.length&&Jt(t,Ye(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
210
- `;n.right=new nt(Ye(s,Ot(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Bn(l)),n.right.integrate(t,0),n.forward()}fE(t,e,n,a)},mE=(t,e,n,r,o)=>{let i=e;const s=Rn();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===vt){const c=i.content;s.set(c.key,c)}i=i.right}let a=0,l=!1;for(;e!==i;){if(n===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case vt:{const{key:u,value:d}=c,h=r.get(u)??null;(s.get(u)!==c||h===d)&&(e.delete(t),a++,!l&&(o.get(u)??null)===d&&h!==d&&(h===null?o.delete(u):o.set(u,h))),!l&&!e.deleted&&pi(o,c);break}}}e=e.right}return a},p4=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===vt){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},g4=t=>{let e=0;return tt(t.doc,n=>{let r=t._start,o=t._start,i=Rn();const s=up(i);for(;o;){if(o.deleted===!1)switch(o.content.constructor){case vt:pi(s,o.content);break;default:e+=mE(n,r,o,i,s),i=up(s),r=o;break}o=o.right}}),e},m4=t=>{const e=new Set,n=t.doc;for(const[r,o]of t.afterState.entries()){const i=t.beforeState.get(r)||0;o!==i&&qC(t,n.store.clients.get(r),i,o,s=>{!s.deleted&&s.content.constructor===vt&&s.constructor!==jr&&e.add(s.parent)})}tt(n,r=>{Vr(t,t.deleteSet,o=>{if(o instanceof jr||!o.parent._hasFormatting||e.has(o.parent))return;const i=o.parent;o.content.constructor===vt?e.add(i):p4(r,o)});for(const o of e)g4(o)})},yE=(t,e,n)=>{const r=n,o=up(e.currentAttributes),i=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Vn:case yi:case Bn:n<e.right.length&&Jt(t,Ye(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}i&&mE(t,i,e.right,o,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&Fs(s._searchMarker,e.index,-r+n),e};class y4 extends Pc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];tt(e,r=>{const o=new Map,i=new Map;let s=this.target._start,a=null;const l={};let c="",u=0,d=0;const h=()=>{if(a!==null){let f=null;switch(a){case"delete":d>0&&(f={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(f={insert:c},o.size>0&&(f.attributes={},o.forEach((p,g)=>{p!==null&&(f.attributes[g]=p)}))),c="";break;case"retain":u>0&&(f={retain:u},dH(l)||(f.attributes=cH({},l))),u=0;break}f&&n.push(f),a=null}};for(;s!==null;){switch(s.content.constructor){case Vn:case yi:this.adds(s)?this.deletes(s)||(h(),a="insert",c=s.content.getContent()[0],h()):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=1):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=1);break;case Bn:this.adds(s)?this.deletes(s)||(a!=="insert"&&(h(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=s.length):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=s.length);break;case vt:{const{key:f,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const g=o.get(f)??null;$r(g,p)?p!==null&&s.delete(r):(a==="retain"&&h(),$r(p,i.get(f)??null)?delete l[f]:l[f]=p)}}else if(this.deletes(s)){i.set(f,p);const g=o.get(f)??null;$r(g,p)||(a==="retain"&&h(),l[f]=g)}else if(!s.deleted){i.set(f,p);const g=l[f];g!==void 0&&($r(g,p)?g!==null&&s.delete(r):(a==="retain"&&h(),p===null?delete l[f]:l[f]=p))}s.deleted||(a==="insert"&&h(),pi(o,s.content));break}}s=s.right}for(h();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class gi extends kt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new gi}clone(){const e=new gi;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new y4(this,e,n);Lc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Bn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?tt(this.doc,r=>{const o=new jp(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const s=e[i];if(s.insert!==void 0){const a=!n&&typeof s.insert=="string"&&i===e.length-1&&o.right===null&&s.insert.slice(-1)===`
211
- `?s.insert.slice(0,-1):s.insert;(typeof a!="string"||a.length>0)&&zp(r,this,o,a,s.attributes||{})}else s.retain!==void 0?gE(r,this,o,s.retain,s.attributes||{}):s.delete!==void 0&&yE(r,o,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const o=[],i=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const d={};let h=!1;i.forEach((p,g)=>{h=!0,d[g]=p});const f={insert:a};h&&(f.attributes=d),o.push(f),a=""}}const u=()=>{for(;l!==null;){if(xo(l,e)||n!==void 0&&xo(l,n))switch(l.content.constructor){case Bn:{const d=i.get("ychange");e!==void 0&&!xo(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!xo(l,n)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",l.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),a+=l.content.str;break}case Vn:case yi:{c();const d={insert:l.content.getContent()[0]};if(i.size>0){const h={};d.attributes=h,i.forEach((f,p)=>{h[p]=f})}o.push(d);break}case vt:xo(l,e)&&(c(),pi(i,l.content));break}l=l.right}c()};return e||n?tt(s,d=>{e&&Fp(d,e),n&&Fp(d,n),u()},"cleanup"):u(),o}insert(e,n,r){if(n.length<=0)return;const o=this.doc;o!==null?tt(o,i=>{const s=Fc(i,this,e,!r);r||(r={},s.currentAttributes.forEach((a,l)=>{r[l]=a})),zp(i,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const o=this.doc;o!==null?tt(o,i=>{const s=Fc(i,this,e,!r);zp(i,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?tt(r,o=>{yE(o,Fc(o,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const o=this.doc;o!==null?tt(o,i=>{const s=Fc(i,this,e,!1);s.right!==null&&gE(i,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?tt(this.doc,n=>{Nc(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?tt(this.doc,r=>{Vp(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return $p(this,e)}getAttributes(){return cE(this)}_write(e){e.writeTypeRef(E4)}}class Up{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Xt||n.constructor===mi)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class mi extends kt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new mi}clone(){const e=new mi;return e.insert(0,this.toArray().map(n=>n instanceof kt?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Up(this,e)}querySelector(e){e=e.toUpperCase();const r=new Up(this,o=>o.nodeName&&o.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Eo(new Up(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Lc(this,e,new v4(this,n,e))}toString(){return oE(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const o=e.createDocumentFragment();return r!==void 0&&r._createAssociation(o,this),Hs(this,i=>{o.insertBefore(i.toDOM(e,n,r),null)}),o}insert(e,n){this.doc!==null?tt(this.doc,r=>{aE(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)tt(this.doc,r=>{const o=e&&e instanceof kt?e._item:e;Dc(r,this,o,n)});else{const r=this._prelimContent,o=e===null?0:r.findIndex(i=>i===e)+1;if(o===0&&e!==null)throw Br("Reference item not found");r.splice(o,0,...n)}}delete(e,n=1){this.doc!==null?tt(this.doc,r=>{lE(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return nE(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return iE(this,e)}slice(e=0,n=this.length){return tE(this,e,n)}forEach(e){Hs(this,e)}_write(e){e.writeTypeRef(x4)}}class Xt extends mi{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,o)=>{this.setAttribute(o,r)}),this._prelimAttrs=null}_copy(){return new Xt(this.nodeName)}clone(){const e=new Xt(this.nodeName),n=this.getAttributes();return uH(n,(r,o)=>{typeof r=="string"&&e.setAttribute(o,r)}),e.insert(0,this.toArray().map(r=>r instanceof kt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const o=r.length;for(let a=0;a<o;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const i=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${i}${s}>${super.toString()}</${i}>`}removeAttribute(e){this.doc!==null?tt(this.doc,n=>{Nc(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?tt(this.doc,r=>{Vp(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return $p(this,e)}hasAttribute(e){return uE(this,e)}getAttributes(e){return e?d4(this,e):cE(this)}toDOM(e=document,n={},r){const o=e.createElement(this.nodeName),i=this.getAttributes();for(const s in i){const a=i[s];typeof a=="string"&&o.setAttribute(s,a)}return Hs(this,s=>{o.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(o,this),o}_write(e){e.writeTypeRef(_4),e.writeKey(this.nodeName)}}class v4 extends Pc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}}class yn extends gi{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new yn}clone(){const e=new yn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const o=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(o,this),o}toString(){return this.toDelta().map(e=>{const n=[];for(const o in e.attributes){const i=[];for(const s in e.attributes[o])i.push({key:s,value:e.attributes[o][s]});i.sort((s,a)=>s.key<a.key?-1:1),n.push({nodeName:o,attrs:i})}n.sort((o,i)=>o.nodeName<i.nodeName?-1:1);let r="";for(let o=0;o<n.length;o++){const i=n[o];r+=`<${i.nodeName}`;for(let s=0;s<i.attrs.length;s++){const a=i.attrs[s];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let o=n.length-1;o>=0;o--)r+=`</${n[o].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(A4)}}class vE{constructor(e,n){this.id=e,this.length=n}get deleted(){throw Sn()}mergeWith(e){return!1}write(e,n,r){throw Sn()}integrate(e,n){throw Sn()}}const b4=0;class jr extends vE{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),zC(e.doc.store,this)}write(e,n){e.writeInfo(b4),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Hc{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Hc(this.content)}splice(e){throw Sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class Bc{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Bc(this.len)}splice(e){const n=new Bc(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Pp(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const w4=(t,e)=>new fi({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Vc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Vc(w4(this.doc.guid,this.opts))}splice(e){throw Sn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class yi{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new yi(this.embed)}splice(e){throw Sn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class vt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new vt(this.key,this.value)}splice(e){throw Sn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class vi{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new vi(this.arr)}splice(e){const n=new vi(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let o=n;o<r;o++){const i=this.arr[o];e.writeAny(i)}}getRef(){return 8}}class Bn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Bn(this.str)}splice(e){const n=new Bn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const S4=0,C4=1,E4=2,_4=3,x4=4,A4=6;class Vn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Vn(this.type._copy())}splice(e){throw Sn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const qp=(t,e)=>{let n=e,r=0,o;do r>0&&(n=Ye(n.client,n.clock+r)),o=hi(t,n),r=n.clock-o.id.clock,n=o.redone;while(n!==null&&o instanceof nt);return{item:o,diff:r}},Wp=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},bE=(t,e,n)=>{const{client:r,clock:o}=e.id,i=new nt(Ye(r,o+n),e,Ye(r,o+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=Ye(e.redone.client,e.redone.clock+n)),e.right=i,i.right!==null&&(i.right.left=i),t._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=n,i},wE=(t,e)=>O5(t,n=>_o(n.deletions,e)),SE=(t,e,n,r,o,i)=>{const s=t.doc,a=s.store,l=s.clientID,c=e.redone;if(c!==null)return Jt(t,c);let u=e.parent._item,d=null,h;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||SE(t,u,n,r,o,i)===null))return null;for(;u.redone!==null;)u=Jt(t,u.redone)}const f=u===null?e.parent:u.content.type;if(e.parentSub===null){for(d=e.left,h=e;d!==null;){let v=d;for(;v!==null&&v.parent._item!==u;)v=v.redone===null?null:Jt(t,v.redone);if(v!==null&&v.parent._item===u){d=v;break}d=d.left}for(;h!==null;){let v=h;for(;v!==null&&v.parent._item!==u;)v=v.redone===null?null:Jt(t,v.redone);if(v!==null&&v.parent._item===u){h=v;break}h=h.right}}else if(h=null,e.right&&!o){for(d=e;d!==null&&d.right!==null&&(d.right.redone||_o(r,d.right.id)||wE(i.undoStack,d.right.id)||wE(i.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Jt(t,d.redone);if(d&&d.right!==null)return null}else d=f._map.get(e.parentSub)||null;const p=Ot(a,l),g=Ye(l,p),m=new nt(g,d,d&&d.lastId,h,h&&h.id,f,e.parentSub,e.content.copy());return e.redone=g,Wp(m,!0),m.integrate(t,0),m};class nt extends vE{constructor(e,n,r,o,i,s,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=o,this.rightOrigin=i,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?gC:0}set marker(e){(this.info&pp)>0!==e&&(this.info^=pp)}get marker(){return(this.info&pp)>0}get keep(){return(this.info&pC)>0}set keep(e){this.keep!==e&&(this.info^=pC)}get countable(){return(this.info&gC)>0}get deleted(){return(this.info&hp)>0}set deleted(e){this.deleted!==e&&(this.info^=hp)}markDeleted(){this.info|=hp}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Ot(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Ot(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===_c&&this.id.client!==this.parent.client&&this.parent.clock>=Ot(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=UC(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Jt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===jr||this.right&&this.right.constructor===jr)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===nt&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===nt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===_c){const r=hi(n,this.parent);r.constructor===jr?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=UC(e,e.doc.store,Ye(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,o;if(r!==null)o=r.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;const i=new Set,s=new Set;for(;o!==null&&o!==this.right;){if(s.add(o),i.add(o),xc(this.origin,o.origin)){if(o.id.client<this.id.client)r=o,i.clear();else if(xc(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&s.has(hi(e.doc.store,o.origin)))i.has(hi(e.doc.store,o.origin))||(r=o,i.clear());else break;o=o.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),zC(e.doc.store,this),this.content.integrate(e,this),KC(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new jr(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ye(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&xc(e.origin,this.lastId)&&this.right===e&&xc(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Pp(e.deleteSet,this.id.client,this.id.clock,this.length),KC(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw tr();this.content.gc(e),n?e4(e,this,new jr(this.id,this.length)):this.content=new Bc(this.length)}write(e,n){const r=n>0?Ye(this.id.client,this.id.clock+n-1):this.origin,o=this.rightOrigin,i=this.parentSub,s=this.content.getRef()&P5|(r===null?0:Ms)|(o===null?0:mC)|(i===null?0:M5);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),o!==null&&e.writeRightID(o),r===null&&o===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=Ns(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===_c?(e.writeParentInfo(!1),e.writeLeftID(a)):tr();i!==null&&e.writeString(i)}this.content.write(e,n)}}const CE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},EE="__ $YJS$ __";CE[EE]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),CE[EE]=!0;const T4=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},O4=/[\uD800-\uDBFF]/,k4=/[\uDC00-\uDFFF]/,M4=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&O4.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&k4.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},ft=new yt("y-sync"),ir=new yt("y-undo");new yt("yjs-cursor");const $c=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!_o(e.ds,t.id),P4=[{light:"#ecd44433",dark:"#ecd444"}],I4=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=Co();t.forEach(o=>r.add(o)),e=e.filter(o=>!r.has(o))}t.set(n,nH(e))}return t.get(n)},L4=(t,{colors:e=P4,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:o=()=>{}}={})=>{let i=!1,s;const a=new lt({props:{editable:l=>{const c=ft.getState(l);return c.snapshot==null&&c.prevSnapshot==null}},key:ft,state:{init:(l,c)=>({type:t,doc:t.doc,binding:null,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(l,c)=>{const u=l.getMeta(ft);if(u!==void 0){c=Object.assign({},c);for(const d in u)c[d]=u[d]}return c.addToHistory=l.getMeta("addToHistory")!==!1,c.isChangeOrigin=u!==void 0&&!!u.isChangeOrigin,c.isUndoRedoOperation=u!==void 0&&!!u.isChangeOrigin&&!!u.isUndoRedoOperation,c.binding!==null&&u!==void 0&&(u.snapshot!=null||u.prevSnapshot!=null)&&Ap(0,()=>{c.binding==null||c.binding.isDestroyed||(u.restore==null?c.binding._renderSnapshot(u.snapshot,u.prevSnapshot,c):(c.binding._renderSnapshot(u.snapshot,u.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,c.binding.mux(()=>{c.binding._prosemirrorChanged(c.binding.prosemirrorView.state.doc)})))}),c}},view:l=>{const c=new N4(t,l);return s!=null&&s.destroy(),s=Ap(0,()=>{c._forceRerender(),l.dispatch(l.state.tr.setMeta(ft,{binding:c})),o()}),{update:()=>{const u=a.getState(l.state);if(u.snapshot==null&&u.prevSnapshot==null&&(i||l.state.doc.content.findDiffStart(l.state.doc.type.createAndFill().content)!==null)){if(i=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=ir.getState(l.state),h=d&&d.undoManager;h&&h.stopCapturing()}c.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),c._prosemirrorChanged(l.state.doc)},ft)})}},destroy:()=>{s.destroy(),c.destroy()}}}});return a},D4=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null){const r=ME(n.doc,n.type,e.anchor,n.mapping),o=ME(n.doc,n.type,e.head,n.mapping);r!==null&&o!==null&&(t=t.setSelection(Le.create(t.doc,r,o)))}},Kp=(t,e)=>({anchor:kE(e.selection.anchor,t.type,t.mapping),head:kE(e.selection.head,t.type,t.mapping)});class N4{constructor(e,n){this.type=e,this.prosemirrorView=n,this.mux=T4(),this.isDestroyed=!1,this.mapping=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&(this.beforeTransactionSelection=Kp(this,n.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),e.observeDeep(this._observeFunction),this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(mH&&this._domSelectionInView===null&&(Ap(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection(),n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const o=n.getBoundingClientRect(),i=wH.documentElement;return o.bottom>=0&&o.right>=0&&o.left<=(window.innerWidth||i.clientWidth||0)&&o.top<=(window.innerHeight||i.clientHeight||0)}renderSnapshot(e,n){n||(n=Rp(Sc(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(ft,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>jc(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(e),0,0));n.setMeta(ft,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>jc(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(e),0,0));this.prosemirrorView.dispatch(n.setMeta(ft,{isChangeOrigin:!0}))})}_renderSnapshot(e,n,r){e||(e=jC(this.doc)),this.mapping=new Map,this.mux(()=>{this.doc.transact(o=>{const i=r.permanentUserData;i&&i.dss.forEach(c=>{Vr(o,c,u=>{})});const s=(c,u)=>{const d=c==="added"?i.getUserByClientId(u.client):i.getUserByDeletedId(u);return{user:d,type:c,color:I4(r.colorMapping,r.colors,d)}},a=rE(this.type,new Oc(n.ds,e.sv)).map(c=>!c._item.deleted||$c(c._item,e)||$c(c._item,n)?jc(c,this.prosemirrorView.state.schema,new Map,e,n,s):null).filter(c=>c!==null),l=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(a),0,0));this.prosemirrorView.dispatch(l.setMeta(ft,{isChangeOrigin:!0}))},ft)})}_typeChanged(e,n){const r=ft.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const o=(a,l)=>this.mapping.delete(l);Vr(n,n.deleteSet,a=>{if(a.constructor===nt){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(o),n.changedParentTypes.forEach(o);const i=this.type.toArray().map(a=>_E(a,this.prosemirrorView.state.schema,this.mapping)).filter(a=>a!==null);let s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(i),0,0));D4(s,this.beforeTransactionSelection,this),s=s.setMeta(ft,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof YC}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&s.scrollIntoView(),this.prosemirrorView.dispatch(s)})}_prosemirrorChanged(e){this.doc.transact(()=>{Xp(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=Kp(this,this.prosemirrorView.state)},ft)}destroy(){this.isDestroyed=!0,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions)}}const _E=(t,e,n,r,o,i)=>{const s=n.get(t);if(s===void 0){if(t instanceof Xt)return jc(t,e,n,r,o,i);throw Sn()}return s},jc=(t,e,n,r,o,i)=>{const s=[],a=l=>{if(l.constructor===Xt){const c=_E(l,e,n,r,o,i);c!==null&&s.push(c)}else{const c=R4(l,e,n,r,o,i);c!==null&&c.forEach(u=>{u!==null&&s.push(u)})}};r===void 0||o===void 0?t.toArray().forEach(a):rE(t,new Oc(o.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&($c(t._item,r)?$c(t._item,o)||(l.ychange=i?i("added",t._item.id):{type:"added"}):l.ychange=i?i("removed",t._item.id):{type:"removed"});const c=e.node(t.nodeName,l,s);return n.set(t,c),c}catch{return t.doc.transact(c=>{t._item.delete(c)},ft),n.delete(t),null}},R4=(t,e,n,r,o,i)=>{const s=[],a=t.toDelta(r,o,i);try{for(let l=0;l<a.length;l++){const c=a[l],u=[];for(const d in c.attributes)u.push(e.mark(d,c.attributes[d]));s.push(e.text(c.insert,u))}}catch{return t.doc.transact(c=>{t._item.delete(c)},ft),null}return s},F4=(t,e)=>{const n=new yn,r=t.map(o=>({insert:o.text,attributes:OE(o.marks)}));return n.applyDelta(r),e.set(n,t),n},H4=(t,e)=>{const n=new Xt(t.type.name);for(const r in t.attrs){const o=t.attrs[r];o!==null&&r!=="ychange"&&n.setAttribute(r,o)}return n.insert(0,zc(t).map(r=>Gp(r,e))),e.set(n,t),n},Gp=(t,e)=>t instanceof Array?F4(t,e):H4(t,e),xE=t=>typeof t=="object"&&t!==null,Jp=(t,e)=>{const n=Object.keys(t).filter(o=>t[o]!==null);let r=n.length===Object.keys(e).filter(o=>e[o]!==null).length;for(let o=0;o<n.length&&r;o++){const i=n[o],s=t[i],a=e[i];r=i==="ychange"||s===a||xE(s)&&xE(a)&&Jp(s,a)}return r},zc=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o.isText){const i=[];for(let s=e[r];r<e.length&&s.isText;s=e[++r])i.push(s);r--,n.push(i)}else n.push(o)}return n},AE=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,o)=>r.insert===e[o].text&&TC(r.attributes||{}).length===e[o].marks.length&&e[o].marks.every(i=>Jp(r.attributes[i.type.name]||{},i.attrs)))},Vs=(t,e)=>{if(t instanceof Xt&&!(e instanceof Array)&&Yp(t,e)){const n=zc(e);return t._length===n.length&&Jp(t.getAttributes(),e.attrs)&&t.toArray().every((r,o)=>Vs(r,n[o]))}return t instanceof yn&&e instanceof Array&&AE(t,e)},Uc=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),TE=(t,e,n)=>{const r=t.toArray(),o=zc(e),i=o.length,s=r.length,a=yc(s,i);let l=0,c=0,u=!1;for(;l<a;l++){const d=r[l],h=o[l];if(Uc(n.get(d),h))u=!0;else if(!Vs(d,h))break}for(;l+c<a;c++){const d=r[s-c-1],h=o[i-c-1];if(Uc(n.get(d),h))u=!0;else if(!Vs(d,h))break}return{equalityFactor:l+c,foundMappedChild:u}},B4=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Bn?e+=n.content.str:n.content instanceof vt&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},V4=(t,e,n)=>{n.set(t,e);const{nAttrs:r,str:o}=B4(t),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,OE(c.marks))})),{insert:s,remove:a,index:l}=M4(o,i.map(c=>c.insert).join(""));t.delete(l,a),t.insert(l,s),t.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},OE=t=>{const e={};return t.forEach(n=>{n.type.name!=="ychange"&&(e[n.type.name]=n.attrs)}),e},Xp=(t,e,n,r)=>{if(e instanceof Xt&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.set(e,n),e instanceof Xt){const d=e.getAttributes(),h=n.attrs;for(const f in h)h[f]!==null?d[f]!==h[f]&&f!=="ychange"&&e.setAttribute(f,h[f]):e.removeAttribute(f);for(const f in d)h[f]===void 0&&e.removeAttribute(f)}const o=zc(n),i=o.length,s=e.toArray(),a=s.length,l=yc(i,a);let c=0,u=0;for(;c<l;c++){const d=s[c],h=o[c];if(!Uc(r.get(d),h))if(Vs(d,h))r.set(d,h);else break}for(;u+c+1<l;u++){const d=s[a-u-1],h=o[i-u-1];if(!Uc(r.get(d),h))if(Vs(d,h))r.set(d,h);else break}t.transact(()=>{for(;a-c-u>0&&i-c-u>0;){const h=s[c],f=o[c],p=s[a-u-1],g=o[i-u-1];if(h instanceof yn&&f instanceof Array)AE(h,f)||V4(h,f,r),c+=1;else{let m=h instanceof Xt&&Yp(h,f),v=p instanceof Xt&&Yp(p,g);if(m&&v){const C=TE(h,f,r),w=TE(p,g,r);C.foundMappedChild&&!w.foundMappedChild?v=!1:!C.foundMappedChild&&w.foundMappedChild||C.equalityFactor<w.equalityFactor?m=!1:v=!1}m?(Xp(t,h,f,r),c+=1):v?(Xp(t,p,g,r),u+=1):(r.delete(e.get(c)),e.delete(c,1),e.insert(c,[Gp(f,r)]),c+=1)}}const d=a-c-u;if(a===1&&i===0&&s[0]instanceof yn?(r.delete(s[0]),s[0].delete(0,s[0].length)):d>0&&(e.slice(c,c+d).forEach(h=>r.delete(h)),e.delete(c,d)),c+u<i){const h=[];for(let f=c;f<i-u;f++)h.push(Gp(o[f],r));e.insert(c,h)}},ft)},Yp=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,kE=(t,e,n)=>{if(t===0)return Dp(e,0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof yn){if(r._length>=t)return Dp(r,t);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new Ac(r._item===null?null:r._item.id,r._item===null?Ns(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Ac(r._item===null?null:r._item.id,r._item===null?Ns(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw tr();if(t===0&&r.constructor!==yn&&r!==e)return $4(r._item.parent,r._item)}return Dp(e,e._length)},$4=(t,e)=>{let n=null,r=null;return t._item===null?r=Ns(t):n=Ye(t._item.id.client,t._item.id.clock),new Ac(n,r,e.id)},ME=(t,e,n,r)=>{const o=KH(n,t);if(o===null||o.type!==e&&!Rs(e,o.type._item))return null;let i=o.type,s=0;if(i.constructor===yn)s=o.index;else if(i._item===null||!i._item.deleted){let a=i._first,l=0;for(;l<i._length&&l<o.index&&a!==null;){if(!a.deleted){const c=a.content.type;l++,c instanceof yn?s+=c._length:s+=r.get(c).nodeSize}a=a.right}s+=1}for(;i!==e&&i._item!==null;){const a=i._item.parent;if(a._item===null||!a._item.deleted){s+=1;let l=a._first;for(;l!==null;){const c=l.content.type;if(c===i)break;l.deleted||(c instanceof yn?s+=c._length:s+=r.get(c).nodeSize),l=l.right}}i=a}return s-1},j4=t=>{const e=ir.getState(t).undoManager;if(e!=null)return e.undo(),!0},z4=t=>{const e=ir.getState(t).undoManager;if(e!=null)return e.redo(),!0},U4=new Set(["paragraph"]),q4=(t,e)=>!(t instanceof nt)||!(t.content instanceof Vn)||!(t.content.type instanceof gi||t.content.type instanceof Xt&&e.has(t.content.type.nodeName))||t.content.type._length===0,W4=({protectedNodes:t=U4,trackedOrigins:e=[],undoManager:n=null}={})=>new lt({key:ir,state:{init:(r,o)=>{const i=ft.getState(o),s=n||new YC(i.type,{trackedOrigins:new Set([ft].concat(e)),deleteFilter:a=>q4(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:s,prevSel:null,hasUndoOps:s.undoStack.length>0,hasRedoOps:s.redoStack.length>0}},apply:(r,o,i,s)=>{const a=ft.getState(s).binding,l=o.undoManager,c=l.undoStack.length>0,u=l.redoStack.length>0;return a?{undoManager:l,prevSel:Kp(a,i),hasUndoOps:c,hasRedoOps:u}:c!==o.hasUndoOps||u!==o.hasRedoOps?Object.assign({},o,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):o}},view:r=>{const o=ft.getState(r.state),i=ir.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:s})=>{const a=o.binding;a&&s.meta.set(a,ir.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:s})=>{const a=o.binding;a&&(a.beforeTransactionSelection=s.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}}),K4=gt.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),ir.getState(e).undoManager.undoStack.length===0?!1:n?j4(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),ir.getState(e).undoManager.redoStack.length===0?!1:n?z4(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=W4(),n=e.spec.view;e.spec.view=a=>{const{undoManager:l}=ir.getState(a.state);l.restore&&(l.restore(),l.restore=()=>{});const c=n?n(a):void 0;return{destroy:()=>{const u=l.trackedOrigins.has(l),d=l._observers;l.restore=()=>{u&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=d},c!=null&&c.destroy&&c.destroy()}}};const r=this.options.ySyncOptions,o=this.options.onFirstRender,i={...r?{...r}:{},...o?{onFirstRender:o}:{}};return[L4(t,i),e]}});function G4(t){const e=new UH(t);return e.setUserMapping(t,t.clientID,"Nathan"),e}function J4({defaultValue:t,readOnly:e,onChange:n,placeHolder:r,extensions:o=[],menuItems:i,commands:s,invalidateOnChange:a=!1,ydoc:l,useYjs:c,showDiff:u,extraProps:d,autoFocus:h=!0,...f}){const[p,g]=T.useState(!1),m=T.useCallback(b=>{n==null||n(b.editor.getJSON())},[n]),v=a?[t]:[],C=c?l??new fi:null,w=YN({extensions:E5(s,{placeHolderText:r}).concat(o??[]).concat(c?[K4.configure({document:C,ySyncOptions:{permanentUserData:G4(C),colors:[{light:"#bef264",dark:"#dc2626"}]}})]:[]),editorProps:_5,autofocus:h?"start":!1,editable:!e,onUpdate:m,content:t},v);return w&&(w.extras=d??{}),w==null||w.setOptions,T.useEffect(()=>{!u&&!p&&l&&(setTimeout(function(){const b=l.getArray("versions"),S=b.length===0?null:b.get(b.length-1),E=S===null?QH:Np(S==null?void 0:S.snapshot),x=jC(l);S!=null&&E.sv.set(S.clientID,(E.sv.get(S.clientID)??0)+1),GH(E,x)||b.push([{date:new Date().getTime(),snapshot:XH(x),clientID:l.clientID}])},20),g(!0))},[p,g,l]),T.useEffect(()=>{if(u&&l&&w){const b=l.getArray("versions");b.length>1&&setTimeout(function(){const S=b.get(b.length-2),E=b.get(b.length-1);w==null||w.view.dispatch(w==null?void 0:w.state.tr.setMeta(ft,{snapshot:Np(E.snapshot),prevSnapshot:Np(S.snapshot)}))},20)}},[u,w,l]),w?y.jsxs("div",{id:"editor",onClick:()=>w.chain().focus().run(),css:{"& .ProseMirror:focus, .ProseMirror:focus-visible":{outline:"none"},"& .ProseMirror p a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all",fontWeight:700},"& .ProseMirror p:first-of-type":{marginTop:0},"& .ProseMirror > :first-child":{marginTop:0},"& .ProseMirror > :last-child":{marginBottom:0}},...f,children:[w&&y.jsx(gR,{editor:w,menuItems:i}),y.jsx($N,{editor:w,style:{outline:0}})]}):null}N.ComponentManager.registerComponent("Editor.Paragraph",lC),N.ComponentManager.registerComponent("Editor.H1",wS),N.ComponentManager.registerComponent("Editor.H2",SS),N.ComponentManager.registerComponent("Editor.H3",CS),N.ComponentManager.registerComponent("Editor.BlockQuote",yS),N.ComponentManager.registerComponent("Editor.BulletList",bS),N.ComponentManager.registerComponent("Editor.OrderedList",aC),N.ComponentManager.registerComponent("Editor.ListItem",sC);const X4={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};var Y4={},Qp={},qc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return e}});let e=n=>{};if(process.env.NODE_ENV!=="production"){const n=new Set;e=r=>{n.has(r)||console.warn(r),n.add(r)}}})(qc);var PE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return e}});function e(n){let{widthInt:r,heightInt:o,blurWidth:i,blurHeight:s,blurDataURL:a,objectFit:l}=n;const c=20,u=i?i*40:r,d=s?s*40:o,h=u&&d?"viewBox='0 0 "+u+" "+d+"'":"",f=h?"none":l==="contain"?"xMidYMid":l==="cover"?"xMidYMid slice":"none";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+h+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+f+"' style='filter: url(%23b);' href='"+a+"'/%3E%3C/svg%3E"}})(PE);var Wc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});const n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}})(Wc),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return f}});const e=qc,n=PE,r=Wc,o=["lazy","eager",void 0];function i(p){return p.default!==void 0}function s(p){return p.src!==void 0}function a(p){return typeof p=="object"&&(i(p)||s(p))}const l=new Map;let c;function u(p){return typeof p>"u"?p:typeof p=="number"?Number.isFinite(p)?p:NaN:typeof p=="string"&&/^[0-9]+$/.test(p)?parseInt(p,10):NaN}function d(p,g,m){let{deviceSizes:v,allSizes:C}=p;if(m){const b=/(^|\s)(1?\d?\d)vw/g,S=[];for(let E;E=b.exec(m);E)S.push(parseInt(E[2]));if(S.length){const E=Math.min(...S)*.01;return{widths:C.filter(x=>x>=v[0]*E),kind:"w"}}return{widths:C,kind:"w"}}return typeof g!="number"?{widths:v,kind:"w"}:{widths:[...new Set([g,g*2].map(b=>C.find(S=>S>=b)||C[C.length-1]))],kind:"x"}}function h(p){let{config:g,src:m,unoptimized:v,width:C,quality:w,sizes:b,loader:S}=p;if(v)return{src:m,srcSet:void 0,sizes:void 0};const{widths:E,kind:x}=d(g,C,b),_=E.length-1;return{sizes:!b&&x==="w"?"100vw":b,srcSet:E.map((A,O)=>S({config:g,src:m,quality:w,width:A})+" "+(x==="w"?A:O+1)+x).join(", "),src:S({config:g,src:m,quality:w,width:E[_]})}}function f(p,g){let{src:m,sizes:v,unoptimized:C=!1,priority:w=!1,loading:b,className:S,quality:E,width:x,height:_,fill:A=!1,style:O,overrideSrc:k,onLoad:M,onLoadingComplete:I,placeholder:P="empty",blurDataURL:F,fetchPriority:z,decoding:V="async",layout:J,objectFit:K,objectPosition:R,lazyBoundary:Q,lazyRoot:se,...ie}=p;const{imgConf:de,showAltText:ue,blurComplete:pe,defaultLoader:D}=g;let ce,ye=de||r.imageConfigDefault;if("allSizes"in ye)ce=ye;else{var be;const re=[...ye.deviceSizes,...ye.imageSizes].sort((fe,ve)=>fe-ve),j=ye.deviceSizes.sort((fe,ve)=>fe-ve),te=(be=ye.qualities)==null?void 0:be.sort((fe,ve)=>fe-ve);ce={...ye,allSizes:re,deviceSizes:j,qualities:te}}if(typeof D>"u")throw new Error(`images.loaderFile detected but the file is missing default export.
212
- Read more: https://nextjs.org/docs/messages/invalid-images-config`);let H=ie.loader||D;delete ie.loader,delete ie.srcSet;const L="__next_img_default"in H;if(L){if(ce.loader==="custom")throw new Error('Image with src "'+m+`" is missing "loader" prop.
213
- Read more: https://nextjs.org/docs/messages/next-image-missing-loader`)}else{const re=H;H=j=>{const{config:te,...fe}=j;return re(fe)}}if(J){J==="fill"&&(A=!0);const re={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}},j={responsive:"100vw",fill:"100vw"},te=re[J];te&&(O={...O,...te});const fe=j[J];fe&&!v&&(v=fe)}let Ve="",G=u(x),ne=u(_),X,W;if(a(m)){const re=i(m)?m.default:m;if(!re.src)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(re));if(!re.height||!re.width)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(re));if(X=re.blurWidth,W=re.blurHeight,F=F||re.blurDataURL,Ve=re.src,!A){if(!G&&!ne)G=re.width,ne=re.height;else if(G&&!ne){const j=G/re.width;ne=Math.round(re.height*j)}else if(!G&&ne){const j=ne/re.height;G=Math.round(re.width*j)}}}m=typeof m=="string"?m:Ve;let $=!w&&(b==="lazy"||typeof b>"u");(!m||m.startsWith("data:")||m.startsWith("blob:"))&&(C=!0,$=!1),ce.unoptimized&&(C=!0),L&&m.endsWith(".svg")&&!ce.dangerouslyAllowSVG&&(C=!0),w&&(z="high");const ee=u(E);if(process.env.NODE_ENV!=="production"){if(ce.output==="export"&&L&&!C)throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");if(!m)C=!0;else if(A){if(x)throw new Error('Image with src "'+m+'" has both "width" and "fill" properties. Only one should be used.');if(_)throw new Error('Image with src "'+m+'" has both "height" and "fill" properties. Only one should be used.');if(O!=null&&O.position&&O.position!=="absolute")throw new Error('Image with src "'+m+'" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');if(O!=null&&O.width&&O.width!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');if(O!=null&&O.height&&O.height!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.')}else{if(typeof G>"u")throw new Error('Image with src "'+m+'" is missing required "width" property.');if(isNaN(G))throw new Error('Image with src "'+m+'" has invalid "width" property. Expected a numeric value in pixels but received "'+x+'".');if(typeof ne>"u")throw new Error('Image with src "'+m+'" is missing required "height" property.');if(isNaN(ne))throw new Error('Image with src "'+m+'" has invalid "height" property. Expected a numeric value in pixels but received "'+_+'".')}if(!o.includes(b))throw new Error('Image with src "'+m+'" has invalid "loading" property. Provided "'+b+'" should be one of '+o.map(String).join(",")+".");if(w&&b==="lazy")throw new Error('Image with src "'+m+`" has both "priority" and "loading='lazy'" properties. Only one should be used.`);if(P!=="empty"&&P!=="blur"&&!P.startsWith("data:image/"))throw new Error('Image with src "'+m+'" has invalid "placeholder" property "'+P+'".');if(P!=="empty"&&G&&ne&&G*ne<1600&&(0,e.warnOnce)('Image with src "'+m+'" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.'),P==="blur"&&!F){const re=["jpeg","png","webp","avif"];throw new Error('Image with src "'+m+`" has "placeholder='blur'" property but is missing the "blurDataURL" property.
214
- Possible solutions:
215
- - Add a "blurDataURL" property, the contents should be a small Data URL to represent the image
216
- - Change the "src" property to a static import with one of the supported file types: `+re.join(",")+` (animated images not supported)
217
- - Remove the "placeholder" property, effectively no blur effect
218
- Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url`)}if("ref"in ie&&(0,e.warnOnce)('Image with src "'+m+'" is using unsupported "ref" property. Consider using the "onLoad" property instead.'),!C&&!L){const re=H({config:ce,src:m,width:G||400,quality:ee||75});let j;try{j=new URL(re)}catch{}(re===m||j&&j.pathname===m&&!j.search)&&(0,e.warnOnce)('Image with src "'+m+`" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.
219
- Read more: https://nextjs.org/docs/messages/next-image-missing-loader-width`)}I&&(0,e.warnOnce)('Image with src "'+m+'" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.');for(const[re,j]of Object.entries({layout:J,objectFit:K,objectPosition:R,lazyBoundary:Q,lazyRoot:se}))j&&(0,e.warnOnce)('Image with src "'+m+'" has legacy prop "'+re+`". Did you forget to run the codemod?
220
- Read more: https://nextjs.org/docs/messages/next-image-upgrade-to-13`);if(typeof window<"u"&&!c&&window.PerformanceObserver){c=new PerformanceObserver(re=>{for(const te of re.getEntries()){var j;const fe=(te==null||(j=te.element)==null?void 0:j.src)||"",ve=l.get(fe);ve&&!ve.priority&&ve.placeholder==="empty"&&!ve.src.startsWith("data:")&&!ve.src.startsWith("blob:")&&(0,e.warnOnce)('Image with src "'+ve.src+`" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.
221
- Read more: https://nextjs.org/docs/api-reference/next/image#priority`)}});try{c.observe({type:"largest-contentful-paint",buffered:!0})}catch(re){console.error(re)}}}const Ce=Object.assign(A?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:K,objectPosition:R}:{},ue?{}:{color:"transparent"},O),we=!pe&&P!=="empty"?P==="blur"?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:G,heightInt:ne,blurWidth:X,blurHeight:W,blurDataURL:F||"",objectFit:Ce.objectFit})+'")':'url("'+P+'")':null;let Z=we?{backgroundSize:Ce.objectFit||"cover",backgroundPosition:Ce.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:we}:{};process.env.NODE_ENV==="development"&&Z.backgroundImage&&P==="blur"&&F!=null&&F.startsWith("/")&&(Z.backgroundImage='url("'+F+'")');const Se=h({config:ce,src:m,unoptimized:C,width:G,quality:ee,sizes:v,loader:H});if(process.env.NODE_ENV!=="production"&&typeof window<"u"){let re;try{re=new URL(Se.src)}catch{re=new URL(Se.src,window.location.href)}l.set(re.href,{src:m,priority:w,placeholder:P})}return{props:{...ie,loading:$?"lazy":b,fetchPriority:z,width:G,height:ne,decoding:V,className:S,style:{...Ce,...Z},sizes:Se.sizes,srcSet:Se.srcSet,src:k||Se.src},meta:{unoptimized:C,priority:w,placeholder:P,fill:A}}}}(Qp);var Zp={exports:{}},Kc={exports:{}},eg={},IE;function Q4(){return IE||(IE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});const e=T,n=typeof window>"u",r=n?()=>{}:e.useLayoutEffect,o=n?()=>{}:e.useEffect;function i(s){const{headManager:a,reduceComponentsToState:l}=s;function c(){if(a&&a.mountedInstances){const d=e.Children.toArray(Array.from(a.mountedInstances).filter(Boolean));a.updateHead(l(d,s))}}if(n){var u;a==null||(u=a.mountedInstances)==null||u.add(s.children),c()}return r(()=>{var d;return a==null||(d=a.mountedInstances)==null||d.add(s.children),()=>{var h;a==null||(h=a.mountedInstances)==null||h.delete(s.children)}}),r(()=>(a&&(a._pendingUpdate=c),()=>{a&&(a._pendingUpdate=c)})),o(()=>(a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null),()=>{a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null)})),null}}(eg)),eg}var tg={},LE;function Z4(){return LE||(LE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});const r=Ft._(T).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="AmpStateContext")}(tg)),tg}var ng={},DE;function eB(){return DE||(DE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return e}});function e(n){let{ampFirst:r=!1,hybrid:o=!1,hasQuery:i=!1}=n===void 0?{}:n;return r||o&&i}}(ng)),ng}var NE;function tB(){return NE||(NE=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(w,b){for(var S in b)Object.defineProperty(w,S,{enumerable:!0,get:b[S]})}n(e,{default:function(){return C},defaultHead:function(){return h}});const r=Ft,o=_i(),i=Ei,s=o._(T),a=r._(Q4()),l=Z4(),c=Wy(),u=eB(),d=qc;function h(w){w===void 0&&(w=!1);const b=[(0,i.jsx)("meta",{charSet:"utf-8"})];return w||b.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"})),b}function f(w,b){return typeof b=="string"||typeof b=="number"?w:b.type===s.default.Fragment?w.concat(s.default.Children.toArray(b.props.children).reduce((S,E)=>typeof E=="string"||typeof E=="number"?S:S.concat(E),[])):w.concat(b)}const p=["name","httpEquiv","charSet","itemProp"];function g(){const w=new Set,b=new Set,S=new Set,E={};return x=>{let _=!0,A=!1;if(x.key&&typeof x.key!="number"&&x.key.indexOf("$")>0){A=!0;const O=x.key.slice(x.key.indexOf("$")+1);w.has(O)?_=!1:w.add(O)}switch(x.type){case"title":case"base":b.has(x.type)?_=!1:b.add(x.type);break;case"meta":for(let O=0,k=p.length;O<k;O++){const M=p[O];if(x.props.hasOwnProperty(M))if(M==="charSet")S.has(M)?_=!1:S.add(M);else{const I=x.props[M],P=E[M]||new Set;(M!=="name"||!A)&&P.has(I)?_=!1:(P.add(I),E[M]=P)}}break}return _}}function m(w,b){const{inAmpMode:S}=b;return w.reduce(f,[]).reverse().concat(h(S).reverse()).filter(g()).reverse().map((E,x)=>{const _=E.key||x;if(process.env.NODE_ENV!=="development"&&process.env.__NEXT_OPTIMIZE_FONTS&&!S&&E.type==="link"&&E.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(A=>E.props.href.startsWith(A))){const A={...E.props||{}};return A["data-href"]=A.href,A.href=void 0,A["data-optimized-fonts"]=!0,s.default.cloneElement(E,A)}if(process.env.NODE_ENV==="development")if(E.type==="script"&&E.props.type!=="application/ld+json"){const A=E.props.src?'<script> tag with src="'+E.props.src+'"':"inline <script>";(0,d.warnOnce)("Do not add <script> tags using next/head (see "+A+`). Use next/script instead.
222
- See more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component`)}else E.type==="link"&&E.props.rel==="stylesheet"&&(0,d.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="'+E.props.href+`"). Use Document instead.
223
- See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component`);return s.default.cloneElement(E,{key:_})})}function v(w){let{children:b}=w;const S=(0,s.useContext)(l.AmpStateContext),E=(0,s.useContext)(c.HeadManagerContext);return(0,i.jsx)(a.default,{reduceComponentsToState:m,headManager:E,inAmpMode:(0,u.isInAmpMode)(S),children:b})}const C=v;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Kc,Kc.exports)),Kc.exports}var rg={},RE;function nB(){return RE||(RE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});const n=Ft._(T),r=Wc,o=n.default.createContext(r.imageConfigDefault);process.env.NODE_ENV!=="production"&&(o.displayName="ImageConfigContext")}(rg)),rg}var og={},ig={},sg={exports:{}},FE;function HE(){return FE||(FE=1,(()=>{var t={170:(o,i,s)=>{const a=s(510),l=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};function c(u,d,h=!1){return d&&(d.windows===null||d.windows===void 0)&&(d={...d,windows:l()}),a(u,d,h)}Object.assign(c,a),o.exports=c},154:o=>{const i="\\\\/",s=`[^${i}]`,a="\\.",l="\\+",c="\\?",u="\\/",d="(?=.)",h="[^/]",f=`(?:${u}|$)`,p=`(?:^|${u})`,g=`${a}{1,2}${f}`,m=`(?!${a})`,v=`(?!${p}${g})`,C=`(?!${a}{0,1}${f})`,w=`(?!${g})`,b=`[^.${u}]`,S=`${h}*?`,x={DOT_LITERAL:a,PLUS_LITERAL:l,QMARK_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:d,QMARK:h,END_ANCHOR:f,DOTS_SLASH:g,NO_DOT:m,NO_DOTS:v,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK_NO_DOT:b,STAR:S,START_ANCHOR:p,SEP:"/"},_={...x,SLASH_LITERAL:`[${i}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${a}{1,2}(?:[${i}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${i}])${a}{1,2}(?:[${i}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${i}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${i}]|$))`,QMARK_NO_DOT:`[^.${i}]`,START_ANCHOR:`(?:^|[${i}])`,END_ANCHOR:`(?:[${i}]|$)`,SEP:"\\"},A={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};o.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:A,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(O){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${O.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(O){return O===!0?_:x}}},697:(o,i,s)=>{const a=s(154),l=s(96),{MAX_LENGTH:c,POSIX_REGEX_SOURCE:u,REGEX_NON_SPECIAL_CHARS:d,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:f}=a,p=(v,C)=>{if(typeof C.expandRange=="function")return C.expandRange(...v,C);v.sort();const w=`[${v.join("-")}]`;try{new RegExp(w)}catch{return v.map(S=>l.escapeRegex(S)).join("..")}return w},g=(v,C)=>`Missing ${v}: "${C}" - use "\\\\${C}" to match literal characters`,m=(v,C)=>{if(typeof v!="string")throw new TypeError("Expected a string");v=f[v]||v;const w={...C},b=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c;let S=v.length;if(S>b)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${b}`);const E={type:"bos",value:"",output:w.prepend||""},x=[E],_=w.capture?"":"?:",A=a.globChars(w.windows),O=a.extglobChars(A),{DOT_LITERAL:k,PLUS_LITERAL:M,SLASH_LITERAL:I,ONE_CHAR:P,DOTS_SLASH:F,NO_DOT:z,NO_DOT_SLASH:V,NO_DOTS_SLASH:J,QMARK:K,QMARK_NO_DOT:R,STAR:Q,START_ANCHOR:se}=A,ie=B=>`(${_}(?:(?!${se}${B.dot?F:k}).)*?)`,de=w.dot?"":z,ue=w.dot?K:R;let pe=w.bash===!0?ie(w):Q;w.capture&&(pe=`(${pe})`),typeof w.noext=="boolean"&&(w.noextglob=w.noext);const D={input:v,index:-1,start:0,dot:w.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};v=l.removePrefix(v,D),S=v.length;const ce=[],ye=[],be=[];let H=E,L;const Ve=()=>D.index===S-1,G=D.peek=(B=1)=>v[D.index+B],ne=D.advance=()=>v[++D.index]||"",X=()=>v.slice(D.index+1),W=(B="",re=0)=>{D.consumed+=B,D.index+=re},$=B=>{D.output+=B.output!=null?B.output:B.value,W(B.value)},ee=()=>{let B=1;for(;G()==="!"&&(G(2)!=="("||G(3)==="?");)ne(),D.start++,B++;return B%2===0?!1:(D.negated=!0,D.start++,!0)},Ce=B=>{D[B]++,be.push(B)},we=B=>{D[B]--,be.pop()},Z=B=>{if(H.type==="globstar"){const re=D.braces>0&&(B.type==="comma"||B.type==="brace"),j=B.extglob===!0||ce.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!re&&!j&&(D.output=D.output.slice(0,-H.output.length),H.type="star",H.value="*",H.output=pe,D.output+=H.output)}if(ce.length&&B.type!=="paren"&&(ce[ce.length-1].inner+=B.value),(B.value||B.output)&&$(B),H&&H.type==="text"&&B.type==="text"){H.output=(H.output||H.value)+B.value,H.value+=B.value;return}B.prev=H,x.push(B),H=B},Se=(B,re)=>{const j={...O[re],conditions:1,inner:""};j.prev=H,j.parens=D.parens,j.output=D.output;const te=(w.capture?"(":"")+j.open;Ce("parens"),Z({type:B,value:re,output:D.output?"":P}),Z({type:"paren",extglob:!0,value:ne(),output:te}),ce.push(j)},U=B=>{let re=B.close+(w.capture?")":""),j;if(B.type==="negate"){let te=pe;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(te=ie(w)),(te!==pe||Ve()||/^\)+$/.test(X()))&&(re=B.close=`)$))${te}`),B.inner.includes("*")&&(j=X())&&/^\.[^\\/.]+$/.test(j)){const fe=m(j,{...C,fastpaths:!1}).output;re=B.close=`)${fe})${te})`}B.prev.type==="bos"&&(D.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:L,output:re}),we("parens")};if(w.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(v)){let B=!1,re=v.replace(h,(j,te,fe,ve,Ee,je)=>ve==="\\"?(B=!0,j):ve==="?"?te?te+ve+(Ee?K.repeat(Ee.length):""):je===0?ue+(Ee?K.repeat(Ee.length):""):K.repeat(fe.length):ve==="."?k.repeat(fe.length):ve==="*"?te?te+ve+(Ee?pe:""):pe:te?j:`\\${j}`);return B===!0&&(w.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,j=>j.length%2===0?"\\\\":j?"\\":"")),re===v&&w.contains===!0?(D.output=v,D):(D.output=l.wrapOutput(re,D,C),D)}for(;!Ve();){if(L=ne(),L==="\0")continue;if(L==="\\"){const j=G();if(j==="/"&&w.bash!==!0||j==="."||j===";")continue;if(!j){L+="\\",Z({type:"text",value:L});continue}const te=/^\\+/.exec(X());let fe=0;if(te&&te[0].length>2&&(fe=te[0].length,D.index+=fe,fe%2!==0&&(L+="\\")),w.unescape===!0?L=ne():L+=ne(),D.brackets===0){Z({type:"text",value:L});continue}}if(D.brackets>0&&(L!=="]"||H.value==="["||H.value==="[^")){if(w.posix!==!1&&L===":"){const j=H.value.slice(1);if(j.includes("[")&&(H.posix=!0,j.includes(":"))){const te=H.value.lastIndexOf("["),fe=H.value.slice(0,te),ve=H.value.slice(te+2),Ee=u[ve];if(Ee){H.value=fe+Ee,D.backtrack=!0,ne(),!E.output&&x.indexOf(H)===1&&(E.output=P);continue}}}(L==="["&&G()!==":"||L==="-"&&G()==="]")&&(L=`\\${L}`),L==="]"&&(H.value==="["||H.value==="[^")&&(L=`\\${L}`),w.posix===!0&&L==="!"&&H.value==="["&&(L="^"),H.value+=L,$({value:L});continue}if(D.quotes===1&&L!=='"'){L=l.escapeRegex(L),H.value+=L,$({value:L});continue}if(L==='"'){D.quotes=D.quotes===1?0:1,w.keepQuotes===!0&&Z({type:"text",value:L});continue}if(L==="("){Ce("parens"),Z({type:"paren",value:L});continue}if(L===")"){if(D.parens===0&&w.strictBrackets===!0)throw new SyntaxError(g("opening","("));const j=ce[ce.length-1];if(j&&D.parens===j.parens+1){U(ce.pop());continue}Z({type:"paren",value:L,output:D.parens?")":"\\)"}),we("parens");continue}if(L==="["){if(w.nobracket===!0||!X().includes("]")){if(w.nobracket!==!0&&w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));L=`\\${L}`}else Ce("brackets");Z({type:"bracket",value:L});continue}if(L==="]"){if(w.nobracket===!0||H&&H.type==="bracket"&&H.value.length===1){Z({type:"text",value:L,output:`\\${L}`});continue}if(D.brackets===0){if(w.strictBrackets===!0)throw new SyntaxError(g("opening","["));Z({type:"text",value:L,output:`\\${L}`});continue}we("brackets");const j=H.value.slice(1);if(H.posix!==!0&&j[0]==="^"&&!j.includes("/")&&(L=`/${L}`),H.value+=L,$({value:L}),w.literalBrackets===!1||l.hasRegexChars(j))continue;const te=l.escapeRegex(H.value);if(D.output=D.output.slice(0,-H.value.length),w.literalBrackets===!0){D.output+=te,H.value=te;continue}H.value=`(${_}${te}|${H.value})`,D.output+=H.value;continue}if(L==="{"&&w.nobrace!==!0){Ce("braces");const j={type:"brace",value:L,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};ye.push(j),Z(j);continue}if(L==="}"){const j=ye[ye.length-1];if(w.nobrace===!0||!j){Z({type:"text",value:L,output:L});continue}let te=")";if(j.dots===!0){const fe=x.slice(),ve=[];for(let Ee=fe.length-1;Ee>=0&&(x.pop(),fe[Ee].type!=="brace");Ee--)fe[Ee].type!=="dots"&&ve.unshift(fe[Ee].value);te=p(ve,w),D.backtrack=!0}if(j.comma!==!0&&j.dots!==!0){const fe=D.output.slice(0,j.outputIndex),ve=D.tokens.slice(j.tokensIndex);j.value=j.output="\\{",L=te="\\}",D.output=fe;for(const Ee of ve)D.output+=Ee.output||Ee.value}Z({type:"brace",value:L,output:te}),we("braces"),ye.pop();continue}if(L==="|"){ce.length>0&&ce[ce.length-1].conditions++,Z({type:"text",value:L});continue}if(L===","){let j=L;const te=ye[ye.length-1];te&&be[be.length-1]==="braces"&&(te.comma=!0,j="|"),Z({type:"comma",value:L,output:j});continue}if(L==="/"){if(H.type==="dot"&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",x.pop(),H=E;continue}Z({type:"slash",value:L,output:I});continue}if(L==="."){if(D.braces>0&&H.type==="dot"){H.value==="."&&(H.output=k);const j=ye[ye.length-1];H.type="dots",H.output+=L,H.value+=L,j.dots=!0;continue}if(D.braces+D.parens===0&&H.type!=="bos"&&H.type!=="slash"){Z({type:"text",value:L,output:k});continue}Z({type:"dot",value:L,output:k});continue}if(L==="?"){if(!(H&&H.value==="(")&&w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("qmark",L);continue}if(H&&H.type==="paren"){const te=G();let fe=L;(H.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(X()))&&(fe=`\\${L}`),Z({type:"text",value:L,output:fe});continue}if(w.dot!==!0&&(H.type==="slash"||H.type==="bos")){Z({type:"qmark",value:L,output:R});continue}Z({type:"qmark",value:L,output:K});continue}if(L==="!"){if(w.noextglob!==!0&&G()==="("&&(G(2)!=="?"||!/[!=<:]/.test(G(3)))){Se("negate",L);continue}if(w.nonegate!==!0&&D.index===0){ee();continue}}if(L==="+"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("plus",L);continue}if(H&&H.value==="("||w.regex===!1){Z({type:"plus",value:L,output:M});continue}if(H&&(H.type==="bracket"||H.type==="paren"||H.type==="brace")||D.parens>0){Z({type:"plus",value:L});continue}Z({type:"plus",value:M});continue}if(L==="@"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Z({type:"at",extglob:!0,value:L,output:""});continue}Z({type:"text",value:L});continue}if(L!=="*"){(L==="$"||L==="^")&&(L=`\\${L}`);const j=d.exec(X());j&&(L+=j[0],D.index+=j[0].length),Z({type:"text",value:L});continue}if(H&&(H.type==="globstar"||H.star===!0)){H.type="star",H.star=!0,H.value+=L,H.output=pe,D.backtrack=!0,D.globstar=!0,W(L);continue}let B=X();if(w.noextglob!==!0&&/^\([^?]/.test(B)){Se("star",L);continue}if(H.type==="star"){if(w.noglobstar===!0){W(L);continue}const j=H.prev,te=j.prev,fe=j.type==="slash"||j.type==="bos",ve=te&&(te.type==="star"||te.type==="globstar");if(w.bash===!0&&(!fe||B[0]&&B[0]!=="/")){Z({type:"star",value:L,output:""});continue}const Ee=D.braces>0&&(j.type==="comma"||j.type==="brace"),je=ce.length&&(j.type==="pipe"||j.type==="paren");if(!fe&&j.type!=="paren"&&!Ee&&!je){Z({type:"star",value:L,output:""});continue}for(;B.slice(0,3)==="/**";){const Ue=v[D.index+4];if(Ue&&Ue!=="/")break;B=B.slice(3),W("/**",3)}if(j.type==="bos"&&Ve()){H.type="globstar",H.value+=L,H.output=ie(w),D.output=H.output,D.globstar=!0,W(L);continue}if(j.type==="slash"&&j.prev.type!=="bos"&&!ve&&Ve()){D.output=D.output.slice(0,-(j.output+H.output).length),j.output=`(?:${j.output}`,H.type="globstar",H.output=ie(w)+(w.strictSlashes?")":"|$)"),H.value+=L,D.globstar=!0,D.output+=j.output+H.output,W(L);continue}if(j.type==="slash"&&j.prev.type!=="bos"&&B[0]==="/"){const Ue=B[1]!==void 0?"|$":"";D.output=D.output.slice(0,-(j.output+H.output).length),j.output=`(?:${j.output}`,H.type="globstar",H.output=`${ie(w)}${I}|${I}${Ue})`,H.value+=L,D.output+=j.output+H.output,D.globstar=!0,W(L+ne()),Z({type:"slash",value:"/",output:""});continue}if(j.type==="bos"&&B[0]==="/"){H.type="globstar",H.value+=L,H.output=`(?:^|${I}|${ie(w)}${I})`,D.output=H.output,D.globstar=!0,W(L+ne()),Z({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-H.output.length),H.type="globstar",H.output=ie(w),H.value+=L,D.output+=H.output,D.globstar=!0,W(L);continue}const re={type:"star",value:L,output:pe};if(w.bash===!0){re.output=".*?",(H.type==="bos"||H.type==="slash")&&(re.output=de+re.output),Z(re);continue}if(H&&(H.type==="bracket"||H.type==="paren")&&w.regex===!0){re.output=L,Z(re);continue}(D.index===D.start||H.type==="slash"||H.type==="dot")&&(H.type==="dot"?(D.output+=V,H.output+=V):w.dot===!0?(D.output+=J,H.output+=J):(D.output+=de,H.output+=de),G()!=="*"&&(D.output+=P,H.output+=P)),Z(re)}for(;D.brackets>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));D.output=l.escapeLast(D.output,"["),we("brackets")}for(;D.parens>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing",")"));D.output=l.escapeLast(D.output,"("),we("parens")}for(;D.braces>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","}"));D.output=l.escapeLast(D.output,"{"),we("braces")}if(w.strictSlashes!==!0&&(H.type==="star"||H.type==="bracket")&&Z({type:"maybe_slash",value:"",output:`${I}?`}),D.backtrack===!0){D.output="";for(const B of D.tokens)D.output+=B.output!=null?B.output:B.value,B.suffix&&(D.output+=B.suffix)}return D};m.fastpaths=(v,C)=>{const w={...C},b=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c,S=v.length;if(S>b)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${b}`);v=f[v]||v;const{DOT_LITERAL:E,SLASH_LITERAL:x,ONE_CHAR:_,DOTS_SLASH:A,NO_DOT:O,NO_DOTS:k,NO_DOTS_SLASH:M,STAR:I,START_ANCHOR:P}=a.globChars(w.windows),F=w.dot?k:O,z=w.dot?M:O,V=w.capture?"":"?:",J={negated:!1,prefix:""};let K=w.bash===!0?".*?":I;w.capture&&(K=`(${K})`);const R=de=>de.noglobstar===!0?K:`(${V}(?:(?!${P}${de.dot?A:E}).)*?)`,Q=de=>{switch(de){case"*":return`${F}${_}${K}`;case".*":return`${E}${_}${K}`;case"*.*":return`${F}${K}${E}${_}${K}`;case"*/*":return`${F}${K}${x}${_}${z}${K}`;case"**":return F+R(w);case"**/*":return`(?:${F}${R(w)}${x})?${z}${_}${K}`;case"**/*.*":return`(?:${F}${R(w)}${x})?${z}${K}${E}${_}${K}`;case"**/.*":return`(?:${F}${R(w)}${x})?${E}${_}${K}`;default:{const ue=/^(.*?)\.(\w+)$/.exec(de);if(!ue)return;const pe=Q(ue[1]);return pe?pe+E+ue[2]:void 0}}},se=l.removePrefix(v,J);let ie=Q(se);return ie&&w.strictSlashes!==!0&&(ie+=`${x}?`),ie},o.exports=m},510:(o,i,s)=>{const a=s(716),l=s(697),c=s(96),u=s(154),d=f=>f&&typeof f=="object"&&!Array.isArray(f),h=(f,p,g=!1)=>{if(Array.isArray(f)){const x=f.map(A=>h(A,p,g));return A=>{for(const O of x){const k=O(A);if(k)return k}return!1}}const m=d(f)&&f.tokens&&f.input;if(f===""||typeof f!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const v=p||{},C=v.windows,w=m?h.compileRe(f,p):h.makeRe(f,p,!1,!0),b=w.state;delete w.state;let S=()=>!1;if(v.ignore){const x={...p,ignore:null,onMatch:null,onResult:null};S=h(v.ignore,x,g)}const E=(x,_=!1)=>{const{isMatch:A,match:O,output:k}=h.test(x,w,p,{glob:f,posix:C}),M={glob:f,state:b,regex:w,posix:C,input:x,output:k,match:O,isMatch:A};return typeof v.onResult=="function"&&v.onResult(M),A===!1?(M.isMatch=!1,_?M:!1):S(x)?(typeof v.onIgnore=="function"&&v.onIgnore(M),M.isMatch=!1,_?M:!1):(typeof v.onMatch=="function"&&v.onMatch(M),_?M:!0)};return g&&(E.state=b),E};h.test=(f,p,g,{glob:m,posix:v}={})=>{if(typeof f!="string")throw new TypeError("Expected input to be a string");if(f==="")return{isMatch:!1,output:""};const C=g||{},w=C.format||(v?c.toPosixSlashes:null);let b=f===m,S=b&&w?w(f):f;return b===!1&&(S=w?w(f):f,b=S===m),(b===!1||C.capture===!0)&&(C.matchBase===!0||C.basename===!0?b=h.matchBase(f,p,g,v):b=p.exec(S)),{isMatch:!!b,match:b,output:S}},h.matchBase=(f,p,g)=>(p instanceof RegExp?p:h.makeRe(p,g)).test(c.basename(f)),h.isMatch=(f,p,g)=>h(p,g)(f),h.parse=(f,p)=>Array.isArray(f)?f.map(g=>h.parse(g,p)):l(f,{...p,fastpaths:!1}),h.scan=(f,p)=>a(f,p),h.compileRe=(f,p,g=!1,m=!1)=>{if(g===!0)return f.output;const v=p||{},C=v.contains?"":"^",w=v.contains?"":"$";let b=`${C}(?:${f.output})${w}`;f&&f.negated===!0&&(b=`^(?!${b}).*$`);const S=h.toRegex(b,p);return m===!0&&(S.state=f),S},h.makeRe=(f,p={},g=!1,m=!1)=>{if(!f||typeof f!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(f[0]==="."||f[0]==="*")&&(v.output=l.fastpaths(f,p)),v.output||(v=l(f,p)),h.compileRe(v,p,g,m)},h.toRegex=(f,p)=>{try{const g=p||{};return new RegExp(f,g.flags||(g.nocase?"i":""))}catch(g){if(p&&p.debug===!0)throw g;return/$^/}},h.constants=u,o.exports=h},716:(o,i,s)=>{const a=s(96),{CHAR_ASTERISK:l,CHAR_AT:c,CHAR_BACKWARD_SLASH:u,CHAR_COMMA:d,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:f,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:g,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:C,CHAR_QUESTION_MARK:w,CHAR_RIGHT_CURLY_BRACE:b,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:E}=s(154),x=O=>O===p||O===u,_=O=>{O.isPrefix!==!0&&(O.depth=O.isGlobstar?1/0:1)},A=(O,k)=>{const M=k||{},I=O.length-1,P=M.parts===!0||M.scanToEnd===!0,F=[],z=[],V=[];let J=O,K=-1,R=0,Q=0,se=!1,ie=!1,de=!1,ue=!1,pe=!1,D=!1,ce=!1,ye=!1,be=!1,H=!1,L=0,Ve,G,ne={value:"",depth:0,isGlob:!1};const X=()=>K>=I,W=()=>J.charCodeAt(K+1),$=()=>(Ve=G,J.charCodeAt(++K));for(;K<I;){G=$();let Se;if(G===u){ce=ne.backslashes=!0,G=$(),G===g&&(D=!0);continue}if(D===!0||G===g){for(L++;X()!==!0&&(G=$());){if(G===u){ce=ne.backslashes=!0,$();continue}if(G===g){L++;continue}if(D!==!0&&G===h&&(G=$())===h){if(se=ne.isBrace=!0,de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(D!==!0&&G===d){if(se=ne.isBrace=!0,de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===b&&(L--,L===0)){D=!1,se=ne.isBrace=!0,H=!0;break}}if(P===!0)continue;break}if(G===p){if(F.push(K),z.push(ne),ne={value:"",depth:0,isGlob:!1},H===!0)continue;if(Ve===h&&K===R+1){R+=2;continue}Q=K+1;continue}if(M.noext!==!0&&(G===C||G===c||G===l||G===w||G===f)===!0&&W()===m){if(de=ne.isGlob=!0,ue=ne.isExtglob=!0,H=!0,G===f&&K===R&&(be=!0),P===!0){for(;X()!==!0&&(G=$());){if(G===u){ce=ne.backslashes=!0,G=$();continue}if(G===S){de=ne.isGlob=!0,H=!0;break}}continue}break}if(G===l){if(Ve===l&&(pe=ne.isGlobstar=!0),de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===w){if(de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===v){for(;X()!==!0&&(Se=$());){if(Se===u){ce=ne.backslashes=!0,$();continue}if(Se===E){ie=ne.isBracket=!0,de=ne.isGlob=!0,H=!0;break}}if(P===!0)continue;break}if(M.nonegate!==!0&&G===f&&K===R){ye=ne.negated=!0,R++;continue}if(M.noparen!==!0&&G===m){if(de=ne.isGlob=!0,P===!0){for(;X()!==!0&&(G=$());){if(G===m){ce=ne.backslashes=!0,G=$();continue}if(G===S){H=!0;break}}continue}break}if(de===!0){if(H=!0,P===!0)continue;break}}M.noext===!0&&(ue=!1,de=!1);let ee=J,Ce="",we="";R>0&&(Ce=J.slice(0,R),J=J.slice(R),Q-=R),ee&&de===!0&&Q>0?(ee=J.slice(0,Q),we=J.slice(Q)):de===!0?(ee="",we=J):ee=J,ee&&ee!==""&&ee!=="/"&&ee!==J&&x(ee.charCodeAt(ee.length-1))&&(ee=ee.slice(0,-1)),M.unescape===!0&&(we&&(we=a.removeBackslashes(we)),ee&&ce===!0&&(ee=a.removeBackslashes(ee)));const Z={prefix:Ce,input:O,start:R,base:ee,glob:we,isBrace:se,isBracket:ie,isGlob:de,isExtglob:ue,isGlobstar:pe,negated:ye,negatedExtglob:be};if(M.tokens===!0&&(Z.maxDepth=0,x(G)||z.push(ne),Z.tokens=z),M.parts===!0||M.tokens===!0){let Se;for(let U=0;U<F.length;U++){const B=Se?Se+1:R,re=F[U],j=O.slice(B,re);M.tokens&&(U===0&&R!==0?(z[U].isPrefix=!0,z[U].value=Ce):z[U].value=j,_(z[U]),Z.maxDepth+=z[U].depth),(U!==0||j!=="")&&V.push(j),Se=re}if(Se&&Se+1<O.length){const U=O.slice(Se+1);V.push(U),M.tokens&&(z[z.length-1].value=U,_(z[z.length-1]),Z.maxDepth+=z[z.length-1].depth)}Z.slashes=F,Z.parts=V}return Z};o.exports=A},96:(o,i,s)=>{const{REGEX_BACKSLASH:a,REGEX_REMOVE_BACKSLASH:l,REGEX_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_GLOBAL:u}=s(154);i.isObject=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),i.hasRegexChars=d=>c.test(d),i.isRegexChar=d=>d.length===1&&i.hasRegexChars(d),i.escapeRegex=d=>d.replace(u,"\\$1"),i.toPosixSlashes=d=>d.replace(a,"/"),i.removeBackslashes=d=>d.replace(l,h=>h==="\\"?"":h),i.escapeLast=(d,h,f)=>{const p=d.lastIndexOf(h,f);return p===-1?d:d[p-1]==="\\"?i.escapeLast(d,h,p-1):`${d.slice(0,p)}\\${d.slice(p)}`},i.removePrefix=(d,h={})=>{let f=d;return f.startsWith("./")&&(f=f.slice(2),h.prefix="./"),f},i.wrapOutput=(d,h={},f={})=>{const p=f.contains?"":"^",g=f.contains?"":"$";let m=`${p}(?:${d})${g}`;return h.negated===!0&&(m=`(?:^(?!${m}).*$)`),m},i.basename=(d,{windows:h}={})=>{const f=d.split(h?/[\\/]/:"/"),p=f[f.length-1];return p===""?f[f.length-2]:p}}},e={};function n(o){var i=e[o];if(i!==void 0)return i.exports;var s=e[o]={exports:{}},a=!0;try{t[o](s,s.exports,n),a=!1}finally{a&&delete e[o]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(170);sg.exports=r})()),sg.exports}var BE;function rB(){return BE||(BE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{hasLocalMatch:function(){return o},matchLocalPattern:function(){return r}});const n=HE();function r(i,s){if(i.search!==void 0&&i.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=i.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function o(i,s){if(!i)return!0;const a=new URL(s,"http://n");return i.some(l=>r(l,a))}}(ig)),ig}var ag={},VE;function oB(){return VE||(VE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{hasRemoteMatch:function(){return o},matchRemotePattern:function(){return r}});const n=HE();function r(i,s){if(i.protocol!==void 0){const l=s.protocol.slice(0,-1);if(i.protocol!==l)return!1}if(i.port!==void 0&&i.port!==s.port)return!1;if(i.hostname===void 0)throw new Error(`Pattern should define hostname but found
224
- `+JSON.stringify(i));if(!(0,n.makeRe)(i.hostname).test(s.hostname)||i.search!==void 0&&i.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=i.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function o(i,s,a){return i.some(l=>a.hostname===l)||s.some(l=>r(l,a))}}(ag)),ag}var $E;function jE(){return $E||($E=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const e=75;function n(o){let{config:i,src:s,width:a,quality:l}=o;var c;if(process.env.NODE_ENV!=="production"){const d=[];if(s||d.push("src"),a||d.push("width"),d.length>0)throw new Error("Next Image Optimization requires "+d.join(", ")+" to be provided. Make sure you pass them as props to the `next/image` component. Received: "+JSON.stringify({src:s,width:a,quality:l}));if(s.startsWith("//"))throw new Error('Failed to parse src "'+s+'" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');if(s.startsWith("/")&&i.localPatterns&&process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasLocalMatch:h}=rB();if(!h(i.localPatterns,s))throw new Error("Invalid src prop ("+s+") on `next/image` does not match `images.localPatterns` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns")}if(!s.startsWith("/")&&(i.domains||i.remotePatterns)){let h;try{h=new URL(s)}catch(f){throw console.error(f),new Error('Failed to parse src "'+s+'" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)')}if(process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasRemoteMatch:f}=oB();if(!f(i.domains,i.remotePatterns,h))throw new Error("Invalid src prop ("+s+') on `next/image`, hostname "'+h.hostname+'" is not configured under images in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-host')}}if(l&&i.qualities&&!i.qualities.includes(l))throw new Error("Invalid quality prop ("+l+") on `next/image` does not match `images.qualities` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities")}const u=l||((c=i.qualities)==null?void 0:c.reduce((d,h)=>Math.abs(h-e)<Math.abs(d-e)?h:d))||e;return i.path+"?url="+encodeURIComponent(s)+"&w="+a+"&q="+u+(process.env.NEXT_DEPLOYMENT_ID?"&dpl="+process.env.NEXT_DEPLOYMENT_ID:"")}n.__next_img_default=!0;const r=n}(og)),og}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return w}});const n=Ft,r=_i(),o=Ei,i=r._(T),s=n._(Mo),a=n._(tB()),l=Qp,c=Wc,u=nB(),d=qc,h=Iu(),f=n._(jE()),p=process.env.__NEXT_IMAGE_OPTS;typeof window>"u"&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);function g(b,S,E,x,_,A,O){const k=b==null?void 0:b.src;if(!b||b["data-loaded-src"]===k)return;b["data-loaded-src"]=k,("decode"in b?b.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(!(!b.parentElement||!b.isConnected)){if(S!=="empty"&&_(!0),E!=null&&E.current){const I=new Event("load");Object.defineProperty(I,"target",{writable:!1,value:b});let P=!1,F=!1;E.current({...I,nativeEvent:I,currentTarget:b,target:b,isDefaultPrevented:()=>P,isPropagationStopped:()=>F,persist:()=>{},preventDefault:()=>{P=!0,I.preventDefault()},stopPropagation:()=>{F=!0,I.stopPropagation()}})}if(x!=null&&x.current&&x.current(b),process.env.NODE_ENV!=="production"){const I=new URL(k,"http://n").searchParams.get("url")||k;if(b.getAttribute("data-nimg")==="fill"){if(!A&&(!O||O==="100vw")&&b.getBoundingClientRect().width/window.innerWidth<.6&&(O==="100vw"?(0,d.warnOnce)('Image with src "'+I+'" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes'):(0,d.warnOnce)('Image with src "'+I+'" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes')),b.parentElement){const{position:z}=window.getComputedStyle(b.parentElement),V=["absolute","fixed","relative"];V.includes(z)||(0,d.warnOnce)('Image with src "'+I+'" has "fill" and parent element with invalid "position". Provided "'+z+'" should be one of '+V.map(String).join(",")+".")}b.height===0&&(0,d.warnOnce)('Image with src "'+I+'" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.')}const P=b.height.toString()!==b.getAttribute("height"),F=b.width.toString()!==b.getAttribute("width");(P&&!F||!P&&F)&&(0,d.warnOnce)('Image with src "'+I+`" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.`)}}})}function m(b){return i.use?{fetchPriority:b}:{fetchpriority:b}}const v=(0,i.forwardRef)((b,S)=>{let{src:E,srcSet:x,sizes:_,height:A,width:O,decoding:k,className:M,style:I,fetchPriority:P,placeholder:F,loading:z,unoptimized:V,fill:J,onLoadRef:K,onLoadingCompleteRef:R,setBlurComplete:Q,setShowAltText:se,sizesInput:ie,onLoad:de,onError:ue,...pe}=b;return(0,o.jsx)("img",{...pe,...m(P),loading:z,width:O,height:A,decoding:k,"data-nimg":J?"fill":"1",className:M,style:I,sizes:_,srcSet:x,src:E,ref:(0,i.useCallback)(D=>{S&&(typeof S=="function"?S(D):typeof S=="object"&&(S.current=D)),D&&(ue&&(D.src=D.src),process.env.NODE_ENV!=="production"&&(E||console.error('Image is missing required "src" property:',D),D.getAttribute("alt")===null&&console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.')),D.complete&&g(D,F,K,R,Q,V,ie))},[E,F,K,R,Q,ue,V,ie,S]),onLoad:D=>{const ce=D.currentTarget;g(ce,F,K,R,Q,V,ie)},onError:D=>{se(!0),F!=="empty"&&Q(!0),ue&&ue(D)}})});function C(b){let{isAppRouter:S,imgAttributes:E}=b;const x={as:"image",imageSrcSet:E.srcSet,imageSizes:E.sizes,crossOrigin:E.crossOrigin,referrerPolicy:E.referrerPolicy,...m(E.fetchPriority)};return S&&s.default.preload?(s.default.preload(E.src,x),null):(0,o.jsx)(a.default,{children:(0,o.jsx)("link",{rel:"preload",href:E.srcSet?void 0:E.src,...x},"__nimg-"+E.src+E.srcSet+E.sizes)})}const w=(0,i.forwardRef)((b,S)=>{const x=!(0,i.useContext)(h.RouterContext),_=(0,i.useContext)(u.ImageConfigContext),A=(0,i.useMemo)(()=>{var R;const Q=p||_||c.imageConfigDefault,se=[...Q.deviceSizes,...Q.imageSizes].sort((ue,pe)=>ue-pe),ie=Q.deviceSizes.sort((ue,pe)=>ue-pe),de=(R=Q.qualities)==null?void 0:R.sort((ue,pe)=>ue-pe);return{...Q,allSizes:se,deviceSizes:ie,qualities:de}},[_]),{onLoad:O,onLoadingComplete:k}=b,M=(0,i.useRef)(O);(0,i.useEffect)(()=>{M.current=O},[O]);const I=(0,i.useRef)(k);(0,i.useEffect)(()=>{I.current=k},[k]);const[P,F]=(0,i.useState)(!1),[z,V]=(0,i.useState)(!1),{props:J,meta:K}=(0,l.getImgProps)(b,{defaultLoader:f.default,imgConf:A,blurComplete:P,showAltText:z});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v,{...J,unoptimized:K.unoptimized,placeholder:K.placeholder,fill:K.fill,onLoadRef:M,onLoadingCompleteRef:I,setBlurComplete:F,setShowAltText:V,sizesInput:b.sizes,ref:S}),K.priority?(0,o.jsx)(C,{isAppRouter:x,imgAttributes:J}):null]})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(Zp,Zp.exports);var iB=Zp.exports;(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{default:function(){return a},getImageProps:function(){return s}});const n=Ft,r=Qp,o=iB,i=n._(jE());function s(l){const{props:c}=(0,r.getImgProps)(l,{defaultLoader:i.default,imgConf:process.env.__NEXT_IMAGE_OPTS});for(const[u,d]of Object.entries(c))d===void 0&&delete c[u];return{props:c}}const a=o.Image})(Y4),N.ComponentManager.registerComponent("Editor.Image",X4);function zE(t,e){return T.useCallback(r=>{const o=t.view;o.dispatch(o.state.tr.setNodeMarkup(e(),void 0,{...r})),t.commands.focus()},[t,e])}function sB({name:t,placeholder:e,...n}){return y.jsx(Xe.Field,{name:t,children:({field:r,meta:o})=>y.jsx(J4,{...n,defaultValue:o.initialValue,onChange:i=>r.onChange({target:{name:t,value:i}})})})}function UE({children:t,...e}){return y.jsx(N.Tile,{scheme:"light",p:"5",...e,children:t})}function qE({name:t,...e}){return y.jsx(UE,{h:"min",...e,children:y.jsx(sB,{minH:"128",minW:"144",name:t,placeHolder:"Write here..."})})}function aB({queryId:t,api:e,children:n,...r}){const{data:o,isLoading:i,isError:s}=Re.useApiQuery(e.queryKey,e.get,t),a=Re.useInvalidateQuery(e.queryKey,t);return i?y.jsx(hr,{w:"full",h:"100%"}):s?y.jsx(Jr,{p:"0",onClick:a}):y.jsx(Fa,{...r,children:n(o)})}const lg=T.forwardRef(aB);function WE({children:t,...e}){return y.jsx("div",{w:"112",minW:"112",minH:"100%",gap:"8",dflex:!0,flexCol:!0,...e,children:t})}function KE({title:t,children:e,...n}){return y.jsxs("div",{w:"full",bgColor:"white",rounded:!0,p:"5",textSize:"sm",...n,children:[t&&y.jsx(I_,{children:t}),e]})}function cg({children:t,...e}){return y.jsx("div",{trait:"typo.h5",children:t})}function ug({title:t,breadcrumbs:e,children:n,...r}){return y.jsxs(Ia,{gap:"3",minH:"9",...r,children:[t&&y.jsx(cg,{children:t}),e&&y.jsx(Fu,{breadcrumbs:e}),y.jsx("div",{flexGrow:!0}),n]})}const[lB,GE]=Fe.createContext();function JE({children:t}){const[e,n]=T.useState(null);return T.createRef(),y.jsx(lB,{value:{containerEl:e,setContainerEl:n},children:t})}function XE({title:t,breadcrumbs:e,children:n,...r}){const o=T.createRef(),{setContainerEl:i}=GE(),[s,a]=T.useState(!1);return T.useEffect(()=>(!s&&o.current&&(i(o.current),a(!0)),()=>i(null)),[]),y.jsx(Ia,{gap:"3",minH:"9",...r,children:y.jsxs(y.Fragment,{children:[t&&y.jsx(cg,{children:t}),e&&y.jsx(Fu,{breadcrumbs:e}),y.jsx("div",{flexGrow:!0}),y.jsx("div",{ref:o,dflex:!0,flexRow:!0,gap:"3"}),n]})})}function YE({trackingRef:t,children:e}){const{containerEl:n}=GE(),[r,o]=T.useState(!1),i=T.useMemo(()=>n,[n]),s=n??(typeof window<"u"?document.body:void 0);T.useLayoutEffect(()=>{if(!(!i||!s)){try{r?s.appendChild(i):s.removeChild(i)}catch{}return()=>{try{s.removeChild(i)}catch{}}}},[r,i,s]);const a=T.useCallback(l=>{o(l[0].isVisible)},[e]);return T.useEffect(()=>{const l={root:null,rootMargin:"0px",threshold:0,trackVisibility:!0,delay:100},c=new IntersectionObserver(a,l);return t&&c.observe(t),()=>c.disconnect()},[t,a,e]),s&&i?Mo.createPortal(e,i):null}function cB({tabbed:t,breadcrumbs:e,api:n,item:r,isLoading:o,buttonBar:i,trackingRef:s}){return y.jsxs(y.Fragment,{children:[t&&y.jsx(YE,{trackingRef:s,children:y.jsx(QE,{api:n,item:r,isLoading:o,buttonBar:i})}),!t&&y.jsx(ug,{breadcrumbs:e,children:y.jsx(QE,{api:n,item:r,isLoading:o,buttonBar:i})})]})}function QE({api:t,item:e,isLoading:n,buttonBar:r}){return y.jsxs(y.Fragment,{children:[r==null?void 0:r.map((o,i)=>y.jsxs(T.Fragment,{children:[o.type==="link"&&y.jsx(K0,{path:o.path,icon:o.icon}),o.type==="invalidate"&&y.jsx(Zu,{pathOrPermalink:o.pathOrPermalink}),o.type=="custom"&&o.render(e)]},i)),y.jsx(Ly,{api:t,queryId:e.id,status:e.status,disabled:n}),y.jsx(W0,{disabled:n})]})}function uB({queryField:t,api:e,processInput:n,screen:r,tabbed:o,...i}){const{[t]:s}=Qt.useParams(),a=T.useRef(null);return y.jsx(lg,{api:e,queryId:s,ref:a,p:"5",...i,children:l=>y.jsx(dB,{item:l,screen:r,api:e,tabbed:o,processInput:n,containerRef:a})})}function dB({item:t,screen:e,api:n,processInput:r,tabbed:o,containerRef:i}){const{breadcrumbs:s,schema:a,initialValues:l,header:c,editorFooter:u,sections:d,buttonBar:h,editor:f,type:p,invalidateParentQueryKey:g}=Fe.runIfFn(e,t),m=Re.useInvalidateParentMutation(n.update,g??n.queryKey,{networkMode:"always"}),v=Re.useMutate(m,{processInput:r,successMsg:w=>`${w.title} updated.`,errorMsg:(w,b)=>`Error updating ${b.title}: ${w}`});let C;return p=="post"?C="calc(1280px - 30rem)":p=="section"&&(C="calc(1280px - 22rem)"),y.jsxs(Ra,{initialValues:Fe.runIfFn(l,t),validationSchema:a,onSubmit:v,enableReinitialize:!0,children:[y.jsx(cB,{tabbed:o,api:n,breadcrumbs:s,buttonBar:h,item:t,isLoading:m.isLoading,trackingRef:i==null?void 0:i.current}),y.jsxs(Fa,{w:C?"auto":"full",size:"x2",id:"pagecontainer",children:[c,y.jsxs("div",{dflex:!0,gap:"8",children:[y.jsxs("div",{dflex:!0,flexCol:!0,gap:"8",flexGrow:!0,children:[(f==null?void 0:f.type)!="textarea"&&y.jsx(qE,{name:"content",maxW:C,minW:"144"}),(f==null?void 0:f.type)=="textarea"&&y.jsx(id,{name:f==null?void 0:f.name,maxW:C,minW:C,minH:"128",rows:25,bgColor:"white",border:"0",p:"5",textColor:"slate-800"}),u]}),y.jsx(WE,{children:d==null?void 0:d.map((w,b)=>y.jsx(fB,{section:w,item:t},b))})]})]})]})}function fB({section:t,item:e}){return t.type==="section"?y.jsx(KE,{title:t.title,children:y.jsx(pr,{form:Fe.runIfFn(t.form,e)})}):t.type==="custom"?Fe.runIfFn(t.component,e):null}function hB(t,e){const n=Qt.useParams();if(e===void 0)return{id:void 0,api:t};const{[e]:r}=n;return{id:r,api:Fe.runIfFn(t,r)}}function pB({api:t,queryField:e,fn:n,transformFn:r,config:o,tabbed:i,...s}){const{id:a,api:l}=hB(t,e),{data:c}=Re.useApiQuery(l.queryKey,n==="get"||n==="getTransformed"?l.get:l.getAll,Fe.isFunction(t)?void 0:a),u=T.useMemo(()=>c&&(n==="getTransformed"||n==="getAllTransformed")?(r||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${n}`),r==null?void 0:r(c)):c,[c]);return c?y.jsx(Zc,{config:o(u),tabbed:i,...s}):null}function gB({queryField:t,api:e,screen:n,...r}){const{[t]:o}=Qt.useParams();return y.jsx(lg,{queryId:o,api:e,p:"5",children:i=>{const{breadcrumbs:s,tabs:a}=Fe.runIfFn(n,i);return y.jsxs(JE,{children:[y.jsx(XE,{breadcrumbs:s,mb:"-3"}),y.jsx(hk,{tabs:a.map(l=>l.label),saveKey:`tab-${o}`,mt:"-3",mb:"3",id:"fff",children:a.map((l,c)=>y.jsx(mB,{tab:l},c))})]})}})}function mB({tab:t}){if(!t.component&&!t.config)throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${t.label}`);return t.component?t.component():y.jsx(Zc,{config:t.config,tabbed:!0,p:"0"})}/**
1
+ (function(L,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("@soperio/jsx-runtime"),require("@valerya/ui"),require("react/jsx-runtime"),require("react"),require("@compill/api"),require("react-router-dom"),require("@compill/form"),require("formik"),require("@compill/components"),require("@soperio/react"),require("@compill/form-extras"),require("@compill/admin"),require("react-dom"),require("@compill/table"),require("@compill/hooks"),require("@tanstack/react-query")):typeof define=="function"&&define.amd?define(["exports","@soperio/jsx-runtime","@valerya/ui","react/jsx-runtime","react","@compill/api","react-router-dom","@compill/form","formik","@compill/components","@soperio/react","@compill/form-extras","@compill/admin","react-dom","@compill/table","@compill/hooks","@tanstack/react-query"],l):(L=typeof globalThis<"u"?globalThis:L||self,l(L.admin={},L["@soperio/jsx-runtime"],L.ui,L.require$$1,L.react,L["@compill/api"],L.reactRouterDom,L["@compill/form"],L.formik,L["@compill/components"],L.react,L["@compill/form-extras"],L["@compill/admin"],L.reactDom,L["@compill/table"],L["@compill/hooks"],L["@tanstack/react-query"]))})(this,function(L,l,T,ts,v,x,le,ee,Ae,J,z,rs,ns,os,Se,Cr,Or){"use strict";var ou=Object.defineProperty;var su=(L,l,T)=>l in L?ou(L,l,{enumerable:!0,configurable:!0,writable:!0,value:T}):L[l]=T;var es=(L,l,T)=>(su(L,typeof l!="symbol"?l+"":l,T),T);function ss({children:e,...t}){return l.jsx("h2",{textSize:"xl",fontWeight:"600",textColor:"slate-800",...t,children:e})}var is="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M12,17L17,12H14V8H10V12H7L12,17Z",as="M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M12,7L7,12H10V16H14V12H17L12,7Z",ls="M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z",us="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",cs="M6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.03C18.17 12 18.33 12 18.5 12C19 12 19.5 12.07 20 12.18V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.17 21 12.33 21 12.5 21C12.24 20.37 12.09 19.7 12.03 19L12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.17 16 12.34 16 12.5 16C12.85 15.18 13.34 14.46 13.95 13.86C13.32 13.95 12.67 14 12 14C9.58 14 7.3 13.4 6 12.45M12 5C15.87 5 18 6.5 18 7S15.87 9 12 9 6 7.5 6 7 8.13 5 12 5M18 18.5L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5S16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5S15.79 14.5 18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18Z",vt="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Et="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",ds="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",fs="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",wt="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",Ar="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",ps="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",hs="M3 3V21H21V3H3M18 18H6V17H18V18M18 16H6V15H18V16M18 12H6V6H18V12Z",Sr="M5,4V6H19V4H5M5,14H9V20H15V14H19L12,7L5,14Z",Lr="M20.8 22.7L15 16.9V20H9V14H5L8.6 10.4L1.1 3L2.4 1.7L22.1 21.4L20.8 22.7M19 6V4H7.2L9.2 6H19M17.2 14H19L12 7L11.1 7.9L17.2 14Z",ys="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z";function gs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt={exports:{}},Le={};Le._=Le._interop_require_default=ms;function ms(e){return e&&e.__esModule?e:{default:e}}var qe={exports:{}},_t={},Mr;function Nr(){return Mr||(Mr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{assign:function(){return i},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}});function r(s){const a={};return s.forEach((u,d)=>{typeof a[d]>"u"?a[d]=u:Array.isArray(a[d])?a[d].push(u):a[d]=[a[d],u]}),a}function n(s){return typeof s=="string"||typeof s=="number"&&!isNaN(s)||typeof s=="boolean"?String(s):""}function o(s){const a=new URLSearchParams;return Object.entries(s).forEach(u=>{let[d,f]=u;Array.isArray(f)?f.forEach(c=>a.append(d,n(c))):a.set(d,n(f))}),a}function i(s){for(var a=arguments.length,u=new Array(a>1?a-1:0),d=1;d<a;d++)u[d-1]=arguments[d];return u.forEach(f=>{Array.from(f.keys()).forEach(c=>s.delete(c)),f.forEach((c,m)=>s.append(m,c))}),s}}(_t)),_t}var Tt={},Ue={},Ir;function bs(){if(Ir)return Ue;Ir=1;function e(r){if(typeof WeakMap!="function")return null;var n=new WeakMap,o=new WeakMap;return(e=function(i){return i?o:n})(r)}Ue._=Ue._interop_require_wildcard=t;function t(r,n){if(!n&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var o=e(n);if(o&&o.has(r))return o.get(r);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)){var u=s?Object.getOwnPropertyDescriptor(r,a):null;u&&(u.get||u.set)?Object.defineProperty(i,a,u):i[a]=r[a]}return i.default=r,o&&o.set(r,i),i}return Ue}var kr;function xr(){return kr||(kr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(u,d){for(var f in d)Object.defineProperty(u,f,{enumerable:!0,get:d[f]})}t(e,{formatUrl:function(){return i},formatWithValidation:function(){return a},urlObjectKeys:function(){return s}});const n=bs()._(Nr()),o=/https?|ftp|gopher|file/;function i(u){let{auth:d,hostname:f}=u,c=u.protocol||"",m=u.pathname||"",h=u.hash||"",y=u.query||"",p=!1;d=d?encodeURIComponent(d).replace(/%3A/i,":")+"@":"",u.host?p=d+u.host:f&&(p=d+(~f.indexOf(":")?"["+f+"]":f),u.port&&(p+=":"+u.port)),y&&typeof y=="object"&&(y=String(n.urlQueryToSearchParams(y)));let g=u.search||y&&"?"+y||"";return c&&!c.endsWith(":")&&(c+=":"),u.slashes||(!c||o.test(c))&&p!==!1?(p="//"+(p||""),m&&m[0]!=="/"&&(m="/"+m)):p||(p=""),h&&h[0]!=="#"&&(h="#"+h),g&&g[0]!=="?"&&(g="?"+g),m=m.replace(/[?#]/g,encodeURIComponent),g=g.replace("#","%23"),""+c+p+m+g+h}const s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(u){return process.env.NODE_ENV==="development"&&u!==null&&typeof u=="object"&&Object.keys(u).forEach(d=>{s.includes(d)||console.warn("Unknown key passed via urlObject into url.format: "+d)}),i(u)}}(Tt)),Tt}var Ct={},Br;function vs(){return Br||(Br=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"omit",{enumerable:!0,get:function(){return t}});function t(r,n){const o={};return Object.keys(r).forEach(i=>{n.includes(i)||(o[i]=r[i])}),o}}(Ct)),Ct}var Ot={},jr;function Ve(){return jr||(jr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(b,_){for(var A in _)Object.defineProperty(b,A,{enumerable:!0,get:_[A]})}t(e,{DecodeError:function(){return y},MiddlewareNotFoundError:function(){return O},MissingStaticPage:function(){return E},NormalizeError:function(){return p},PageNotFoundError:function(){return g},SP:function(){return m},ST:function(){return h},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return u},getLocationOrigin:function(){return s},getURL:function(){return a},isAbsoluteUrl:function(){return i},isResSent:function(){return d},loadGetInitialProps:function(){return c},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return P}});const r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(b){let _=!1,A;return function(){for(var S=arguments.length,C=new Array(S),N=0;N<S;N++)C[N]=arguments[N];return _||(_=!0,A=b(...C)),A}}const o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=b=>o.test(b);function s(){const{protocol:b,hostname:_,port:A}=window.location;return b+"//"+_+(A?":"+A:"")}function a(){const{href:b}=window.location,_=s();return b.substring(_.length)}function u(b){return typeof b=="string"?b:b.displayName||b.name||"Unknown"}function d(b){return b.finished||b.headersSent}function f(b){const _=b.split("?");return _[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(_[1]?"?"+_.slice(1).join("?"):"")}async function c(b,_){if(process.env.NODE_ENV!=="production"){var A;if((A=b.prototype)!=null&&A.getInitialProps){const N='"'+u(b)+'.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';throw new Error(N)}}const S=_.res||_.ctx&&_.ctx.res;if(!b.getInitialProps)return _.ctx&&_.Component?{pageProps:await c(_.Component,_.ctx)}:{};const C=await b.getInitialProps(_);if(S&&d(S))return C;if(!C){const N='"'+u(b)+'.getInitialProps()" should resolve to an object. But found "'+C+'" instead.';throw new Error(N)}return process.env.NODE_ENV!=="production"&&Object.keys(C).length===0&&!_.ctx&&console.warn(""+u(b)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),C}const m=typeof performance<"u",h=m&&["mark","measure","getEntriesByName"].every(b=>typeof performance[b]=="function");class y extends Error{}class p extends Error{}class g extends Error{constructor(_){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+_}}class E extends Error{constructor(_,A){super(),this.message="Failed to load static file for page: "+_+" "+A}}class O extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function P(b){return JSON.stringify({message:b.message,stack:b.stack})}}(Ot)),Ot}var Re={exports:{}},At={},Fr;function Dr(){return Fr||(Fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeTrailingSlash",{enumerable:!0,get:function(){return t}});function t(r){return r.replace(/\/$/,"")||"/"}}(At)),At}var St={},Hr;function Lt(){return Hr||(Hr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return t}});function t(r){const n=r.indexOf("#"),o=r.indexOf("?"),i=o>-1&&(n<0||o<n);return i||n>-1?{pathname:r.substring(0,i?o:n),query:i?r.substring(o,n>-1?n:void 0):"",hash:n>-1?r.slice(n):""}:{pathname:r,query:"",hash:""}}}(St)),St}var qr;function ze(){return qr||(qr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});const r=Dr(),n=Lt(),o=i=>{if(!i.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return i;const{pathname:s,query:a,hash:u}=(0,n.parsePath)(i);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(s)?""+(0,r.removeTrailingSlash)(s)+a+u:s.endsWith("/")?""+s+a+u:s+"/"+a+u:""+(0,r.removeTrailingSlash)(s)+a+u};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Re,Re.exports)),Re.exports}var Mt={},Ke={exports:{}},Nt={},Ur;function Vr(){return Ur||(Ur=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"pathHasPrefix",{enumerable:!0,get:function(){return r}});const t=Lt();function r(n,o){if(typeof n!="string")return!1;const{pathname:i}=(0,t.parsePath)(n);return i===o||i.startsWith(o+"/")}}(Nt)),Nt}var Rr;function Es(){return Rr||(Rr=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});const r=Vr(),n=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return(0,r.pathHasPrefix)(i,n)}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ke,Ke.exports)),Ke.exports}var zr;function Kr(){return zr||(zr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isLocalURL",{enumerable:!0,get:function(){return n}});const t=Ve(),r=Es();function n(o){if(!(0,t.isAbsoluteUrl)(o))return!0;try{const i=(0,t.getLocationOrigin)(),s=new URL(o,i);return s.origin===i&&(0,r.hasBasePath)(s.pathname)}catch{return!1}}}(Mt)),Mt}var It={},kt={},$r;function ws(){return $r||($r=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getSortedRoutes",{enumerable:!0,get:function(){return r}});class t{insert(o){this._insert(o.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(o){o===void 0&&(o="/");const i=[...this.children.keys()].sort();this.slugName!==null&&i.splice(i.indexOf("[]"),1),this.restSlugName!==null&&i.splice(i.indexOf("[...]"),1),this.optionalRestSlugName!==null&&i.splice(i.indexOf("[[...]]"),1);const s=i.map(a=>this.children.get(a)._smoosh(""+o+a+"/")).reduce((a,u)=>[...a,...u],[]);if(this.slugName!==null&&s.push(...this.children.get("[]")._smoosh(o+"["+this.slugName+"]/")),!this.placeholder){const a=o==="/"?"/":o.slice(0,-1);if(this.optionalRestSlugName!=null)throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("'+a+'" and "'+a+"[[..."+this.optionalRestSlugName+']]").');s.unshift(a)}return this.restSlugName!==null&&s.push(...this.children.get("[...]")._smoosh(o+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&s.push(...this.children.get("[[...]]")._smoosh(o+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(o,i,s){if(o.length===0){this.placeholder=!1;return}if(s)throw new Error("Catch-all must be the last part of the URL.");let a=o[0];if(a.startsWith("[")&&a.endsWith("]")){let f=function(c,m){if(c!==null&&c!==m)throw new Error("You cannot use different slug names for the same dynamic path ('"+c+"' !== '"+m+"').");i.forEach(h=>{if(h===m)throw new Error('You cannot have the same slug name "'+m+'" repeat within a single dynamic path');if(h.replace(/\W/g,"")===a.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+h+'" and "'+m+'" differ only by non-word symbols within a single dynamic path')}),i.push(m)},u=a.slice(1,-1),d=!1;if(u.startsWith("[")&&u.endsWith("]")&&(u=u.slice(1,-1),d=!0),u.startsWith("...")&&(u=u.substring(3),s=!0),u.startsWith("[")||u.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+u+"').");if(u.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+u+"').");if(s)if(d){if(this.restSlugName!=null)throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+o[0]+'" ).');f(this.optionalRestSlugName,u),this.optionalRestSlugName=u,a="[[...]]"}else{if(this.optionalRestSlugName!=null)throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+o[0]+'").');f(this.restSlugName,u),this.restSlugName=u,a="[...]"}else{if(d)throw new Error('Optional route parameters are not yet supported ("'+o[0]+'").');f(this.slugName,u),this.slugName=u,a="[]"}}this.children.has(a)||this.children.set(a,new t),this.children.get(a)._insert(o.slice(1),i,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function r(n){const o=new t;return n.forEach(i=>o.insert(i)),o.smoosh()}}(kt)),kt}var xt={},Bt={},jt={},Ft={},Wr;function Ps(){return Wr||(Wr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ensureLeadingSlash",{enumerable:!0,get:function(){return t}});function t(r){return r.startsWith("/")?r:"/"+r}}(Ft)),Ft}var Dt={},Qr;function _s(){return Qr||(Qr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}t(e,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return n},isGroupSegment:function(){return r}});function r(i){return i[0]==="("&&i.endsWith(")")}const n="__PAGE__",o="__DEFAULT__"}(Dt)),Dt}var Gr;function Ts(){return Gr||(Gr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return i}});const r=Ps(),n=_s();function o(s){return(0,r.ensureLeadingSlash)(s.split("/").reduce((a,u,d,f)=>!u||(0,n.isGroupSegment)(u)||u[0]==="@"||(u==="page"||u==="route")&&d===f.length-1?a:a+"/"+u,""))}function i(s){return s.replace(/\.rsc($|\?)/,"$1")}}(jt)),jt}var Xr;function Jr(){return Xr||(Xr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(s,a){for(var u in a)Object.defineProperty(s,u,{enumerable:!0,get:a[u]})}t(e,{INTERCEPTION_ROUTE_MARKERS:function(){return n},extractInterceptionRouteInformation:function(){return i},isInterceptionRouteAppPath:function(){return o}});const r=Ts(),n=["(..)(..)","(.)","(..)","(...)"];function o(s){return s.split("/").find(a=>n.find(u=>a.startsWith(u)))!==void 0}function i(s){let a,u,d;for(const f of s.split("/"))if(u=n.find(c=>f.startsWith(c)),u){[a,d]=s.split(u,2);break}if(!a||!u||!d)throw new Error(`Invalid interception route: ${s}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(a=(0,r.normalizeAppPath)(a),u){case"(.)":a==="/"?d=`/${d}`:d=a+"/"+d;break;case"(..)":if(a==="/")throw new Error(`Invalid interception route: ${s}. Cannot use (..) marker at the root level, use (.) instead.`);d=a.split("/").slice(0,-1).concat(d).join("/");break;case"(...)":d="/"+d;break;case"(..)(..)":const f=a.split("/");if(f.length<=2)throw new Error(`Invalid interception route: ${s}. Cannot use (..)(..) marker at the root level or one level up.`);d=f.slice(0,-2).concat(d).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:a,interceptedRoute:d}}}(Bt)),Bt}var Zr;function Cs(){return Zr||(Zr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isDynamicRoute",{enumerable:!0,get:function(){return n}});const t=Jr(),r=/\/\[[^/]+?\](?=\/|$)/;function n(o){return(0,t.isInterceptionRouteAppPath)(o)&&(o=(0,t.extractInterceptionRouteInformation)(o).interceptedRoute),r.test(o)}}(xt)),xt}var Yr;function Os(){return Yr||(Yr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}t(e,{getSortedRoutes:function(){return r.getSortedRoutes},isDynamicRoute:function(){return n.isDynamicRoute}});const r=ws(),n=Cs()}(It)),It}var Ht={},qt={},en;function As(){return en||(en=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getRouteMatcher",{enumerable:!0,get:function(){return r}});const t=Ve();function r(n){let{re:o,groups:i}=n;return s=>{const a=o.exec(s);if(!a)return!1;const u=f=>{try{return decodeURIComponent(f)}catch{throw new t.DecodeError("failed to decode param")}},d={};return Object.keys(i).forEach(f=>{const c=i[f],m=a[c.pos];m!==void 0&&(d[f]=~m.indexOf("/")?m.split("/").map(h=>u(h)):c.repeat?[u(m)]:u(m))}),d}}}(qt)),qt}var Ut={},Vt={},tn;function Ss(){return tn||(tn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"escapeStringRegexp",{enumerable:!0,get:function(){return n}});const t=/[|\\{}()[\]^$+*?.-]/,r=/[|\\{}()[\]^$+*?.-]/g;function n(o){return t.test(o)?o.replace(r,"\\$&"):o}}(Vt)),Vt}var rn;function Ls(){return rn||(rn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(p,g){for(var E in g)Object.defineProperty(p,E,{enumerable:!0,get:g[E]})}t(e,{getNamedMiddlewareRegex:function(){return y},getNamedRouteRegex:function(){return h},getRouteRegex:function(){return d},parseParameter:function(){return a}});const r=Jr(),n=Ss(),o=Dr(),i="nxtP",s="nxtI";function a(p){const g=p.startsWith("[")&&p.endsWith("]");g&&(p=p.slice(1,-1));const E=p.startsWith("...");return E&&(p=p.slice(3)),{key:p,repeat:E,optional:g}}function u(p){const g=(0,o.removeTrailingSlash)(p).slice(1).split("/"),E={};let O=1;return{parameterizedRoute:g.map(P=>{const b=r.INTERCEPTION_ROUTE_MARKERS.find(A=>P.startsWith(A)),_=P.match(/\[((?:\[.*\])|.+)\]/);if(b&&_){const{key:A,optional:S,repeat:C}=a(_[1]);return E[A]={pos:O++,repeat:C,optional:S},"/"+(0,n.escapeStringRegexp)(b)+"([^/]+?)"}else if(_){const{key:A,repeat:S,optional:C}=a(_[1]);return E[A]={pos:O++,repeat:S,optional:C},S?C?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,n.escapeStringRegexp)(P)}).join(""),groups:E}}function d(p){const{parameterizedRoute:g,groups:E}=u(p);return{re:new RegExp("^"+g+"(?:/)?$"),groups:E}}function f(){let p=0;return()=>{let g="",E=++p;for(;E>0;)g+=String.fromCharCode(97+(E-1)%26),E=Math.floor((E-1)/26);return g}}function c(p){let{interceptionMarker:g,getSafeRouteKey:E,segment:O,routeKeys:P,keyPrefix:b}=p;const{key:_,optional:A,repeat:S}=a(O);let C=_.replace(/\W/g,"");b&&(C=""+b+C);let N=!1;(C.length===0||C.length>30)&&(N=!0),isNaN(parseInt(C.slice(0,1)))||(N=!0),N&&(C=E()),b?P[C]=""+b+_:P[C]=_;const I=g?(0,n.escapeStringRegexp)(g):"";return S?A?"(?:/"+I+"(?<"+C+">.+?))?":"/"+I+"(?<"+C+">.+?)":"/"+I+"(?<"+C+">[^/]+?)"}function m(p,g){const E=(0,o.removeTrailingSlash)(p).slice(1).split("/"),O=f(),P={};return{namedParameterizedRoute:E.map(b=>{const _=r.INTERCEPTION_ROUTE_MARKERS.some(S=>b.startsWith(S)),A=b.match(/\[((?:\[.*\])|.+)\]/);if(_&&A){const[S]=b.split(A[0]);return c({getSafeRouteKey:O,interceptionMarker:S,segment:A[1],routeKeys:P,keyPrefix:g?s:void 0})}else return A?c({getSafeRouteKey:O,segment:A[1],routeKeys:P,keyPrefix:g?i:void 0}):"/"+(0,n.escapeStringRegexp)(b)}).join(""),routeKeys:P}}function h(p,g){const E=m(p,g);return{...d(p),namedRegex:"^"+E.namedParameterizedRoute+"(?:/)?$",routeKeys:E.routeKeys}}function y(p,g){const{parameterizedRoute:E}=u(p),{catchAll:O=!0}=g;if(E==="/")return{namedRegex:"^/"+(O?".*":"")+"$"};const{namedParameterizedRoute:P}=m(p,!1);let b=O?"(?:(/.*)?)":"";return{namedRegex:"^"+P+b+"$"}}}(Ut)),Ut}var nn;function Ms(){return nn||(nn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"interpolateAs",{enumerable:!0,get:function(){return n}});const t=As(),r=Ls();function n(o,i,s){let a="";const u=(0,r.getRouteRegex)(o),d=u.groups,f=(i!==o?(0,t.getRouteMatcher)(u)(i):"")||s;a=o;const c=Object.keys(d);return c.every(m=>{let h=f[m]||"";const{repeat:y,optional:p}=d[m];let g="["+(y?"...":"")+m+"]";return p&&(g=(h?"":"/")+"["+g+"]"),y&&!Array.isArray(h)&&(h=[h]),(p||m in f)&&(a=a.replace(g,y?h.map(E=>encodeURIComponent(E)).join("/"):encodeURIComponent(h))||"/")})||(a=""),{params:c,result:a}}}(Ht)),Ht}var on;function Ns(){return on||(on=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return f}});const r=Nr(),n=xr(),o=vs(),i=Ve(),s=ze(),a=Kr(),u=Os(),d=Ms();function f(c,m,h){let y,p=typeof m=="string"?m:(0,n.formatWithValidation)(m);const g=p.match(/^[a-zA-Z]{1,}:\/\//),E=g?p.slice(g[0].length):p;if((E.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+p+"' passed to next/router in page: '"+c.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const P=(0,i.normalizeRepeatedSlashes)(E);p=(g?g[0]:"")+P}if(!(0,a.isLocalURL)(p))return h?[p]:p;try{y=new URL(p.startsWith("#")?c.asPath:c.pathname,"http://n")}catch{y=new URL("/","http://n")}try{const P=new URL(p,y);P.pathname=(0,s.normalizePathTrailingSlash)(P.pathname);let b="";if((0,u.isDynamicRoute)(P.pathname)&&P.searchParams&&h){const A=(0,r.searchParamsToUrlQuery)(P.searchParams),{result:S,params:C}=(0,d.interpolateAs)(P.pathname,P.pathname,A);S&&(b=(0,n.formatWithValidation)({pathname:S,hash:P.hash,query:(0,o.omit)(A,C)}))}const _=P.origin===y.origin?P.href.slice(P.origin.length):P.href;return h?[_,b||_]:_}catch{return h?[p]:p}}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(qe,qe.exports)),qe.exports}var $e={exports:{}},Rt={},zt={},sn;function an(){return sn||(sn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addPathPrefix",{enumerable:!0,get:function(){return r}});const t=Lt();function r(n,o){if(!n.startsWith("/")||!o)return n;const{pathname:i,query:s,hash:a}=(0,t.parsePath)(n);return""+o+i+s+a}}(zt)),zt}var ln;function Is(){return ln||(ln=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return n}});const t=an(),r=Vr();function n(o,i,s,a){if(!i||i===s)return o;const u=o.toLowerCase();return!a&&((0,r.pathHasPrefix)(u,"/api")||(0,r.pathHasPrefix)(u,"/"+i.toLowerCase()))?o:(0,t.addPathPrefix)(o,"/"+i)}}(Rt)),Rt}var un;function ks(){return un||(un=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return n}});const r=ze(),n=function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];return process.env.__NEXT_I18N_SUPPORT?(0,r.normalizePathTrailingSlash)(Is().addLocale(o,...s)):o};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}($e,$e.exports)),$e.exports}var Kt={},cn;function xs(){return cn||(cn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RouterContext",{enumerable:!0,get:function(){return n}});const n=Le._(v).default.createContext(null);process.env.NODE_ENV!=="production"&&(n.displayName="RouterContext")}(Kt)),Kt}var $t={},dn;function Bs(){return dn||(dn=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function t(d,f){for(var c in f)Object.defineProperty(d,c,{enumerable:!0,get:f[c]})}t(e,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return i},MissingSlotContext:function(){return u},TemplateContext:function(){return a}});const n=Le._(v),o=n.default.createContext(null),i=n.default.createContext(null),s=n.default.createContext(null),a=n.default.createContext(null);process.env.NODE_ENV!=="production"&&(o.displayName="AppRouterContext",i.displayName="LayoutRouterContext",s.displayName="GlobalLayoutRouterContext",a.displayName="TemplateContext");const u=n.default.createContext(new Set)}($t)),$t}var We={exports:{}},Qe={exports:{}},fn;function js(){return fn||(fn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function r(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}r(t,{cancelIdleCallback:function(){return o},requestIdleCallback:function(){return n}});const n=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(i){let s=Date.now();return self.setTimeout(function(){i({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-s))}})},1)},o=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(i){return clearTimeout(i)};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Qe,Qe.exports)),Qe.exports}var pn;function Fs(){return pn||(pn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return d}});const r=v,n=js(),o=typeof IntersectionObserver=="function",i=new Map,s=[];function a(f){const c={root:f.root||null,margin:f.rootMargin||""},m=s.find(g=>g.root===c.root&&g.margin===c.margin);let h;if(m&&(h=i.get(m),h))return h;const y=new Map,p=new IntersectionObserver(g=>{g.forEach(E=>{const O=y.get(E.target),P=E.isIntersecting||E.intersectionRatio>0;O&&P&&O(P)})},f);return h={id:c,observer:p,elements:y},s.push(c),i.set(c,h),h}function u(f,c,m){const{id:h,observer:y,elements:p}=a(m);return p.set(f,c),y.observe(f),function(){if(p.delete(f),y.unobserve(f),p.size===0){y.disconnect(),i.delete(h);const E=s.findIndex(O=>O.root===h.root&&O.margin===h.margin);E>-1&&s.splice(E,1)}}}function d(f){let{rootRef:c,rootMargin:m,disabled:h}=f;const y=h||!o,[p,g]=(0,r.useState)(!1),E=(0,r.useRef)(null),O=(0,r.useCallback)(b=>{E.current=b},[]);(0,r.useEffect)(()=>{if(o){if(y||p)return;const b=E.current;if(b&&b.tagName)return u(b,A=>A&&g(A),{root:c==null?void 0:c.current,rootMargin:m})}else if(!p){const b=(0,n.requestIdleCallback)(()=>g(!0));return()=>(0,n.cancelIdleCallback)(b)}},[y,m,c,p,E.current]);const P=(0,r.useCallback)(()=>{g(!1)},[]);return[O,p,P]}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(We,We.exports)),We.exports}var Ge={exports:{}},Xe={exports:{}},Wt={},hn;function Ds(){return hn||(hn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return t}});function t(r,n){let o;const i=r.split("/");return(n||[]).some(s=>i[1]&&i[1].toLowerCase()===s.toLowerCase()?(o=s,i.splice(1,1),r=i.join("/")||"/",!0):!1),{pathname:r,detectedLocale:o}}}(Wt)),Wt}var yn;function Hs(){return yn||(yn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return r}});const r=(n,o)=>process.env.__NEXT_I18N_SUPPORT?Ds().normalizeLocalePath(n,o):{pathname:n,detectedLocale:void 0};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Xe,Xe.exports)),Xe.exports}var Je={exports:{}},Qt={},gn;function qs(){return gn||(gn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return t}});function t(r,n,o){if(r){o&&(o=o.toLowerCase());for(const a of r){var i,s;const u=(i=a.domain)==null?void 0:i.split(":",1)[0].toLowerCase();if(n===u||o===a.defaultLocale.toLowerCase()||(s=a.locales)!=null&&s.some(d=>d.toLowerCase()===o))return a}}}}(Qt)),Qt}var mn;function Us(){return mn||(mn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}});const r=function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];if(process.env.__NEXT_I18N_SUPPORT)return qs().detectDomainLocale(...o)};(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Je,Je.exports)),Je.exports}var bn;function Vs(){return bn||(bn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return o}});const r=ze(),n=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i,s,a,u){if(process.env.__NEXT_I18N_SUPPORT){const d=Hs().normalizeLocalePath,f=Us().detectDomainLocale,c=s||d(i,a).detectedLocale,m=f(u,void 0,c);if(m){const h="http"+(m.http?"":"s")+"://",y=c===m.defaultLocale?"":"/"+c;return""+h+m.domain+(0,r.normalizePathTrailingSlash)(""+n+y+i)}return!1}else return!1}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ge,Ge.exports)),Ge.exports}var Ze={exports:{}},vn;function Rs(){return vn||(vn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return i}});const r=an(),n=ze(),o=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s,a){return(0,n.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!a?s:(0,r.addPathPrefix)(s,o))}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ze,Ze.exports)),Ze.exports}var Ye={exports:{}},En;function zs(){return En||(En=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});function r(h,y){for(var p in y)Object.defineProperty(h,p,{enumerable:!0,get:y[p]})}r(t,{ACTION_FAST_REFRESH:function(){return u},ACTION_NAVIGATE:function(){return o},ACTION_PREFETCH:function(){return a},ACTION_REFRESH:function(){return n},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return s},PrefetchCacheEntryStatus:function(){return c},PrefetchKind:function(){return f},isThenable:function(){return m}});const n="refresh",o="navigate",i="restore",s="server-patch",a="prefetch",u="fast-refresh",d="server-action";var f;(function(h){h.AUTO="auto",h.FULL="full",h.TEMPORARY="temporary"})(f||(f={}));var c;(function(h){h.fresh="fresh",h.reusable="reusable",h.expired="expired",h.stale="stale"})(c||(c={}));function m(h){return h&&(typeof h=="object"||typeof h=="function")&&typeof h.then=="function"}(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}(Ye,Ye.exports)),Ye.exports}(function(e,t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return A}});const r=Le,n=ts,o=r._(v),i=Ns(),s=Kr(),a=xr(),u=Ve(),d=ks(),f=xs(),c=Bs(),m=Fs(),h=Vs(),y=Rs(),p=zs(),g=new Set;function E(S,C,N,I,M,q){if(typeof window>"u"||!q&&!(0,s.isLocalURL)(C))return;if(!I.bypassPrefetchedCheck){const U=typeof I.locale<"u"?I.locale:"locale"in S?S.locale:void 0,V=C+"%"+N+"%"+U;if(g.has(V))return;g.add(V)}(async()=>q?S.prefetch(C,M):S.prefetch(C,N,I))().catch(U=>{if(process.env.NODE_ENV!=="production")throw U})}function O(S){const N=S.currentTarget.getAttribute("target");return N&&N!=="_self"||S.metaKey||S.ctrlKey||S.shiftKey||S.altKey||S.nativeEvent&&S.nativeEvent.which===2}function P(S,C,N,I,M,q,j,U,V){const{nodeName:K}=S.currentTarget;if(K.toUpperCase()==="A"&&(O(S)||!V&&!(0,s.isLocalURL)(N)))return;S.preventDefault();const R=()=>{const $=j??!0;"beforePopState"in C?C[M?"replace":"push"](N,I,{shallow:q,locale:U,scroll:$}):C[M?"replace":"push"](I||N,{scroll:$})};V?o.default.startTransition(R):R()}function b(S){return typeof S=="string"?S:(0,a.formatUrl)(S)}const A=o.default.forwardRef(function(C,N){let I;const{href:M,as:q,children:j,prefetch:U=null,passHref:V,replace:K,shallow:W,scroll:R,locale:$,onClick:Q,onMouseEnter:ne,onTouchStart:G,legacyBehavior:Y=!1,...He}=C;I=j,Y&&(typeof I=="string"||typeof I=="number")&&(I=(0,n.jsx)("a",{children:I}));const X=o.default.useContext(f.RouterContext),Tr=o.default.useContext(c.AppRouterContext),F=X??Tr,te=!X,de=U!==!1,Pe=U===null?p.PrefetchKind.AUTO:p.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let D=function(H){return new Error("Failed prop type: The prop `"+H.key+"` expects a "+H.expected+" in `<Link>`, but got `"+H.actual+"` instead."+(typeof window<"u"?`
2
+ Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(H=>{if(H==="href"&&(C[H]==null||typeof C[H]!="string"&&typeof C[H]!="object"))throw D({key:H,expected:"`string` or `object`",actual:C[H]===null?"null":typeof C[H]})}),Object.keys({as:!0,replace:!0,scroll:!0,shallow:!0,passHref:!0,prefetch:!0,locale:!0,onClick:!0,onMouseEnter:!0,onTouchStart:!0,legacyBehavior:!0}).forEach(H=>{const he=typeof C[H];if(H==="as"){if(C[H]&&he!=="string"&&he!=="object")throw D({key:H,expected:"`string` or `object`",actual:he})}else if(H==="locale"){if(C[H]&&he!=="string")throw D({key:H,expected:"`string`",actual:he})}else if(H==="onClick"||H==="onMouseEnter"||H==="onTouchStart"){if(C[H]&&he!=="function")throw D({key:H,expected:"`function`",actual:he})}else if((H==="replace"||H==="scroll"||H==="shallow"||H==="passHref"||H==="prefetch"||H==="legacyBehavior")&&C[H]!=null&&he!=="boolean")throw D({key:H,expected:"`boolean`",actual:he})});const Yo=o.default.useRef(!1);C.prefetch&&!Yo.current&&!te&&(Yo.current=!0,console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated"))}if(process.env.NODE_ENV!=="production"&&te&&!q){let D;if(typeof M=="string"?D=M:typeof M=="object"&&typeof M.pathname=="string"&&(D=M.pathname),D&&D.split("/").some(Oe=>Oe.startsWith("[")&&Oe.endsWith("]")))throw new Error("Dynamic href `"+D+"` found in <Link> while using the `/app` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href")}const{href:pe,as:se}=o.default.useMemo(()=>{if(!X){const Oe=b(M);return{href:Oe,as:q?b(q):Oe}}const[D,ve]=(0,i.resolveHref)(X,M,!0);return{href:D,as:q?(0,i.resolveHref)(X,q):ve||D}},[X,M,q]),Qo=o.default.useRef(pe),Go=o.default.useRef(se);let re;if(Y)if(process.env.NODE_ENV==="development"){Q&&console.warn('"onClick" was passed to <Link> with `href` of `'+M+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),ne&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+M+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{re=o.default.Children.only(I)}catch{throw I?new Error("Multiple children were passed to <Link> with `href` of `"+M+"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"+(typeof window<"u"?`
3
+ Open your browser's console to view the Component stack trace.`:"")):new Error("No children were passed to <Link> with `href` of `"+M+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else re=o.default.Children.only(I);else if(process.env.NODE_ENV==="development"&&(I==null?void 0:I.type)==="a")throw new Error(`Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
4
+ Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor`);const Ce=Y?re&&typeof re=="object"&&re.ref:N,[Xo,Jo,Zo]=(0,m.useIntersection)({rootMargin:"200px"}),nu=o.default.useCallback(D=>{(Go.current!==se||Qo.current!==pe)&&(Zo(),Go.current=se,Qo.current=pe),Xo(D),Ce&&(typeof Ce=="function"?Ce(D):typeof Ce=="object"&&(Ce.current=D))},[se,Ce,pe,Zo,Xo]);o.default.useEffect(()=>{process.env.NODE_ENV==="production"&&F&&(!Jo||!de||E(F,pe,se,{locale:$},{kind:Pe},te))},[se,pe,Jo,$,de,X==null?void 0:X.locale,F,te,Pe]);const bt={ref:nu,onClick(D){if(process.env.NODE_ENV!=="production"&&!D)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!Y&&typeof Q=="function"&&Q(D),Y&&re.props&&typeof re.props.onClick=="function"&&re.props.onClick(D),F&&(D.defaultPrevented||P(D,F,pe,se,K,W,R,$,te))},onMouseEnter(D){!Y&&typeof ne=="function"&&ne(D),Y&&re.props&&typeof re.props.onMouseEnter=="function"&&re.props.onMouseEnter(D),F&&((!de||process.env.NODE_ENV==="development")&&te||E(F,pe,se,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:Pe},te))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(ve){!Y&&typeof G=="function"&&G(ve),Y&&re.props&&typeof re.props.onTouchStart=="function"&&re.props.onTouchStart(ve),F&&(!de&&te||E(F,pe,se,{locale:$,priority:!0,bypassPrefetchedCheck:!0},{kind:Pe},te))}};if((0,u.isAbsoluteUrl)(se))bt.href=se;else if(!Y||V||re.type==="a"&&!("href"in re.props)){const D=typeof $<"u"?$:X==null?void 0:X.locale,ve=(X==null?void 0:X.isLocaleDomain)&&(0,h.getDomainLocale)(se,D,X==null?void 0:X.locales,X==null?void 0:X.domainLocales);bt.href=ve||(0,y.addBasePath)((0,d.addLocale)(se,D,X==null?void 0:X.defaultLocale))}return Y?o.default.cloneElement(re,bt):(0,n.jsx)("a",{...He,...bt,children:I})});(typeof t.default=="function"||typeof t.default=="object"&&t.default!==null)&&typeof t.default.__esModule>"u"&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)})(Pt,Pt.exports);var Ks=Pt.exports,$s=Ks;const Ws=gs($s);function Gt({breadcrumbs:e,...t}){return l.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",trait:"typo.h5",...t,children:e.map((r,n)=>l.jsx(Qs,{breadcrumb:r,showSeparator:n>0},n))})}function Qs({breadcrumb:e,showSeparator:t}){return l.jsxs(l.Fragment,{children:[t&&l.jsx(T.Icon,{path:ls,mx:"1"}),l.jsx(Ws,{href:`/${e.path??"#"}`,children:l.jsx("span",{hover_textDecoration:e.path?"underline":void 0,cursor:e.path?"pointer":void 0,children:e.label})})]})}function et({buildDialog:e,...t}){const[r,n]=v.useState(!1),o=v.useCallback(s=>{s==null||s.preventDefault(),s==null||s.stopPropagation(),n(!0)},[n]),i=v.useCallback(()=>{n(!1)},[n]);return l.jsxs(l.Fragment,{children:[l.jsx(T.Button,{onClick:o,...t}),r&&e(i)]})}function Gs({icon:e,...t}){return l.jsx(T.Button,{variant:"glass",w:"10",h:"10",rounded:"full",...t,children:l.jsx(T.Icon,{path:e})})}function wn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xs}=Object.prototype,{getPrototypeOf:Xt}=Object,tt=(e=>t=>{const r=Xs.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ue=e=>(e=e.toLowerCase(),t=>tt(t)===e),rt=e=>t=>typeof t===e,{isArray:_e}=Array,Me=rt("undefined");function Js(e){return e!==null&&!Me(e)&&e.constructor!==null&&!Me(e.constructor)&&ie(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Pn=ue("ArrayBuffer");function Zs(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Pn(e.buffer),t}const Ys=rt("string"),ie=rt("function"),_n=rt("number"),nt=e=>e!==null&&typeof e=="object",ei=e=>e===!0||e===!1,ot=e=>{if(tt(e)!=="object")return!1;const t=Xt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ti=ue("Date"),ri=ue("File"),ni=ue("Blob"),oi=ue("FileList"),si=e=>nt(e)&&ie(e.pipe),ii=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ie(e.append)&&((t=tt(e))==="formdata"||t==="object"&&ie(e.toString)&&e.toString()==="[object FormData]"))},ai=ue("URLSearchParams"),li=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),_e(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function Tn(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Cn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,On=e=>!Me(e)&&e!==Cn;function Jt(){const{caseless:e}=On(this)&&this||{},t={},r=(n,o)=>{const i=e&&Tn(t,o)||o;ot(t[i])&&ot(n)?t[i]=Jt(t[i],n):ot(n)?t[i]=Jt({},n):_e(n)?t[i]=n.slice():t[i]=n};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&Ne(arguments[n],r);return t}const ui=(e,t,r,{allOwnKeys:n}={})=>(Ne(t,(o,i)=>{r&&ie(o)?e[i]=wn(o,r):e[i]=o},{allOwnKeys:n}),e),ci=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),di=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},fi=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Xt(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},pi=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},hi=e=>{if(!e)return null;if(_e(e))return e;let t=e.length;if(!_n(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},yi=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xt(Uint8Array)),gi=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},mi=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},bi=ue("HTMLFormElement"),vi=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),An=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ei=ue("RegExp"),Sn=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ne(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},wi=e=>{Sn(e,(t,r)=>{if(ie(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ie(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pi=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return _e(e)?n(e):n(String(e).split(t)),r},_i=()=>{},Ti=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Zt="abcdefghijklmnopqrstuvwxyz",Ln="0123456789",Mn={DIGIT:Ln,ALPHA:Zt,ALPHA_DIGIT:Zt+Zt.toUpperCase()+Ln},Ci=(e=16,t=Mn.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Oi(e){return!!(e&&ie(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Ai=e=>{const t=new Array(10),r=(n,o)=>{if(nt(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[o]=n;const i=_e(n)?[]:{};return Ne(n,(s,a)=>{const u=r(s,o+1);!Me(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},Si=ue("AsyncFunction"),w={isArray:_e,isArrayBuffer:Pn,isBuffer:Js,isFormData:ii,isArrayBufferView:Zs,isString:Ys,isNumber:_n,isBoolean:ei,isObject:nt,isPlainObject:ot,isUndefined:Me,isDate:ti,isFile:ri,isBlob:ni,isRegExp:Ei,isFunction:ie,isStream:si,isURLSearchParams:ai,isTypedArray:yi,isFileList:oi,forEach:Ne,merge:Jt,extend:ui,trim:li,stripBOM:ci,inherits:di,toFlatObject:fi,kindOf:tt,kindOfTest:ue,endsWith:pi,toArray:hi,forEachEntry:gi,matchAll:mi,isHTMLForm:bi,hasOwnProperty:An,hasOwnProp:An,reduceDescriptors:Sn,freezeMethods:wi,toObjectSet:Pi,toCamelCase:vi,noop:_i,toFiniteNumber:Ti,findKey:Tn,global:Cn,isContextDefined:On,ALPHABET:Mn,generateString:Ci,isSpecCompliantForm:Oi,toJSONObject:Ai,isAsyncFn:Si,isThenable:e=>e&&(nt(e)||ie(e))&&ie(e.then)&&ie(e.catch)};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}w.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:w.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Nn=B.prototype,In={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{In[e]={value:e}}),Object.defineProperties(B,In),Object.defineProperty(Nn,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,i)=>{const s=Object.create(Nn);return w.toFlatObject(e,s,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),B.call(s,e.message,t,r,n,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const Li=null;function Yt(e){return w.isPlainObject(e)||w.isArray(e)}function kn(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function xn(e,t,r){return e?e.concat(t).map(function(o,i){return o=kn(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Mi(e){return w.isArray(e)&&!e.some(Yt)}const Ni=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});function st(e,t,r){if(!w.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=w.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!w.isUndefined(g[p])});const n=r.metaTokens,o=r.visitor||f,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&w.isSpecCompliantForm(t);if(!w.isFunction(o))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(w.isDate(y))return y.toISOString();if(!u&&w.isBlob(y))throw new B("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(y)||w.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function f(y,p,g){let E=y;if(y&&!g&&typeof y=="object"){if(w.endsWith(p,"{}"))p=n?p:p.slice(0,-2),y=JSON.stringify(y);else if(w.isArray(y)&&Mi(y)||(w.isFileList(y)||w.endsWith(p,"[]"))&&(E=w.toArray(y)))return p=kn(p),E.forEach(function(P,b){!(w.isUndefined(P)||P===null)&&t.append(s===!0?xn([p],b,i):s===null?p:p+"[]",d(P))}),!1}return Yt(y)?!0:(t.append(xn(g,p,i),d(y)),!1)}const c=[],m=Object.assign(Ni,{defaultVisitor:f,convertValue:d,isVisitable:Yt});function h(y,p){if(!w.isUndefined(y)){if(c.indexOf(y)!==-1)throw Error("Circular reference detected in "+p.join("."));c.push(y),w.forEach(y,function(E,O){(!(w.isUndefined(E)||E===null)&&o.call(t,E,w.isString(O)?O.trim():O,p,m))===!0&&h(E,p?p.concat(O):[O])}),c.pop()}}if(!w.isObject(e))throw new TypeError("data must be an object");return h(e),t}function Bn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function er(e,t){this._pairs=[],e&&st(e,this,t)}const jn=er.prototype;jn.append=function(t,r){this._pairs.push([t,r])},jn.toString=function(t){const r=t?function(n){return t.call(this,n,Bn)}:Bn;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Ii(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Fn(e,t,r){if(!t)return e;const n=r&&r.encode||Ii,o=r&&r.serialize;let i;if(o?i=o(t,r):i=w.isURLSearchParams(t)?t.toString():new er(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Dn{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){w.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Hn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ki={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:er,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},qn=typeof window<"u"&&typeof document<"u",xi=(e=>qn&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Bi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ce={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qn,hasStandardBrowserEnv:xi,hasStandardBrowserWebWorkerEnv:Bi},Symbol.toStringTag,{value:"Module"})),...ki};function ji(e,t){return st(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(r,n,o,i){return ce.isNode&&w.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Fi(e){return w.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Di(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Un(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=r.length;return s=!s&&w.isArray(o)?o.length:s,u?(w.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!w.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&w.isArray(o[s])&&(o[s]=Di(o[s])),!a)}if(w.isFormData(e)&&w.isFunction(e.entries)){const r={};return w.forEachEntry(e,(n,o)=>{t(Fi(n),o,r,0)}),r}return null}function Hi(e,t,r){if(w.isString(e))try{return(t||JSON.parse)(e),w.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const tr={transitional:Hn,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=w.isObject(t);if(i&&w.isHTMLForm(t)&&(t=new FormData(t)),w.isFormData(t))return o?JSON.stringify(Un(t)):t;if(w.isArrayBuffer(t)||w.isBuffer(t)||w.isStream(t)||w.isFile(t)||w.isBlob(t))return t;if(w.isArrayBufferView(t))return t.buffer;if(w.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return ji(t,this.formSerializer).toString();if((a=w.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return st(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Hi(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(t&&w.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?B.from(a,B.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch"],e=>{tr.headers[e]={}});const rr=tr,qi=w.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ui=e=>{const t={};let r,n,o;return e&&e.split(`
5
+ `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&qi[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Vn=Symbol("internals");function Ie(e){return e&&String(e).trim().toLowerCase()}function it(e){return e===!1||e==null?e:w.isArray(e)?e.map(it):String(e)}function Vi(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Ri=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function nr(e,t,r,n,o){if(w.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!w.isString(t)){if(w.isString(n))return t.indexOf(n)!==-1;if(w.isRegExp(n))return n.test(t)}}function zi(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Ki(e,t){const r=w.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}class at{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,d){const f=Ie(u);if(!f)throw new Error("header name must be a non-empty string");const c=w.findKey(o,f);(!c||o[c]===void 0||d===!0||d===void 0&&o[c]!==!1)&&(o[c||u]=it(a))}const s=(a,u)=>w.forEach(a,(d,f)=>i(d,f,u));return w.isPlainObject(t)||t instanceof this.constructor?s(t,r):w.isString(t)&&(t=t.trim())&&!Ri(t)?s(Ui(t),r):t!=null&&i(r,t,n),this}get(t,r){if(t=Ie(t),t){const n=w.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Vi(o);if(w.isFunction(r))return r.call(this,o,n);if(w.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ie(t),t){const n=w.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||nr(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=Ie(s),s){const a=w.findKey(n,s);a&&(!r||nr(n,n[a],a,r))&&(delete n[a],o=!0)}}return w.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||nr(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return w.forEach(this,(o,i)=>{const s=w.findKey(n,i);if(s){r[s]=it(o),delete r[i];return}const a=t?zi(i):String(i).trim();a!==i&&delete r[i],r[a]=it(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return w.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&w.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
6
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Vn]=this[Vn]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Ie(s);n[a]||(Ki(o,s),n[a]=!0)}return w.isArray(t)?t.forEach(i):i(t),this}}at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(at.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),w.freezeMethods(at);const fe=at;function or(e,t){const r=this||rr,n=t||r,o=fe.from(n.headers);let i=n.data;return w.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Rn(e){return!!(e&&e.__CANCEL__)}function ke(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}w.inherits(ke,B,{__CANCEL__:!0});function $i(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Wi=ce.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const s=[e+"="+encodeURIComponent(t)];w.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),w.isString(n)&&s.push("path="+n),w.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Qi(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gi(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zn(e,t){return e&&!Qi(t)?Gi(e,t):t}const Xi=ce.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function o(i){let s=i;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(s){const a=w.isString(s)?o(s):s;return a.protocol===n.protocol&&a.host===n.host}}():function(){return function(){return!0}}();function Ji(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Zi(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),f=n[i];s||(s=d),r[o]=u,n[o]=d;let c=i,m=0;for(;c!==o;)m+=r[c++],c=c%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const h=f&&d-f;return h?Math.round(m*1e3/h):void 0}}function Kn(e,t){let r=0;const n=Zi(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-r,u=n(a),d=i<=s;r=i;const f={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&d?(s-i)/u:void 0,event:o};f[t?"download":"upload"]=!0,e(f)}}const sr={http:Li,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){let o=e.data;const i=fe.from(e.headers).normalize();let{responseType:s,withXSRFToken:a}=e,u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let f;if(w.isFormData(o)){if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((f=i.getContentType())!==!1){const[p,...g]=f?f.split(";").map(E=>E.trim()).filter(Boolean):[];i.setContentType([p||"multipart/form-data",...g].join("; "))}}let c=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+g))}const m=zn(e.baseURL,e.url);c.open(e.method.toUpperCase(),Fn(m,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function h(){if(!c)return;const p=fe.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),E={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:p,config:e,request:c};$i(function(P){r(P),d()},function(P){n(P),d()},E),c=null}if("onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(h)},c.onabort=function(){c&&(n(new B("Request aborted",B.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new B("Network Error",B.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let g=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const E=e.transitional||Hn;e.timeoutErrorMessage&&(g=e.timeoutErrorMessage),n(new B(g,E.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,c)),c=null},ce.hasStandardBrowserEnv&&(a&&w.isFunction(a)&&(a=a(e)),a||a!==!1&&Xi(m))){const p=e.xsrfHeaderName&&e.xsrfCookieName&&Wi.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in c&&w.forEach(i.toJSON(),function(g,E){c.setRequestHeader(E,g)}),w.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&s!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Kn(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Kn(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=p=>{c&&(n(!p||p.type?new ke(null,e,c):p),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const y=Ji(m);if(y&&ce.protocols.indexOf(y)===-1){n(new B("Unsupported protocol "+y+":",B.ERR_BAD_REQUEST,e));return}c.send(o||null)})}};w.forEach(sr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $n=e=>`- ${e}`,Yi=e=>w.isFunction(e)||e===null||e===!1,Wn={getAdapter:e=>{e=w.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let i=0;i<t;i++){r=e[i];let s;if(n=r,!Yi(r)&&(n=sr[(s=String(r)).toLowerCase()],n===void 0))throw new B(`Unknown adapter '${s}'`);if(n)break;o[s||"#"+i]=n}if(!n){const i=Object.entries(o).map(([a,u])=>`adapter ${a} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
7
+ `+i.map($n).join(`
8
+ `):" "+$n(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:sr};function ir(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function Qn(e){return ir(e),e.headers=fe.from(e.headers),e.data=or.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Wn.getAdapter(e.adapter||rr.adapter)(e).then(function(n){return ir(e),n.data=or.call(e,e.transformResponse,n),n.headers=fe.from(n.headers),n},function(n){return Rn(n)||(ir(e),n&&n.response&&(n.response.data=or.call(e,e.transformResponse,n.response),n.response.headers=fe.from(n.response.headers))),Promise.reject(n)})}const Gn=e=>e instanceof fe?e.toJSON():e;function Te(e,t){t=t||{};const r={};function n(d,f,c){return w.isPlainObject(d)&&w.isPlainObject(f)?w.merge.call({caseless:c},d,f):w.isPlainObject(f)?w.merge({},f):w.isArray(f)?f.slice():f}function o(d,f,c){if(w.isUndefined(f)){if(!w.isUndefined(d))return n(void 0,d,c)}else return n(d,f,c)}function i(d,f){if(!w.isUndefined(f))return n(void 0,f)}function s(d,f){if(w.isUndefined(f)){if(!w.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function a(d,f,c){if(c in t)return n(d,f);if(c in e)return n(void 0,d)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(d,f)=>o(Gn(d),Gn(f),!0)};return w.forEach(Object.keys(Object.assign({},e,t)),function(f){const c=u[f]||o,m=c(e[f],t[f],f);w.isUndefined(m)&&c!==a||(r[f]=m)}),r}const Xn="1.6.7",ar={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ar[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Jn={};ar.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Xn+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new B(o(s," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Jn[s]&&(Jn[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}};function ea(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new B("option "+i+" must be "+u,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const lr={assertOptions:ea,validators:ar},ye=lr.validators;class lt{constructor(t){this.defaults=t,this.interceptors={request:new Dn,response:new Dn}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
9
+ `+i):n.stack=i}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Te(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&lr.assertOptions(n,{silentJSONParsing:ye.transitional(ye.boolean),forcedJSONParsing:ye.transitional(ye.boolean),clarifyTimeoutError:ye.transitional(ye.boolean)},!1),o!=null&&(w.isFunction(o)?r.paramsSerializer={serialize:o}:lr.assertOptions(o,{encode:ye.function,serialize:ye.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&w.merge(i.common,i[r.method]);i&&w.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),r.headers=fe.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let f,c=0,m;if(!u){const y=[Qn.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,d),m=y.length,f=Promise.resolve(r);c<m;)f=f.then(y[c++],y[c++]);return f}m=a.length;let h=r;for(c=0;c<m;){const y=a[c++],p=a[c++];try{h=y(h)}catch(g){p.call(this,g);break}}try{f=Qn.call(this,h)}catch(y){return Promise.reject(y)}for(c=0,m=d.length;c<m;)f=f.then(d[c++],d[c++]);return f}getUri(t){t=Te(this.defaults,t);const r=zn(t.baseURL,t.url);return Fn(r,t.params,t.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(t){lt.prototype[t]=function(r,n){return this.request(Te(n||{},{method:t,url:r,data:(n||{}).data}))}}),w.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(Te(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}lt.prototype[t]=r(),lt.prototype[t+"Form"]=r(!0)});const ut=lt;class ur{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new ke(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new ur(function(o){t=o}),cancel:t}}}const ta=ur;function ra(e){return function(r){return e.apply(null,r)}}function na(e){return w.isObject(e)&&e.isAxiosError===!0}const cr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cr).forEach(([e,t])=>{cr[t]=e});const oa=cr;function Zn(e){const t=new ut(e),r=wn(ut.prototype.request,t);return w.extend(r,ut.prototype,t,{allOwnKeys:!0}),w.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Zn(Te(e,o))},r}const Z=Zn(rr);Z.Axios=ut,Z.CanceledError=ke,Z.CancelToken=ta,Z.isCancel=Rn,Z.VERSION=Xn,Z.toFormData=st,Z.AxiosError=B,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=ra,Z.isAxiosError=na,Z.mergeConfig=Te,Z.AxiosHeaders=fe,Z.formToJSON=e=>Un(w.isHTMLForm(e)?new FormData(e):e),Z.getAdapter=Wn.getAdapter,Z.HttpStatusCode=oa,Z.default=Z;const Yn={adminApiURL:"",nextAPIURL:"",invalidateToken:""};class eo extends x.BaseAPI{constructor(r){console.warn("AdminAPI: nextAPIURL is not set. Please set it in the AdminApiProvider."),console.warn("AdminAPI: invalidateToken is not set. Please set it in the AdminApiProvider.");const n=Z.create({baseURL:Yn.nextAPIURL,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Invalidate-Token":Yn.invalidateToken},withCredentials:!0});super(n,"api/invalidate");es(this,"pathOrPermalink");this.pathOrPermalink=r,this.invalidate=this.invalidate.bind(this)}invalidate(){let r=this.pathOrPermalink;if(r.startsWith("https://")){const n=r.substring(8);r=n.substring(n.indexOf("/"))}if(r.startsWith("http://")){const n=r.substring(7);r=n.substring(n.indexOf("/"))}return r.startsWith("/")||console.warn("Invalidate: string does not start with /: ",r,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{path:r})}invalidateCustomPath(r){let n=r;if(r.startsWith("https://")){const o=r.substring(8);n=o.substring(o.indexOf("/"))}if(r.startsWith("http://")){const o=r.substring(7);n=o.substring(o.indexOf("/"))}return n.startsWith("/")||console.warn("Invalidate: string does not start with /: ",r,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{_path:n})}}const sa={new:e=>new eo(e),custom:()=>new eo("")};function dr({pathOrPermalink:e,...t}){const r=sa.new(e),n=x.useApiMutation(r.invalidate,r.queryKey),o=x.useMutate(n,{successMsg:"Page successfully invalidated"});return l.jsx(T.Button,{scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",title:"Regenerate",disabled:n.isLoading,onClick:o,...t,children:l.jsx(T.Icon,{path:cs})})}function ia({path:e,...t}){const r=le.useNavigate(),n=v.useCallback(()=>{r(e)},[r,e]);return l.jsx(T.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:n,...t,children:l.jsx(T.Icon,{path:hs})})}function to(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=to(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ge(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=to(e))&&(n&&(n+=" "),n+=t);return n}const xe=e=>typeof e=="number"&&!isNaN(e),Ee=e=>typeof e=="string",oe=e=>typeof e=="function",ct=e=>Ee(e)||oe(e)?e:null,fr=e=>v.isValidElement(e)||Ee(e)||oe(e)||xe(e);function aa(e,t,r){r===void 0&&(r=300);const{scrollHeight:n,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=n+"px",o.transition=`all ${r}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,r)})})}function dt(e){let{enter:t,exit:r,appendPosition:n=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(s){let{children:a,position:u,preventExitTransition:d,done:f,nodeRef:c,isIn:m}=s;const h=n?`${t}--${u}`:t,y=n?`${r}--${u}`:r,p=v.useRef(0);return v.useLayoutEffect(()=>{const g=c.current,E=h.split(" "),O=P=>{P.target===c.current&&(g.dispatchEvent(new Event("d")),g.removeEventListener("animationend",O),g.removeEventListener("animationcancel",O),p.current===0&&P.type!=="animationcancel"&&g.classList.remove(...E))};g.classList.add(...E),g.addEventListener("animationend",O),g.addEventListener("animationcancel",O)},[]),v.useEffect(()=>{const g=c.current,E=()=>{g.removeEventListener("animationend",E),o?aa(g,f,i):f()};m||(d?E():(p.current=1,g.className+=` ${y}`,g.addEventListener("animationend",E)))},[m]),v.createElement(v.Fragment,null,a)}}function ro(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const ae={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const r=this.list.get(e).filter(n=>n!==t);return this.list.set(e,r),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const r=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(r)})}},ft=e=>{let{theme:t,type:r,...n}=e;return v.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${r})`,...n})},pr={info:function(e){return v.createElement(ft,{...e},v.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return v.createElement(ft,{...e},v.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return v.createElement(ft,{...e},v.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return v.createElement(ft,{...e},v.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return v.createElement("div",{className:"Toastify__spinner"})}};function la(e){const[,t]=v.useReducer(h=>h+1,0),[r,n]=v.useState([]),o=v.useRef(null),i=v.useRef(new Map).current,s=h=>r.indexOf(h)!==-1,a=v.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:h=>i.get(h)}).current;function u(h){let{containerId:y}=h;const{limit:p}=a.props;!p||y&&a.containerId!==y||(a.count-=a.queue.length,a.queue=[])}function d(h){n(y=>h==null?[]:y.filter(p=>p!==h))}function f(){const{toastContent:h,toastProps:y,staleId:p}=a.queue.shift();m(h,y,p)}function c(h,y){let{delay:p,staleId:g,...E}=y;if(!fr(h)||function(q){return!o.current||a.props.enableMultiContainer&&q.containerId!==a.props.containerId||i.has(q.toastId)&&q.updateId==null}(E))return;const{toastId:O,updateId:P,data:b}=E,{props:_}=a,A=()=>d(O),S=P==null;S&&a.count++;const C={..._,style:_.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(E).filter(q=>{let[j,U]=q;return U!=null})),toastId:O,updateId:P,data:b,closeToast:A,isIn:!1,className:ct(E.className||_.toastClassName),bodyClassName:ct(E.bodyClassName||_.bodyClassName),progressClassName:ct(E.progressClassName||_.progressClassName),autoClose:!E.isLoading&&(N=E.autoClose,I=_.autoClose,N===!1||xe(N)&&N>0?N:I),deleteToast(){const q=ro(i.get(O),"removed");i.delete(O),ae.emit(4,q);const j=a.queue.length;if(a.count=O==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),j>0){const U=O==null?a.props.limit:1;if(j===1||U===1)a.displayedToast++,f();else{const V=U>j?j:U;a.displayedToast=V;for(let K=0;K<V;K++)f()}}else t()}};var N,I;C.iconOut=function(q){let{theme:j,type:U,isLoading:V,icon:K}=q,W=null;const R={theme:j,type:U};return K===!1||(oe(K)?W=K(R):v.isValidElement(K)?W=v.cloneElement(K,R):Ee(K)||xe(K)?W=K:V?W=pr.spinner():($=>$ in pr)(U)&&(W=pr[U](R))),W}(C),oe(E.onOpen)&&(C.onOpen=E.onOpen),oe(E.onClose)&&(C.onClose=E.onClose),C.closeButton=_.closeButton,E.closeButton===!1||fr(E.closeButton)?C.closeButton=E.closeButton:E.closeButton===!0&&(C.closeButton=!fr(_.closeButton)||_.closeButton);let M=h;v.isValidElement(h)&&!Ee(h.type)?M=v.cloneElement(h,{closeToast:A,toastProps:C,data:b}):oe(h)&&(M=h({closeToast:A,toastProps:C,data:b})),_.limit&&_.limit>0&&a.count>_.limit&&S?a.queue.push({toastContent:M,toastProps:C,staleId:g}):xe(p)?setTimeout(()=>{m(M,C,g)},p):m(M,C,g)}function m(h,y,p){const{toastId:g}=y;p&&i.delete(p);const E={content:h,props:y};i.set(g,E),n(O=>[...O,g].filter(P=>P!==p)),ae.emit(4,ro(E,E.props.updateId==null?"added":"updated"))}return v.useEffect(()=>(a.containerId=e.containerId,ae.cancelEmit(3).on(0,c).on(1,h=>o.current&&d(h)).on(5,u).emit(2,a),()=>{i.clear(),ae.emit(3,a)}),[]),v.useEffect(()=>{a.props=e,a.isToastActive=s,a.displayedToast=r.length}),{getToastToRender:function(h){const y=new Map,p=Array.from(i.values());return e.newestOnTop&&p.reverse(),p.forEach(g=>{const{position:E}=g.props;y.has(E)||y.set(E,[]),y.get(E).push(g)}),Array.from(y,g=>h(g[0],g[1]))},containerRef:o,isToastActive:s}}function no(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function oo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function ua(e){const[t,r]=v.useState(!1),[n,o]=v.useState(!1),i=v.useRef(null),s=v.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=v.useRef(e),{autoClose:u,pauseOnHover:d,closeToast:f,onClick:c,closeOnClick:m}=e;function h(b){if(e.draggable){b.nativeEvent.type==="touchstart"&&b.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",E),document.addEventListener("mouseup",O),document.addEventListener("touchmove",E),document.addEventListener("touchend",O);const _=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=_.getBoundingClientRect(),_.style.transition="",s.x=no(b.nativeEvent),s.y=oo(b.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=_.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=_.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function y(b){if(s.boundingRect){const{top:_,bottom:A,left:S,right:C}=s.boundingRect;b.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=S&&s.x<=C&&s.y>=_&&s.y<=A?g():p()}}function p(){r(!0)}function g(){r(!1)}function E(b){const _=i.current;s.canDrag&&_&&(s.didMove=!0,t&&g(),s.x=no(b),s.y=oo(b),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),_.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,_.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function O(){document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",O);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void e.closeToast();b.style.transition="transform 0.2s, opacity 0.2s",b.style.transform=`translate${e.draggableDirection}(0)`,b.style.opacity="1"}}v.useEffect(()=>{a.current=e}),v.useEffect(()=>(i.current&&i.current.addEventListener("d",p,{once:!0}),oe(e.onOpen)&&e.onOpen(v.isValidElement(e.children)&&e.children.props),()=>{const b=a.current;oe(b.onClose)&&b.onClose(v.isValidElement(b.children)&&b.children.props)}),[]),v.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||g(),window.addEventListener("focus",p),window.addEventListener("blur",g)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",p),window.removeEventListener("blur",g))}),[e.pauseOnFocusLoss]);const P={onMouseDown:h,onTouchStart:h,onMouseUp:y,onTouchEnd:y};return u&&d&&(P.onMouseEnter=g,P.onMouseLeave=p),m&&(P.onClick=b=>{c&&c(b),s.canCloseOnClick&&f()}),{playToast:p,pauseToast:g,isRunning:t,preventExitTransition:n,toastRef:i,eventHandlers:P}}function so(e){let{closeToast:t,theme:r,ariaLabel:n="close"}=e;return v.createElement("button",{className:`Toastify__close-button Toastify__close-button--${r}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":n},v.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},v.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ca(e){let{delay:t,isRunning:r,closeToast:n,type:o="default",hide:i,className:s,style:a,controlledProgress:u,progress:d,rtl:f,isIn:c,theme:m}=e;const h=i||u&&d===0,y={...a,animationDuration:`${t}ms`,animationPlayState:r?"running":"paused",opacity:h?0:1};u&&(y.transform=`scaleX(${d})`);const p=ge("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${m}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":f}),g=oe(s)?s({rtl:f,type:o,defaultClassName:p}):ge(p,s);return v.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:g,style:y,[u&&d>=1?"onTransitionEnd":"onAnimationEnd"]:u&&d<1?null:()=>{c&&n()}})}const da=e=>{const{isRunning:t,preventExitTransition:r,toastRef:n,eventHandlers:o}=ua(e),{closeButton:i,children:s,autoClose:a,onClick:u,type:d,hideProgressBar:f,closeToast:c,transition:m,position:h,className:y,style:p,bodyClassName:g,bodyStyle:E,progressClassName:O,progressStyle:P,updateId:b,role:_,progress:A,rtl:S,toastId:C,deleteToast:N,isIn:I,isLoading:M,iconOut:q,closeOnClick:j,theme:U}=e,V=ge("Toastify__toast",`Toastify__toast-theme--${U}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":j}),K=oe(y)?y({rtl:S,position:h,type:d,defaultClassName:V}):ge(V,y),W=!!A||!a,R={closeToast:c,type:d,theme:U};let $=null;return i===!1||($=oe(i)?i(R):v.isValidElement(i)?v.cloneElement(i,R):so(R)),v.createElement(m,{isIn:I,done:N,position:h,preventExitTransition:r,nodeRef:n},v.createElement("div",{id:C,onClick:u,className:K,...o,style:p,ref:n},v.createElement("div",{...I&&{role:_},className:oe(g)?g({type:d}):ge("Toastify__toast-body",g),style:E},q!=null&&v.createElement("div",{className:ge("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!M})},q),v.createElement("div",null,s)),$,v.createElement(ca,{...b&&!W?{key:`pb-${b}`}:{},rtl:S,theme:U,delay:a,isRunning:t,isIn:I,closeToast:c,hide:f,type:d,style:P,className:O,controlledProgress:W,progress:A||0})))},pt=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},fa=dt(pt("bounce",!0));dt(pt("slide",!0)),dt(pt("zoom")),dt(pt("flip"));const io=v.forwardRef((e,t)=>{const{getToastToRender:r,containerRef:n,isToastActive:o}=la(e),{className:i,style:s,rtl:a,containerId:u}=e;function d(f){const c=ge("Toastify__toast-container",`Toastify__toast-container--${f}`,{"Toastify__toast-container--rtl":a});return oe(i)?i({position:f,rtl:a,defaultClassName:c}):ge(c,ct(i))}return v.useEffect(()=>{t&&(t.current=n.current)},[]),v.createElement("div",{ref:n,className:"Toastify",id:u},r((f,c)=>{const m=c.length?{...s}:{...s,pointerEvents:"none"};return v.createElement("div",{className:d(f),style:m,key:`container-${f}`},c.map((h,y)=>{let{content:p,props:g}=h;return v.createElement(da,{...g,isIn:o(g.toastId),style:{...g.style,"--nth":y+1,"--len":c.length},key:`toast-${g.key}`},p)}))}))});io.displayName="ToastContainer",io.defaultProps={position:"top-right",transition:fa,autoClose:5e3,closeButton:so,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let hr,we=new Map,Be=[],pa=1;function ao(){return""+pa++}function ha(e){return e&&(Ee(e.toastId)||xe(e.toastId))?e.toastId:ao()}function je(e,t){return we.size>0?ae.emit(0,e,t):Be.push({content:e,options:t}),t.toastId}function ht(e,t){return{...t,type:t&&t.type||e,toastId:ha(t)}}function yt(e){return(t,r)=>je(t,ht(e,r))}function k(e,t){return je(e,ht("default",t))}k.loading=(e,t)=>je(e,ht("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),k.promise=function(e,t,r){let n,{pending:o,error:i,success:s}=t;o&&(n=Ee(o)?k.loading(o,r):k.loading(o.render,{...r,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(f,c,m)=>{if(c==null)return void k.dismiss(n);const h={type:f,...a,...r,data:m},y=Ee(c)?{render:c}:c;return n?k.update(n,{...h,...y}):k(y.render,{...h,...y}),m},d=oe(e)?e():e;return d.then(f=>u("success",s,f)).catch(f=>u("error",i,f)),d},k.success=yt("success"),k.info=yt("info"),k.error=yt("error"),k.warning=yt("warning"),k.warn=k.warning,k.dark=(e,t)=>je(e,ht("default",{theme:"dark",...t})),k.dismiss=e=>{we.size>0?ae.emit(1,e):Be=Be.filter(t=>e!=null&&t.options.toastId!==e)},k.clearWaitingQueue=function(e){return e===void 0&&(e={}),ae.emit(5,e)},k.isActive=e=>{let t=!1;return we.forEach(r=>{r.isToastActive&&r.isToastActive(e)&&(t=!0)}),t},k.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const r=function(n,o){let{containerId:i}=o;const s=we.get(i||hr);return s&&s.getToast(n)}(e,t);if(r){const{props:n,content:o}=r,i={delay:100,...n,...t,toastId:t.toastId||e,updateId:ao()};i.toastId!==e&&(i.staleId=e);const s=i.render||o;delete i.render,je(s,i)}},0)},k.done=e=>{k.update(e,{progress:1})},k.onChange=e=>(ae.on(4,e),()=>{ae.off(4,e)}),k.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},k.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},ae.on(2,e=>{hr=e.containerId||e,we.set(hr,e),Be.forEach(t=>{ae.emit(0,t.content,t.options)}),Be=[]}).on(3,e=>{we.delete(e.containerId||e),we.size===0&&ae.off(0).off(1).off(5)});function lo({status:e,queryId:t,api:r,...n}){const o=e=="draft",i=x.useInvalidateMutation(o?r.publish:r.unpublish,r.queryKey,t,{networkMode:"always"}),s=v.useCallback(()=>{i.reset(),i.mutateAsync(t).then(()=>k.success(o?"Published!":"Unpublished!")).catch(a=>k.error(`Error: ${a}`))},[i,t]);return l.jsxs(T.Button,{scheme:"secondary",variant:"glass",corners:"pill",px:"4",disabled:i.isLoading,onClick:s,dflex:!0,alignItems:"center",gap:"3",...n,children:[l.jsx(T.Icon,{path:o?Et:ds}),o?"Publish":"Switch to draft"]})}function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}var uo=["shift","alt","meta","mod","ctrl"],ya={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function me(e){return(ya[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function ga(e){return uo.includes(e)}function gr(e,t){return t===void 0&&(t=","),e.split(t)}function mr(e,t,r){t===void 0&&(t="+");var n=e.toLocaleLowerCase().split(t).map(function(s){return me(s)}),o={alt:n.includes("alt"),ctrl:n.includes("ctrl")||n.includes("control"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(function(s){return!uo.includes(s)});return yr({},o,{keys:i,description:r})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&co([me(e.key),me(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&fo([me(e.key),me(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){be.clear()})})();var be=new Set;function br(e){return Array.isArray(e)}function ma(e,t){t===void 0&&(t=",");var r=br(e)?e:e.split(t);return r.every(function(n){return be.has(n.trim().toLowerCase())})}function co(e){var t=Array.isArray(e)?e:[e];be.has("meta")&&be.forEach(function(r){return!ga(r)&&be.delete(r.toLowerCase())}),t.forEach(function(r){return be.add(r.toLowerCase())})}function fo(e){var t=Array.isArray(e)?e:[e];e==="meta"?be.clear():t.forEach(function(r){return be.delete(r.toLowerCase())})}function ba(e,t,r){(typeof r=="function"&&r(e,t)||r===!0)&&e.preventDefault()}function va(e,t,r){return typeof r=="function"?r(e,t):r===!0||r===void 0}function Ea(e){return po(e,["input","textarea","select"])}function po(e,t){var r=e.target;t===void 0&&(t=!1);var n=r&&r.tagName;return br(t)?!!(n&&t&&t.some(function(o){return o.toLowerCase()===n.toLowerCase()})):!!(n&&t&&t===!0)}function wa(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(r){return t.includes(r)})||e.includes("*"):!0}var Pa=function(t,r,n){n===void 0&&(n=!1);var o=r.alt,i=r.meta,s=r.mod,a=r.shift,u=r.ctrl,d=r.keys,f=t.key,c=t.code,m=t.ctrlKey,h=t.metaKey,y=t.shiftKey,p=t.altKey,g=me(c),E=f.toLowerCase();if(!(d!=null&&d.includes(g))&&!(d!=null&&d.includes(E))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(g))return!1;if(!n){if(o===!p&&E!=="alt"||a===!y&&E!=="shift")return!1;if(s){if(!h&&!m)return!1}else if(i===!h&&E!=="meta"&&E!=="os"||u===!m&&E!=="ctrl"&&E!=="control")return!1}return d&&d.length===1&&(d.includes(E)||d.includes(g))?!0:d?ma(d):!d},_a=v.createContext(void 0),Ta=function(){return v.useContext(_a)};function ho(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(r,n){return r&&ho(e[n],t[n])},!0):e===t}var Ca=v.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Oa=function(){return v.useContext(Ca)};function Aa(e){var t=v.useRef(void 0);return ho(t.current,e)||(t.current=e),t.current}var yo=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Sa=typeof window<"u"?v.useLayoutEffect:v.useEffect;function go(e,t,r,n){var o=v.useRef(null),i=v.useRef(!1),s=r instanceof Array?n instanceof Array?void 0:n:r,a=br(e)?e.join(s==null?void 0:s.splitKey):e,u=r instanceof Array?r:n instanceof Array?n:void 0,d=v.useCallback(t,u??[]),f=v.useRef(d);u?f.current=d:f.current=t;var c=Aa(s),m=Oa(),h=m.enabledScopes,y=Ta();return Sa(function(){if(!((c==null?void 0:c.enabled)===!1||!wa(h,c==null?void 0:c.scopes))){var p=function(b,_){var A;if(_===void 0&&(_=!1),!(Ea(b)&&!po(b,c==null?void 0:c.enableOnFormTags))){if(o.current!==null){var S=o.current.getRootNode();if((S instanceof Document||S instanceof ShadowRoot)&&S.activeElement!==o.current&&!o.current.contains(S.activeElement)){yo(b);return}}(A=b.target)!=null&&A.isContentEditable&&!(c!=null&&c.enableOnContentEditable)||gr(a,c==null?void 0:c.splitKey).forEach(function(C){var N,I=mr(C,c==null?void 0:c.combinationKey);if(Pa(b,I,c==null?void 0:c.ignoreModifiers)||(N=I.keys)!=null&&N.includes("*")){if(c!=null&&c.ignoreEventWhen!=null&&c.ignoreEventWhen(b)||_&&i.current)return;if(ba(b,I,c==null?void 0:c.preventDefault),!va(b,I,c==null?void 0:c.enabled)){yo(b);return}f.current(b,I),_||(i.current=!0)}})}},g=function(b){b.key!==void 0&&(co(me(b.code)),((c==null?void 0:c.keydown)===void 0&&(c==null?void 0:c.keyup)!==!0||c!=null&&c.keydown)&&p(b))},E=function(b){b.key!==void 0&&(fo(me(b.code)),i.current=!1,c!=null&&c.keyup&&p(b,!0))},O=o.current||(s==null?void 0:s.document)||document;return O.addEventListener("keyup",E),O.addEventListener("keydown",g),y&&gr(a,c==null?void 0:c.splitKey).forEach(function(P){return y.addHotkey(mr(P,c==null?void 0:c.combinationKey,c==null?void 0:c.description))}),function(){O.removeEventListener("keyup",E),O.removeEventListener("keydown",g),y&&gr(a,c==null?void 0:c.splitKey).forEach(function(P){return y.removeHotkey(mr(P,c==null?void 0:c.combinationKey,c==null?void 0:c.description))})}}},[a,c,h]),o}function mo({...e}){const{dirty:t,handleSubmit:r}=Ae.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}};return go("ctrl+s",()=>{t&&!e.disabled&&r()},{preventDefault:!0},[t,e,r]),l.jsxs(ee.SubmitButton,{type:"submit",corners:"pill",px:"4",dflex:!0,alignItems:"center",gap:"3",...e,children:[l.jsx(T.Icon,{path:us}),"Update"]})}function bo({path:e,icon:t,...r}){const n=v.useCallback(()=>{window.open(e,"_blank")},[e]);return l.jsx(T.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:n,...r,children:l.jsx(T.Icon,{path:t??wt})})}function La({api:e,postId:t,order:r}){const n=x.useInvalidateMutation(e.moveDown,e.queryKey),o=x.useInvalidateMutation(e.moveUp,e.queryKey),i=v.useCallback(a=>{a.stopPropagation(),n.mutateAsync(t).catch(u=>{k.error(`Error: ${u}`)})},[n,t]),s=v.useCallback(a=>{a.stopPropagation(),o.mutateAsync(t).catch(u=>{k.error(`Error: ${u}`)})},[o,t]);return l.jsxs(J.FlexCenter,{placeContent:"start",numericFontVariant:"tabular-nums",children:[r,l.jsx(T.Button,{ms:"3",variant:"borderless",scheme:"dark",onClick:s,children:l.jsx(T.Icon,{path:as})}),l.jsx(T.Button,{variant:"borderless",scheme:"dark",onClick:i,children:l.jsx(T.Icon,{path:is})})]})}function gt({children:e,...t}){return l.jsx(T.Container,{center:!0,dflex:!0,flexCol:!0,gap:"8",...t,children:e})}function vo({children:e,...t}){return l.jsx(T.Tile,{scheme:"light",p:"5",...t,children:e})}function Eo({name:e,...t}){return l.jsx(vo,{h:"min",...t,children:l.jsx(rs.FormEditor,{minH:"128",minW:"144",name:e,placeHolder:"Write here..."})})}function Ma({queryId:e,api:t,children:r,...n}){const{data:o,isLoading:i,isError:s}=x.useApiQuery(t.queryKey,t.get,e),a=x.useInvalidateQuery(t.queryKey,e);return i?l.jsx(J.QueryLoadingState,{w:"full",h:"100%"}):s?l.jsx(J.RetryOnError,{p:"0",onClick:a}):l.jsx(gt,{...n,children:r(o)})}const vr=v.forwardRef(Ma);function wo({children:e,...t}){return l.jsx("div",{w:"112",minW:"112",minH:"100%",gap:"8",dflex:!0,flexCol:!0,...t,children:e})}function Po({title:e,children:t,...r}){return l.jsxs("div",{w:"full",bgColor:"white",rounded:!0,p:"5",textSize:"sm",...r,children:[e&&l.jsx(ns.PageSectionTitle,{children:e}),t]})}function Er({children:e,...t}){return l.jsx("div",{trait:"typo.h5",children:e})}function wr({title:e,breadcrumbs:t,children:r,...n}){return l.jsxs(J.FlexCenter,{gap:"3",minH:"9",...n,children:[e&&l.jsx(Er,{children:e}),t&&l.jsx(Gt,{breadcrumbs:t}),l.jsx("div",{flexGrow:!0}),r]})}const[Na,_o]=z.createContext();function To({children:e}){const[t,r]=v.useState(null);return v.createRef(),l.jsx(Na,{value:{containerEl:t,setContainerEl:r},children:e})}function Co({title:e,breadcrumbs:t,children:r,...n}){const o=v.createRef(),{setContainerEl:i}=_o(),[s,a]=v.useState(!1);return v.useEffect(()=>(!s&&o.current&&(i(o.current),a(!0)),()=>i(null)),[]),l.jsx(J.FlexCenter,{gap:"3",minH:"9",...n,children:l.jsxs(l.Fragment,{children:[e&&l.jsx(Er,{children:e}),t&&l.jsx(Gt,{breadcrumbs:t}),l.jsx("div",{flexGrow:!0}),l.jsx("div",{ref:o,dflex:!0,flexRow:!0,gap:"3"}),r]})})}function Oo({trackingRef:e,children:t}){const{containerEl:r}=_o(),[n,o]=v.useState(!1),i=v.useMemo(()=>r,[r]),s=r??(typeof window<"u"?document.body:void 0);v.useLayoutEffect(()=>{if(!(!i||!s)){try{n?s.appendChild(i):s.removeChild(i)}catch{}return()=>{try{s.removeChild(i)}catch{}}}},[n,i,s]);const a=v.useCallback(u=>{o(u[0].isVisible)},[t]);return v.useEffect(()=>{const u={root:null,rootMargin:"0px",threshold:0,trackVisibility:!0,delay:100},d=new IntersectionObserver(a,u);return e&&d.observe(e),()=>d.disconnect()},[e,a,t]),s&&i?os.createPortal(t,i):null}function Ia({tabbed:e,breadcrumbs:t,api:r,item:n,isLoading:o,buttonBar:i,trackingRef:s}){return l.jsxs(l.Fragment,{children:[e&&l.jsx(Oo,{trackingRef:s,children:l.jsx(Ao,{api:r,item:n,isLoading:o,buttonBar:i})}),!e&&l.jsx(wr,{breadcrumbs:t,children:l.jsx(Ao,{api:r,item:n,isLoading:o,buttonBar:i})})]})}function Ao({api:e,item:t,isLoading:r,buttonBar:n}){return l.jsxs(l.Fragment,{children:[n==null?void 0:n.map((o,i)=>l.jsxs(v.Fragment,{children:[o.type==="link"&&l.jsx(bo,{path:o.path,icon:o.icon}),o.type==="invalidate"&&l.jsx(dr,{pathOrPermalink:o.pathOrPermalink}),o.type=="custom"&&o.render(t)]},i)),l.jsx(lo,{api:e,queryId:t.id,status:t.status,disabled:r}),l.jsx(mo,{disabled:r})]})}function ka({queryField:e,api:t,processInput:r,screen:n,tabbed:o,...i}){const{[e]:s}=le.useParams(),a=v.useRef(null);return l.jsx(vr,{api:t,queryId:s,ref:a,p:"5",...i,children:u=>l.jsx(xa,{item:u,screen:n,api:t,tabbed:o,processInput:r,containerRef:a})})}function xa({item:e,screen:t,api:r,processInput:n,tabbed:o,containerRef:i}){const{breadcrumbs:s,schema:a,initialValues:u,header:d,editorFooter:f,sections:c,buttonBar:m,editor:h,type:y,invalidateParentQueryKey:p}=z.runIfFn(t,e),g=x.useInvalidateParentMutation(r.update,p??r.queryKey,{networkMode:"always"}),E=x.useMutate(g,{processInput:n,successMsg:P=>`${P.title} updated.`,errorMsg:(P,b)=>`Error updating ${b.title}: ${P}`});let O;return y=="post"?O="calc(1280px - 30rem)":y=="section"&&(O="calc(1280px - 22rem)"),l.jsxs(ee.FormProvider,{initialValues:z.runIfFn(u,e),validationSchema:a,onSubmit:E,enableReinitialize:!0,children:[l.jsx(Ia,{tabbed:o,api:r,breadcrumbs:s,buttonBar:m,item:e,isLoading:g.isLoading,trackingRef:i==null?void 0:i.current}),l.jsxs(gt,{w:O?"auto":"full",size:"x2",id:"pagecontainer",children:[d,l.jsxs("div",{dflex:!0,gap:"8",children:[l.jsxs("div",{dflex:!0,flexCol:!0,gap:"8",flexGrow:!0,children:[(h==null?void 0:h.type)!="textarea"&&l.jsx(Eo,{name:"content",maxW:O,minW:"144"}),(h==null?void 0:h.type)=="textarea"&&l.jsx(ee.TextArea,{name:h==null?void 0:h.name,maxW:O,minW:O,minH:"128",rows:25,bgColor:"white",border:"0",p:"5",textColor:"slate-800"}),f]}),l.jsx(wo,{children:c==null?void 0:c.map((P,b)=>l.jsx(Ba,{section:P,item:e},b))})]})]})]})}function Ba({section:e,item:t}){return e.type==="section"?l.jsx(Po,{title:e.title,children:l.jsx(ee.FormRenderer,{form:z.runIfFn(e.form,t)})}):e.type==="custom"?z.runIfFn(e.component,t):null}function ja(e,t){const r=le.useParams();if(t===void 0)return{id:void 0,api:e};const{[t]:n}=r;return{id:n,api:z.runIfFn(e,n)}}function Fa({api:e,queryField:t,fn:r,transformFn:n,config:o,tabbed:i,...s}){const{id:a,api:u}=ja(e,t),{data:d}=x.useApiQuery(u.queryKey,r==="get"||r==="getTransformed"?u.get:u.getAll,z.isFunction(e)?void 0:a),f=v.useMemo(()=>d&&(r==="getTransformed"||r==="getAllTransformed")?(n||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${r}`),n==null?void 0:n(d)):d,[d]);return d?l.jsx(mt,{config:o(f),tabbed:i,...s}):null}function Da({queryField:e,api:t,screen:r,...n}){const{[e]:o}=le.useParams();return l.jsx(vr,{queryId:o,api:t,p:"5",children:i=>{const{breadcrumbs:s,tabs:a}=z.runIfFn(r,i);return l.jsxs(To,{children:[l.jsx(Co,{breadcrumbs:s,mb:"-3"}),l.jsx(J.TabContainer,{tabs:a.map(u=>u.label),saveKey:`tab-${o}`,mt:"-3",mb:"3",id:"fff",children:a.map((u,d)=>l.jsx(Ha,{tab:u},d))})]})}})}function Ha({tab:e}){if(!e.component&&!e.config)throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${e.label}`);return e.component?e.component():l.jsx(mt,{config:e.config,tabbed:!0,p:"0"})}const[qa,Ua]=z.createContext();function So(e){return e.accessorKey??e.id}function Va({initialVisibleColumns:e,columns:t,children:r}){const[n,o]=v.useState(!1),[i,s]=v.useState(!1),[a,u]=v.useState(e??(t==null?void 0:t.map(y=>So(y)))??[]),d=(t==null?void 0:t.filter(y=>a.includes(So(y))))??[],f=v.useCallback(y=>{const p=a.indexOf(y);if(p>-1){const g=a.concat();g.splice(p,1),u(g)}else u(a.concat(y))},[a,u]),c=v.useCallback(y=>a.includes(y),[a]),m=qa,h={showFilters:n,setShowFilters:o,showMassActions:i,setShowMassActions:s,columns:t??[],filteredColumns:d,toggleColumnVisibility:f,isColumnVisible:c};return l.jsx(m,{value:h,children:r})}function Lo({initialPageSize:e,initialVisibleColumns:t,columns:r,children:n,...o}){return l.jsx(T.Tile,{scheme:"light",shadow:!0,rounded:"md",px:"0",py:"4",w:"full",dflex:!0,flexCol:!0,...o,children:l.jsx(Se.TableContextProvider,{initialPageSize:e,children:l.jsx(Va,{columns:r,initialVisibleColumns:t,children:n})})})}function Mo({children:e,...t}){return l.jsx(et,{scheme:"default",corners:"pill",h:"10",variant:"glass",...t,children:e??l.jsx(T.Icon,{path:ps})})}function No({...e}){return l.jsxs(T.Popover,{side:"bottom-end",modal:!0,children:[l.jsx(T.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",...e,children:l.jsx(T.Icon,{path:fs})}),l.jsxs("div",{bgColor:"white",rounded:!0,shadow:!0,children:[l.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"First Item"}),l.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Second Item"}),l.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Third Item"})]})]})}function Io({title:e,queryKey:t,children:r,...n}){const o=x.useInvalidateQuery(t);return go("ctrl+r",()=>o(),{preventDefault:!0},[o]),l.jsxs("div",{dflex:!0,flexRow:!0,pb:"4",alignItems:"center",gap:"3",px:"8",borderB:"0.5",borderBColor:"--bg-2",...n,children:[e&&l.jsx("h2",{textSize:"x3",fontWeight:"600",textColor:"#3f4254",textTransform:"capitalize",children:e}),l.jsx("div",{flexGrow:!0,children:" "}),l.jsxs("div",{spaceX:"2",dflex:!0,alignItems:"center",children:[l.jsx(T.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",onClick:o,children:l.jsx(T.Icon,{path:ys})}),r]})]})}const ko="Oops, something went wrong...";function xo(e){if(e){const t={...e};for(const r in e)t[r]=t[r]??"";return t}return e}function Pr({initialValues:e,itemLabel:t,queryId:r="",api:n,queryFetchOptions:o,querySaveOptions:i,onSuccess:s,onFetchError:a,fetchErrorMsg:u=ko,onSaveError:d,saveErrorMsg:f=ko,fetchToFormData:c,formToQueryData:m,invalidateQueriesOnSuccess:h=!0,invalidateQueryKey:y,retryText:p="Retry",cancelLabel:g="Cancel",saveLabel:E,size:O="lg",title:P,form:b,show:_,onClose:A,formikProps:S,...C}){const{isInitialLoading:N,isFetching:I,data:M,isError:q,error:j,refetch:U}=x.useApiQuery(n.queryKey,n.get,r,{enabled:!(r==""||r==null||r==null),onError:a,...o}),V=h?x.useInvalidateParentMutation(n.upsert,y??n.queryKey,i):x.useApiMutation(n.upsert,n.queryKey,r,i),K=v.useCallback(()=>U(),[U]),W=v.useCallback(async(R,$)=>{V.reset();const Q=m?m(R):{...R};await V.mutateAsync(Q).then(ne=>{s?s(Q,ne):k.success(`${P?P(Q):Q.name??Q.title} ${r?"saved":"created"}`),A==null||A()}).catch(ne=>{console.error("on error",ne),d?d(R):k.error(`Couldn't save ${P?P(Q):Q.name??Q.title}`),$.setSubmitting(!1)})},[V,m,s,d,A]);return l.jsxs(T.Modal,{size:O,show:_,onClose:A,scheme:"light",transition:!0,...C,children:[l.jsxs(T.Modal.Header,{children:[!N&&r&&`Edit ${P?P(M):(M==null?void 0:M.name)??(M==null?void 0:M.title)??""}`,!r&&`Create new ${t??"item"}`,Array.isArray(b)&&l.jsx(l.Fragment,{})]}),N&&l.jsx(T.Modal.Body,{children:l.jsx(J.QueryLoadingState,{minW:"72"})}),q&&l.jsx(T.Modal.Body,{children:l.jsx(J.RetryOnError,{label:`${u} ${j}`,onClick:K})}),!N&&!q&&l.jsx(l.Fragment,{children:l.jsx(Ae.Formik,{initialValues:c&&r&&M?c(xo(M)):xo(e(M))??{},onSubmit:W,...S,children:({setFieldValue:R,dirty:$,handleSubmit:Q,isValid:ne,values:G})=>l.jsxs(l.Fragment,{children:[l.jsx(T.Modal.Body,{pb:"6",children:l.jsxs(Ae.Form,{children:[v.isValidElement(b)&&b,Array.isArray(b)&&l.jsx(ee.FormRenderer,{form:b}),z.isFunction(b)&&l.jsx(ee.FormRenderer,{form:b(M??G)})]})}),l.jsxs(T.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[l.jsx(T.Button,{disabled:V.isLoading,onClick:A,variant:"borderless",me:"2",children:g}),l.jsx(T.Button,{type:"submit",disabled:!$||V.isLoading,onClick:()=>Q(),children:E||(r?"Update":"Create")})]})]})})}),V.isLoading&&l.jsx(J.ModalLoadingOverlay,{})]})}function Ra({api:e,fn:t,transformFn:r,config:n,onClose:o,queryId:i,invalidateQueryKey:s}){const{data:a,isFetching:u}=x.useApiQuery(e.queryKey,t==="get"||t==="getTransformed"?e.get:e.getAll,void 0,{retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1}),d=v.useMemo(()=>a&&(t==="getTransformed"||t==="getAllTransformed")?(r||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${t}`),r==null?void 0:r(a)):a,[a,t,r]);return u?null:l.jsx(Pr,{...n(d),queryId:i,invalidateQueryKey:s,show:!0,onClose:o})}function za({queries:e,config:t,onClose:r,queryId:n,invalidateQueryKey:o}){const{data:i,isFetching:s,isError:a}=x.useApiQueries(e.map(d=>({queryKey:d.api.queryKey,queryFn:d.fn=="get"?d.api.get:d.api.getAll,queryOptions:{cacheTime:d.cache===!1?0:void 0,staleTime:d.cache===!1?0:void 0}}))),u=v.useMemo(()=>i==null?void 0:i.map((d,f)=>{var c,m;return e[f].transformFn?(m=(c=e[f])==null?void 0:c.transformFn)==null?void 0:m.call(c,d):d}),[i,e]);return l.jsx(Pr,{isPreloading:s,...t(...u),queryId:n,invalidateQueryKey:o,show:!0,onClose:r})}function Bo({config:e,onClose:t,invalidateQueryKey:r,queryId:n}){const{type:o,...i}=e;return e.type==="dialog"?l.jsx(Pr,{...i,queryId:n,invalidateQueryKey:r,show:!0,onClose:t}):e.type==="query"?l.jsx(Ra,{...i,queryId:n,invalidateQueryKey:r,onClose:t}):e.type==="multiQuery"?l.jsx(za,{...i,queryId:n,invalidateQueryKey:r,onClose:t}):null}function Ka({itemLabel:e,queryId:t="",api:r,invalidateQueriesOnSuccess:n=!0,invalidateQueryKey:o,size:i="lg",show:s,onClose:a,...u}){const d=n?x.useInvalidateParentMutation(r.delete,o??r.queryKey):x.useApiMutation(r.upsert,r.queryKey),f=x.useMutate(d,{onSuccess:()=>a==null?void 0:a()}),c=v.useCallback(()=>f(t),[f,t]);return l.jsxs(T.Modal,{size:i,show:s,onClose:a,scheme:"danger",variant:"glass",transition:!0,...u,children:[l.jsx(T.Modal.Header,{children:`Delete ${e}`}),l.jsxs(T.Modal.Body,{pb:"6",children:["Do you really want to delete ",e,"?"]}),l.jsxs(T.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[l.jsx(T.Button,{disabled:d.isLoading,onClick:a,variant:"borderless",scheme:"secondary",me:"2",children:"Cancel"}),l.jsx(T.Button,{scheme:"danger",disabled:d.isLoading,onClick:c,children:"Delete"})]}),d.isLoading&&l.jsx(J.ModalLoadingOverlay,{})]})}const[$a,jo]=z.createContext();function Wa({editView:e,deleteItem:t,queryKey:r,children:n}){const o=Cr.useOpenLink(),i=le.useNavigate(),[s,a]=v.useState(null),u=v.useCallback(()=>a(null),[a]),d=v.useCallback((m,h)=>{switch(m.type){case"view":{i(z.runIfFn(m.path,h));break}case"link":{o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${z.runIfFn(m.path,h)}`);break}case"edit":{e.type=="customDialog"?a(e.render({show:!0,onClose:u})):a(l.jsx(Bo,{onClose:u,config:e,queryId:h.id,invalidateQueryKey:r}));break}case"delete":{a(l.jsx(Ka,{show:!0,onClose:u,queryId:h.id,invalidateQueryKey:r,...t,itemLabel:z.runIfFn(t.itemLabel,h)}));break}}},[i,e,t]),f=$a,c={dialog:s,onAction:d};return l.jsx(f,{value:c,children:n})}/**
225
10
  * table-core
226
11
  *
227
12
  * Copyright (c) TanStack
@@ -230,19 +15,4 @@ See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-comp
230
15
  * LICENSE.md file in the root directory of this source tree.
231
16
  *
232
17
  * @license MIT
233
- */function yB(){return{accessor:(t,e)=>typeof t=="function"?{...e,accessorFn:t}:{...e,accessorKey:t},display:t=>t,group:t=>t}}function zr(t,e){return typeof t=="function"?t(e):t}function rn(t,e){return n=>{e.setState(r=>({...r,[t]:zr(n,r[t])}))}}function Gc(t){return t instanceof Function}function vB(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function bB(t,e){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=e(i);s!=null&&s.length&&r(s)})};return r(t),n}function Pe(t,e,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=t(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=e(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,h=d/16,f=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${f(d,5)} /${f(u,5)} ms`,`
234
- font-size: .6rem;
235
- font-weight: bold;
236
- color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Ie(t,e,n,r){return{debug:()=>{var o;return(o=t==null?void 0:t.debugAll)!=null?o:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function wB(t,e,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:Pe(()=>[t,n,e,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ie(t.options,"debugCells","cell.getContext"))};return t._features.forEach(s=>{s.createCell==null||s.createCell(i,n,e,t)},{}),i}function SB(t,e,n,r){var o,i;const a={...t._getDefaultColumnDef(),...e},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=h=>{let f=h;for(const g of l.split(".")){var p;f=(p=f)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${g}" in deeply nested key "${l}" returned undefined.`)}return f}:u=h=>h[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Pe(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(f=>f.getFlatColumns())]},Ie(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Pe(()=>[t._getOrderColumnsFn()],h=>{var f;if((f=d.columns)!=null&&f.length){let p=d.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[d]},Ie(t.options,"debugColumns","column.getLeafColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(d,t);return d}const Rt="debugHeaders";function ZE(t,e,n){var r;let i={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(s=>{s.createHeader==null||s.createHeader(i,t)}),i}const CB={createTable:t=>{t.getHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Jc(e,[...a,...c,...l],t)},Ie(t.options,Rt,"getHeaderGroups")),t.getCenterHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Jc(e,n,t,"center")),Ie(t.options,Rt,"getCenterHeaderGroups")),t.getLeftHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Jc(e,i,t,"left")},Ie(t.options,Rt,"getLeftHeaderGroups")),t.getRightHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Jc(e,i,t,"right")},Ie(t.options,Rt,"getRightHeaderGroups")),t.getFooterGroups=Pe(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getFooterGroups")),t.getLeftFooterGroups=Pe(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getLeftFooterGroups")),t.getCenterFooterGroups=Pe(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getCenterFooterGroups")),t.getRightFooterGroups=Pe(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getRightFooterGroups")),t.getFlatHeaders=Pe(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getFlatHeaders")),t.getLeftFlatHeaders=Pe(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getLeftFlatHeaders")),t.getCenterFlatHeaders=Pe(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getCenterFlatHeaders")),t.getRightFlatHeaders=Pe(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getRightFlatHeaders")),t.getCenterLeafHeaders=Pe(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getCenterLeafHeaders")),t.getLeftLeafHeaders=Pe(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getLeftLeafHeaders")),t.getRightLeafHeaders=Pe(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getRightLeafHeaders")),t.getLeafHeaders=Pe(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=e[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Ie(t.options,Rt,"getLeafHeaders"))}};function Jc(t,e,n,r){var o,i;let s=0;const a=function(h,f){f===void 0&&(f=1),s=Math.max(s,f),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,f+1)},0)};a(t);let l=[];const c=(h,f)=>{const p={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(m=>{const v=[...g].reverse()[0],C=m.column.depth===p.depth;let w,b=!1;if(C&&m.column.parent?w=m.column.parent:(w=m.column,b=!0),v&&(v==null?void 0:v.column)===w)v.subHeaders.push(m);else{const S=ZE(n,w,{id:[r,f,w.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${g.filter(E=>E.column===w).length}`:void 0,depth:f,index:g.length});S.subHeaders.push(m),g.push(S)}p.headers.push(m),m.headerGroup=p}),l.push(p),f>0&&c(g,f-1)},u=e.map((h,f)=>ZE(n,h,{depth:s,index:f}));c(u,s-1),l.reverse();const d=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,m=0,v=[0];p.subHeaders&&p.subHeaders.length?(v=[],d(p.subHeaders).forEach(w=>{let{colSpan:b,rowSpan:S}=w;g+=b,v.push(S)})):g=1;const C=Math.min(...v);return m=m+C,p.colSpan=g,p.rowSpan=m,{colSpan:g,rowSpan:m}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const dg=(t,e,n,r,o,i,s)=>{let a={id:e,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:t.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>bB(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Pe(()=>[t.getAllLeafColumns()],l=>l.map(c=>wB(t,a,c,c.id)),Ie(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Pe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Ie(t.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<t._features.length;l++){const c=t._features[l];c==null||c.createRow==null||c.createRow(a,t)}return a},EB={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},e_=(t,e,n)=>{var r;const o=n.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};e_.autoRemove=t=>Cn(t);const t_=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};t_.autoRemove=t=>Cn(t);const n_=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};n_.autoRemove=t=>Cn(t);const r_=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};r_.autoRemove=t=>Cn(t)||!(t!=null&&t.length);const o_=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});o_.autoRemove=t=>Cn(t)||!(t!=null&&t.length);const i_=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});i_.autoRemove=t=>Cn(t)||!(t!=null&&t.length);const s_=(t,e,n)=>t.getValue(e)===n;s_.autoRemove=t=>Cn(t);const a_=(t,e,n)=>t.getValue(e)==n;a_.autoRemove=t=>Cn(t);const fg=(t,e,n)=>{let[r,o]=n;const i=t.getValue(e);return i>=r&&i<=o};fg.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]},fg.autoRemove=t=>Cn(t)||Cn(t[0])&&Cn(t[1]);const sr={includesString:e_,includesStringSensitive:t_,equalsString:n_,arrIncludes:r_,arrIncludesAll:o_,arrIncludesSome:i_,equals:s_,weakEquals:a_,inNumberRange:fg};function Cn(t){return t==null||t===""}const _B={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:rn("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?sr.includesString:typeof r=="number"?sr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?sr.equals:Array.isArray(r)?sr.arrIncludes:sr.weakEquals},t.getFilterFn=()=>{var n,r;return Gc(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:sr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===t.id),s=zr(n,i?i.value:void 0);if(l_(o,s,t)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==t.id))!=null?a:[]}const l={id:t.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===t.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var i;return(i=zr(e,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(l_(l,s.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function l_(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const hg={sum:(t,e,n)=>n.reduce((r,o)=>{const i=o.getValue(t);return r+(typeof i=="number"?i:0)},0),min:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(t,e,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},mean:(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let i=o.getValue(t);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!vB(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},xB={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:rn("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return hg.sum;if(Object.prototype.toString.call(r)==="[object Date]")return hg.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return Gc(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:hg[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function AB(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(i=>!e.includes(i.id));return n==="remove"?r:[...e.map(i=>t.find(s=>s.id===i)).filter(Boolean),...r]}const TB={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:rn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Pe(n=>[$s(e,n)],n=>n.findIndex(r=>r.id===t.id),Ie(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var r;return((r=$s(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=$s(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Pe(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let i=[];if(!(e!=null&&e.length))i=o;else{const s=[...e],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return AB(i,n,r)},Ie(t.options,"debugTable","_getOrderColumnsFn"))}},pg=()=>({left:[],right:[]}),OB={getInitialState:t=>({columnPinning:pg(),...t}),getDefaultOptions:t=>({onColumnPinningChange:rn("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=e.options.enableColumnPinning)!=null?s:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:r,right:o}=e.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},Ie(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Ie(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Ie(e.options,"debugRows","getRightVisibleCells"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?pg():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:pg())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ie(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ie(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(i=>!o.includes(i.id))},Ie(t.options,"debugColumns","getCenterLeafColumns"))}},Xc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},gg=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),kB={getDefaultColumnDef:()=>Xc,getInitialState:t=>({columnSizing:{},columnSizingInfo:gg(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:rn("columnSizing",t),onColumnSizingInfoChange:rn("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Xc.minSize,(r=i??t.columnDef.size)!=null?r:Xc.size),(o=t.columnDef.maxSize)!=null?o:Xc.maxSize)},t.getStart=Pe(n=>[n,$s(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Ie(e.options,"debugColumns","getStart")),t.getAfter=Pe(n=>[n,$s(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Ie(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),mg(i)&&i.touches&&i.touches.length>1))return;const s=t.getSize(),a=t?t.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=mg(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,C)=>{typeof C=="number"&&(e.setColumnSizingInfo(w=>{var b,S;const E=e.options.columnResizeDirection==="rtl"?-1:1,x=(C-((b=w==null?void 0:w.startOffset)!=null?b:0))*E,_=Math.max(x/((S=w==null?void 0:w.startSize)!=null?S:0),-.999999);return w.columnSizingStart.forEach(A=>{let[O,k]=A;c[O]=Math.round(Math.max(k+k*_,0)*100)/100}),{...w,deltaOffset:x,deltaPercentage:_}}),(e.options.columnResizeMode==="onChange"||v==="end")&&e.setColumnSizing(w=>({...w,...c})))},d=v=>u("move",v),h=v=>{u("end",v),e.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||typeof document<"u"?document:null,p={moveHandler:v=>d(v.clientX),upHandler:v=>{f==null||f.removeEventListener("mousemove",p.moveHandler),f==null||f.removeEventListener("mouseup",p.upHandler),h(v.clientX)}},g={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),d(v.touches[0].clientX),!1),upHandler:v=>{var C;f==null||f.removeEventListener("touchmove",g.moveHandler),f==null||f.removeEventListener("touchend",g.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),h((C=v.touches[0])==null?void 0:C.clientX)}},m=MB()?{passive:!1}:!1;mg(i)?(f==null||f.addEventListener("touchmove",g.moveHandler,m),f==null||f.addEventListener("touchend",g.upHandler,m)):(f==null||f.addEventListener("mousemove",p.moveHandler,m),f==null||f.addEventListener("mouseup",p.upHandler,m)),e.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?gg():(n=t.initialState.columnSizingInfo)!=null?n:gg())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let Yc=null;function MB(){if(typeof Yc=="boolean")return Yc;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Yc=t,Yc}function mg(t){return t.type==="touchstart"}const PB={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:rn("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Pe(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ie(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=Pe(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ie(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,r)=>Pe(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Ie(t.options,"debugColumns",n));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $s(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const IB={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},LB={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:rn("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>sr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return Gc(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:sr[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},DB={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:rn("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,i;t.setExpanded(r?{}:(o=(i=t.initialState)==null?void 0:i.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[t.id]);let s={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[t.id]:!0};if(i&&!n){const{[t.id]:a,...l}=s;return l}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},yg=0,vg=10,bg=()=>({pageIndex:yg,pageSize:vg}),NB={getInitialState:t=>({...t,pagination:{...bg(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:rn("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=i=>zr(r,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?bg():(o=t.initialState.pagination)!=null?o:bg())},t.setPageIndex=r=>{t.setPagination(o=>{let i=zr(r,o.pageIndex);const s=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},t.resetPageIndex=r=>{var o,i;t.setPageIndex(r?yg:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:yg)},t.resetPageSize=r=>{var o,i;t.setPageSize(r?vg:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:vg)},t.setPageSize=r=>{t.setPagination(o=>{const i=Math.max(1,zr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},t.setPageCount=r=>t.setPagination(o=>{var i;let s=zr(r,(i=t.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),t.getPageOptions=Pe(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Ie(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},wg=()=>({top:[],bottom:[]}),RB={getInitialState:t=>({rowPinning:wg(),...t}),getDefaultOptions:t=>({onRowPinningChange:rn("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const i=r?t.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?t.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,t.id,...i]);e.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var f,p;return{top:[...((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const i=(n=e._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?wg():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:wg())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=Pe(e=>[t.getRowModel().rows,t.getState().rowPinning[e],e],(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=t.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>e.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},Ie(t.options,"debugRows","_getPinnedRows")),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=Pe(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(i=>!o.has(i.id))},Ie(t.options,"debugRows","getCenterRows"))}},FB={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:rn("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(i=>{Sg(o,i.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Cg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Cg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Cg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return i;const a={...i};return Sg(a,t.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Eg(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return _g(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return _g(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Sg=(t,e,n,r,o)=>{var i;const s=o.getRow(e,!0);n?(s.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),s.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Sg(t,a.id,n,r,o))};function Cg(t,e){const n=t.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=Eg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(e.rows),flatRows:r,rowsById:o}}function Eg(t,e){var n;return(n=e[t.id])!=null?n:!1}function _g(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return t.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Eg(s,e)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=_g(s,e);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const xg=/([0-9]+)/gm,HB=(t,e,n)=>c_(Ur(t.getValue(n)).toLowerCase(),Ur(e.getValue(n)).toLowerCase()),BB=(t,e,n)=>c_(Ur(t.getValue(n)),Ur(e.getValue(n))),VB=(t,e,n)=>Ag(Ur(t.getValue(n)).toLowerCase(),Ur(e.getValue(n)).toLowerCase()),$B=(t,e,n)=>Ag(Ur(t.getValue(n)),Ur(e.getValue(n))),jB=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},zB=(t,e,n)=>Ag(t.getValue(n),e.getValue(n));function Ag(t,e){return t===e?0:t>e?1:-1}function Ur(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function c_(t,e){const n=t.split(xg).filter(Boolean),r=e.split(xg).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const js={alphanumeric:HB,alphanumericCaseSensitive:BB,text:VB,textCaseSensitive:$B,datetime:jB,basic:zB},UB=[CB,PB,TB,OB,EB,_B,IB,LB,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:rn("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return js.datetime;if(typeof i=="string"&&(r=!0,i.split(xg).length>1))return js.alphanumeric}return r?js.text:js.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return Gc(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:js[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(s=>{const a=s==null?void 0:s.find(f=>f.id===t.id),l=s==null?void 0:s.findIndex(f=>f.id===t.id);let c=[],u,d=i?n:o==="desc";if(s!=null&&s.length&&t.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var h;c=[...s,{id:t.id,desc:d}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(f=>f.id===t.id?{...f,desc:d}:f):u==="remove"?c=s.filter(f=>f.id!==t.id):c=[{id:t.id,desc:d}];return c})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const i=t.getFirstSortDir(),s=t.getIsSorted();return s?s!==i&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},xB,DB,NB,RB,FB,kB];function qB(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const r=[...UB,...(e=t._features)!=null?e:[]];let o={_features:r};const i=o._features.reduce((h,f)=>Object.assign(h,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),s=h=>o.options.mergeOptions?o.options.mergeOptions(i,h):{...i,...h};let l={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(h=>{var f;l=(f=h.getInitialState==null?void 0:h.getInitialState(l))!=null?f:l});const c=[];let u=!1;const d={_features:r,options:{...i,...t},initialState:l,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const f=zr(h,o.options);o.options=s(f)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,f,p)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(h,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,f)=>{let p=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!p&&(p=o.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:Pe(()=>[o.options.defaultColumn],h=>{var f;return h=(f=h)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,m;return(g=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?g:null},...o._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},Ie(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Pe(()=>[o._getColumnDefs()],h=>{const f=function(p,g,m){return m===void 0&&(m=0),p.map(v=>{const C=SB(o,v,m,g),w=v;return C.columns=w.columns?f(w.columns,C,m+1):[],C})};return f(h)},Ie(t,"debugColumns","getAllColumns")),getAllFlatColumns:Pe(()=>[o.getAllColumns()],h=>h.flatMap(f=>f.getFlatColumns()),Ie(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Pe(()=>[o.getAllFlatColumns()],h=>h.reduce((f,p)=>(f[p.id]=p,f),{}),Ie(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Pe(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,f)=>{let p=h.flatMap(g=>g.getLeafColumns());return f(p)},Ie(t,"debugColumns","getAllLeafColumns")),getColumn:h=>{const f=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${h}' does not exist.`),f}};Object.assign(o,d);for(let h=0;h<o._features.length;h++){const f=o._features[h];f==null||f.createTable==null||f.createTable(o)}return o}function WB(){return t=>Pe(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=dg(t,t._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var l;u.originalSubRows=t.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(e),n},Ie(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function KB(t,e,n){return n.options.filterFromLeafRows?GB(t,e,n):JB(t,e,n)}function GB(t,e,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){var d;let f=l[h];const p=dg(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,(d=f.subRows)!=null&&d.length&&c<s){if(p.subRows=a(f.subRows,c+1),f=p,e(f)&&!p.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}if(e(f)||p.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}}else f=p,e(f)&&(u.push(f),i[f.id]=f,o.push(f))}return u};return{rows:a(t),flatRows:o,rowsById:i}}function JB(t,e,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){let f=l[h];if(e(f)){var d;if((d=f.subRows)!=null&&d.length&&c<s){const g=dg(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);g.subRows=a(f.subRows,c+1),f=g}u.push(f),o.push(f),i[f.id]=f}}return u};return{rows:a(t),flatRows:o,rowsById:i}}function XB(){return t=>Pe(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const o=[],i=[];(n??[]).forEach(h=>{var f;const p=t.getColumn(h.id);if(!p)return;const g=p.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}o.push({id:h.id,filterFn:g,resolvedValue:(f=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?f:h.value})});const s=(n??[]).map(h=>h.id),a=t.getGlobalFilterFn(),l=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(h=>{var f;i.push({id:h.id,filterFn:a,resolvedValue:(f=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?f:r})}));let c,u;for(let h=0;h<e.flatRows.length;h++){const f=e.flatRows[h];if(f.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const g=c.id;f.columnFilters[g]=c.filterFn(f,g,c.resolvedValue,m=>{f.columnFiltersMeta[g]=m})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const g=u.id;if(u.filterFn(f,g,u.resolvedValue,m=>{f.columnFiltersMeta[g]=m})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const d=h=>{for(let f=0;f<s.length;f++)if(h.columnFilters[s[f]]===!1)return!1;return!0};return KB(e.rows,d,t)},Ie(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}/**
237
- * react-table
238
- *
239
- * Copyright (c) TanStack
240
- *
241
- * This source code is licensed under the MIT license found in the
242
- * LICENSE.md file in the root directory of this source tree.
243
- *
244
- * @license MIT
245
- */function u_(t,e){return t?YB(t)?Wr.createElement(t,e):t:null}function YB(t){return QB(t)||typeof t=="function"||ZB(t)}function QB(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function ZB(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function eV(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=Wr.useState(()=>({current:qB(e)})),[r,o]=Wr.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...r,...t.state},onStateChange:s=>{o(s),t.onStateChange==null||t.onStateChange(s)}})),n.current}function bi(t,e,n){let r=n.initialDeps??[],o;function i(){var s,a,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const d=t();if(!(d.length!==r.length||d.some((p,g)=>r[g]!==p)))return o;r=d;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),o=e(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-f)*100)/100,m=g/16,v=(C,w)=>{for(C=String(C);C.length<w;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(p,5)} ms`,`
246
- font-size: .6rem;
247
- font-weight: bold;
248
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,o),o}return i.updateDeps=s=>{r=s},i}function Tg(t,e){if(t===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return t}const tV=(t,e)=>Math.abs(t-e)<1,nV=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},rV=t=>t,oV=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},iV=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;e({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},d_={passive:!0},f_=typeof window>"u"?!0:"onscrollend"in window,sV=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const i=t.options.useScrollendEvent&&f_?()=>{}:nV(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:h}=t.options;o=d?n.scrollLeft*(h&&-1||1):n.scrollTop,i(),e(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,d_);const c=t.options.useScrollendEvent&&f_;return c&&n.addEventListener("scrollend",l,d_),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},aV=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},lV=(t,{adjustments:e=0,behavior:n},r)=>{var o,i;const s=t+e;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class cV{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:rV,rangeExtractor:oV,onChange:()=>{},measureElement:aV,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=bi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=bi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=bi(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:r+o,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),m=f+g,v=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:g,end:m,key:d,lane:v}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=bi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?uV({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=bi(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=bi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Tg(r[h_(0,r.length-1,o=>Tg(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Tg(this.getOffsetForIndex(n,a));tV(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const h_=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,i=n(o);if(i<r)t=o+1;else if(i>r)e=o-1;else return o}return t>0?t-1:0};function uV({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1;let s=h_(0,o,l=>t[l].start,n),a=s;if(r===1)for(;a<o&&t[a].end<n+e;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+e);){const u=t[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+e);for(;s>0&&c.some(u=>u>=n);){const u=t[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const p_=typeof document<"u"?Wr.useLayoutEffect:Wr.useEffect;function dV(t){const e=Wr.useReducer(()=>({}),{})[1],n={...t,onChange:(o,i)=>{var s;i?Mo.flushSync(e):e(),(s=t.onChange)==null||s.call(t,o,i)}},[r]=Wr.useState(()=>new cV(n));return r.setOptions(n),p_(()=>r._didMount(),[]),p_(()=>r._willUpdate()),r}function fV(t){return dV({observeElementRect:iV,observeElementOffset:sV,scrollToFn:lV,...t})}function hV(t,e){const{rows:n}=t.getRowModel(),r=fV({getScrollElement:()=>e,count:n.length,estimateSize:()=>35,overscan:10});return{rows:n,virtualRows:r.getVirtualItems(),totalSize:r.getTotalSize(),virtualizer:r}}function pV(t,e){const n=t.getIsPinned(),r=n==="left"&&t.getIsLastColumn("left"),o=n==="right"&&t.getIsFirstColumn("right");return{shadow:r?"-2px 0 2px -2px gray inset":o?"2px 0 2px -2px gray inset":void 0,start:n==="left"?`${t.getStart("left")}px`:void 0,end:n==="right"?`${t.getAfter("right")}px`:void 0,position:n?"sticky":"relative",w:t.getSize(),z:n?1:0,bgColor:n?e?"gray.50":"white":e?"gray.50":void 0}}function gV({table:t,containerRef:e,onRowClick:n,disabledRow:r}){var u,d;const{rows:o,virtualRows:i,totalSize:s,virtualizer:a}=hV(t,e),l=i.length>0&&((u=i==null?void 0:i[0])==null?void 0:u.start)||0,c=i.length>0?s-(((d=i==null?void 0:i[i.length-1])==null?void 0:d.end)||0):0;return y.jsxs("tbody",{children:[l>0&&y.jsx("tr",{children:y.jsx("td",{h:`${l}px`})}),i.map(h=>{const f=o[h.index],p=mV(f.original,r);return y.jsx("tr",{borderB:"px",borderBColor:"#F4F4F4",borderStyle:"dashed",hover_bgColor:"slate-50",cursor:n?"pointer":"default",onClick:n?()=>n(f.original):void 0,w:"fit-content",group:!0,children:f.getVisibleCells().map((g,m)=>y.jsx("td",{px:"3",py:"2",textSize:"sm",textColor:p?"gray.400":"gray.700",fontWeight:"500",borderTColor:"--bg-3",borderT:"0.5",cursor:n&&!p?"pointer":"default",w:`${g.column.getSize()}px`,groupHover_bgColor:p?void 0:"gray.100",...pV(g.column,p),children:u_(g.column.columnDef.cell,g.getContext())},g.id))},f.id)}),c>0&&y.jsx("tr",{children:y.jsx("td",{h:`${c}px`})})]})}function mV(t,e){return e?typeof e=="string"?t[e]:e(t):!1}function yV({headers:t}){const e=Fe.useThemeAwareColor("slate-500","slate-700");return y.jsx("thead",{children:t.map(n=>y.jsx("tr",{w:"fit",children:n.headers.map(r=>y.jsx("th",{position:"relative",colSpan:r.colSpan,textAlign:"start",fontWeight:"600",textColor:e,px:"3",py:"2",textSize:"sm",w:`${r.getSize()}px`,children:y.jsxs("div",{dflex:!0,flexRow:!0,children:[r.isPlaceholder?null:y.jsxs(y.Fragment,{children:[u_(r.column.columnDef.header,r.getContext()),y.jsx("span",{cursor:r.column.getCanSort()?"pointer":"default",onClick:r.column.getToggleSortingHandler(),opacity:"0",hover_opacity:"100",flexGrow:!0,textAlign:"end",children:{asc:y.jsx(y.Fragment,{children:" ▲"}),desc:y.jsx(y.Fragment,{children:" ▼"})}[r.column.getIsSorted()]??y.jsx(y.Fragment,{children:" ▲"})})]}),y.jsx("div",{onMouseDown:r.getResizeHandler(),onTouchStart:r.getResizeHandler(),onClick:o=>{o.preventDefault(),o.stopPropagation()},position:"absolute",end:"0",top:"0",h:"full",w:"2",bgColor:r.column.getIsResizing()?"primary-500":"slate-900",bgOpacity:r.column.getIsResizing()?"70":"30",cursor:"col-resize",userSelect:"none",style:{touchAction:"none"},opacity:r.column.getIsResizing()?"100":"0",hover_opacity:"100"})]})},r.id))},n.id))})}const[vV,Og]=Fe.createContext();function bV({initialPageSize:t,children:e}){const[n,r]=Qt.useSearchParams(),{pageIndex:o,pageSize:i}=T.useMemo(()=>({pageIndex:n.get("page")??1,pageSize:n.get("sizePerPage")??t??25}),[n,t]),s=T.useCallback(c=>{const u=Fe.runIfFn(c,{pageIndex:o,pageSize:i});r(d=>(d.set("page",`${u.pageIndex}`),d.set("sizePerPage",`${u.pageSize}`),d))},[r,o,i]),a=vV,l={pageIndex:typeof o=="string"?parseInt(o):o,pageSize:typeof i=="string"?parseInt(i):i,setPagination:s};return y.jsx(a,{value:l,children:e})}function g_({page:t,...e}){const{pageSize:n,pageIndex:r,setPagination:o}=Og(),i=T.useCallback(()=>o({pageIndex:1,pageSize:n}),[n,o]);return y.jsxs("div",{dflex:!0,flexCol:!0,gap:"10",w:"full",h:"full",alignItems:"center",placeContent:"center",py:"16",...e,children:[y.jsx(N.Icon,{path:ax,w:"24",h:"24",textColor:"gray.400"}),y.jsx("div",{textSize:"xl",textColor:"gray.600",children:"No Data"}),t>1&&y.jsx(N.Button,{onClick:i,children:"Back To First Page"})]})}function wV({table:t,isLoading:e}){const n=t.getPageCount(),r=t.getState().pagination.pageIndex+1,o=SV(r,n,5);return y.jsxs(y.Fragment,{children:[n<2&&y.jsx(y.Fragment,{}),n>1&&y.jsx(y.Fragment,{children:y.jsxs("div",{dflex:!0,flexRow:!0,spaceX:"2",py:"2",children:[y.jsx(wi,{onClick:()=>t.setPageIndex(0),disabled:e||r==1,children:y.jsx(N.Icon,{path:X_})}),y.jsx(wi,{onClick:()=>t.previousPage(),disabled:e||r==1,children:y.jsx(N.Icon,{path:Z_})}),o.length>0&&o[0]>1&&y.jsx("a",{children:"..."}),o.map(i=>y.jsx(wi,{onClick:()=>t.setPageIndex(i-1),disabled:e,variant:r==i?"default":"glass",scheme:"secondary",children:i},i)),o.length>0&&o[o.length-1]<n&&y.jsx(wi,{disabled:e,children:"..."}),y.jsx(wi,{onClick:()=>t.nextPage(),disabled:e||!t.getCanNextPage(),children:y.jsx(N.Icon,{path:ex})}),y.jsx(wi,{onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:e||!t.getCanNextPage(),children:y.jsx(N.Icon,{path:Y_})})]})})]})}function wi({...t}){return y.jsx(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",w:"8",h:"8",p:"0",dflex:!0,alignItems:"center",placeContent:"center",...t})}function SV(t,e,n){const r=[];if(!t)return r;if(e===1)return r.push(1),r;if(e<t)return r;if(e<n+1){for(let i=1;i<e+1;i++)r.push(i);return r}if(t===1){for(let i=1;i<n+1;i++)i<e&&r.push(i);return r}if(t===e){for(let i=e-n+1;i<=e;i++)i<=e&&r.push(i);return r}const o=Math.floor(n/2);if(o<1)return r.push(t),r;if(t<o+2){for(let i=1;i<n+1;i++)r.push(i);return r}if(e-t<o+2){for(let i=e-n;i<e+1;i++)r.push(i);return r}for(let i=t-o;i<t;i++)i>0&&r.push(i);r.push(t);for(let i=t+1;i<t+o+1;i++)i<=e&&r.push(i);return r}const CV=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}];function EV({table:t,total:e,isLoading:n,reverseOrder:r,sizePerPageList:o}){const i=t.getState().pagination.pageIndex,s=t.getState().pagination.pageSize;return y.jsxs("div",{dflex:!0,flexDirection:r?"row-reverse":"row",alignItems:"center",py:"3",spaceX:"3",children:[y.jsx(N.Select,{disabled:e===0||n,onChange:a=>t.setPageSize(Number(a.target.value)),value:s,w:"20",children:(o??CV).map(a=>{const l=s===a.value;return y.jsx("option",{value:a.value,className:`btn ${l?"active":""}`,children:a.label},a.label)})}),y.jsxs("div",{children:["Showing rows ",1+i*s," to ",Math.min((i+1)*s,e)," of ",e]}),n&&y.jsx(N.Spinner,{size:"sm"})]})}function m_({isLoading:t,table:e,total:n,show:r,toolbarPosition:o="both",reverseOrder:i=!1,sizePerPageList:s,children:a,...l}){return y.jsxs("div",{...l,children:[r&&["top","both"].includes(o)&&y.jsx(y_,{isLoading:t,table:e,total:n,reverseOrder:i,sizePerPageList:s}),a,r&&["bottom","both"].includes(o)&&y.jsx(y_,{isLoading:t,table:e,total:n,reverseOrder:i,sizePerPageList:s})]})}function y_({isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:o}){return y.jsxs("div",{dflex:!0,justifyContent:"between",alignItems:"center",flexWrap:!0,flexDirection:r?"row-reverse":"row",children:[y.jsx(EV,{isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:o}),y.jsx("div",{className:"d-flex flex-wrap"}),y.jsx(wV,{isLoading:t,table:e})]})}const[_V,v_]=Fe.createContext();function xV({sortBy:t,sortDir:e,children:n}){const[r,o]=Qt.useSearchParams(),{sortBy:i,sortDir:s}=T.useMemo(()=>({sortBy:r.get("sortBy")??t??"",sortDir:r.get("sortDir")??e??"asc"}),[r]),a=T.useCallback(u=>{const d=Fe.runIfFn(u,[{id:i,desc:s==="desc"}]);o(h=>{var f,p;return h.set("sortBy",`${((f=d==null?void 0:d[0])==null?void 0:f.id)??""}`),h.set("sortDir",`${(p=d==null?void 0:d[0])!=null&&p.desc?"desc":"asc"}`),h})},[o,i,s]),l=_V,c={sortBy:i,sortDir:s,setSorting:a};return y.jsx(l,{value:c,children:n})}function AV(t,e,n){const{setPagination:r}=Og(),{sortBy:o,sortDir:i,setSorting:s}=v_(),[a,l]=T.useState((n==null?void 0:n.rowSelection)??{}),c=T.useCallback(h=>{var f;l(h),(f=n==null?void 0:n.onSelectionChange)==null||f.call(n,Fe.runIfFn(h,a))},[l,a]),u=T.useCallback(h=>{var f;if(n!=null&&n.enableSelection&&(n!=null&&n.enableSelectOnRowClick)){h.toggleSelected();return}(f=n==null?void 0:n.onRowClick)==null||f.call(n,h.original)},[]);return{table:eV(Li({data:t??[],getRowId:h=>h.id,columns:e,columnResizeMode:"onChange",enableColumnResizing:!0,enableSortingRemoval:!1,defaultColumn:{size:150,minSize:40,maxSize:1e3},state:{sorting:[{id:o,desc:i==="desc"}],rowSelection:a},filterFns:{},enableRowSelection:n==null?void 0:n.enableSelection,onRowSelectionChange:c,onSortingChange:s,getCoreRowModel:WB(),getFilteredRowModel:XB(),onPaginationChange:r},n==null?void 0:n.tableOptions)),onRowClick:u}}const b_=T.createContext({});function Qc(){return T.useContext(b_)}const TV=["sortBy","sortDir","page","sizePerPage"];function OV({sortBy:t,sortDir:e,initialPageSize:n,children:r}){const[o,i]=Qt.useSearchParams(),s=T.useCallback(h=>{i(f=>(Object.keys(h).forEach(p=>{f.set(p,h[p]===void 0?"":h[p])}),f.set("page","1"),f))},[i]),a=T.useCallback(()=>{const h={},f=o.entries();for(const[p,g]of f)TV.includes(p)||(h[p]=g);return h},[o]),[l,c]=T.useState(),d={ids:T.useMemo(()=>{const h=Object.keys(l??{});return(h==null?void 0:h.filter(f=>l==null?void 0:l[f]))??[]},[l]),setRowSelection:c,getFilters:a,setFilters:s};return y.jsx(b_.Provider,{value:d,children:y.jsx(bV,{initialPageSize:n,children:y.jsx(xV,{sortBy:t,sortDir:e,children:r})})})}function kV(t,e,n){const r=Re.useInvalidateQuery(t),o=T.useMemo(()=>({onError:()=>He.error((n==null?void 0:n.errorMessage)??"Oops, something went wrong :("),refetchOnWindowFocus:!1,keepPreviousData:!0,retry:!1,staleTime:1e8}),[n]),{pageIndex:i,pageSize:s,setPagination:a}=Og(),{sortBy:l,sortDir:c}=v_(),{getFilters:u}=Qc(),d={pageSize:s,pageNumber:i,sortBy:l,sortDir:c,...n!=null&&n.transformFilters?n.transformFilters(u()):u()},h=T.useMemo(()=>({...o,...n==null?void 0:n.queryOptions}),[n]),{data:f,isError:p,isFetching:g,isLoading:m}=Re.useApiQuery(t,e,d,h),v=T.useCallback(r,[r]),{data:C}=f??{data:{data:void 0,meta:void 0}},{data:w,meta:b}=C;return{data:w&&(n!=null&&n.transformResponse)?n.transformResponse(w):w,response:C,retry:v,isError:p,isLoading:m,isFetching:g,page:(b==null?void 0:b.current_page)??1??i,pageSize:(b==null?void 0:b.per_page)??s,total:(b==null?void 0:b.total)??0,onPaginationChange:a}}function MV({columns:t,keyField:e="id",queryKey:n,queryFn:r,queryOptions:o,errorMessage:i,transformFilters:s,transformResponse:a,defaultSorted:l="name",defaultSortOrder:c="desc",nonSelectable:u,enableFilters:d=!1,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,onRowClick:g,onSelectionChange:m,sizePerPageList:v,paginationPosition:C,reversePaginationTools:w,containerEl:b,emptyMessage:S,title:E,disabledRow:x,pinnedColumnsLeft:_,pinnedColumnsRight:A,...O}){const k=T.useRef(null),{data:M,response:I,retry:P,isError:F,isLoading:z,isFetching:V,page:J,pageSize:K,total:R,onPaginationChange:Q}=kV(n,r,{errorMessage:i,queryOptions:o,transformResponse:a,transformFilters:s}),ie=AV(M??[],LV(t,h),{defaultSorted:l,defaultSortOrder:c,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,nonSelectable:u,onRowClick:g,onSelectionChange:m,tableOptions:{enableColumnFilters:d,initialState:{columnPinning:{left:_??[],right:A??[]}},state:{pagination:{pageIndex:J,pageSize:K}},autoResetPageIndex:!1,pageCount:Math.ceil(R/K),onPaginationChange:Q}}).table;return y.jsxs("div",{px:"8",pt:"8",ref:k,h:"100%",children:[F&&y.jsx(Jr,{onClick:P,label:i}),(z||V&&(!M||(M==null?void 0:M.length)==0))&&y.jsx(hr,{}),!F&&!z&&M&&y.jsxs("div",{children:[E&&(Fe.isFunction(E)?E(I):E),O.mode=="table"&&y.jsx(PV,{table:ie,total:R??0,data:M,isLoading:V,containerEl:b??k.current,onRowClick:g,sizePerPageList:v,disabledRow:x}),O.mode=="grid"&&y.jsx(IV,{table:ie,total:R??0,data:M,isLoading:V,onRowClick:g,sizePerPageList:v,gridCols:O.gridCols,renderGridItem:O.renderGridItem})]})]})}function PV({table:t,total:e,data:n,isLoading:r,onRowClick:o,containerEl:i,sizePerPageList:s,disabledRow:a}){return y.jsxs(m_,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:s,children:[n.length==0&&y.jsx(g_,{page:t.getState().pagination.pageIndex}),n.length>0&&y.jsx("div",{w:"full",border:"2px",borderColor:"#F4F4F4",rounded:"base",my:"3",overflowX:"auto",children:y.jsxs("table",{style:{width:"max(1400px, 100%)",tableLayout:"fixed"},children:[y.jsx(yV,{headers:t.getHeaderGroups()}),y.jsx(gV,{table:t,containerRef:i,onRowClick:o,disabledRow:a})]})})]})}function IV({table:t,total:e,data:n,isLoading:r,onRowClick:o,sizePerPageList:i,gridCols:s,renderGridItem:a}){return y.jsxs(m_,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:i,children:[n.length==0&&y.jsx(g_,{page:t.getState().pagination.pageIndex}),n.length>0&&y.jsx("div",{w:"full",children:y.jsx("div",{grid:!0,gridCols:`${s??3}`,gap:"5",w:"full",children:n.map(l=>a==null?void 0:a(l,o))})})]})}function LV(t,e){return e?[{id:"select-col",header:({table:n})=>y.jsx(N.Checkbox,{checked:n.getIsAllRowsSelected(),onChange:n.getToggleAllRowsSelectedHandler()}),cell:({row:n})=>y.jsx(N.Checkbox,{checked:n.getIsSelected(),disabled:!n.getCanSelect(),onChange:n.getToggleSelectedHandler()}),size:10,maxSize:1,enableResizing:!1}].concat(t):t}const[DV,NV]=Fe.createContext();function w_(t){return t.accessorKey??t.id}function RV({initialVisibleColumns:t,columns:e,children:n}){const[r,o]=T.useState(!1),[i,s]=T.useState(!1),[a,l]=T.useState(t??(e==null?void 0:e.map(p=>w_(p)))??[]),c=(e==null?void 0:e.filter(p=>a.includes(w_(p))))??[],u=T.useCallback(p=>{const g=a.indexOf(p);if(g>-1){const m=a.concat();m.splice(g,1),l(m)}else l(a.concat(p))},[a,l]),d=T.useCallback(p=>a.includes(p),[a]),h=DV,f={showFilters:r,setShowFilters:o,showMassActions:i,setShowMassActions:s,columns:e??[],filteredColumns:c,toggleColumnVisibility:u,isColumnVisible:d};return y.jsx(h,{value:f,children:n})}function S_({initialPageSize:t,initialVisibleColumns:e,columns:n,children:r,...o}){return y.jsx(N.Tile,{scheme:"light",shadow:!0,rounded:"md",px:"0",py:"4",w:"full",dflex:!0,flexCol:!0,...o,children:y.jsx(OV,{initialPageSize:t,children:y.jsx(RV,{columns:n,initialVisibleColumns:e,children:r})})})}function C_({children:t,...e}){return y.jsx(ia,{scheme:"default",corners:"pill",h:"10",variant:"glass",...e,children:t??y.jsx(N.Icon,{path:bx})})}function E_({...t}){return y.jsxs(N.Popover,{side:"bottom-end",modal:!0,children:[y.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",...t,children:y.jsx(N.Icon,{path:sx})}),y.jsxs("div",{bgColor:"white",rounded:!0,shadow:!0,children:[y.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"First Item"}),y.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Second Item"}),y.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Third Item"})]})]})}function __({title:t,queryKey:e,children:n,...r}){const o=Re.useInvalidateQuery(e);return q0("ctrl+r",()=>o(),{preventDefault:!0},[o]),y.jsxs("div",{dflex:!0,flexRow:!0,pb:"4",alignItems:"center",gap:"3",px:"8",borderB:"0.5",borderBColor:"--bg-2",...r,children:[t&&y.jsx("h2",{textSize:"x3",fontWeight:"600",textColor:"#3f4254",textTransform:"capitalize",children:t}),y.jsx("div",{flexGrow:!0,children:" "}),y.jsxs("div",{spaceX:"2",dflex:!0,alignItems:"center",children:[y.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",onClick:o,children:y.jsx(N.Icon,{path:Kg})}),n]})]})}const x_="Oops, something went wrong...";function A_(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function kg({initialValues:t,itemLabel:e,queryId:n="",api:r,queryFetchOptions:o,querySaveOptions:i,onSuccess:s,onFetchError:a,fetchErrorMsg:l=x_,onSaveError:c,saveErrorMsg:u=x_,fetchToFormData:d,formToQueryData:h,invalidateQueriesOnSuccess:f=!0,invalidateQueryKey:p,retryText:g="Retry",cancelLabel:m="Cancel",saveLabel:v,size:C="lg",title:w,form:b,show:S,onClose:E,formikProps:x,..._}){const{isInitialLoading:A,isFetching:O,data:k,isError:M,error:I,refetch:P}=Re.useApiQuery(r.queryKey,r.get,n,{enabled:!(n==""||n==null||n==null),onError:a,...o}),F=f?Re.useInvalidateParentMutation(r.upsert,p??r.queryKey,i):Re.useApiMutation(r.upsert,r.queryKey,n,i),z=T.useCallback(()=>P(),[P]),V=T.useCallback(async(J,K)=>{F.reset();const R=h?h(J):{...J};await F.mutateAsync(R).then(Q=>{s?s(R,Q):He.success(`${w?w(R):R.name??R.title} ${n?"saved":"created"}`),E==null||E()}).catch(Q=>{console.error("on error",Q),c?c(J):He.error(`Couldn't save ${w?w(R):R.name??R.title}`),K.setSubmitting(!1)})},[F,h,s,c,E]);return y.jsxs(N.Modal,{size:C,show:S,onClose:E,scheme:"light",transition:!0,..._,children:[y.jsxs(N.Modal.Header,{children:[!A&&n&&`Edit ${w?w(k):(k==null?void 0:k.name)??(k==null?void 0:k.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(b)&&y.jsx(y.Fragment,{})]}),A&&y.jsx(N.Modal.Body,{children:y.jsx(hr,{minW:"72"})}),M&&y.jsx(N.Modal.Body,{children:y.jsx(Jr,{label:`${l} ${I}`,onClick:z})}),!A&&!M&&y.jsx(y.Fragment,{children:y.jsx(Xe.Formik,{initialValues:d&&n&&k?d(A_(k)):A_(t(k))??{},onSubmit:V,...x,children:({setFieldValue:J,dirty:K,handleSubmit:R,isValid:Q,values:se})=>y.jsxs(y.Fragment,{children:[y.jsx(N.Modal.Body,{pb:"6",children:y.jsxs(Xe.Form,{children:[T.isValidElement(b)&&b,Array.isArray(b)&&y.jsx(pr,{form:b}),Fe.isFunction(b)&&y.jsx(pr,{form:b(k??se)})]})}),y.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[y.jsx(N.Button,{disabled:F.isLoading,onClick:E,variant:"borderless",me:"2",children:m}),y.jsx(N.Button,{type:"submit",disabled:!K||F.isLoading,onClick:()=>R(),children:v||(n?"Update":"Create")})]})]})})}),F.isLoading&&y.jsx(Fi,{})]})}function FV({api:t,fn:e,transformFn:n,config:r,onClose:o,queryId:i,invalidateQueryKey:s}){const{data:a,isFetching:l}=Re.useApiQuery(t.queryKey,e==="get"||e==="getTransformed"?t.get:t.getAll,void 0,{retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1}),c=T.useMemo(()=>a&&(e==="getTransformed"||e==="getAllTransformed")?(n||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${e}`),n==null?void 0:n(a)):a,[a,e,n]);return l?null:y.jsx(kg,{...r(c),queryId:i,invalidateQueryKey:s,show:!0,onClose:o})}function HV({queries:t,config:e,onClose:n,queryId:r,invalidateQueryKey:o}){const{data:i,isFetching:s,isError:a}=Re.useApiQueries(t.map(c=>({queryKey:c.api.queryKey,queryFn:c.fn=="get"?c.api.get:c.api.getAll,queryOptions:{cacheTime:c.cache===!1?0:void 0,staleTime:c.cache===!1?0:void 0}}))),l=T.useMemo(()=>i==null?void 0:i.map((c,u)=>{var d,h;return t[u].transformFn?(h=(d=t[u])==null?void 0:d.transformFn)==null?void 0:h.call(d,c):c}),[i,t]);return y.jsx(kg,{isPreloading:s,...e(...l),queryId:r,invalidateQueryKey:o,show:!0,onClose:n})}function T_({config:t,onClose:e,invalidateQueryKey:n,queryId:r}){const{type:o,...i}=t;return t.type==="dialog"?y.jsx(kg,{...i,queryId:r,invalidateQueryKey:n,show:!0,onClose:e}):t.type==="query"?y.jsx(FV,{...i,queryId:r,invalidateQueryKey:n,onClose:e}):t.type==="multiQuery"?y.jsx(HV,{...i,queryId:r,invalidateQueryKey:n,onClose:e}):null}function BV({itemLabel:t,queryId:e="",api:n,invalidateQueriesOnSuccess:r=!0,invalidateQueryKey:o,size:i="lg",show:s,onClose:a,...l}){const c=r?Re.useInvalidateParentMutation(n.delete,o??n.queryKey):Re.useApiMutation(n.upsert,n.queryKey),u=Re.useMutate(c,{onSuccess:()=>a==null?void 0:a()}),d=T.useCallback(()=>u(e),[u,e]);return y.jsxs(N.Modal,{size:i,show:s,onClose:a,scheme:"danger",variant:"glass",transition:!0,...l,children:[y.jsx(N.Modal.Header,{children:`Delete ${t}`}),y.jsxs(N.Modal.Body,{pb:"6",children:["Do you really want to delete ",t,"?"]}),y.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[y.jsx(N.Button,{disabled:c.isLoading,onClick:a,variant:"borderless",scheme:"secondary",me:"2",children:"Cancel"}),y.jsx(N.Button,{scheme:"danger",disabled:c.isLoading,onClick:d,children:"Delete"})]}),c.isLoading&&y.jsx(Fi,{})]})}const[VV,O_]=Fe.createContext();function $V({editView:t,deleteItem:e,queryKey:n,children:r}){const o=Vy(),i=Qt.useNavigate(),[s,a]=T.useState(null),l=T.useCallback(()=>a(null),[a]),c=T.useCallback((h,f)=>{switch(h.type){case"view":{i(Fe.runIfFn(h.path,f));break}case"link":{o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${Fe.runIfFn(h.path,f)}`);break}case"edit":{t.type=="customDialog"?a(t.render({show:!0,onClose:l})):a(y.jsx(T_,{onClose:l,config:t,queryId:f.id,invalidateQueryKey:n}));break}case"delete":{a(y.jsx(BV,{show:!0,onClose:l,queryId:f.id,invalidateQueryKey:n,...e,itemLabel:Fe.runIfFn(e.itemLabel,f)}));break}}},[i,t,e]),u=VV,d={dialog:s,onAction:c};return y.jsx(u,{value:d,children:r})}function jV({id:t,api:e,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=Re.useInvalidateParentMutation(i?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=T.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>He.success(i?"Published!":"Unpublished!")).catch(c=>He.error(`Error: ${c}`))},[s,t]);return y.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:y.jsx(N.Icon,{path:i?qg:Wg})})}function zV({row:t,onAction:e,rowActions:n,api:r,queryKey:o}){const i=t.original;return y.jsx("div",{dflex:!0,spaceX:"1",placeContent:"end",children:n==null?void 0:n.map((s,a)=>y.jsxs(T.Fragment,{children:[s.type==="publish"&&y.jsx(jV,{id:i.id,api:r,status:i.status,invalidateQueryKey:o}),s.type=="custom"&&y.jsx(y.Fragment,{children:s.component(i,o,s.icon,s.label)}),!["publish","custom"].includes(s.type)&&y.jsx(UV,{onClick:()=>e(s,i),scheme:WV[s.type],children:y.jsx(N.Icon,{path:qV[s.type]})})]},a))})}function UV({onClick:t,...e}){const n=T.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),t==null||t(r)},[t]);return y.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",onClick:n,...e})}const qV={link:ru,view:nu,edit:Ug,delete:tu,publish:tu,custom:""},WV={link:"dark",view:"secondary",edit:"warning",delete:"danger",publish:"warning",custom:"default"};function KV(t,e,n){const r=Qt.useNavigate(),o=Vy(),{onAction:i}=O_(),{onRowClick:s,columns:a,...l}=e,c=T.useCallback(h=>{(s==null?void 0:s.type)==="navigate"?r(Fe.runIfFn(s.path,h)):(s==null?void 0:s.type)=="link"&&o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${Fe.runIfFn(s.path,h)}`)},[r,s]),u=T.useMemo(()=>{const h=e.columns.concat([]);return n&&h.push(yB().display({id:"actions",header:"Actions",cell:f=>y.jsx(zV,{row:f.row,onAction:i,rowActions:n,api:t,queryKey:t.queryKey})})),h},[e]),d={...l};return d.columns=u,d.onRowClick=c,d.queryKey=t.queryKey,d.queryFn=t.search,d}function GV({form:t,initialValues:e,schema:n,processInput:r}){const{showFilters:o}=NV(),{getFilters:i,setFilters:s}=Qc(),a=T.useCallback((c,u)=>{const d=(r==null?void 0:r(c))??c;Fy(d,i())||s(d),u.setSubmitting(!1)},[s,r]),l=T.useCallback(c=>{s(e),c()},[s,e]);return T.useEffect(()=>s(e),[]),y.jsx(N.Collapse,{in:o,style:{overflow:o?"initial":"hidden"},children:y.jsx("div",{p:"8",borderT:"px",borderB:"px",borderColor:"slate-100",children:y.jsx(Ra,{initialValues:H0(i(),e),onSubmit:a,validationSchema:n,enableReinitialize:!0,children:c=>y.jsxs("div",{dflex:!0,gap:"3",placeContent:"start",children:[y.jsx(pr,{flexRow:!0,w:"auto",form:t}),y.jsx(JV,{handleReset:()=>l(c.resetForm)})]})})})})}function JV({handleReset:t}){return y.jsxs("div",{dflex:!0,gap:"3",children:[y.jsxs("div",{dflex:!0,flexCol:!0,children:[y.jsx(vn,{name:"",label:" "}),y.jsx(Bd,{children:"Filter"})]}),y.jsxs("div",{dflex:!0,flexCol:!0,children:[y.jsx(vn,{name:"",label:" "}),y.jsx(N.Button,{scheme:"neutral",onClick:t,children:"Reset"})]})]})}function XV({label:t,buttonProps:e,icon:n,queryKey:r,queryFn:o,successMsg:i,errorMsg:s,invalidateParent:a}){const l=a?Re.useInvalidateParentMutation(o,r):Re.useApiMutation(o,r),c=Re.useMutate(l,{successMsg:i,errorMsg:s});return y.jsxs(N.Button,{display:"flex",alignItems:"center",gap:"3",...e,onClick:c,disabled:l.isLoading,children:[n&&y.jsx(N.Icon,{path:n}),t]})}function YV({actions:t}){const{ids:e}=Qc(),n=e&&e.length>0;return y.jsx(N.Collapse,{in:n,style:{overflow:n?"initial":"hidden"},children:y.jsx("div",{dflex:!0,gap:"3",flexWrap:!0,alignItems:"center",px:"8",pt:"5",children:t.map((r,o)=>y.jsx("div",{children:r.type=="button"&&!r.showConfirmationDialog&&y.jsx(XV,{label:r.label,queryFn:r.queryFn,queryKey:r.queryKey,buttonProps:r.buttonProps})},o))})})}function QV(t){const e=Qt.useParams();if(t===void 0)return;const{[t]:n}=e;return n}function ZV({queryField:t,title:e,subtitle:n,screen:r,...o}){const i=QV(t),s=Fe.runIfFn(r,i);return y.jsx(Fa,{p:"5",...o,children:y.jsx(S_,{columns:s.table.columns,initialVisibleColumns:s.table.initialVisibleColumns,children:y.jsx(e$,{id:i,title:e,subtitle:n,screen:s})})})}function e$({id:t,title:e,subtitle:n,screen:r}){const{setRowSelection:o}=Qc(),{api:i,table:s,filters:a,massActions:l,buttonBar:c,rowActions:u,createView:d,editView:h,deleteItem:f,breadcrumbs:p}=r,g=Fe.runIfFn(i,t??"");return y.jsxs(y.Fragment,{children:[p&&y.jsx(ug,{breadcrumbs:p}),y.jsxs(__,{title:e,queryKey:g.queryKey,children:[y.jsx(t$,{buttonBar:c,createView:d,editView:h,api:g}),a&&y.jsx(E_,{})]}),a&&y.jsx(GV,{form:a.form,initialValues:a.initialValues,schema:a.schema,processInput:a.processInput}),l&&y.jsx(YV,{actions:l.items}),y.jsxs($V,{queryKey:g.queryKey,editView:h,deleteItem:f,children:[y.jsx(n$,{table:{...s,onSelectionChange:o},rowActions:u,api:g,subtitle:n}),y.jsx(r$,{})]})]})}function t$({buttonBar:t,createView:e,editView:n,api:r}){const o=T.useCallback(i=>{const s=e??n;return s.type=="customDialog"?s.render({show:!0,onClose:i}):y.jsx(T_,{config:s,onClose:i,invalidateQueryKey:r.queryKey})},[n,r]);return y.jsx(y.Fragment,{children:t&&t.map((i,s)=>y.jsxs("div",{children:[i.type==="create"&&n&&y.jsx(C_,{buildDialog:o}),i.type==="invalidate"&&y.jsx(Zu,{pathOrPermalink:i.pathOrPermalink}),i.type==="custom"&&i.render()]},s))})}function n$({table:t,subtitle:e,rowActions:n,api:r}){const o=KV(r,t,n),i=T.useMemo(()=>{if(e)return s=>y.jsx("div",{textSize:"lg",textColor:"#475569",fontWeight:"600",children:Fe.isFunction(e)?e(s):e})},[e]);return y.jsx(MV,{...o,title:i})}function r$(){const{dialog:t}=O_();return t}function o$(t){const e=Qt.useParams(),{data:n,isFetching:r,isError:o}=Re.useApiQueries(t.map(s=>{if(!s.queryField||!Fe.isFunction(s.api)){const c=s.api;return{queryKey:c.queryKey,queryFn:s.fn=="get"?c.get:c.getAll,queryParam:s.params}}const a=e[s.queryField],l=Fe.runIfFn(s.api,a);return{queryKey:l.queryKey,queryFn:s.fn=="get"?l.get:l.getAll,queryParam:s.fn=="getAll"?s.params:Fe.isFunction(s.api)?void 0:a}}));let i;return!r&&!o&&(i=n==null?void 0:n.map((s,a)=>{var l,c;return t[a].transformFn?(c=(l=t[a]).transformFn)==null?void 0:c.call(l,s):s})),{data:i,isFetching:r,isError:o}}function i$(t){const e=Dg.useQueryClient(),n=Qt.useParams();return T.useCallback(()=>{const o=[];t.forEach(i=>{if(!i.queryField||!Fe.isFunction(i.api))o.push(i.api.queryKey);else{const s=n[i.queryField],a=Fe.runIfFn(i.api,s);o.push(a.queryKey)}}),e.invalidateQueries({predicate:i=>o.includes(i.queryKey)})},[t,e,n])}function s$({queries:t,config:e,tabbed:n,...r}){const{data:o,isFetching:i,isError:s}=o$(t),a=i$(t);return i?y.jsx(hr,{w:"full",h:"100vh"}):s||!o?y.jsx(Jr,{p:"0",w:"full",h:"100vh",onClick:a}):y.jsx(Zc,{config:e(...o),tabbed:n,...r})}function Zc({config:t,tabbed:e,...n}){return t.type==="table"?y.jsx(ZV,{...t,...n}):t.type==="tabbed"?y.jsx(gB,{...t,...n}):t.type==="details"?y.jsx(uB,{...t,tabbed:e,...n}):t.type==="query"?y.jsx(pB,{...t,tabbed:e,...n}):t.type==="multiQuery"?y.jsx(s$,{...t,tabbed:e,...n}):y.jsx(y.Fragment,{})}const k_="Oops, something went wrong...";function a$({queryId:t,queryKey:e,queryFetchFn:n,queryFetchAllKey:r,queryFetchAllFn:o,querySaveFn:i,matchKey:s,size:a="lg",show:l,onClose:c,itemLabel:u,onSuccess:d,onFetchError:h,fetchErrorMsg:f=k_,onSaveError:p,saveErrorMsg:g=k_,invalidateQueriesOnSuccess:m=!0,retryText:v="Retry",cancelLabel:C="Cancel",saveLabel:w,formikProps:b,getItemName:S,...E}){const x=Dg.useQueryClient(),{data:_,isInitialLoading:A,isError:O,refetch:k,error:M}=Re.useApiQuery(e,n),{data:I,isInitialLoading:P,isError:F,refetch:z,error:V}=Re.useApiQuery(r,o),[J,K]=T.useState([]),R=A||P,Q=O||F,se=Re.useApiMutation(i,e,t),ie=T.useCallback(D=>{const ce=(D==null?void 0:D.currentTarget.dataset.id)??"",ye=J.concat([]),be=J.indexOf(ce);be!=-1?ye.splice(be,1):ye.push(ce),K(ye)},[J,K]),de=T.useCallback(()=>{O&&k(),F&&z()},[k,z,O,F]),ue=T.useCallback(()=>{se.reset(),se.mutateAsync({resources:J}).then(D=>{d?d(D):He.success(`${u} saved`),m&&x.invalidateQueries({queryKey:e}),c==null||c()}).catch(D=>{console.error("on error",D),p?p():He.error(`Error adding ${u}`)})},[se,t,d,x,p,c]),pe=T.useMemo(()=>{let D=[];return _&&I&&(D=[].concat(I),_.forEach(ce=>D.splice(D.findIndex(ye=>ye.id==ce[s]),1)),S&&(D=D.map(ce=>({...ce,name:S(ce)}))),D=GT(D,["name"])),D},[_,I]);return y.jsxs(N.Modal,{size:a,show:l,onClose:c,scheme:"light",transition:!0,...E,children:[y.jsx(N.Modal.Header,{children:`Add ${u}`}),R&&y.jsx(N.Modal.Body,{children:y.jsx(hr,{minW:"72"})}),Q&&y.jsx(N.Modal.Body,{children:y.jsx(Jr,{label:`${f} ${M}`,onClick:de})}),!R&&!Q&&y.jsxs(y.Fragment,{children:[y.jsx(N.Modal.Body,{px:"0",pb:"6",maxH:"750px",overflow:"auto",children:y.jsx("div",{dflex:!0,flexCol:!0,overflow:"auto",children:pe.map(D=>y.jsx(l$,{label:D.name,value:D.id,"data-id":D.id,checked:J.includes(`${D.id}`),onClick:ie},D.id))})}),y.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[y.jsx(N.Button,{disabled:se.isLoading,onClick:c,variant:"borderless",me:"2",children:C}),y.jsx(N.Button,{type:"submit",disabled:J.length==0||se.isLoading,onClick:ue,children:w||(t?"Update":"Create")})]})]}),se.isLoading&&y.jsx(Fi,{})]})}function l$({label:t,value:e,checked:n,...r}){return y.jsxs("div",{dflex:!0,alignItems:"center",hover_bgColor:"slate-100",px:"5",py:"2",cursor:"pointer",...r,children:[y.jsx("span",{flexGrow:!0,children:t}),y.jsx(N.Checkbox,{name:`resources.${e}`,value:e,checked:n})]})}function c$({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFn:o,queryOptions:i,onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h,invalidateQueriesOnSuccess:f=!0,cancelLabel:p="Cancel",saveLabel:g="Send",size:m="lg",title:v,form:C,show:w,onClose:b,formikProps:S,...E}){const x=f?Re.useInvalidateParentMutation(o,r,i):Re.useApiMutation(o,r,n,i),_=Re.useMutate(x,{onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h});return y.jsxs(N.Modal,{size:m,show:w,onClose:b,scheme:"light",transition:!0,...E,children:[y.jsx(N.Modal.Header,{children:v}),y.jsxs(Ra,{initialValues:t??{},onSubmit:_,...S,children:[y.jsxs(N.Modal.Body,{pb:"6",children:[T.isValidElement(C)&&C,Array.isArray(C)&&y.jsx(pr,{form:C})]}),y.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[y.jsx(N.Button,{disabled:x.isLoading,onClick:b,variant:"borderless",me:"2",children:p}),y.jsx(Bd,{disabled:x.isLoading,children:g})]})]}),x.isLoading&&y.jsx(Fi,{})]})}const M_="Oops, something went wrong...";function P_(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function u$({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFetchFn:o,queryFetchOptions:i,querySaveFn:s,querySaveOptions:a,onSuccess:l,onFetchError:c,fetchErrorMsg:u=M_,onSaveError:d,saveErrorMsg:h=M_,fetchToFormData:f,formToQueryData:p,invalidateQueriesOnSuccess:g=!0,invalidateQueryKey:m,retryText:v="Retry",cancelLabel:C="Cancel",saveLabel:w,size:b="lg",title:S,form:E,show:x,onClose:_,formikProps:A,...O}){const{isInitialLoading:k,isFetching:M,data:I,isError:P,error:F,refetch:z}=Re.useApiQuery(r,o,n,{enabled:!(n==""||n==null||n==null),onError:c,...i}),V=g?Re.useInvalidateParentMutation(s,m??r,a):Re.useApiMutation(s,r,n,a),J=T.useCallback(()=>z(),[z]),K=T.useCallback((R,Q)=>{V.reset();const se=p?p(R):{...R};V.mutateAsync(se).then(ie=>{l?l(se,ie):He.success(`${S?S(se):se.name??se.title} ${n?"saved":"created"}`),_==null||_()}).catch(ie=>{console.error("on error",ie),d?d(R):He.error(`Couldn't save ${S?S(se):se.name??se.title}`),Q.setSubmitting(!1)})},[V,p,l,d,_]);return y.jsxs(N.Modal,{size:b,show:x,onClose:_,scheme:"light",transition:!0,...O,children:[y.jsxs(N.Modal.Header,{children:[!k&&n&&`Edit ${S?S(I):(I==null?void 0:I.name)??(I==null?void 0:I.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(E)&&y.jsx(y.Fragment,{})]}),k&&y.jsx(N.Modal.Body,{children:y.jsx(hr,{minW:"72"})}),P&&y.jsx(N.Modal.Body,{children:y.jsx(Jr,{label:`${u} ${F}`,onClick:J})}),!k&&!P&&y.jsx(y.Fragment,{children:y.jsx(Xe.Formik,{initialValues:f&&n&&I?f(P_(I)):P_(I)??t??{},onSubmit:K,...A,children:({setFieldValue:R,dirty:Q,handleSubmit:se,isValid:ie,values:de})=>y.jsxs(y.Fragment,{children:[y.jsx(N.Modal.Body,{pb:"6",children:y.jsxs(Xe.Form,{children:[T.isValidElement(E)&&E,Array.isArray(E)&&y.jsx(pr,{form:E}),Fe.isFunction(E)&&y.jsx(pr,{form:E(I??de)})]})}),y.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[y.jsx(N.Button,{disabled:V.isLoading,onClick:_,variant:"borderless",me:"2",children:C}),y.jsx(N.Button,{type:"submit",disabled:!Q||V.isLoading,onClick:()=>se(),children:w||(n?"Update":"Create")})]})]})})}),V.isLoading&&y.jsx(Fi,{})]})}function I_({children:t,...e}){return y.jsx("div",{trait:"typo.h6",mb:"5",...e,children:t})}const d$=T.forwardRef(({loading:t=!1,children:e,...n},r)=>y.jsxs(y.Fragment,{children:[t&&y.jsx(hr,{w:"full",h:"100%"}),!t&&y.jsx(N.Container,{ref:r,center:!0,size:"x2",dflex:!0,flexCol:!0,gap:"8",...n,children:e})]}));function f$({children:t,...e}){return y.jsx("div",{trait:"typo.h6",mb:"3",...e,children:t})}const h$={draft:"Draft",published:"Published",pending:"Pending",approved:"Approved",partially_approved:"Partially Approved",rejected:"Rejected"},p$={draft:"warning",published:"success",pending:"secondary",approved:"success",partially_approved:"warning",rejected:"danger"};function g$({status:t,...e}){return y.jsx(N.Badge,{size:"sm",variant:"glass",whiteSpace:"nowrap",rounded:"full",px:"3",scheme:p$[t],...e,children:h$[t]})}function L_({path:t,...e}){const n=T.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),window.open(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${t}`,"_blank")},[t]);return y.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"dark",onClick:n,...e,children:y.jsx(N.Icon,{path:ru})})}function D_({path:t,...e}){const n=Qt.useNavigate(),r=T.useCallback(o=>{o==null||o.preventDefault(),o==null||o.stopPropagation(),n(`${t}`)},[n,t]);return y.jsx(N.Button,{scheme:"secondary",w:"10",h:"10",variant:"borderless",corners:"pill",onClick:r,...e,children:y.jsx(N.Icon,{path:nu})})}function N_({children:t,...e}){return y.jsx(ia,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"warning",...e,children:t??y.jsx(N.Icon,{path:Ug})})}function R_({children:t,...e}){return y.jsx(ia,{w:"10",h:"10",scheme:"danger",variant:"borderless",corners:"pill",...e,children:t??y.jsx(N.Icon,{path:tu})})}function m$({publishId:t,viewPath:e,navigatePath:n,editDialog:r,deleteDialog:o,children:i,...s}){return y.jsxs("div",{dflex:!0,spaceX:"1",placeContent:"end",...s,children:[e&&y.jsx(L_,{path:e}),n&&y.jsx(D_,{path:n}),r&&y.jsx(N_,{buildDialog:r}),o&&y.jsx(R_,{buildDialog:o}),i]})}function y$({id:t,api:e,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=Re.useInvalidateParentMutation(i?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=T.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>He.success(i?"Published!":"Unpublished!")).catch(c=>He.error(`Error: ${c}`))},[s,t]);return y.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:y.jsx(N.Icon,{path:i?qg:Wg})})}Ae.AttachDialog=a$,Ae.Breadcrumbs=Fu,Ae.DialogButton=ia,Ae.FormActionDialog=c$,Ae.IconButton=jx,Ae.InvalidateButton=Zu,Ae.ItemEditDialog=u$,Ae.NavigateButton=ZA,Ae.OrderCell=iM,Ae.PageContainer=Fa,Ae.PageContentEditor=qE,Ae.PageMain=UE,Ae.PageQueryStateContainer=lg,Ae.PageSectionTitle=I_,Ae.PageSidebar=WE,Ae.PageSidebarSection=KE,Ae.PageStateContainer=d$,Ae.PageSubSectionTitle=f$,Ae.PageTabbedTopBar=XE,Ae.PageTabbedTopBarProvider=JE,Ae.PageTitle=cg,Ae.PageTopBar=ug,Ae.PageTopBarToolbar=YE,Ae.PublishButton=Ly,Ae.ScreenRenderer=Zc,Ae.SectionTitle=K_,Ae.StatusBadge=g$,Ae.TableContainer=S_,Ae.TableCreateButton=C_,Ae.TableFilterButton=E_,Ae.TableRowActionBar=m$,Ae.TableRowDeleteButton=R_,Ae.TableRowEditButton=N_,Ae.TableRowNavigateButton=D_,Ae.TableRowPublishPostButton=y$,Ae.TableRowViewButton=L_,Ae.TableTopBar=__,Ae.UpdateButton=W0,Ae.ViewButton=K0,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});
18
+ */function Qa(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Ga({id:e,api:t,status:r,invalidateQueryKey:n,...o}){const i=r=="draft",s=x.useInvalidateParentMutation(i?t.publish:t.unpublish,n??t.queryKey,{networkMode:"always"}),a=v.useCallback(u=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),s.reset(),s.mutateAsync(e).then(()=>k.success(i?"Published!":"Unpublished!")).catch(d=>k.error(`Error: ${d}`))},[s,e]);return l.jsx(T.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:l.jsx(T.Icon,{path:i?Sr:Lr})})}function Xa({row:e,onAction:t,rowActions:r,api:n,queryKey:o}){const i=e.original;return l.jsx("div",{dflex:!0,spaceX:"1",placeContent:"end",children:r==null?void 0:r.map((s,a)=>l.jsxs(v.Fragment,{children:[s.type==="publish"&&l.jsx(Ga,{id:i.id,api:n,status:i.status,invalidateQueryKey:o}),s.type=="custom"&&l.jsx(l.Fragment,{children:s.component(i,o,s.icon,s.label)}),!["publish","custom"].includes(s.type)&&l.jsx(Ja,{onClick:()=>t(s,i),scheme:Ya[s.type],children:l.jsx(T.Icon,{path:Za[s.type]})})]},a))})}function Ja({onClick:e,...t}){const r=v.useCallback(n=>{n==null||n.preventDefault(),n==null||n.stopPropagation(),e==null||e(n)},[e]);return l.jsx(T.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",onClick:r,...t})}const Za={link:wt,view:Et,edit:Ar,delete:vt,publish:vt,custom:""},Ya={link:"dark",view:"secondary",edit:"warning",delete:"danger",publish:"warning",custom:"default"};function el(e,t,r){const n=le.useNavigate(),o=Cr.useOpenLink(),{onAction:i}=jo(),{onRowClick:s,columns:a,...u}=t,d=v.useCallback(m=>{(s==null?void 0:s.type)==="navigate"?n(z.runIfFn(s.path,m)):(s==null?void 0:s.type)=="link"&&o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${z.runIfFn(s.path,m)}`)},[n,s]),f=v.useMemo(()=>{const m=t.columns.concat([]);return r&&m.push(Qa().display({id:"actions",header:"Actions",cell:h=>l.jsx(Xa,{row:h.row,onAction:i,rowActions:r,api:e,queryKey:e.queryKey})})),m},[t]),c={...u};return c.columns=f,c.onRowClick=d,c.queryKey=e.queryKey,c.queryFn=e.search,c}function tl(e,t,r){return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function rl(e,t,r){return e.slice().sort((n,o)=>{const i=r.length;for(let s=0;s<t.length;s++){const a=i>s?r[s]:r[i-1],u=t[s],d=typeof u=="function",f=d?u(n):n[u],c=d?u(o):o[u],m=tl(f,c,a);if(m!==0)return m}return 0})}function nl(e,t){return rl(e,t,["asc"])}function ol(){}function Fo(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Do(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const sl="[object RegExp]",il="[object String]",al="[object Number]",ll="[object Boolean]",Ho="[object Arguments]",ul="[object Symbol]",cl="[object Date]",dl="[object Map]",fl="[object Set]",pl="[object Array]",hl="[object Function]",yl="[object ArrayBuffer]",_r="[object Object]",gl="[object Error]",ml="[object DataView]",bl="[object Uint8Array]",vl="[object Uint8ClampedArray]",El="[object Uint16Array]",wl="[object Uint32Array]",Pl="[object BigUint64Array]",_l="[object Int8Array]",Tl="[object Int16Array]",Cl="[object Int32Array]",Ol="[object BigInt64Array]",Al="[object Float32Array]",Sl="[object Float64Array]";function qo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function Ll(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Ml(e,t,r){return Fe(e,t,void 0,void 0,void 0,void 0,r)}function Fe(e,t,r,n,o,i,s){const a=s(e,t,r,n,o,i);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return De(e,t,i,s)}return De(e,t,i,s)}function De(e,t,r,n){if(Object.is(e,t))return!0;let o=Do(e),i=Do(t);if(o===Ho&&(o=_r),i===Ho&&(i=_r),o!==i)return!1;switch(o){case il:return e.toString()===t.toString();case al:{const u=e.valueOf(),d=t.valueOf();return Ll(u,d)}case ll:case cl:case ul:return Object.is(e.valueOf(),t.valueOf());case sl:return e.source===t.source&&e.flags===t.flags;case hl:return e===t}r=r??new Map;const s=r.get(e),a=r.get(t);if(s!=null&&a!=null)return s===t;r.set(e,t),r.set(t,e);try{switch(o){case dl:{if(e.size!==t.size)return!1;for(const[u,d]of e.entries())if(!t.has(u)||!Fe(d,t.get(u),u,e,t,r,n))return!1;return!0}case fl:{if(e.size!==t.size)return!1;const u=Array.from(e.values()),d=Array.from(t.values());for(let f=0;f<u.length;f++){const c=u[f],m=d.findIndex(h=>Fe(c,h,void 0,e,t,r,n));if(m===-1)return!1;d.splice(m,1)}return!0}case pl:case bl:case vl:case El:case wl:case Pl:case _l:case Tl:case Cl:case Ol:case Al:case Sl:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let u=0;u<e.length;u++)if(!Fe(e[u],t[u],u,e,t,r,n))return!1;return!0}case yl:return e.byteLength!==t.byteLength?!1:De(new Uint8Array(e),new Uint8Array(t),r,n);case ml:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:De(new Uint8Array(e),new Uint8Array(t),r,n);case gl:return e.name===t.name&&e.message===t.message;case _r:{if(!(De(e.constructor,t.constructor,r,n)||qo(e)&&qo(t)))return!1;const d=[...Object.keys(e),...Fo(e)],f=[...Object.keys(t),...Fo(t)];if(d.length!==f.length)return!1;for(let c=0;c<d.length;c++){const m=d[c],h=e[m];if(!Object.hasOwn(t,m))return!1;const y=t[m];if(!Fe(h,y,m,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function Nl(e,t){return Ml(e,t,ol)}function Il({form:e,initialValues:t,schema:r,processInput:n}){const{showFilters:o}=Ua(),{getFilters:i,setFilters:s}=Se.useTableContext(),a=v.useCallback((d,f)=>{const c=(n==null?void 0:n(d))??d;Nl(c,i())||s(c),f.setSubmitting(!1)},[s,n]),u=v.useCallback(d=>{s(t),d()},[s,t]);return v.useEffect(()=>s(t),[]),l.jsx(T.Collapse,{in:o,style:{overflow:o?"initial":"hidden"},children:l.jsx("div",{p:"8",borderT:"px",borderB:"px",borderColor:"slate-100",children:l.jsx(ee.FormProvider,{initialValues:ee.mergeInitialFormValues(i(),t),onSubmit:a,validationSchema:r,enableReinitialize:!0,children:d=>l.jsxs("div",{dflex:!0,gap:"3",placeContent:"start",children:[l.jsx(ee.FormRenderer,{flexRow:!0,w:"auto",form:e}),l.jsx(kl,{handleReset:()=>u(d.resetForm)})]})})})})}function kl({handleReset:e}){return l.jsxs("div",{dflex:!0,gap:"3",children:[l.jsxs("div",{dflex:!0,flexCol:!0,children:[l.jsx(ee.FieldLabel,{name:"",label:" "}),l.jsx(ee.SubmitButton,{children:"Filter"})]}),l.jsxs("div",{dflex:!0,flexCol:!0,children:[l.jsx(ee.FieldLabel,{name:"",label:" "}),l.jsx(T.Button,{scheme:"neutral",onClick:e,children:"Reset"})]})]})}function xl({label:e,buttonProps:t,icon:r,queryKey:n,queryFn:o,successMsg:i,errorMsg:s,invalidateParent:a}){const u=a?x.useInvalidateParentMutation(o,n):x.useApiMutation(o,n),d=x.useMutate(u,{successMsg:i,errorMsg:s});return l.jsxs(T.Button,{display:"flex",alignItems:"center",gap:"3",...t,onClick:d,disabled:u.isLoading,children:[r&&l.jsx(T.Icon,{path:r}),e]})}function Bl({actions:e}){const{ids:t}=Se.useTableContext(),r=t&&t.length>0;return l.jsx(T.Collapse,{in:r,style:{overflow:r?"initial":"hidden"},children:l.jsx("div",{dflex:!0,gap:"3",flexWrap:!0,alignItems:"center",px:"8",pt:"5",children:e.map((n,o)=>l.jsx("div",{children:n.type=="button"&&!n.showConfirmationDialog&&l.jsx(xl,{label:n.label,queryFn:n.queryFn,queryKey:n.queryKey,buttonProps:n.buttonProps})},o))})})}function jl(e){const t=le.useParams();if(e===void 0)return;const{[e]:r}=t;return r}function Fl({queryField:e,title:t,subtitle:r,screen:n,...o}){const i=jl(e),s=z.runIfFn(n,i);return l.jsx(gt,{p:"5",...o,children:l.jsx(Lo,{columns:s.table.columns,initialVisibleColumns:s.table.initialVisibleColumns,children:l.jsx(Dl,{id:i,title:t,subtitle:r,screen:s})})})}function Dl({id:e,title:t,subtitle:r,screen:n}){const{setRowSelection:o}=Se.useTableContext(),{api:i,table:s,filters:a,massActions:u,buttonBar:d,rowActions:f,createView:c,editView:m,deleteItem:h,breadcrumbs:y}=n,p=z.runIfFn(i,e??"");return l.jsxs(l.Fragment,{children:[y&&l.jsx(wr,{breadcrumbs:y}),l.jsxs(Io,{title:t,queryKey:p.queryKey,children:[l.jsx(Hl,{buttonBar:d,createView:c,editView:m,api:p}),a&&l.jsx(No,{})]}),a&&l.jsx(Il,{form:a.form,initialValues:a.initialValues,schema:a.schema,processInput:a.processInput}),u&&l.jsx(Bl,{actions:u.items}),l.jsxs(Wa,{queryKey:p.queryKey,editView:m,deleteItem:h,children:[l.jsx(ql,{table:{...s,onSelectionChange:o},rowActions:f,api:p,subtitle:r}),l.jsx(Ul,{})]})]})}function Hl({buttonBar:e,createView:t,editView:r,api:n}){const o=v.useCallback(i=>{const s=t??r;return s.type=="customDialog"?s.render({show:!0,onClose:i}):l.jsx(Bo,{config:s,onClose:i,invalidateQueryKey:n.queryKey})},[r,n]);return l.jsx(l.Fragment,{children:e&&e.map((i,s)=>l.jsxs("div",{children:[i.type==="create"&&r&&l.jsx(Mo,{buildDialog:o}),i.type==="invalidate"&&l.jsx(dr,{pathOrPermalink:i.pathOrPermalink}),i.type==="custom"&&i.render()]},s))})}function ql({table:e,subtitle:t,rowActions:r,api:n}){const o=el(n,e,r),i=v.useMemo(()=>{if(t)return s=>l.jsx("div",{textSize:"lg",textColor:"#475569",fontWeight:"600",children:z.isFunction(t)?t(s):t})},[t]);return l.jsx(Se.Table,{...o,title:i})}function Ul(){const{dialog:e}=jo();return e}function Vl(e){const t=le.useParams(),{data:r,isFetching:n,isError:o}=x.useApiQueries(e.map(s=>{if(!s.queryField||!z.isFunction(s.api)){const d=s.api;return{queryKey:d.queryKey,queryFn:s.fn=="get"?d.get:d.getAll,queryParam:s.params}}const a=t[s.queryField],u=z.runIfFn(s.api,a);return{queryKey:u.queryKey,queryFn:s.fn=="get"?u.get:u.getAll,queryParam:s.fn=="getAll"?s.params:z.isFunction(s.api)?void 0:a}}));let i;return!n&&!o&&(i=r==null?void 0:r.map((s,a)=>{var u,d;return e[a].transformFn?(d=(u=e[a]).transformFn)==null?void 0:d.call(u,s):s})),{data:i,isFetching:n,isError:o}}function Rl(e){const t=Or.useQueryClient(),r=le.useParams();return v.useCallback(()=>{const o=[];e.forEach(i=>{if(!i.queryField||!z.isFunction(i.api))o.push(i.api.queryKey);else{const s=r[i.queryField],a=z.runIfFn(i.api,s);o.push(a.queryKey)}}),t.invalidateQueries({predicate:i=>o.includes(i.queryKey)})},[e,t,r])}function zl({queries:e,config:t,tabbed:r,...n}){const{data:o,isFetching:i,isError:s}=Vl(e),a=Rl(e);return i?l.jsx(J.QueryLoadingState,{w:"full",h:"100vh"}):s||!o?l.jsx(J.RetryOnError,{p:"0",w:"full",h:"100vh",onClick:a}):l.jsx(mt,{config:t(...o),tabbed:r,...n})}function mt({config:e,tabbed:t,...r}){return e.type==="table"?l.jsx(Fl,{...e,...r}):e.type==="tabbed"?l.jsx(Da,{...e,...r}):e.type==="details"?l.jsx(ka,{...e,tabbed:t,...r}):e.type==="query"?l.jsx(Fa,{...e,tabbed:t,...r}):e.type==="multiQuery"?l.jsx(zl,{...e,tabbed:t,...r}):l.jsx(l.Fragment,{})}const Uo="Oops, something went wrong...";function Kl({queryId:e,queryKey:t,queryFetchFn:r,queryFetchAllKey:n,queryFetchAllFn:o,querySaveFn:i,matchKey:s,size:a="lg",show:u,onClose:d,itemLabel:f,onSuccess:c,onFetchError:m,fetchErrorMsg:h=Uo,onSaveError:y,saveErrorMsg:p=Uo,invalidateQueriesOnSuccess:g=!0,retryText:E="Retry",cancelLabel:O="Cancel",saveLabel:P,formikProps:b,getItemName:_,...A}){const S=Or.useQueryClient(),{data:C,isInitialLoading:N,isError:I,refetch:M,error:q}=x.useApiQuery(t,r),{data:j,isInitialLoading:U,isError:V,refetch:K,error:W}=x.useApiQuery(n,o),[R,$]=v.useState([]),Q=N||U,ne=I||V,G=x.useApiMutation(i,t,e),Y=v.useCallback(F=>{const te=(F==null?void 0:F.currentTarget.dataset.id)??"",de=R.concat([]),Pe=R.indexOf(te);Pe!=-1?de.splice(Pe,1):de.push(te),$(de)},[R,$]),He=v.useCallback(()=>{I&&M(),V&&K()},[M,K,I,V]),X=v.useCallback(()=>{G.reset(),G.mutateAsync({resources:R}).then(F=>{c?c(F):k.success(`${f} saved`),g&&S.invalidateQueries({queryKey:t}),d==null||d()}).catch(F=>{console.error("on error",F),y?y():k.error(`Error adding ${f}`)})},[G,e,c,S,y,d]),Tr=v.useMemo(()=>{let F=[];return C&&j&&(F=[].concat(j),C.forEach(te=>F.splice(F.findIndex(de=>de.id==te[s]),1)),_&&(F=F.map(te=>({...te,name:_(te)}))),F=nl(F,["name"])),F},[C,j]);return l.jsxs(T.Modal,{size:a,show:u,onClose:d,scheme:"light",transition:!0,...A,children:[l.jsx(T.Modal.Header,{children:`Add ${f}`}),Q&&l.jsx(T.Modal.Body,{children:l.jsx(J.QueryLoadingState,{minW:"72"})}),ne&&l.jsx(T.Modal.Body,{children:l.jsx(J.RetryOnError,{label:`${h} ${q}`,onClick:He})}),!Q&&!ne&&l.jsxs(l.Fragment,{children:[l.jsx(T.Modal.Body,{px:"0",pb:"6",maxH:"750px",overflow:"auto",children:l.jsx("div",{dflex:!0,flexCol:!0,overflow:"auto",children:Tr.map(F=>l.jsx($l,{label:F.name,value:F.id,"data-id":F.id,checked:R.includes(`${F.id}`),onClick:Y},F.id))})}),l.jsxs(T.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[l.jsx(T.Button,{disabled:G.isLoading,onClick:d,variant:"borderless",me:"2",children:O}),l.jsx(T.Button,{type:"submit",disabled:R.length==0||G.isLoading,onClick:X,children:P||(e?"Update":"Create")})]})]}),G.isLoading&&l.jsx(J.ModalLoadingOverlay,{})]})}function $l({label:e,value:t,checked:r,...n}){return l.jsxs("div",{dflex:!0,alignItems:"center",hover_bgColor:"slate-100",px:"5",py:"2",cursor:"pointer",...n,children:[l.jsx("span",{flexGrow:!0,children:e}),l.jsx(T.Checkbox,{name:`resources.${t}`,value:t,checked:r})]})}function Wl({initialValues:e,itemLabel:t,queryId:r="",queryKey:n,queryFn:o,queryOptions:i,onSuccess:s,successMsg:a,showSuccessMsg:u,onError:d,errorMsg:f,showErrorMsg:c,processInput:m,invalidateQueriesOnSuccess:h=!0,cancelLabel:y="Cancel",saveLabel:p="Send",size:g="lg",title:E,form:O,show:P,onClose:b,formikProps:_,...A}){const S=h?x.useInvalidateParentMutation(o,n,i):x.useApiMutation(o,n,r,i),C=x.useMutate(S,{onSuccess:s,successMsg:a,showSuccessMsg:u,onError:d,errorMsg:f,showErrorMsg:c,processInput:m});return l.jsxs(T.Modal,{size:g,show:P,onClose:b,scheme:"light",transition:!0,...A,children:[l.jsx(T.Modal.Header,{children:E}),l.jsxs(ee.FormProvider,{initialValues:e??{},onSubmit:C,..._,children:[l.jsxs(T.Modal.Body,{pb:"6",children:[v.isValidElement(O)&&O,Array.isArray(O)&&l.jsx(ee.FormRenderer,{form:O})]}),l.jsxs(T.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[l.jsx(T.Button,{disabled:S.isLoading,onClick:b,variant:"borderless",me:"2",children:y}),l.jsx(ee.SubmitButton,{disabled:S.isLoading,children:p})]})]}),S.isLoading&&l.jsx(J.ModalLoadingOverlay,{})]})}const Vo="Oops, something went wrong...";function Ro(e){if(e){const t={...e};for(const r in e)t[r]=t[r]??"";return t}return e}function Ql({initialValues:e,itemLabel:t,queryId:r="",queryKey:n,queryFetchFn:o,queryFetchOptions:i,querySaveFn:s,querySaveOptions:a,onSuccess:u,onFetchError:d,fetchErrorMsg:f=Vo,onSaveError:c,saveErrorMsg:m=Vo,fetchToFormData:h,formToQueryData:y,invalidateQueriesOnSuccess:p=!0,invalidateQueryKey:g,retryText:E="Retry",cancelLabel:O="Cancel",saveLabel:P,size:b="lg",title:_,form:A,show:S,onClose:C,formikProps:N,...I}){const{isInitialLoading:M,isFetching:q,data:j,isError:U,error:V,refetch:K}=x.useApiQuery(n,o,r,{enabled:!(r==""||r==null||r==null),onError:d,...i}),W=p?x.useInvalidateParentMutation(s,g??n,a):x.useApiMutation(s,n,r,a),R=v.useCallback(()=>K(),[K]),$=v.useCallback((Q,ne)=>{W.reset();const G=y?y(Q):{...Q};W.mutateAsync(G).then(Y=>{u?u(G,Y):k.success(`${_?_(G):G.name??G.title} ${r?"saved":"created"}`),C==null||C()}).catch(Y=>{console.error("on error",Y),c?c(Q):k.error(`Couldn't save ${_?_(G):G.name??G.title}`),ne.setSubmitting(!1)})},[W,y,u,c,C]);return l.jsxs(T.Modal,{size:b,show:S,onClose:C,scheme:"light",transition:!0,...I,children:[l.jsxs(T.Modal.Header,{children:[!M&&r&&`Edit ${_?_(j):(j==null?void 0:j.name)??(j==null?void 0:j.title)??""}`,!r&&`Create new ${t??"item"}`,Array.isArray(A)&&l.jsx(l.Fragment,{})]}),M&&l.jsx(T.Modal.Body,{children:l.jsx(J.QueryLoadingState,{minW:"72"})}),U&&l.jsx(T.Modal.Body,{children:l.jsx(J.RetryOnError,{label:`${f} ${V}`,onClick:R})}),!M&&!U&&l.jsx(l.Fragment,{children:l.jsx(Ae.Formik,{initialValues:h&&r&&j?h(Ro(j)):Ro(j)??e??{},onSubmit:$,...N,children:({setFieldValue:Q,dirty:ne,handleSubmit:G,isValid:Y,values:He})=>l.jsxs(l.Fragment,{children:[l.jsx(T.Modal.Body,{pb:"6",children:l.jsxs(Ae.Form,{children:[v.isValidElement(A)&&A,Array.isArray(A)&&l.jsx(ee.FormRenderer,{form:A}),z.isFunction(A)&&l.jsx(ee.FormRenderer,{form:A(j??He)})]})}),l.jsxs(T.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[l.jsx(T.Button,{disabled:W.isLoading,onClick:C,variant:"borderless",me:"2",children:O}),l.jsx(T.Button,{type:"submit",disabled:!ne||W.isLoading,onClick:()=>G(),children:P||(r?"Update":"Create")})]})]})})}),W.isLoading&&l.jsx(J.ModalLoadingOverlay,{})]})}function Gl({children:e,...t}){return l.jsx("div",{trait:"typo.h6",mb:"5",...t,children:e})}const Xl=v.forwardRef(({loading:e=!1,children:t,...r},n)=>l.jsxs(l.Fragment,{children:[e&&l.jsx(J.QueryLoadingState,{w:"full",h:"100%"}),!e&&l.jsx(T.Container,{ref:n,center:!0,size:"x2",dflex:!0,flexCol:!0,gap:"8",...r,children:t})]}));function Jl({children:e,...t}){return l.jsx("div",{trait:"typo.h6",mb:"3",...t,children:e})}const Zl={draft:"Draft",published:"Published",pending:"Pending",approved:"Approved",partially_approved:"Partially Approved",rejected:"Rejected"},Yl={draft:"warning",published:"success",pending:"secondary",approved:"success",partially_approved:"warning",rejected:"danger"};function eu({status:e,...t}){return l.jsx(T.Badge,{size:"sm",variant:"glass",whiteSpace:"nowrap",rounded:"full",px:"3",scheme:Yl[e],...t,children:Zl[e]})}function zo({path:e,...t}){const r=v.useCallback(n=>{n==null||n.preventDefault(),n==null||n.stopPropagation(),window.open(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${e}`,"_blank")},[e]);return l.jsx(T.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"dark",onClick:r,...t,children:l.jsx(T.Icon,{path:wt})})}function Ko({path:e,...t}){const r=le.useNavigate(),n=v.useCallback(o=>{o==null||o.preventDefault(),o==null||o.stopPropagation(),r(`${e}`)},[r,e]);return l.jsx(T.Button,{scheme:"secondary",w:"10",h:"10",variant:"borderless",corners:"pill",onClick:n,...t,children:l.jsx(T.Icon,{path:Et})})}function $o({children:e,...t}){return l.jsx(et,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"warning",...t,children:e??l.jsx(T.Icon,{path:Ar})})}function Wo({children:e,...t}){return l.jsx(et,{w:"10",h:"10",scheme:"danger",variant:"borderless",corners:"pill",...t,children:e??l.jsx(T.Icon,{path:vt})})}function tu({publishId:e,viewPath:t,navigatePath:r,editDialog:n,deleteDialog:o,children:i,...s}){return l.jsxs("div",{dflex:!0,spaceX:"1",placeContent:"end",...s,children:[t&&l.jsx(zo,{path:t}),r&&l.jsx(Ko,{path:r}),n&&l.jsx($o,{buildDialog:n}),o&&l.jsx(Wo,{buildDialog:o}),i]})}function ru({id:e,api:t,status:r,invalidateQueryKey:n,...o}){const i=r=="draft",s=x.useInvalidateParentMutation(i?t.publish:t.unpublish,n??t.queryKey,{networkMode:"always"}),a=v.useCallback(u=>{u==null||u.preventDefault(),u==null||u.stopPropagation(),s.reset(),s.mutateAsync(e).then(()=>k.success(i?"Published!":"Unpublished!")).catch(d=>k.error(`Error: ${d}`))},[s,e]);return l.jsx(T.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:l.jsx(T.Icon,{path:i?Sr:Lr})})}L.AttachDialog=Kl,L.Breadcrumbs=Gt,L.DialogButton=et,L.FormActionDialog=Wl,L.IconButton=Gs,L.InvalidateButton=dr,L.ItemEditDialog=Ql,L.NavigateButton=ia,L.OrderCell=La,L.PageContainer=gt,L.PageContentEditor=Eo,L.PageMain=vo,L.PageQueryStateContainer=vr,L.PageSectionTitle=Gl,L.PageSidebar=wo,L.PageSidebarSection=Po,L.PageStateContainer=Xl,L.PageSubSectionTitle=Jl,L.PageTabbedTopBar=Co,L.PageTabbedTopBarProvider=To,L.PageTitle=Er,L.PageTopBar=wr,L.PageTopBarToolbar=Oo,L.PublishButton=lo,L.ScreenRenderer=mt,L.SectionTitle=ss,L.StatusBadge=eu,L.TableContainer=Lo,L.TableCreateButton=Mo,L.TableFilterButton=No,L.TableRowActionBar=tu,L.TableRowDeleteButton=Wo,L.TableRowEditButton=$o,L.TableRowNavigateButton=Ko,L.TableRowPublishPostButton=ru,L.TableRowViewButton=zo,L.TableTopBar=Io,L.UpdateButton=mo,L.ViewButton=bo,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});