zt-react-milkdown 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +149 -0
  2. package/dist/commands-CDrea4WB.cjs +1 -0
  3. package/dist/commands-DoqeX5uJ.js +36 -0
  4. package/dist/debounce-Bqj_3iJs.cjs +1 -0
  5. package/dist/debounce-Cuk3VGPr.js +118 -0
  6. package/dist/dist-BCCSKc3M.cjs +5 -0
  7. package/dist/dist-C0PSMrs7.cjs +37 -0
  8. package/dist/dist-CPVooDwj.cjs +2 -0
  9. package/dist/dist-CxZn1qUo.js +1584 -0
  10. package/dist/dist-Cxaq2crg.js +409 -0
  11. package/dist/dist-DaM7GJv6.js +3499 -0
  12. package/dist/dist-Dhukmh4L.js +7562 -0
  13. package/dist/dist-mOpTMw1E.cjs +1 -0
  14. package/dist/floating-ui.dom-CKbcbmJV.js +883 -0
  15. package/dist/floating-ui.dom-VaZZ2gzS.cjs +1 -0
  16. package/dist/index.browser-5LtNN9G9.cjs +1 -0
  17. package/dist/index.browser-D2DmEB8o.js +26 -0
  18. package/dist/index.cjs +393 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.mjs +43325 -0
  21. package/dist/lib-38nxOnTd.cjs +4 -0
  22. package/dist/lib-8Tr6mAln.cjs +1 -0
  23. package/dist/lib-B0rHJ9lJ.js +28 -0
  24. package/dist/lib-BJgvZywM.cjs +3 -0
  25. package/dist/lib-BNOSyYeU.cjs +3 -0
  26. package/dist/lib-C5AzmhNY.cjs +5 -0
  27. package/dist/lib-C8xOD1Bp.cjs +1 -0
  28. package/dist/lib-CCUU16r8.js +1081 -0
  29. package/dist/lib-CK9MEMX-.js +73 -0
  30. package/dist/lib-D4HMdvmK.cjs +1 -0
  31. package/dist/lib-DWZA8C0h.cjs +1 -0
  32. package/dist/lib-Dbe-cVjv.js +367 -0
  33. package/dist/lib-DkE7Uq2b.js +1886 -0
  34. package/dist/lib-DzK_kn7a.js +21 -0
  35. package/dist/lib-IahjxPWM.cjs +3 -0
  36. package/dist/lib-m8lKZKxK.js +80 -0
  37. package/dist/lib-r5eNG0sa.js +754 -0
  38. package/dist/lib-wmHesNI0.js +2223 -0
  39. package/dist/rolldown-runtime-CerMd-t8.cjs +1 -0
  40. package/dist/rolldown-runtime-DnwLefa7.js +23 -0
  41. package/dist/schema-list-DSdBEAWW.js +171 -0
  42. package/dist/schema-list-bL8FNes5.cjs +1 -0
  43. package/dist/src/components/ui/button.d.ts +16 -0
  44. package/dist/src/components/ui/button.d.ts.map +1 -0
  45. package/dist/src/components/ui/dialog.d.ts +36 -0
  46. package/dist/src/components/ui/dialog.d.ts.map +1 -0
  47. package/dist/src/components/ui/popover.d.ts +14 -0
  48. package/dist/src/components/ui/popover.d.ts.map +1 -0
  49. package/dist/src/core/commands.d.ts +7 -0
  50. package/dist/src/core/commands.d.ts.map +1 -0
  51. package/dist/src/core/createEditor.d.ts +6 -0
  52. package/dist/src/core/createEditor.d.ts.map +1 -0
  53. package/dist/src/core/schema.d.ts +8 -0
  54. package/dist/src/core/schema.d.ts.map +1 -0
  55. package/dist/src/index.d.ts +4 -0
  56. package/dist/src/index.d.ts.map +1 -0
  57. package/dist/src/lib/editor-overlay-position.d.ts +83 -0
  58. package/dist/src/lib/editor-overlay-position.d.ts.map +1 -0
  59. package/dist/src/lib/global-scroll-listener.d.ts +9 -0
  60. package/dist/src/lib/global-scroll-listener.d.ts.map +1 -0
  61. package/dist/src/lib/utils.d.ts +6 -0
  62. package/dist/src/lib/utils.d.ts.map +1 -0
  63. package/dist/src/local/en-US.d.ts +6 -0
  64. package/dist/src/local/en-US.d.ts.map +1 -0
  65. package/dist/src/local/i18n.d.ts +10 -0
  66. package/dist/src/local/i18n.d.ts.map +1 -0
  67. package/dist/src/local/zh-CN.d.ts +6 -0
  68. package/dist/src/local/zh-CN.d.ts.map +1 -0
  69. package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts +5 -0
  70. package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts.map +1 -0
  71. package/dist/src/plugins/custom/blockquote/index.d.ts +3 -0
  72. package/dist/src/plugins/custom/blockquote/index.d.ts.map +1 -0
  73. package/dist/src/plugins/custom/code-block/code-block-editable.d.ts +7 -0
  74. package/dist/src/plugins/custom/code-block/code-block-editable.d.ts.map +1 -0
  75. package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts +7 -0
  76. package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -0
  77. package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts +5 -0
  78. package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts.map +1 -0
  79. package/dist/src/plugins/custom/code-block/code-block-prism.d.ts +5 -0
  80. package/dist/src/plugins/custom/code-block/code-block-prism.d.ts.map +1 -0
  81. package/dist/src/plugins/custom/code-block/index.d.ts +9 -0
  82. package/dist/src/plugins/custom/code-block/index.d.ts.map +1 -0
  83. package/dist/src/plugins/custom/cursor/drop-cursor.d.ts +5 -0
  84. package/dist/src/plugins/custom/cursor/drop-cursor.d.ts.map +1 -0
  85. package/dist/src/plugins/custom/cursor/gap-cursor.d.ts +5 -0
  86. package/dist/src/plugins/custom/cursor/gap-cursor.d.ts.map +1 -0
  87. package/dist/src/plugins/custom/cursor/index.d.ts +5 -0
  88. package/dist/src/plugins/custom/cursor/index.d.ts.map +1 -0
  89. package/dist/src/plugins/custom/image/image-editable.d.ts +7 -0
  90. package/dist/src/plugins/custom/image/image-editable.d.ts.map +1 -0
  91. package/dist/src/plugins/custom/image/image-resizable-schema.d.ts +41 -0
  92. package/dist/src/plugins/custom/image/image-resizable-schema.d.ts.map +1 -0
  93. package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts +31 -0
  94. package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts.map +1 -0
  95. package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts +20 -0
  96. package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -0
  97. package/dist/src/plugins/custom/image/index.d.ts +7 -0
  98. package/dist/src/plugins/custom/image/index.d.ts.map +1 -0
  99. package/dist/src/plugins/custom/indent/index.d.ts +3 -0
  100. package/dist/src/plugins/custom/indent/index.d.ts.map +1 -0
  101. package/dist/src/plugins/custom/indent/tab-space-indent.d.ts +5 -0
  102. package/dist/src/plugins/custom/indent/tab-space-indent.d.ts.map +1 -0
  103. package/dist/src/plugins/custom/list/index.d.ts +3 -0
  104. package/dist/src/plugins/custom/list/index.d.ts.map +1 -0
  105. package/dist/src/plugins/custom/list/task-list-toggle.d.ts +5 -0
  106. package/dist/src/plugins/custom/list/task-list-toggle.d.ts.map +1 -0
  107. package/dist/src/plugins/custom/math/index.d.ts +7 -0
  108. package/dist/src/plugins/custom/math/index.d.ts.map +1 -0
  109. package/dist/src/plugins/custom/math/math-backspace-entry.d.ts +5 -0
  110. package/dist/src/plugins/custom/math/math-backspace-entry.d.ts.map +1 -0
  111. package/dist/src/plugins/custom/math/math-block-editable.d.ts +7 -0
  112. package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -0
  113. package/dist/src/plugins/custom/math/math-plugin.d.ts +47 -0
  114. package/dist/src/plugins/custom/math/math-plugin.d.ts.map +1 -0
  115. package/dist/src/plugins/custom/selection-tooltip/constants.d.ts +7 -0
  116. package/dist/src/plugins/custom/selection-tooltip/constants.d.ts.map +1 -0
  117. package/dist/src/plugins/custom/selection-tooltip/index.d.ts +7 -0
  118. package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -0
  119. package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts +25 -0
  120. package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts.map +1 -0
  121. package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +21 -0
  122. package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -0
  123. package/dist/src/plugins/custom/selection-tooltip/types.d.ts +58 -0
  124. package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -0
  125. package/dist/src/plugins/custom/slash-menu/index.d.ts +9 -0
  126. package/dist/src/plugins/custom/slash-menu/index.d.ts.map +1 -0
  127. package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts +6 -0
  128. package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -0
  129. package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts +23 -0
  130. package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts.map +1 -0
  131. package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts +50 -0
  132. package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts.map +1 -0
  133. package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +15 -0
  134. package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -0
  135. package/dist/src/plugins/custom/table/index.d.ts +13 -0
  136. package/dist/src/plugins/custom/table/index.d.ts.map +1 -0
  137. package/dist/src/plugins/custom/table/table-arrow-entry.d.ts +5 -0
  138. package/dist/src/plugins/custom/table/table-arrow-entry.d.ts.map +1 -0
  139. package/dist/src/plugins/custom/table/table-deletion-actions.d.ts +10 -0
  140. package/dist/src/plugins/custom/table/table-deletion-actions.d.ts.map +1 -0
  141. package/dist/src/plugins/custom/table/table-focus-actions.d.ts +7 -0
  142. package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -0
  143. package/dist/src/plugins/custom/table/table-more-actions.d.ts +37 -0
  144. package/dist/src/plugins/custom/table/table-more-actions.d.ts.map +1 -0
  145. package/dist/src/plugins/custom/table/table-row-insertion.d.ts +35 -0
  146. package/dist/src/plugins/custom/table/table-row-insertion.d.ts.map +1 -0
  147. package/dist/src/plugins/custom/table/table-selection.d.ts +30 -0
  148. package/dist/src/plugins/custom/table/table-selection.d.ts.map +1 -0
  149. package/dist/src/plugins/preset-common.d.ts +56 -0
  150. package/dist/src/plugins/preset-common.d.ts.map +1 -0
  151. package/dist/src/react/components/MilkdownEditor.d.ts +7 -0
  152. package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -0
  153. package/dist/src/react/components/index.d.ts +2 -0
  154. package/dist/src/react/components/index.d.ts.map +1 -0
  155. package/dist/src/react/context/EditorContext.d.ts +16 -0
  156. package/dist/src/react/context/EditorContext.d.ts.map +1 -0
  157. package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts +5 -0
  158. package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts.map +1 -0
  159. package/dist/src/react/hooks/useControlledState.d.ts +9 -0
  160. package/dist/src/react/hooks/useControlledState.d.ts.map +1 -0
  161. package/dist/src/react/hooks/useMilkdownEditor.d.ts +35 -0
  162. package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -0
  163. package/dist/src/types/editor.d.ts +233 -0
  164. package/dist/src/types/editor.d.ts.map +1 -0
  165. package/dist/src/types/plugin.d.ts +10 -0
  166. package/dist/src/types/plugin.d.ts.map +1 -0
  167. package/dist/src/utils/guard.d.ts +5 -0
  168. package/dist/src/utils/guard.d.ts.map +1 -0
  169. package/dist/src/utils/markdown.d.ts +9 -0
  170. package/dist/src/utils/markdown.d.ts.map +1 -0
  171. package/dist/state-CHAiIqOA.cjs +1 -0
  172. package/dist/state-DNxqltZl.js +16 -0
  173. package/dist/style.css +3 -0
  174. package/package.json +89 -0
@@ -0,0 +1 @@
1
+ var e=[`top`,`right`,`bottom`,`left`],t=Math.min,n=Math.max,r=Math.round,i=Math.floor,a=e=>({x:e,y:e}),o={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function s(e,r,i){return n(e,t(r,i))}function c(e,t){return typeof e==`function`?e(t):e}function l(e){return e.split(`-`)[0]}function u(e){return e.split(`-`)[1]}function d(e){return e===`x`?`y`:`x`}function f(e){return e===`y`?`height`:`width`}function p(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function m(e){return d(p(e))}function h(e,t,n){n===void 0&&(n=!1);let r=u(e),i=m(e),a=f(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=w(o)),[o,w(o)]}function g(e){let t=w(e);return[_(e),t,_(t)]}function _(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var v=[`left`,`right`],y=[`right`,`left`],b=[`top`,`bottom`],x=[`bottom`,`top`];function S(e,t,n){switch(e){case`top`:case`bottom`:return n?t?y:v:t?v:y;case`left`:case`right`:return t?b:x;default:return[]}}function C(e,t,n,r){let i=u(e),a=S(l(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_)))),a}function w(e){let t=l(e);return o[t]+e.slice(t.length)}function T(e){return{top:0,right:0,bottom:0,left:0,...e}}function E(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:T(e)}function D(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function O(e,t,n){let{reference:r,floating:i}=e,a=p(t),o=m(t),s=f(o),c=l(t),d=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(c){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(u(t)){case`start`:v[o]-=_*(n&&d?-1:1);break;case`end`:v[o]+=_*(n&&d?-1:1);break}return v}async function k(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=c(t,e),m=E(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=D(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:s})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:s}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var A=50,j=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:k},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=O(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<A&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=O(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},M=e=>({name:`arrow`,options:e,async fn(n){let{x:r,y:i,placement:a,rects:o,platform:l,elements:d,middlewareData:p}=n,{element:h,padding:g=0}=c(e,n)||{};if(h==null)return{};let _=E(g),v={x:r,y:i},y=m(a),b=f(y),x=await l.getDimensions(h),S=y===`y`,C=S?`top`:`left`,w=S?`bottom`:`right`,T=S?`clientHeight`:`clientWidth`,D=o.reference[b]+o.reference[y]-v[y]-o.floating[b],O=v[y]-o.reference[y],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h)),A=k?k[T]:0;(!A||!await(l.isElement==null?void 0:l.isElement(k)))&&(A=d.floating[T]||o.floating[b]);let j=D/2-O/2,M=A/2-x[b]/2-1,ee=t(_[C],M),N=t(_[w],M),P=ee,te=A-x[b]-N,F=A/2-x[b]/2+j,I=s(P,F,te),L=!p.arrow&&u(a)!=null&&F!==I&&o.reference[b]/2-(F<P?ee:N)-x[b]/2<0,R=L?F<P?F-P:F-te:0;return{[y]:v[y]+R,data:{[y]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ee=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=c(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=l(r),S=p(o),T=l(o)===o,E=await(s.isRTL==null?void 0:s.isRTL(u.floating)),D=m||(T||!y?[w(o)]:g(o)),O=v!==`none`;!m&&O&&D.push(...C(o,y,v,E));let k=[o,...D],A=await s.detectOverflow(t,b),j=[],M=i.flip?.overflows||[];if(d&&j.push(A[x]),f){let e=h(r,a,E);j.push(A[e[0]],A[e[1]])}if(M=[...M,{placement:r,overflows:j}],!j.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=k[e];if(t&&(!(f===`alignment`&&S!==p(t))||M.every(e=>p(e.placement)===S?e.overflows[0]>0:!0)))return{data:{index:e,overflows:M},reset:{placement:t}};let n=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=M.filter(e=>{if(O){let t=p(e.placement);return t===S||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function N(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function P(t){return e.some(e=>t[e]>=0)}var te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=c(e,t);switch(i){case`referenceHidden`:{let e=N(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:P(e)}}}case`escaped`:{let e=N(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:P(e)}}}default:return{}}}}},F=new Set([`left`,`top`]);async function I(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=l(n),s=u(n),d=p(n)===`y`,f=F.has(o)?-1:1,m=a&&d?-1:1,h=c(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof v==`number`&&(_=s===`end`?v*-1:v),d?{x:_*m,y:g*f}:{x:g*f,y:_*m}}var L=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await I(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},R=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:u=!1,limiter:f={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=c(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=p(l(i)),v=d(_),y=h[v],b=h[_];if(o){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=s(n,y,r)}if(u){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=s(n,b,r)}let x=f.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[_]:u}}}}}},ne=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:u=!0,crossAxis:f=!0}=c(e,t),m={x:n,y:r},h=p(i),g=d(h),_=m[g],v=m[h],y=c(s,t),b=typeof y==`number`?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){let e=g===`y`?`height`:`width`,t=a.reference[g]-a.floating[e]+b.mainAxis,n=a.reference[g]+a.reference[e]-b.mainAxis;_<t?_=t:_>n&&(_=n)}if(f){let e=g===`y`?`width`:`height`,t=F.has(l(i)),n=a.reference[h]-a.floating[e]+(t&&o.offset?.[h]||0)+(t?0:b.crossAxis),r=a.reference[h]+a.reference[e]+(t?0:o.offset?.[h]||0)-(t?b.crossAxis:0);v<n?v=n:v>r&&(v=r)}return{[g]:_,[h]:v}}}},re=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(r){var i,a;let{placement:o,rects:s,platform:d,elements:f}=r,{apply:m=()=>{},...h}=c(e,r),g=await d.detectOverflow(r,h),_=l(o),v=u(o),y=p(o)===`y`,{width:b,height:x}=s.floating,S,C;_===`top`||_===`bottom`?(S=_,C=v===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?`start`:`end`)?`left`:`right`):(C=_,S=v===`end`?`top`:`bottom`);let w=x-g.top-g.bottom,T=b-g.left-g.right,E=t(x-g[S],w),D=t(b-g[C],T),O=!r.middlewareData.shift,k=E,A=D;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(A=T),(a=r.middlewareData.shift)!=null&&a.enabled.y&&(k=w),O&&!v){let e=n(g.left,0),t=n(g.right,0),r=n(g.top,0),i=n(g.bottom,0);y?A=b-2*(e!==0||t!==0?e+t:n(g.left,g.right)):k=x-2*(r!==0||i!==0?r+i:n(g.top,g.bottom))}await m({...r,availableWidth:A,availableHeight:k});let j=await d.getDimensions(f.floating);return b!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function z(){return typeof window<`u`}function B(e){return ie(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ie(e){return z()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return z()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return z()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ae(e){return!z()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function G(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function oe(e){return/^(table|td|th)$/.test(B(e))}function K(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var se=/transform|translate|scale|rotate|perspective|filter/,ce=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,le;function ue(e){let t=U(e)?Y(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!fe()&&(q(t.backdropFilter)||q(t.filter))||se.test(t.willChange||``)||ce.test(t.contain||``)}function de(e){let t=X(e);for(;W(t)&&!J(t);){if(ue(t))return t;if(K(t))return null;t=X(t)}return null}function fe(){return le??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),le}function J(e){return/^(html|body|#document)$/.test(B(e))}function Y(e){return V(e).getComputedStyle(e)}function pe(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ae(e)&&e.host||H(e);return ae(t)?t.host:t}function me(e){let t=X(e);return J(t)?e.ownerDocument?e.ownerDocument.body:e.body:W(t)&&G(t)?t:me(t)}function Z(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=me(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=he(a);return t.concat(a,a.visualViewport||[],G(r)?r:[],e&&n?Z(e):[])}else return t.concat(r,Z(r,[],n))}function he(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ge(e){let t=Y(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=W(e),o=a?e.offsetWidth:n,s=a?e.offsetHeight:i,c=r(n)!==o||r(i)!==s;return c&&(n=o,i=s),{width:n,height:i,$:c}}function _e(e){return U(e)?e:e.contextElement}function Q(e){let t=_e(e);if(!W(t))return a(1);let n=t.getBoundingClientRect(),{width:i,height:o,$:s}=ge(t),c=(s?r(n.width):n.width)/i,l=(s?r(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var ve=a(0);function ye(e){let t=V(e);return!fe()||!t.visualViewport?ve:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function be(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function $(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),o=_e(e),s=a(1);t&&(r?U(r)&&(s=Q(r)):s=Q(e));let c=be(o,n,r)?ye(o):a(0),l=(i.left+c.x)/s.x,u=(i.top+c.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){let e=V(o),t=r&&U(r)?V(r):r,n=e,i=he(n);for(;i&&r&&t!==n;){let e=Q(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=V(i),i=he(n)}}return D({width:d,height:f,x:l,y:u})}function xe(e,t){let n=pe(e).scrollLeft;return t?t.left+n:$(H(e)).left+n}function Se(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xe(e,n),y:n.top+t.scrollTop}}function Ce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o=i===`fixed`,s=H(r),c=t?K(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=a(1),d=a(0),f=W(r);if((f||!f&&!o)&&((B(r)!==`body`||G(s))&&(l=pe(r)),f)){let e=$(r);u=Q(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!o?Se(s,l):a(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function we(e){return Array.from(e.getClientRects())}function Te(e){let t=H(e),r=pe(e),i=e.ownerDocument.body,a=n(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=n(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+xe(e),c=-r.scrollTop;return Y(i).direction===`rtl`&&(s+=n(t.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var Ee=25;function De(e,t){let n=V(e),r=H(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=fe();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xe(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Ee&&(a-=o)}else l<=Ee&&(a+=l);return{width:a,height:o,x:s,y:c}}function Oe(e,t){let n=$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=W(e)?Q(e):a(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}function ke(e,t,n){let r;if(t===`viewport`)r=De(e,n);else if(t===`document`)r=Te(H(e));else if(U(t))r=Oe(t,n);else{let n=ye(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return D(r)}function Ae(e,t){let n=X(e);return n===t||!U(n)||J(n)?!1:Y(n).position===`fixed`||Ae(n,t)}function je(e,t){let n=t.get(e);if(n)return n;let r=Z(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?X(e):e;for(;U(o)&&!J(o);){let t=Y(o),n=ue(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||G(o)&&!n&&Ae(e,o))?r=r.filter(e=>e!==o):i=t,o=X(o)}return t.set(e,r),r}function Me(e){let{element:r,boundary:i,rootBoundary:a,strategy:o}=e,s=[...i===`clippingAncestors`?K(r)?[]:je(r,this._c):[].concat(i),a],c=ke(r,s[0],o),l=c.top,u=c.right,d=c.bottom,f=c.left;for(let e=1;e<s.length;e++){let i=ke(r,s[e],o);l=n(i.top,l),u=t(i.right,u),d=t(i.bottom,d),f=n(i.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function Ne(e){let{width:t,height:n}=ge(e);return{width:t,height:n}}function Pe(e,t,n){let r=W(t),i=H(t),o=n===`fixed`,s=$(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=a(0);function u(){l.x=xe(i)}if(r||!r&&!o)if((B(t)!==`body`||G(i))&&(c=pe(t)),r){let e=$(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&u();o&&!r&&i&&u();let d=i&&!r&&!o?Se(i,c):a(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function Fe(e){return Y(e).position===`static`}function Ie(e,t){if(!W(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Le(e,t){let n=V(e);if(K(e))return n;if(!W(e)){let t=X(e);for(;t&&!J(t);){if(U(t)&&!Fe(t))return t;t=X(t)}return n}let r=Ie(e,t);for(;r&&oe(r)&&Fe(r);)r=Ie(r,t);return r&&J(r)&&Fe(r)&&!ue(r)?n:r||de(e)||n}var Re=async function(e){let t=this.getOffsetParent||Le,n=this.getDimensions,r=await n(e.floating);return{reference:Pe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ze(e){return Y(e).direction===`rtl`}var Be={convertOffsetParentRelativeRectToViewportRelativeRect:Ce,getDocumentElement:H,getClippingRect:Me,getOffsetParent:Le,getElementRects:Re,getClientRects:we,getDimensions:Ne,getScale:Q,isElement:U,isRTL:ze};function Ve(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function He(e,r){let a=null,o,s=H(e);function c(){var e;clearTimeout(o),(e=a)==null||e.disconnect(),a=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),c();let f=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(u||r(),!h||!g)return;let _=i(m),v=i(s.clientWidth-(p+h)),y=i(s.clientHeight-(m+g)),b=i(p),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:n(0,t(1,d))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==d){if(!S)return l();n?l(!1,n):o=setTimeout(()=>{l(!1,1e-7)},1e3)}n===1&&!Ve(f,e.getBoundingClientRect())&&l(),S=!1}try{a=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{a=new IntersectionObserver(C,x)}a.observe(e)}return l(!0),c}function Ue(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=_e(e),u=i||a?[...l?Z(l):[],...t?Z(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?He(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$(e):null;c&&g();function g(){let t=$(e);h&&!Ve(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var We=L,Ge=R,Ke=ee,qe=re,Je=te,Ye=M,Xe=ne,Ze=(e,t,n)=>{let r=new Map,i={platform:Be,...n},a={...i.platform,_c:r};return j(e,t,{...i,platform:a})};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ye}});
@@ -0,0 +1 @@
1
+ var e=e=>crypto.getRandomValues(new Uint8Array(e)),t=(e,t,n)=>{let r=256-256%e.length;if(r===256){let r=e.length-1;return(i=t)=>{if(!i)return``;let a=``;for(;;){let t=n(i),o=i;for(;o--;)if(a+=e[t[o]&r],a.length>=i)return a}}}let i=Math.ceil(1.6*256*t/r);return(a=t)=>{if(!a)return``;let o=``;for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(o+=e[t[s]%e.length],o.length>=a))return o}}},n=(n,r=21)=>t(n,r|0,e);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
@@ -0,0 +1,26 @@
1
+ //#region node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/index.browser.js
2
+ var e = (e) => crypto.getRandomValues(new Uint8Array(e)), t = (e, t, n) => {
3
+ let r = 256 - 256 % e.length;
4
+ if (r === 256) {
5
+ let r = e.length - 1;
6
+ return (i = t) => {
7
+ if (!i) return "";
8
+ let a = "";
9
+ for (;;) {
10
+ let t = n(i), o = i;
11
+ for (; o--;) if (a += e[t[o] & r], a.length >= i) return a;
12
+ }
13
+ };
14
+ }
15
+ let i = Math.ceil(1.6 * 256 * t / r);
16
+ return (a = t) => {
17
+ if (!a) return "";
18
+ let o = "";
19
+ for (;;) {
20
+ let t = n(i), s = i;
21
+ for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
22
+ }
23
+ };
24
+ }, n = (n, r = 21) => t(n, r | 0, e);
25
+ //#endregion
26
+ export { n as t };