@pi-chamber/web 1.0.4-rc.2 → 1.0.4

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 (149) hide show
  1. package/dist/assets/DiagramView-BpG1c3Hi.js +1 -0
  2. package/dist/assets/{DiffView-Cay8VAqL.js → DiffView-BxwoRCYx.js} +5 -5
  3. package/dist/assets/FileSaveConflictDialog-DP7k9a-i.js +3 -0
  4. package/dist/assets/{FilesView-CEeQzjc6.js → FilesView-D_2QcdUt.js} +4 -4
  5. package/dist/assets/{GitHubDetailScaffold-q4YP8iyJ.js → GitHubDetailScaffold-UxLAMAOl.js} +2 -2
  6. package/dist/assets/GitHubLinkPicker-Bh9RO1yK.js +1 -0
  7. package/dist/assets/{GitHubListPrimitives-XkALat1v.js → GitHubListPrimitives-DQyhT5wG.js} +1 -1
  8. package/dist/assets/{GitView-DV3d0oSJ.js → GitView-XBBheKRM.js} +4 -4
  9. package/dist/assets/{IssuesSurface-OTyt9f3A.js → IssuesSurface-BA1kpvAJ.js} +3 -3
  10. package/dist/assets/{JsonTreeView-X2Auiy_q.js → JsonTreeView-BAaEPL4O.js} +1 -1
  11. package/dist/assets/MarkdownRendererImpl-DzgDmUsL.js +12 -0
  12. package/dist/assets/{PatchDiff-GMQAv4en.js → PatchDiff-BMEUsgXH.js} +1 -1
  13. package/dist/assets/{PierreDiffViewer-0X__nypk.js → PierreDiffViewer-BW8MO-O6.js} +2 -2
  14. package/dist/assets/PullRequestsSurface-B3ictm4I.js +2 -0
  15. package/dist/assets/SessionSwitcherContent-rLoyVqgs.js +1 -0
  16. package/dist/assets/SessionSwitcherDropdown-CfySKnUu.js +2 -0
  17. package/dist/assets/{SessionUnreadDot-CJFawQpo.js → SessionUnreadDot-CmEF9sxM.js} +1 -1
  18. package/dist/assets/SettingsView-BiwlwnTK.js +6 -0
  19. package/dist/assets/SettingsWindow-j0e99YI0.js +1 -0
  20. package/dist/assets/ToolOutputDialog-VlS12Xyq.js +8 -0
  21. package/dist/assets/ToolPartDiffPreview-DdSneZws.js +1 -0
  22. package/dist/assets/{VirtualizedFileDiff-CUWx7JVZ.js → VirtualizedFileDiff-BqiXjvP6.js} +1 -1
  23. package/dist/assets/{Virtualizer-wpC51ZBQ.js → Virtualizer-Cp_cJWbI.js} +1 -1
  24. package/dist/assets/{collapsible-Ce85nuXX.js → collapsible-C7oyikVm.js} +1 -1
  25. package/dist/assets/{computeVirtualFileMetrics-3PpRLd5B.js → computeVirtualFileMetrics-BJjC-tXV.js} +1 -1
  26. package/dist/assets/{contextFileOpenGuard-PoBklHMz.js → contextFileOpenGuard-BBzqKGei.js} +1 -1
  27. package/dist/assets/{gitStatusPredicates-BvzxqidP.js → gitStatusPredicates-Dq-E5DaH.js} +1 -1
  28. package/dist/assets/{githubLink-iQ51wqRa.js → githubLink-Cryd7GkG.js} +5 -5
  29. package/dist/assets/index-BbhXFTId.js +1 -0
  30. package/dist/assets/index-BnZVqcki.js +11 -0
  31. package/dist/assets/index-BnieExes.css +1 -0
  32. package/dist/assets/{main-PSCt716b.js → main-9O5IAtT_.js} +4 -4
  33. package/dist/assets/{main-FasHq7Ck.js → main-DWGwALIw.js} +2 -2
  34. package/dist/assets/{markdownCore-BH56o6Wu.js → markdownCore-B9AuEyYi.js} +1 -1
  35. package/dist/assets/miniChat-CgOaJfD8.js +2 -0
  36. package/dist/assets/mobile-BbJcYVym.js +2 -0
  37. package/dist/assets/nativeFileSave-BzhtrDoD.js +1 -0
  38. package/dist/assets/{pi-session-focus-preference-D2-1HWmY.js → pi-session-focus-preference-Bmk1iOvn.js} +4 -4
  39. package/dist/assets/{renderDiffWithHighlighter-l8hZWWBO.js → renderDiffWithHighlighter-CVLsdtQ5.js} +1 -1
  40. package/dist/assets/renderElectronMiniChatApp-R5o9NwFC.js +2 -0
  41. package/dist/assets/{renderFileWithHighlighter-BvDoP7ob.js → renderFileWithHighlighter-DJ9mk2bZ.js} +1 -1
  42. package/dist/assets/renderMobileApp-CQ9tWYIj.js +11 -0
  43. package/dist/assets/runtimeEndpointReset-CtK4C_5h.js +62 -0
  44. package/dist/assets/{runtimeSurface-B1GRkkKC.js → runtimeSurface-DBiUWYK2.js} +1 -1
  45. package/dist/assets/useAppFontEffects-DviRbaCJ.js +212 -0
  46. package/dist/assets/{useFilesViewSearch-D1jsGQrN.js → useFilesViewSearch-D2Au5Xgt.js} +1 -1
  47. package/dist/assets/{useGitHubRemoteSearch-zNgy2bSt.js → useGitHubRemoteSearch-D-K7aolk.js} +1 -1
  48. package/dist/assets/{useSwitcherItems-OCRYcHeu.js → useSwitcherItems-Dej8BzXI.js} +1 -1
  49. package/dist/assets/vendor-aparajita-capacitor-secure-storage-BYohCVY0.js +1 -0
  50. package/dist/assets/{vendor-base-ui-DIkTOIJS.js → vendor-base-ui-BscvGUFt.js} +1 -1
  51. package/dist/assets/vendor-boot-Dgb9NVFe.js +69 -0
  52. package/dist/assets/vendor-capacitor-app-BjdQVib9.js +1 -0
  53. package/dist/assets/vendor-capacitor-keyboard-eTtI5go3.js +1 -0
  54. package/dist/assets/vendor-capacitor-push-notifications-CBKq2Arn.js +1 -0
  55. package/dist/assets/vendor-capacitor-status-bar-9rNIGxlO.js +1 -0
  56. package/dist/assets/{vendor-codemirror-autocomplete-DsFn4GLp.js → vendor-codemirror-autocomplete-DxS3jwvE.js} +1 -1
  57. package/dist/assets/{vendor-codemirror-lang-angular-B_NMmBbS.js → vendor-codemirror-lang-angular-DdjXl9e2.js} +1 -1
  58. package/dist/assets/vendor-codemirror-lang-cpp--aMr7NVt.js +1 -0
  59. package/dist/assets/vendor-codemirror-lang-css-CZ_qxZY9.js +1 -0
  60. package/dist/assets/{vendor-codemirror-lang-go-C2KHbcll.js → vendor-codemirror-lang-go-Ca-y2Alu.js} +2 -2
  61. package/dist/assets/vendor-codemirror-lang-html-COZ0L5wT.js +1 -0
  62. package/dist/assets/vendor-codemirror-lang-java-D3Rf3QNJ.js +1 -0
  63. package/dist/assets/{vendor-codemirror-lang-javascript-DpTUrvx8.js → vendor-codemirror-lang-javascript-DwJ-IvCs.js} +2 -2
  64. package/dist/assets/vendor-codemirror-lang-jinja-D_5lod6k.js +1 -0
  65. package/dist/assets/vendor-codemirror-lang-json-BG8C7OpC.js +1 -0
  66. package/dist/assets/vendor-codemirror-lang-less-CVEkoaTw.js +1 -0
  67. package/dist/assets/vendor-codemirror-lang-liquid-U9vj0m8w.js +1 -0
  68. package/dist/assets/vendor-codemirror-lang-markdown-DqlYH9gY.js +1 -0
  69. package/dist/assets/vendor-codemirror-lang-php-BFEiEVA1.js +1 -0
  70. package/dist/assets/vendor-codemirror-lang-python-Cz1dQXQd.js +3 -0
  71. package/dist/assets/vendor-codemirror-lang-rust-C_CoD9mj.js +1 -0
  72. package/dist/assets/vendor-codemirror-lang-sass-BuR0aKh5.js +1 -0
  73. package/dist/assets/{vendor-codemirror-lang-sql-C_RazIaB.js → vendor-codemirror-lang-sql-DggNUjdM.js} +2 -2
  74. package/dist/assets/{vendor-codemirror-lang-vue-BYL0r7KR.js → vendor-codemirror-lang-vue-DFZHi2J3.js} +1 -1
  75. package/dist/assets/vendor-codemirror-lang-wast-zuTN3SHT.js +1 -0
  76. package/dist/assets/vendor-codemirror-lang-xml-CrcvhI-k.js +1 -0
  77. package/dist/assets/vendor-codemirror-lang-yaml-DcVWsakb.js +1 -0
  78. package/dist/assets/{vendor-codemirror-language-data-DglcKYWT.js → vendor-codemirror-language-data-CCLITgCF.js} +2 -2
  79. package/dist/assets/{vendor-codemirror-search-DaE6R5gH.js → vendor-codemirror-search-H7NOEdbX.js} +2 -2
  80. package/dist/assets/{vendor-lezer-cpp-Dt99h3WT.js → vendor-lezer-cpp-C8aD2KAr.js} +1 -1
  81. package/dist/assets/{vendor-lezer-css-DNU_fzPI.js → vendor-lezer-css-2lbTJF-Y.js} +1 -1
  82. package/dist/assets/{vendor-lezer-go-BEFtcNyS.js → vendor-lezer-go-Bw6LFTrZ.js} +1 -1
  83. package/dist/assets/{vendor-lezer-html-DDGRhRUz.js → vendor-lezer-html-D7ym2z7S.js} +1 -1
  84. package/dist/assets/{vendor-lezer-java-DmfZtW09.js → vendor-lezer-java-CZhK7w21.js} +1 -1
  85. package/dist/assets/{vendor-lezer-javascript-oje4tdp_.js → vendor-lezer-javascript-rpKeTHZp.js} +1 -1
  86. package/dist/assets/{vendor-lezer-json-BRXb_bDX.js → vendor-lezer-json-C7jwsd2G.js} +1 -1
  87. package/dist/assets/{vendor-lezer-lr-BU2qmu_5.js → vendor-lezer-lr-DR-ylqNN.js} +1 -1
  88. package/dist/assets/{vendor-lezer-markdown-CicYv7V9.js → vendor-lezer-markdown-Bir0m5nB.js} +1 -1
  89. package/dist/assets/{vendor-lezer-php-COORrTpE.js → vendor-lezer-php-y0hIEfo1.js} +1 -1
  90. package/dist/assets/{vendor-lezer-python-Cuvm9X9Y.js → vendor-lezer-python-D64A9lNV.js} +1 -1
  91. package/dist/assets/{vendor-lezer-rust-C_zOfHbX.js → vendor-lezer-rust-E3ZA9T2L.js} +1 -1
  92. package/dist/assets/{vendor-lezer-sass-DWP4w7O1.js → vendor-lezer-sass-C5UFI9SP.js} +1 -1
  93. package/dist/assets/{vendor-lezer-xml-Br6nOYeG.js → vendor-lezer-xml-DOy7FzCR.js} +1 -1
  94. package/dist/assets/{vendor-lezer-yaml-CYQmm6Sb.js → vendor-lezer-yaml-kEjaSCvZ.js} +1 -1
  95. package/dist/assets/{vendor-replit-codemirror-vim-CZy3BUVv.js → vendor-replit-codemirror-vim-BLfh0LPy.js} +1 -1
  96. package/dist/assets/{web-components-v9fuidaX.js → web-components-C7CmoFxi.js} +1 -1
  97. package/dist/index.html +4 -4
  98. package/dist/mini-chat.html +3 -3
  99. package/dist/mobile.html +3 -3
  100. package/package.json +1 -1
  101. package/server/lib/pi/routes.js +1 -0
  102. package/server/lib/pi/session-daemon/DOCUMENTATION.md +1 -1
  103. package/server/lib/pi/session-daemon/supervisor.js +13 -1
  104. package/server/lib/pi/session-daemon/supervisor.test.js +92 -0
  105. package/server/lib/relay/DOCUMENTATION.md +4 -0
  106. package/server/lib/terminal/DOCUMENTATION.md +1 -0
  107. package/dist/assets/DiagramView-GKGxPczP.js +0 -1
  108. package/dist/assets/FileSaveConflictDialog-BRM9TJo0.js +0 -3
  109. package/dist/assets/GitHubLinkPicker-B9xgIW8y.js +0 -1
  110. package/dist/assets/MarkdownRendererImpl-1HameF6j.js +0 -12
  111. package/dist/assets/PullRequestsSurface-Dec20SIg.js +0 -2
  112. package/dist/assets/SessionSwitcherContent-DEw4nz7K.js +0 -1
  113. package/dist/assets/SessionSwitcherDropdown-DmLhbRzE.js +0 -2
  114. package/dist/assets/SettingsView-CwSspvq-.js +0 -6
  115. package/dist/assets/SettingsWindow-DkPv9MaU.js +0 -1
  116. package/dist/assets/ToolOutputDialog-DDwbOpTO.js +0 -8
  117. package/dist/assets/ToolPartDiffPreview-DZRP7p-Q.js +0 -1
  118. package/dist/assets/index-CkMnC_GK.js +0 -1
  119. package/dist/assets/index-Dd2OcIUY.js +0 -10
  120. package/dist/assets/index-DvN8zlLT.css +0 -1
  121. package/dist/assets/miniChat-BzfobBDq.js +0 -2
  122. package/dist/assets/mobile-DAzZE2EL.js +0 -2
  123. package/dist/assets/renderElectronMiniChatApp-DGYSIihR.js +0 -2
  124. package/dist/assets/renderMobileApp-CwgWG0lU.js +0 -11
  125. package/dist/assets/runtimeEndpointReset-CmI6dBKM.js +0 -62
  126. package/dist/assets/useAppFontEffects--lKKtKVo.js +0 -212
  127. package/dist/assets/vendor-aparajita-capacitor-secure-storage-5IShChL0.js +0 -1
  128. package/dist/assets/vendor-boot-DyL2td56.js +0 -69
  129. package/dist/assets/vendor-capacitor-app-BrDJj9I_.js +0 -1
  130. package/dist/assets/vendor-capacitor-core-B4EWRrHz.js +0 -1
  131. package/dist/assets/vendor-capacitor-keyboard-CYccoJjr.js +0 -1
  132. package/dist/assets/vendor-capacitor-push-notifications-KNe1zSBF.js +0 -1
  133. package/dist/assets/vendor-capacitor-status-bar-B-N0EOVk.js +0 -1
  134. package/dist/assets/vendor-codemirror-lang-cpp-GOE7Gjd0.js +0 -1
  135. package/dist/assets/vendor-codemirror-lang-css-Dwf2XpnZ.js +0 -1
  136. package/dist/assets/vendor-codemirror-lang-html-DcKqyeGk.js +0 -1
  137. package/dist/assets/vendor-codemirror-lang-java-6eGbyB2k.js +0 -1
  138. package/dist/assets/vendor-codemirror-lang-jinja-xSUJjXhr.js +0 -1
  139. package/dist/assets/vendor-codemirror-lang-json-CLGxdOCz.js +0 -1
  140. package/dist/assets/vendor-codemirror-lang-less-6nXi1rS9.js +0 -1
  141. package/dist/assets/vendor-codemirror-lang-liquid-B9hmb9P8.js +0 -1
  142. package/dist/assets/vendor-codemirror-lang-markdown-DmFP9s6x.js +0 -1
  143. package/dist/assets/vendor-codemirror-lang-php-DC6To8iX.js +0 -1
  144. package/dist/assets/vendor-codemirror-lang-python-yuxIkjit.js +0 -3
  145. package/dist/assets/vendor-codemirror-lang-rust-di1Sjz-0.js +0 -1
  146. package/dist/assets/vendor-codemirror-lang-sass-BWpV9NPV.js +0 -1
  147. package/dist/assets/vendor-codemirror-lang-wast-BiVarhcz.js +0 -1
  148. package/dist/assets/vendor-codemirror-lang-xml-Cn1lY1ts.js +0 -1
  149. package/dist/assets/vendor-codemirror-lang-yaml-BZ6mZw9L.js +0 -1
@@ -0,0 +1,69 @@
1
+ import{r as nm,a as v,b as hf,g as q3,R as ye}from"./vendor-react-DASdDPIk.js";import{c as Y3}from"./vendor-clsx-B-dksMZM.js";var vl;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(vl||(vl={}));class Kh extends Error{constructor(e,n,i){super(e),this.message=e,this.code=n,this.data=i}}const G3=t=>{var e,n;return t?.androidBridge?"android":!((n=(e=t?.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},X3=t=>{const e=t.CapacitorCustomPlatform||null,n=t.Capacitor||{},i=n.Plugins=n.Plugins||{},s=()=>e!==null?e.name:G3(t),o=()=>s()!=="web",l=m=>{const g=d.get(m);return!!(g?.platforms.has(s())||c(m))},c=m=>{var g;return(g=n.PluginHeaders)===null||g===void 0?void 0:g.find(b=>b.name===m)},f=m=>t.console.error(m),d=new Map,h=(m,g={})=>{const b=d.get(m);if(b)return console.warn(`Capacitor plugin "${m}" already registered. Cannot register plugins twice.`),b.proxy;const x=s(),w=c(m);let C;const E=async()=>(!C&&x in g?C=typeof g[x]=="function"?C=await g[x]():C=g[x]:e!==null&&!C&&"web"in g&&(C=typeof g.web=="function"?C=await g.web():C=g.web),C),M=(P,B)=>{var z,q;if(w){const W=w?.methods.find(F=>B===F.name);if(W)return W.rtype==="promise"?F=>n.nativePromise(m,B.toString(),F):(F,_)=>n.nativeCallback(m,B.toString(),F,_);if(P)return(z=P[B])===null||z===void 0?void 0:z.bind(P)}else{if(P)return(q=P[B])===null||q===void 0?void 0:q.bind(P);throw new Kh(`"${m}" plugin is not implemented on ${x}`,vl.Unimplemented)}},T=P=>{let B;const z=(...q)=>{const W=E().then(F=>{const _=M(F,P);if(_){const H=_(...q);return B=H?.remove,H}else throw new Kh(`"${m}.${P}()" is not implemented on ${x}`,vl.Unimplemented)});return P==="addListener"&&(W.remove=async()=>B()),W};return z.toString=()=>`${P.toString()}() { [capacitor code] }`,Object.defineProperty(z,"name",{value:P,writable:!1,configurable:!1}),z},D=T("addListener"),O=T("removeListener"),A=(P,B)=>{const z=D({eventName:P},B),q=async()=>{const F=await z;O({eventName:P,callbackId:F},B)},W=new Promise(F=>z.then(()=>F({remove:q})));return W.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await q()},W},k=new Proxy({},{get(P,B){switch(B){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return w?A:D;case"removeListener":return O;default:return T(B)}}});return i[m]=k,d.set(m,{name:m,proxy:k,platforms:new Set([...Object.keys(g),...w?[x]:[]])}),k};return n.convertFileSrc||(n.convertFileSrc=m=>m),n.getPlatform=s,n.handleError=f,n.isNativePlatform=o,n.isPluginAvailable=l,n.registerPlugin=h,n.Exception=Kh,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},$3=t=>t.Capacitor=X3(t),dp=$3(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}),pf=dp.registerPlugin;class im{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,n){let i=!1;this.listeners[e]||(this.listeners[e]=[],i=!0),this.listeners[e].push(n);const o=this.windowListeners[e];o&&!o.registered&&this.addWindowListener(o),i&&this.sendRetainedArgumentsForEvent(e);const l=async()=>this.removeListener(e,n);return Promise.resolve({remove:l})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,n,i){const s=this.listeners[e];if(!s){if(i){let o=this.retainedEventArguments[e];o||(o=[]),o.push(n),this.retainedEventArguments[e]=o}return}s.forEach(o=>o(n))}hasListeners(e){var n;return!!(!((n=this.listeners[e])===null||n===void 0)&&n.length)}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:i=>{this.notifyListeners(n,i)}}}unimplemented(e="not implemented"){return new dp.Exception(e,vl.Unimplemented)}unavailable(e="not available"){return new dp.Exception(e,vl.Unavailable)}async removeListener(e,n){const i=this.listeners[e];if(!i)return;const s=i.indexOf(n);this.listeners[e].splice(s,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const n=this.retainedEventArguments[e];n&&(delete this.retainedEventArguments[e],n.forEach(i=>{this.notifyListeners(e,i)}))}}const Q3=pf("WebView"),bT=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ST=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Z3 extends im{async getCookies(){const e=document.cookie,n={};return e.split(";").forEach(i=>{if(i.length<=0)return;let[s,o]=i.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=ST(s).trim(),o=ST(o).trim(),n[s]=o}),n}async setCookie(e){try{const n=bT(e.key),i=bT(e.value),s=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",o=(e.path||"/").replace("path=",""),l=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${i||""}${s}; path=${o}; ${l};`}catch(n){return Promise.reject(n)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}const J3=pf("CapacitorCookies",{web:()=>new Z3}),e4=async t=>new Promise((e,n)=>{const i=new FileReader;i.onload=()=>{const s=i.result;e(s.indexOf(",")>=0?s.split(",")[1]:s)},i.onerror=s=>n(s),i.readAsDataURL(t)}),t4=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(s=>s.toLocaleLowerCase()).reduce((s,o,l)=>(s[o]=t[e[l]],s),{})},n4=(t,e=!0)=>t?Object.entries(t).reduce((i,s)=>{const[o,l]=s;let c,f;return Array.isArray(l)?(f="",l.forEach(d=>{c=e?encodeURIComponent(d):d,f+=`${o}=${c}&`}),f.slice(0,-1)):(c=e?encodeURIComponent(l):l,f=`${o}=${c}`),`${i}&${f}`},"").substr(1):null,KO=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),s=t4(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(s.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[l,c]of Object.entries(t.data||{}))o.set(l,c);n.body=o.toString()}else if(s.includes("multipart/form-data")||t.data instanceof FormData){const o=new FormData;if(t.data instanceof FormData)t.data.forEach((c,f)=>{o.append(f,c)});else for(const c of Object.keys(t.data))o.append(c,t.data[c]);n.body=o;const l=new Headers(n.headers);l.delete("content-type"),n.headers=l}else(s.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class i4 extends im{async request(e){const n=KO(e,e.webFetchExtra),i=n4(e.params,e.shouldEncodeUrlParams),s=i?`${e.url}?${i}`:e.url,o=await fetch(s,n),l=o.headers.get("content-type")||"";let{responseType:c="text"}=o.ok?e:{};l.includes("application/json")&&(c="json");let f,d;switch(c){case"arraybuffer":case"blob":d=await o.blob(),f=await e4(d);break;case"json":f=await o.json();break;default:f=await o.text()}const h={};return o.headers.forEach((m,g)=>{h[g]=m}),{data:f,headers:h,status:o.status,url:o.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}const s4=pf("CapacitorHttp",{web:()=>new i4});var Uv;(function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"})(Uv||(Uv={}));var jv;(function(t){t.StatusBar="StatusBar",t.NavigationBar="NavigationBar"})(jv||(jv={}));class r4 extends im{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}const o4=pf("SystemBars",{web:()=>new r4}),jQ=Object.freeze(Object.defineProperty({__proto__:null,Capacitor:dp,CapacitorCookies:J3,CapacitorException:Kh,CapacitorHttp:s4,get ExceptionCode(){return vl},get SystemBarType(){return jv},SystemBars:o4,get SystemBarsStyle(){return Uv},WebPlugin:im,WebView:Q3,buildRequestInit:KO,registerPlugin:pf},Symbol.toStringTag,{value:"Module"}));var y0={exports:{}},su={};var xT;function l4(){if(xT)return su;xT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:t,type:i,key:l,ref:s!==void 0?s:null,props:o}}return su.Fragment=e,su.jsx=n,su.jsxs=n,su}var wT;function a4(){return wT||(wT=1,y0.exports=l4()),y0.exports}var ue=a4(),v0={exports:{}},ru={},b0={exports:{}},S0={};var CT;function c4(){return CT||(CT=1,(function(t){function e(I,L){var K=I.length;I.push(L);e:for(;0<K;){var Y=K-1>>>1,Z=I[Y];if(0<s(Z,L))I[Y]=L,I[K]=Z,K=Y;else break e}}function n(I){return I.length===0?null:I[0]}function i(I){if(I.length===0)return null;var L=I[0],K=I.pop();if(K!==L){I[0]=K;e:for(var Y=0,Z=I.length,le=Z>>>1;Y<le;){var V=2*(Y+1)-1,U=I[V],$=V+1,G=I[$];if(0>s(U,K))$<Z&&0>s(G,U)?(I[Y]=G,I[$]=K,Y=$):(I[Y]=U,I[V]=K,Y=V);else if($<Z&&0>s(G,K))I[Y]=G,I[$]=K,Y=$;else break e}}return L}function s(I,L){var K=I.sortIndex-L.sortIndex;return K!==0?K:I.id-L.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();t.unstable_now=function(){return l.now()-c}}var f=[],d=[],h=1,m=null,g=3,b=!1,x=!1,w=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var L=n(d);L!==null;){if(L.callback===null)i(d);else if(L.startTime<=I)i(d),L.sortIndex=L.expirationTime,e(f,L);else break;L=n(d)}}function O(I){if(w=!1,D(I),!x)if(n(f)!==null)x=!0,A||(A=!0,W());else{var L=n(d);L!==null&&H(O,L.startTime-I)}}var A=!1,k=-1,P=5,B=-1;function z(){return C?!0:!(t.unstable_now()-B<P)}function q(){if(C=!1,A){var I=t.unstable_now();B=I;var L=!0;try{e:{x=!1,w&&(w=!1,M(k),k=-1),b=!0;var K=g;try{t:{for(D(I),m=n(f);m!==null&&!(m.expirationTime>I&&z());){var Y=m.callback;if(typeof Y=="function"){m.callback=null,g=m.priorityLevel;var Z=Y(m.expirationTime<=I);if(I=t.unstable_now(),typeof Z=="function"){m.callback=Z,D(I),L=!0;break t}m===n(f)&&i(f),D(I)}else i(f);m=n(f)}if(m!==null)L=!0;else{var le=n(d);le!==null&&H(O,le.startTime-I),L=!1}}break e}finally{m=null,g=K,b=!1}L=void 0}}finally{L?W():A=!1}}}var W;if(typeof T=="function")W=function(){T(q)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,_=F.port2;F.port1.onmessage=q,W=function(){_.postMessage(null)}}else W=function(){E(q,0)};function H(I,L){k=E(function(){I(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(I){switch(g){case 1:case 2:case 3:var L=3;break;default:L=g}var K=g;g=L;try{return I()}finally{g=K}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(I,L){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var K=g;g=I;try{return L()}finally{g=K}},t.unstable_scheduleCallback=function(I,L,K){var Y=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Y+K:Y):K=Y,I){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=K+Z,I={id:h++,callback:L,priorityLevel:I,startTime:K,expirationTime:Z,sortIndex:-1},K>Y?(I.sortIndex=K,e(d,I),n(f)===null&&I===n(d)&&(w?(M(k),k=-1):w=!0,H(O,K-Y))):(I.sortIndex=Z,e(f,I),x||b||(x=!0,A||(A=!0,W()))),I},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(I){var L=g;return function(){var K=g;g=L;try{return I.apply(this,arguments)}finally{g=K}}}})(S0)),S0}var ET;function u4(){return ET||(ET=1,b0.exports=c4()),b0.exports}var x0={exports:{}},ei={};var TT;function f4(){if(TT)return ei;TT=1;var t=nm();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(f,d,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:f,containerInfo:d,implementation:h}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ei.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ei.createPortal=function(f,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return o(f,d,null,h)},ei.flushSync=function(f){var d=l.T,h=i.p;try{if(l.T=null,i.p=2,f)return f()}finally{l.T=d,i.p=h,i.d.f()}},ei.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},ei.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},ei.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var h=d.as,m=c(h,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:b}):h==="script"&&i.d.X(f,{crossOrigin:m,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ei.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=c(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},ei.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,m=c(h,d.crossOrigin);i.d.L(f,h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ei.preloadModule=function(f,d){if(typeof f=="string")if(d){var h=c(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},ei.requestFormReset=function(f){i.d.r(f)},ei.unstable_batchedUpdates=function(f,d){return f(d)},ei.useFormState=function(f,d,h){return l.H.useFormState(f,d,h)},ei.useFormStatus=function(){return l.H.useHostTransitionStatus()},ei.version="19.2.4",ei}var RT;function qO(){if(RT)return x0.exports;RT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),x0.exports=f4(),x0.exports}var AT;function d4(){if(AT)return ru;AT=1;var t=u4(),e=nm(),n=qO();function i(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var a=r,u=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(u=a.return),r=a.return;while(r)}return a.tag===3?u:null}function l(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function c(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function f(r){if(o(r)!==r)throw Error(i(188))}function d(r){var a=r.alternate;if(!a){if(a=o(r),a===null)throw Error(i(188));return a!==r?null:r}for(var u=r,p=a;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(p=y.return,p!==null){u=p;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return f(y),r;if(S===p)return f(y),a;S=S.sibling}throw Error(i(188))}if(u.return!==p.return)u=y,p=S;else{for(var R=!1,N=y.child;N;){if(N===u){R=!0,u=y,p=S;break}if(N===p){R=!0,p=y,u=S;break}N=N.sibling}if(!R){for(N=S.child;N;){if(N===u){R=!0,u=S,p=y;break}if(N===p){R=!0,p=S,u=y;break}N=N.sibling}if(!R)throw Error(i(189))}}if(u.alternate!==p)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?r:a}function h(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=h(r),a!==null)return a;r=r.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var F=Symbol.for("react.client.reference");function _(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===F?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case x:return"Portal";case T:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case D:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return a=r.displayName||null,a!==null?a:_(r.type)||"Memo";case P:a=r._payload,r=r._init;try{return _(r(a))}catch{}}return null}var H=Array.isArray,I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Y=[],Z=-1;function le(r){return{current:r}}function V(r){0>Z||(r.current=Y[Z],Y[Z]=null,Z--)}function U(r,a){Z++,Y[Z]=r.current,r.current=a}var $=le(null),G=le(null),J=le(null),fe=le(null);function ie(r,a){switch(U(J,a),U(G,r),U($,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?UE(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=UE(a),r=jE(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}V($),U($,r)}function de(){V($),V(G),V(J)}function Se(r){r.memoizedState!==null&&U(fe,r);var a=$.current,u=jE(a,r.type);a!==u&&(U(G,r),U($,u))}function Fe(r){G.current===r&&(V($),V(G)),fe.current===r&&(V(fe),eu._currentValue=K)}var pe,Ee;function De(r){if(pe===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);pe=a&&a[1]||"",Ee=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+pe+r+Ee}var Le=!1;function we(r,a){if(!r||Le)return"";Le=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(a){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(se){var ne=se}Reflect.construct(r,[],ge)}else{try{ge.call()}catch(se){ne=se}r.call(ge.prototype)}}else{try{throw Error()}catch(se){ne=se}(ge=r())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),R=S[0],N=S[1];if(R&&N){var j=R.split(`
4
+ `),te=N.split(`
5
+ `);for(y=p=0;p<j.length&&!j[p].includes("DetermineComponentFrameRoot");)p++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(p===j.length||y===te.length)for(p=j.length-1,y=te.length-1;1<=p&&0<=y&&j[p]!==te[y];)y--;for(;1<=p&&0<=y;p--,y--)if(j[p]!==te[y]){if(p!==1||y!==1)do if(p--,y--,0>y||j[p]!==te[y]){var ce=`
6
+ `+j[p].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=p&&0<=y);break}}}finally{Le=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?De(u):""}function Te(r,a){switch(r.tag){case 26:case 27:case 5:return De(r.type);case 16:return De("Lazy");case 13:return r.child!==a&&a!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return we(r.type,!1);case 11:return we(r.type.render,!1);case 1:return we(r.type,!0);case 31:return De("Activity");default:return""}}function ke(r){try{var a="",u=null;do a+=Te(r,u),u=r,r=r.return;while(r);return a}catch(p){return`
7
+ Error generating stack: `+p.message+`
8
+ `+p.stack}}var ve=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,re=t.unstable_cancelCallback,me=t.unstable_shouldYield,ae=t.unstable_requestPaint,oe=t.unstable_now,Ie=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,ft=t.unstable_LowPriority,at=t.unstable_IdlePriority,ct=t.log,Ae=t.unstable_setDisableYieldValue,je=null,We=null;function xt(r){if(typeof ct=="function"&&Ae(r),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(je,r)}catch{}}var wt=Math.clz32?Math.clz32:Ke,Yt=Math.log,Ze=Math.LN2;function Ke(r){return r>>>=0,r===0?32:31-(Yt(r)/Ze|0)|0}var pt=256,vt=262144,mt=4194304;function it(r){var a=r&42;if(a!==0)return a;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pe(r,a,u){var p=r.pendingLanes;if(p===0)return 0;var y=0,S=r.suspendedLanes,R=r.pingedLanes;r=r.warmLanes;var N=p&134217727;return N!==0?(p=N&~S,p!==0?y=it(p):(R&=N,R!==0?y=it(R):u||(u=N&~r,u!==0&&(y=it(u))))):(N=p&~S,N!==0?y=it(N):R!==0?y=it(R):u||(u=p&~r,u!==0&&(y=it(u)))),y===0?0:a!==0&&a!==y&&(a&S)===0&&(S=y&-y,u=a&-a,S>=u||S===32&&(u&4194048)!==0)?a:y}function et(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function ot(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function gt(){var r=mt;return mt<<=1,(mt&62914560)===0&&(mt=4194304),r}function _t(r){for(var a=[],u=0;31>u;u++)a.push(r);return a}function bt(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function nt(r,a,u,p,y,S){var R=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var N=r.entanglements,j=r.expirationTimes,te=r.hiddenUpdates;for(u=R&~u;0<u;){var ce=31-wt(u),ge=1<<ce;N[ce]=0,j[ce]=-1;var ne=te[ce];if(ne!==null)for(te[ce]=null,ce=0;ce<ne.length;ce++){var se=ne[ce];se!==null&&(se.lane&=-536870913)}u&=~ge}p!==0&&Gt(r,p,0),S!==0&&y===0&&r.tag!==0&&(r.suspendedLanes|=S&~(R&~a))}function Gt(r,a,u){r.pendingLanes|=a,r.suspendedLanes&=~a;var p=31-wt(a);r.entangledLanes|=a,r.entanglements[p]=r.entanglements[p]|1073741824|u&261930}function Ot(r,a){var u=r.entangledLanes|=a;for(r=r.entanglements;u;){var p=31-wt(u),y=1<<p;y&a|r[p]&a&&(r[p]|=a),u&=~y}}function Vt(r,a){var u=a&-a;return u=(u&42)!==0?1:tt(u),(u&(r.suspendedLanes|a))!==0?0:u}function tt(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function lt(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ln(){var r=L.p;return r!==0?r:(r=window.event,r===void 0?32:dT(r.type))}function Pn(r,a){var u=L.p;try{return L.p=r,a()}finally{L.p=u}}var an=Math.random().toString(36).slice(2),hn="__reactFiber$"+an,ri="__reactProps$"+an,Ho="__reactContainer$"+an,ag="__reactEvents$"+an,LV="__reactListeners$"+an,BV="__reactHandles$"+an,Ow="__reactResources$"+an,mc="__reactMarker$"+an;function cg(r){delete r[hn],delete r[ri],delete r[ag],delete r[LV],delete r[BV]}function kl(r){var a=r[hn];if(a)return a;for(var u=r.parentNode;u;){if(a=u[Ho]||u[hn]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(r=$E(r);r!==null;){if(u=r[hn])return u;r=$E(r)}return a}r=u,u=r.parentNode}return null}function Pl(r){if(r=r[hn]||r[Ho]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function gc(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(i(33))}function Nl(r){var a=r[Ow];return a||(a=r[Ow]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Vn(r){r[mc]=!0}var Dw=new Set,kw={};function Fo(r,a){Il(r,a),Il(r+"Capture",a)}function Il(r,a){for(kw[r]=a,r=0;r<a.length;r++)Dw.add(a[r])}var VV=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Pw={},Nw={};function zV(r){return ve.call(Nw,r)?!0:ve.call(Pw,r)?!1:VV.test(r)?Nw[r]=!0:(Pw[r]=!0,!1)}function jf(r,a,u){if(zV(a))if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var p=a.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,""+u)}}function Wf(r,a,u){if(u===null)r.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,""+u)}}function nr(r,a,u,p){if(p===null)r.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(a,u,""+p)}}function zi(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Iw(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function _V(r,a,u){var p=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,S=p.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return y.call(this)},set:function(R){u=""+R,S.call(this,R)}}),Object.defineProperty(r,a,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(R){u=""+R},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function ug(r){if(!r._valueTracker){var a=Iw(r)?"checked":"value";r._valueTracker=_V(r,a,""+r[a])}}function Lw(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var u=a.getValue(),p="";return r&&(p=Iw(r)?r.checked?"true":"false":r.value),r=p,r!==u?(a.setValue(r),!0):!1}function Kf(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var HV=/[\n"\\]/g;function _i(r){return r.replace(HV,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function fg(r,a,u,p,y,S,R,N){r.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.type=R:r.removeAttribute("type"),a!=null?R==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+zi(a)):r.value!==""+zi(a)&&(r.value=""+zi(a)):R!=="submit"&&R!=="reset"||r.removeAttribute("value"),a!=null?dg(r,R,zi(a)):u!=null?dg(r,R,zi(u)):p!=null&&r.removeAttribute("value"),y==null&&S!=null&&(r.defaultChecked=!!S),y!=null&&(r.checked=y&&typeof y!="function"&&typeof y!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+zi(N):r.removeAttribute("name")}function Bw(r,a,u,p,y,S,R,N){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.type=S),a!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||a!=null)){ug(r);return}u=u!=null?""+zi(u):"",a=a!=null?""+zi(a):u,N||a===r.value||(r.value=a),r.defaultValue=a}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,r.checked=N?r.checked:!!p,r.defaultChecked=!!p,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(r.name=R),ug(r)}function dg(r,a,u){a==="number"&&Kf(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Ll(r,a,u,p){if(r=r.options,a){a={};for(var y=0;y<u.length;y++)a["$"+u[y]]=!0;for(u=0;u<r.length;u++)y=a.hasOwnProperty("$"+r[u].value),r[u].selected!==y&&(r[u].selected=y),y&&p&&(r[u].defaultSelected=!0)}else{for(u=""+zi(u),a=null,y=0;y<r.length;y++){if(r[y].value===u){r[y].selected=!0,p&&(r[y].defaultSelected=!0);return}a!==null||r[y].disabled||(a=r[y])}a!==null&&(a.selected=!0)}}function Vw(r,a,u){if(a!=null&&(a=""+zi(a),a!==r.value&&(r.value=a),u==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=u!=null?""+zi(u):""}function zw(r,a,u,p){if(a==null){if(p!=null){if(u!=null)throw Error(i(92));if(H(p)){if(1<p.length)throw Error(i(93));p=p[0]}u=p}u==null&&(u=""),a=u}u=zi(a),r.defaultValue=u,p=r.textContent,p===u&&p!==""&&p!==null&&(r.value=p),ug(r)}function Bl(r,a){if(a){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=a;return}}r.textContent=a}var FV=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _w(r,a,u){var p=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":p?r.setProperty(a,u):typeof u!="number"||u===0||FV.has(a)?a==="float"?r.cssFloat=u:r[a]=(""+u).trim():r[a]=u+"px"}function Hw(r,a,u){if(a!=null&&typeof a!="object")throw Error(i(62));if(r=r.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||a!=null&&a.hasOwnProperty(p)||(p.indexOf("--")===0?r.setProperty(p,""):p==="float"?r.cssFloat="":r[p]="");for(var y in a)p=a[y],a.hasOwnProperty(y)&&u[y]!==p&&_w(r,y,p)}else for(var S in a)a.hasOwnProperty(S)&&_w(r,S,a[S])}function hg(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var UV=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jV=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qf(r){return jV.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ir(){}var pg=null;function mg(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vl=null,zl=null;function Fw(r){var a=Pl(r);if(a&&(r=a.stateNode)){var u=r[ri]||null;e:switch(r=a.stateNode,a.type){case"input":if(fg(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+_i(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var p=u[a];if(p!==r&&p.form===r.form){var y=p[ri]||null;if(!y)throw Error(i(90));fg(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(a=0;a<u.length;a++)p=u[a],p.form===r.form&&Lw(p)}break e;case"textarea":Vw(r,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&Ll(r,!!u.multiple,a,!1)}}}var gg=!1;function Uw(r,a,u){if(gg)return r(a,u);gg=!0;try{var p=r(a);return p}finally{if(gg=!1,(Vl!==null||zl!==null)&&(Nd(),Vl&&(a=Vl,r=zl,zl=Vl=null,Fw(a),r)))for(a=0;a<r.length;a++)Fw(r[a])}}function yc(r,a){var u=r.stateNode;if(u===null)return null;var p=u[ri]||null;if(p===null)return null;u=p[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(r=r.type,p=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!p;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(i(231,a,typeof u));return u}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yg=!1;if(sr)try{var vc={};Object.defineProperty(vc,"passive",{get:function(){yg=!0}}),window.addEventListener("test",vc,vc),window.removeEventListener("test",vc,vc)}catch{yg=!1}var Lr=null,vg=null,Yf=null;function jw(){if(Yf)return Yf;var r,a=vg,u=a.length,p,y="value"in Lr?Lr.value:Lr.textContent,S=y.length;for(r=0;r<u&&a[r]===y[r];r++);var R=u-r;for(p=1;p<=R&&a[u-p]===y[S-p];p++);return Yf=y.slice(r,1<p?1-p:void 0)}function Gf(r){var a=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Xf(){return!0}function Ww(){return!1}function pi(r){function a(u,p,y,S,R){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=S,this.target=R,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(u=r[N],this[N]=u?u(S):S[N]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Xf:Ww,this.isPropagationStopped=Ww,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Xf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Xf)},persist:function(){},isPersistent:Xf}),a}var Uo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$f=pi(Uo),bc=m({},Uo,{view:0,detail:0}),WV=pi(bc),bg,Sg,Sc,Qf=m({},bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wg,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Sc&&(Sc&&r.type==="mousemove"?(bg=r.screenX-Sc.screenX,Sg=r.screenY-Sc.screenY):Sg=bg=0,Sc=r),bg)},movementY:function(r){return"movementY"in r?r.movementY:Sg}}),Kw=pi(Qf),KV=m({},Qf,{dataTransfer:0}),qV=pi(KV),YV=m({},bc,{relatedTarget:0}),xg=pi(YV),GV=m({},Uo,{animationName:0,elapsedTime:0,pseudoElement:0}),XV=pi(GV),$V=m({},Uo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),QV=pi($V),ZV=m({},Uo,{data:0}),qw=pi(ZV),JV={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ez={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},tz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nz(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=tz[r])?!!a[r]:!1}function wg(){return nz}var iz=m({},bc,{key:function(r){if(r.key){var a=JV[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=Gf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ez[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wg,charCode:function(r){return r.type==="keypress"?Gf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Gf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),sz=pi(iz),rz=m({},Qf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yw=pi(rz),oz=m({},bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wg}),lz=pi(oz),az=m({},Uo,{propertyName:0,elapsedTime:0,pseudoElement:0}),cz=pi(az),uz=m({},Qf,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),fz=pi(uz),dz=m({},Uo,{newState:0,oldState:0}),hz=pi(dz),pz=[9,13,27,32],Cg=sr&&"CompositionEvent"in window,xc=null;sr&&"documentMode"in document&&(xc=document.documentMode);var mz=sr&&"TextEvent"in window&&!xc,Gw=sr&&(!Cg||xc&&8<xc&&11>=xc),Xw=" ",$w=!1;function Qw(r,a){switch(r){case"keyup":return pz.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zw(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var _l=!1;function gz(r,a){switch(r){case"compositionend":return Zw(a);case"keypress":return a.which!==32?null:($w=!0,Xw);case"textInput":return r=a.data,r===Xw&&$w?null:r;default:return null}}function yz(r,a){if(_l)return r==="compositionend"||!Cg&&Qw(r,a)?(r=jw(),Yf=vg=Lr=null,_l=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Gw&&a.locale!=="ko"?null:a.data;default:return null}}var vz={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Jw(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!vz[r.type]:a==="textarea"}function e1(r,a,u,p){Vl?zl?zl.push(p):zl=[p]:Vl=p,a=Hd(a,"onChange"),0<a.length&&(u=new $f("onChange","change",null,u,p),r.push({event:u,listeners:a}))}var wc=null,Cc=null;function bz(r){BE(r,0)}function Zf(r){var a=gc(r);if(Lw(a))return r}function t1(r,a){if(r==="change")return a}var n1=!1;if(sr){var Eg;if(sr){var Tg="oninput"in document;if(!Tg){var i1=document.createElement("div");i1.setAttribute("oninput","return;"),Tg=typeof i1.oninput=="function"}Eg=Tg}else Eg=!1;n1=Eg&&(!document.documentMode||9<document.documentMode)}function s1(){wc&&(wc.detachEvent("onpropertychange",r1),Cc=wc=null)}function r1(r){if(r.propertyName==="value"&&Zf(Cc)){var a=[];e1(a,Cc,r,mg(r)),Uw(bz,a)}}function Sz(r,a,u){r==="focusin"?(s1(),wc=a,Cc=u,wc.attachEvent("onpropertychange",r1)):r==="focusout"&&s1()}function xz(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Zf(Cc)}function wz(r,a){if(r==="click")return Zf(a)}function Cz(r,a){if(r==="input"||r==="change")return Zf(a)}function Ez(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var Ri=typeof Object.is=="function"?Object.is:Ez;function Ec(r,a){if(Ri(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var u=Object.keys(r),p=Object.keys(a);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!ve.call(a,y)||!Ri(r[y],a[y]))return!1}return!0}function o1(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function l1(r,a){var u=o1(r);r=0;for(var p;u;){if(u.nodeType===3){if(p=r+u.textContent.length,r<=a&&p>=a)return{node:u,offset:a-r};r=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=o1(u)}}function a1(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?a1(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function c1(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=Kf(r.document);a instanceof r.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)r=a.contentWindow;else break;a=Kf(r.document)}return a}function Rg(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var Tz=sr&&"documentMode"in document&&11>=document.documentMode,Hl=null,Ag=null,Tc=null,Mg=!1;function u1(r,a,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Mg||Hl==null||Hl!==Kf(p)||(p=Hl,"selectionStart"in p&&Rg(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Tc&&Ec(Tc,p)||(Tc=p,p=Hd(Ag,"onSelect"),0<p.length&&(a=new $f("onSelect","select",null,a,u),r.push({event:a,listeners:p}),a.target=Hl)))}function jo(r,a){var u={};return u[r.toLowerCase()]=a.toLowerCase(),u["Webkit"+r]="webkit"+a,u["Moz"+r]="moz"+a,u}var Fl={animationend:jo("Animation","AnimationEnd"),animationiteration:jo("Animation","AnimationIteration"),animationstart:jo("Animation","AnimationStart"),transitionrun:jo("Transition","TransitionRun"),transitionstart:jo("Transition","TransitionStart"),transitioncancel:jo("Transition","TransitionCancel"),transitionend:jo("Transition","TransitionEnd")},Og={},f1={};sr&&(f1=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function Wo(r){if(Og[r])return Og[r];if(!Fl[r])return r;var a=Fl[r],u;for(u in a)if(a.hasOwnProperty(u)&&u in f1)return Og[r]=a[u];return r}var d1=Wo("animationend"),h1=Wo("animationiteration"),p1=Wo("animationstart"),Rz=Wo("transitionrun"),Az=Wo("transitionstart"),Mz=Wo("transitioncancel"),m1=Wo("transitionend"),g1=new Map,Dg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Dg.push("scrollEnd");function as(r,a){g1.set(r,a),Fo(a,[r])}var Jf=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Hi=[],Ul=0,kg=0;function ed(){for(var r=Ul,a=kg=Ul=0;a<r;){var u=Hi[a];Hi[a++]=null;var p=Hi[a];Hi[a++]=null;var y=Hi[a];Hi[a++]=null;var S=Hi[a];if(Hi[a++]=null,p!==null&&y!==null){var R=p.pending;R===null?y.next=y:(y.next=R.next,R.next=y),p.pending=y}S!==0&&y1(u,y,S)}}function td(r,a,u,p){Hi[Ul++]=r,Hi[Ul++]=a,Hi[Ul++]=u,Hi[Ul++]=p,kg|=p,r.lanes|=p,r=r.alternate,r!==null&&(r.lanes|=p)}function Pg(r,a,u,p){return td(r,a,u,p),nd(r)}function Ko(r,a){return td(r,null,null,a),nd(r)}function y1(r,a,u){r.lanes|=u;var p=r.alternate;p!==null&&(p.lanes|=u);for(var y=!1,S=r.return;S!==null;)S.childLanes|=u,p=S.alternate,p!==null&&(p.childLanes|=u),S.tag===22&&(r=S.stateNode,r===null||r._visibility&1||(y=!0)),r=S,S=S.return;return r.tag===3?(S=r.stateNode,y&&a!==null&&(y=31-wt(u),r=S.hiddenUpdates,p=r[y],p===null?r[y]=[a]:p.push(a),a.lane=u|536870912),S):null}function nd(r){if(50<Yc)throw Yc=0,Fy=null,Error(i(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var jl={};function Oz(r,a,u,p){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ai(r,a,u,p){return new Oz(r,a,u,p)}function Ng(r){return r=r.prototype,!(!r||!r.isReactComponent)}function rr(r,a){var u=r.alternate;return u===null?(u=Ai(r.tag,a,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=a,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,a=r.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function v1(r,a){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,a=u.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function id(r,a,u,p,y,S){var R=0;if(p=r,typeof r=="function")Ng(r)&&(R=1);else if(typeof r=="string")R=I3(r,u,$.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=Ai(31,u,a,y),r.elementType=B,r.lanes=S,r;case w:return qo(u.children,y,S,a);case C:R=8,y|=24;break;case E:return r=Ai(12,u,a,y|2),r.elementType=E,r.lanes=S,r;case O:return r=Ai(13,u,a,y),r.elementType=O,r.lanes=S,r;case A:return r=Ai(19,u,a,y),r.elementType=A,r.lanes=S,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:R=10;break e;case M:R=9;break e;case D:R=11;break e;case k:R=14;break e;case P:R=16,p=null;break e}R=29,u=Error(i(130,r===null?"null":typeof r,"")),p=null}return a=Ai(R,u,a,y),a.elementType=r,a.type=p,a.lanes=S,a}function qo(r,a,u,p){return r=Ai(7,r,p,a),r.lanes=u,r}function Ig(r,a,u){return r=Ai(6,r,null,a),r.lanes=u,r}function b1(r){var a=Ai(18,null,null,0);return a.stateNode=r,a}function Lg(r,a,u){return a=Ai(4,r.children!==null?r.children:[],r.key,a),a.lanes=u,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var S1=new WeakMap;function Fi(r,a){if(typeof r=="object"&&r!==null){var u=S1.get(r);return u!==void 0?u:(a={value:r,source:a,stack:ke(a)},S1.set(r,a),a)}return{value:r,source:a,stack:ke(a)}}var Wl=[],Kl=0,sd=null,Rc=0,Ui=[],ji=0,Br=null,Ts=1,Rs="";function or(r,a){Wl[Kl++]=Rc,Wl[Kl++]=sd,sd=r,Rc=a}function x1(r,a,u){Ui[ji++]=Ts,Ui[ji++]=Rs,Ui[ji++]=Br,Br=r;var p=Ts;r=Rs;var y=32-wt(p)-1;p&=~(1<<y),u+=1;var S=32-wt(a)+y;if(30<S){var R=y-y%5;S=(p&(1<<R)-1).toString(32),p>>=R,y-=R,Ts=1<<32-wt(a)+y|u<<y|p,Rs=S+r}else Ts=1<<S|u<<y|p,Rs=r}function Bg(r){r.return!==null&&(or(r,1),x1(r,1,0))}function Vg(r){for(;r===sd;)sd=Wl[--Kl],Wl[Kl]=null,Rc=Wl[--Kl],Wl[Kl]=null;for(;r===Br;)Br=Ui[--ji],Ui[ji]=null,Rs=Ui[--ji],Ui[ji]=null,Ts=Ui[--ji],Ui[ji]=null}function w1(r,a){Ui[ji++]=Ts,Ui[ji++]=Rs,Ui[ji++]=Br,Ts=a.id,Rs=a.overflow,Br=r}var jn=null,rn=null,Mt=!1,Vr=null,Wi=!1,zg=Error(i(519));function zr(r){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ac(Fi(a,r)),zg}function C1(r){var a=r.stateNode,u=r.type,p=r.memoizedProps;switch(a[hn]=r,a[ri]=p,u){case"dialog":Et("cancel",a),Et("close",a);break;case"iframe":case"object":case"embed":Et("load",a);break;case"video":case"audio":for(u=0;u<Xc.length;u++)Et(Xc[u],a);break;case"source":Et("error",a);break;case"img":case"image":case"link":Et("error",a),Et("load",a);break;case"details":Et("toggle",a);break;case"input":Et("invalid",a),Bw(a,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Et("invalid",a);break;case"textarea":Et("invalid",a),zw(a,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||p.suppressHydrationWarning===!0||HE(a.textContent,u)?(p.popover!=null&&(Et("beforetoggle",a),Et("toggle",a)),p.onScroll!=null&&Et("scroll",a),p.onScrollEnd!=null&&Et("scrollend",a),p.onClick!=null&&(a.onclick=ir),a=!0):a=!1,a||zr(r,!0)}function E1(r){for(jn=r.return;jn;)switch(jn.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:jn=jn.return}}function ql(r){if(r!==jn)return!1;if(!Mt)return E1(r),Mt=!0,!1;var a=r.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||n0(r.type,r.memoizedProps)),u=!u),u&&rn&&zr(r),E1(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));rn=XE(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));rn=XE(r)}else a===27?(a=rn,Zr(r.type)?(r=l0,l0=null,rn=r):rn=a):rn=jn?qi(r.stateNode.nextSibling):null;return!0}function Yo(){rn=jn=null,Mt=!1}function _g(){var r=Vr;return r!==null&&(vi===null?vi=r:vi.push.apply(vi,r),Vr=null),r}function Ac(r){Vr===null?Vr=[r]:Vr.push(r)}var Hg=le(null),Go=null,lr=null;function _r(r,a,u){U(Hg,a._currentValue),a._currentValue=u}function ar(r){r._currentValue=Hg.current,V(Hg)}function Fg(r,a,u){for(;r!==null;){var p=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,p!==null&&(p.childLanes|=a)):p!==null&&(p.childLanes&a)!==a&&(p.childLanes|=a),r===u)break;r=r.return}}function Ug(r,a,u,p){var y=r.child;for(y!==null&&(y.return=r);y!==null;){var S=y.dependencies;if(S!==null){var R=y.child;S=S.firstContext;e:for(;S!==null;){var N=S;S=y;for(var j=0;j<a.length;j++)if(N.context===a[j]){S.lanes|=u,N=S.alternate,N!==null&&(N.lanes|=u),Fg(S.return,u,r),p||(R=null);break e}S=N.next}}else if(y.tag===18){if(R=y.return,R===null)throw Error(i(341));R.lanes|=u,S=R.alternate,S!==null&&(S.lanes|=u),Fg(R,u,r),R=null}else R=y.child;if(R!==null)R.return=y;else for(R=y;R!==null;){if(R===r){R=null;break}if(y=R.sibling,y!==null){y.return=R.return,R=y;break}R=R.return}y=R}}function Yl(r,a,u,p){r=null;for(var y=a,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var R=y.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var N=y.type;Ri(y.pendingProps.value,R.value)||(r!==null?r.push(N):r=[N])}}else if(y===fe.current){if(R=y.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(r!==null?r.push(eu):r=[eu])}y=y.return}r!==null&&Ug(a,r,u,p),a.flags|=262144}function rd(r){for(r=r.firstContext;r!==null;){if(!Ri(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Xo(r){Go=r,lr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Wn(r){return T1(Go,r)}function od(r,a){return Go===null&&Xo(r),T1(r,a)}function T1(r,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},lr===null){if(r===null)throw Error(i(308));lr=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else lr=lr.next=a;return u}var Dz=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(u,p){r.push(p)}};this.abort=function(){a.aborted=!0,r.forEach(function(u){return u()})}},kz=t.unstable_scheduleCallback,Pz=t.unstable_NormalPriority,xn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jg(){return{controller:new Dz,data:new Map,refCount:0}}function Mc(r){r.refCount--,r.refCount===0&&kz(Pz,function(){r.controller.abort()})}var Oc=null,Wg=0,Gl=0,Xl=null;function Nz(r,a){if(Oc===null){var u=Oc=[];Wg=0,Gl=Yy(),Xl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Wg++,a.then(R1,R1),a}function R1(){if(--Wg===0&&Oc!==null){Xl!==null&&(Xl.status="fulfilled");var r=Oc;Oc=null,Gl=0,Xl=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function Iz(r,a){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return r.then(function(){p.status="fulfilled",p.value=a;for(var y=0;y<u.length;y++)(0,u[y])(a)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var A1=I.S;I.S=function(r,a){uE=oe(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&Nz(r,a),A1!==null&&A1(r,a)};var $o=le(null);function Kg(){var r=$o.current;return r!==null?r:Xt.pooledCache}function ld(r,a){a===null?U($o,$o.current):U($o,a.pool)}function M1(){var r=Kg();return r===null?null:{parent:xn._currentValue,pool:r}}var $l=Error(i(460)),qg=Error(i(474)),ad=Error(i(542)),cd={then:function(){}};function O1(r){return r=r.status,r==="fulfilled"||r==="rejected"}function D1(r,a,u){switch(u=r[u],u===void 0?r.push(a):u!==a&&(a.then(ir,ir),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,P1(r),r;default:if(typeof a.status=="string")a.then(ir,ir);else{if(r=Xt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=a,r.status="pending",r.then(function(p){if(a.status==="pending"){var y=a;y.status="fulfilled",y.value=p}},function(p){if(a.status==="pending"){var y=a;y.status="rejected",y.reason=p}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,P1(r),r}throw Zo=a,$l}}function Qo(r){try{var a=r._init;return a(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Zo=u,$l):u}}var Zo=null;function k1(){if(Zo===null)throw Error(i(459));var r=Zo;return Zo=null,r}function P1(r){if(r===$l||r===ad)throw Error(i(483))}var Ql=null,Dc=0;function ud(r){var a=Dc;return Dc+=1,Ql===null&&(Ql=[]),D1(Ql,r,a)}function kc(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function fd(r,a){throw a.$$typeof===g?Error(i(525)):(r=Object.prototype.toString.call(a),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function N1(r){function a(Q,X){if(r){var ee=Q.deletions;ee===null?(Q.deletions=[X],Q.flags|=16):ee.push(X)}}function u(Q,X){if(!r)return null;for(;X!==null;)a(Q,X),X=X.sibling;return null}function p(Q){for(var X=new Map;Q!==null;)Q.key!==null?X.set(Q.key,Q):X.set(Q.index,Q),Q=Q.sibling;return X}function y(Q,X){return Q=rr(Q,X),Q.index=0,Q.sibling=null,Q}function S(Q,X,ee){return Q.index=ee,r?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<X?(Q.flags|=67108866,X):ee):(Q.flags|=67108866,X)):(Q.flags|=1048576,X)}function R(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,X,ee,he){return X===null||X.tag!==6?(X=Ig(ee,Q.mode,he),X.return=Q,X):(X=y(X,ee),X.return=Q,X)}function j(Q,X,ee,he){var Ye=ee.type;return Ye===w?ce(Q,X,ee.props.children,he,ee.key):X!==null&&(X.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===P&&Qo(Ye)===X.type)?(X=y(X,ee.props),kc(X,ee),X.return=Q,X):(X=id(ee.type,ee.key,ee.props,null,Q.mode,he),kc(X,ee),X.return=Q,X)}function te(Q,X,ee,he){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=Lg(ee,Q.mode,he),X.return=Q,X):(X=y(X,ee.children||[]),X.return=Q,X)}function ce(Q,X,ee,he,Ye){return X===null||X.tag!==7?(X=qo(ee,Q.mode,he,Ye),X.return=Q,X):(X=y(X,ee),X.return=Q,X)}function ge(Q,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Ig(""+X,Q.mode,ee),X.return=Q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return ee=id(X.type,X.key,X.props,null,Q.mode,ee),kc(ee,X),ee.return=Q,ee;case x:return X=Lg(X,Q.mode,ee),X.return=Q,X;case P:return X=Qo(X),ge(Q,X,ee)}if(H(X)||W(X))return X=qo(X,Q.mode,ee,null),X.return=Q,X;if(typeof X.then=="function")return ge(Q,ud(X),ee);if(X.$$typeof===T)return ge(Q,od(Q,X),ee);fd(Q,X)}return null}function ne(Q,X,ee,he){var Ye=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ye!==null?null:N(Q,X,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Ye?j(Q,X,ee,he):null;case x:return ee.key===Ye?te(Q,X,ee,he):null;case P:return ee=Qo(ee),ne(Q,X,ee,he)}if(H(ee)||W(ee))return Ye!==null?null:ce(Q,X,ee,he,null);if(typeof ee.then=="function")return ne(Q,X,ud(ee),he);if(ee.$$typeof===T)return ne(Q,X,od(Q,ee),he);fd(Q,ee)}return null}function se(Q,X,ee,he,Ye){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return Q=Q.get(ee)||null,N(X,Q,""+he,Ye);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case b:return Q=Q.get(he.key===null?ee:he.key)||null,j(X,Q,he,Ye);case x:return Q=Q.get(he.key===null?ee:he.key)||null,te(X,Q,he,Ye);case P:return he=Qo(he),se(Q,X,ee,he,Ye)}if(H(he)||W(he))return Q=Q.get(ee)||null,ce(X,Q,he,Ye,null);if(typeof he.then=="function")return se(Q,X,ee,ud(he),Ye);if(he.$$typeof===T)return se(Q,X,ee,od(X,he),Ye);fd(X,he)}return null}function Be(Q,X,ee,he){for(var Ye=null,Pt=null,_e=X,dt=X=0,At=null;_e!==null&&dt<ee.length;dt++){_e.index>dt?(At=_e,_e=null):At=_e.sibling;var Nt=ne(Q,_e,ee[dt],he);if(Nt===null){_e===null&&(_e=At);break}r&&_e&&Nt.alternate===null&&a(Q,_e),X=S(Nt,X,dt),Pt===null?Ye=Nt:Pt.sibling=Nt,Pt=Nt,_e=At}if(dt===ee.length)return u(Q,_e),Mt&&or(Q,dt),Ye;if(_e===null){for(;dt<ee.length;dt++)_e=ge(Q,ee[dt],he),_e!==null&&(X=S(_e,X,dt),Pt===null?Ye=_e:Pt.sibling=_e,Pt=_e);return Mt&&or(Q,dt),Ye}for(_e=p(_e);dt<ee.length;dt++)At=se(_e,Q,dt,ee[dt],he),At!==null&&(r&&At.alternate!==null&&_e.delete(At.key===null?dt:At.key),X=S(At,X,dt),Pt===null?Ye=At:Pt.sibling=At,Pt=At);return r&&_e.forEach(function(io){return a(Q,io)}),Mt&&or(Q,dt),Ye}function $e(Q,X,ee,he){if(ee==null)throw Error(i(151));for(var Ye=null,Pt=null,_e=X,dt=X=0,At=null,Nt=ee.next();_e!==null&&!Nt.done;dt++,Nt=ee.next()){_e.index>dt?(At=_e,_e=null):At=_e.sibling;var io=ne(Q,_e,Nt.value,he);if(io===null){_e===null&&(_e=At);break}r&&_e&&io.alternate===null&&a(Q,_e),X=S(io,X,dt),Pt===null?Ye=io:Pt.sibling=io,Pt=io,_e=At}if(Nt.done)return u(Q,_e),Mt&&or(Q,dt),Ye;if(_e===null){for(;!Nt.done;dt++,Nt=ee.next())Nt=ge(Q,Nt.value,he),Nt!==null&&(X=S(Nt,X,dt),Pt===null?Ye=Nt:Pt.sibling=Nt,Pt=Nt);return Mt&&or(Q,dt),Ye}for(_e=p(_e);!Nt.done;dt++,Nt=ee.next())Nt=se(_e,Q,dt,Nt.value,he),Nt!==null&&(r&&Nt.alternate!==null&&_e.delete(Nt.key===null?dt:Nt.key),X=S(Nt,X,dt),Pt===null?Ye=Nt:Pt.sibling=Nt,Pt=Nt);return r&&_e.forEach(function(K3){return a(Q,K3)}),Mt&&or(Q,dt),Ye}function Kt(Q,X,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Ye=ee.key;X!==null;){if(X.key===Ye){if(Ye=ee.type,Ye===w){if(X.tag===7){u(Q,X.sibling),he=y(X,ee.props.children),he.return=Q,Q=he;break e}}else if(X.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===P&&Qo(Ye)===X.type){u(Q,X.sibling),he=y(X,ee.props),kc(he,ee),he.return=Q,Q=he;break e}u(Q,X);break}else a(Q,X);X=X.sibling}ee.type===w?(he=qo(ee.props.children,Q.mode,he,ee.key),he.return=Q,Q=he):(he=id(ee.type,ee.key,ee.props,null,Q.mode,he),kc(he,ee),he.return=Q,Q=he)}return R(Q);case x:e:{for(Ye=ee.key;X!==null;){if(X.key===Ye)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){u(Q,X.sibling),he=y(X,ee.children||[]),he.return=Q,Q=he;break e}else{u(Q,X);break}else a(Q,X);X=X.sibling}he=Lg(ee,Q.mode,he),he.return=Q,Q=he}return R(Q);case P:return ee=Qo(ee),Kt(Q,X,ee,he)}if(H(ee))return Be(Q,X,ee,he);if(W(ee)){if(Ye=W(ee),typeof Ye!="function")throw Error(i(150));return ee=Ye.call(ee),$e(Q,X,ee,he)}if(typeof ee.then=="function")return Kt(Q,X,ud(ee),he);if(ee.$$typeof===T)return Kt(Q,X,od(Q,ee),he);fd(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(u(Q,X.sibling),he=y(X,ee),he.return=Q,Q=he):(u(Q,X),he=Ig(ee,Q.mode,he),he.return=Q,Q=he),R(Q)):u(Q,X)}return function(Q,X,ee,he){try{Dc=0;var Ye=Kt(Q,X,ee,he);return Ql=null,Ye}catch(_e){if(_e===$l||_e===ad)throw _e;var Pt=Ai(29,_e,null,Q.mode);return Pt.lanes=he,Pt.return=Q,Pt}}}var Jo=N1(!0),I1=N1(!1),Hr=!1;function Yg(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gg(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Fr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ur(r,a,u){var p=r.updateQueue;if(p===null)return null;if(p=p.shared,(Lt&2)!==0){var y=p.pending;return y===null?a.next=a:(a.next=y.next,y.next=a),p.pending=a,a=nd(r),y1(r,null,u),a}return td(r,p,a,u),nd(r)}function Pc(r,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var p=a.lanes;p&=r.pendingLanes,u|=p,a.lanes=u,Ot(r,u)}}function Xg(r,a){var u=r.updateQueue,p=r.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var R={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=R:S=S.next=R,u=u.next}while(u!==null);S===null?y=S=a:S=S.next=a}else y=S=a;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=a:r.next=a,u.lastBaseUpdate=a}var $g=!1;function Nc(){if($g){var r=Xl;if(r!==null)throw r}}function Ic(r,a,u,p){$g=!1;var y=r.updateQueue;Hr=!1;var S=y.firstBaseUpdate,R=y.lastBaseUpdate,N=y.shared.pending;if(N!==null){y.shared.pending=null;var j=N,te=j.next;j.next=null,R===null?S=te:R.next=te,R=j;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,N=ce.lastBaseUpdate,N!==R&&(N===null?ce.firstBaseUpdate=te:N.next=te,ce.lastBaseUpdate=j))}if(S!==null){var ge=y.baseState;R=0,ce=te=j=null,N=S;do{var ne=N.lane&-536870913,se=ne!==N.lane;if(se?(Rt&ne)===ne:(p&ne)===ne){ne!==0&&ne===Gl&&($g=!0),ce!==null&&(ce=ce.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Be=r,$e=N;ne=a;var Kt=u;switch($e.tag){case 1:if(Be=$e.payload,typeof Be=="function"){ge=Be.call(Kt,ge,ne);break e}ge=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=$e.payload,ne=typeof Be=="function"?Be.call(Kt,ge,ne):Be,ne==null)break e;ge=m({},ge,ne);break e;case 2:Hr=!0}}ne=N.callback,ne!==null&&(r.flags|=64,se&&(r.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ce===null?(te=ce=se,j=ge):ce=ce.next=se,R|=ne;if(N=N.next,N===null){if(N=y.shared.pending,N===null)break;se=N,N=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);ce===null&&(j=ge),y.baseState=j,y.firstBaseUpdate=te,y.lastBaseUpdate=ce,S===null&&(y.shared.lanes=0),Yr|=R,r.lanes=R,r.memoizedState=ge}}function L1(r,a){if(typeof r!="function")throw Error(i(191,r));r.call(a)}function B1(r,a){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)L1(u[r],a)}var Zl=le(null),dd=le(0);function V1(r,a){r=yr,U(dd,r),U(Zl,a),yr=r|a.baseLanes}function Qg(){U(dd,yr),U(Zl,Zl.current)}function Zg(){yr=dd.current,V(Zl),V(dd)}var Mi=le(null),Ki=null;function jr(r){var a=r.alternate;U(yn,yn.current&1),U(Mi,r),Ki===null&&(a===null||Zl.current!==null||a.memoizedState!==null)&&(Ki=r)}function Jg(r){U(yn,yn.current),U(Mi,r),Ki===null&&(Ki=r)}function z1(r){r.tag===22?(U(yn,yn.current),U(Mi,r),Ki===null&&(Ki=r)):Wr()}function Wr(){U(yn,yn.current),U(Mi,Mi.current)}function Oi(r){V(Mi),Ki===r&&(Ki=null),V(yn)}var yn=le(0);function hd(r){for(var a=r;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||r0(u)||o0(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var cr=0,ut=null,jt=null,wn=null,pd=!1,Jl=!1,el=!1,md=0,Lc=0,ea=null,Lz=0;function pn(){throw Error(i(321))}function ey(r,a){if(a===null)return!1;for(var u=0;u<a.length&&u<r.length;u++)if(!Ri(r[u],a[u]))return!1;return!0}function ty(r,a,u,p,y,S){return cr=S,ut=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=r===null||r.memoizedState===null?xC:gy,el=!1,S=u(p,y),el=!1,Jl&&(S=H1(a,u,p,y)),_1(r),S}function _1(r){I.H=zc;var a=jt!==null&&jt.next!==null;if(cr=0,wn=jt=ut=null,pd=!1,Lc=0,ea=null,a)throw Error(i(300));r===null||Cn||(r=r.dependencies,r!==null&&rd(r)&&(Cn=!0))}function H1(r,a,u,p){ut=r;var y=0;do{if(Jl&&(ea=null),Lc=0,Jl=!1,25<=y)throw Error(i(301));if(y+=1,wn=jt=null,r.updateQueue!=null){var S=r.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=wC,S=a(u,p)}while(Jl);return S}function Bz(){var r=I.H,a=r.useState()[0];return a=typeof a.then=="function"?Bc(a):a,r=r.useState()[0],(jt!==null?jt.memoizedState:null)!==r&&(ut.flags|=1024),a}function ny(){var r=md!==0;return md=0,r}function iy(r,a,u){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~u}function sy(r){if(pd){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}pd=!1}cr=0,wn=jt=ut=null,Jl=!1,Lc=md=0,ea=null}function oi(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ut.memoizedState=wn=r:wn=wn.next=r,wn}function vn(){if(jt===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=jt.next;var a=wn===null?ut.memoizedState:wn.next;if(a!==null)wn=a,jt=r;else{if(r===null)throw ut.alternate===null?Error(i(467)):Error(i(310));jt=r,r={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},wn===null?ut.memoizedState=wn=r:wn=wn.next=r}return wn}function gd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bc(r){var a=Lc;return Lc+=1,ea===null&&(ea=[]),r=D1(ea,r,a),a=ut,(wn===null?a.memoizedState:wn.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?xC:gy),r}function yd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Bc(r);if(r.$$typeof===T)return Wn(r)}throw Error(i(438,String(r)))}function ry(r){var a=null,u=ut.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var p=ut.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(a={data:p.data.map(function(y){return y.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=gd(),ut.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(r),p=0;p<r;p++)u[p]=z;return a.index++,u}function ur(r,a){return typeof a=="function"?a(r):a}function vd(r){var a=vn();return oy(a,jt,r)}function oy(r,a,u){var p=r.queue;if(p===null)throw Error(i(311));p.lastRenderedReducer=u;var y=r.baseQueue,S=p.pending;if(S!==null){if(y!==null){var R=y.next;y.next=S.next,S.next=R}a.baseQueue=y=S,p.pending=null}if(S=r.baseState,y===null)r.memoizedState=S;else{a=y.next;var N=R=null,j=null,te=a,ce=!1;do{var ge=te.lane&-536870913;if(ge!==te.lane?(Rt&ge)===ge:(cr&ge)===ge){var ne=te.revertLane;if(ne===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ge===Gl&&(ce=!0);else if((cr&ne)===ne){te=te.next,ne===Gl&&(ce=!0);continue}else ge={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},j===null?(N=j=ge,R=S):j=j.next=ge,ut.lanes|=ne,Yr|=ne;ge=te.action,el&&u(S,ge),S=te.hasEagerState?te.eagerState:u(S,ge)}else ne={lane:ge,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},j===null?(N=j=ne,R=S):j=j.next=ne,ut.lanes|=ge,Yr|=ge;te=te.next}while(te!==null&&te!==a);if(j===null?R=S:j.next=N,!Ri(S,r.memoizedState)&&(Cn=!0,ce&&(u=Xl,u!==null)))throw u;r.memoizedState=S,r.baseState=R,r.baseQueue=j,p.lastRenderedState=S}return y===null&&(p.lanes=0),[r.memoizedState,p.dispatch]}function ly(r){var a=vn(),u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=r;var p=u.dispatch,y=u.pending,S=a.memoizedState;if(y!==null){u.pending=null;var R=y=y.next;do S=r(S,R.action),R=R.next;while(R!==y);Ri(S,a.memoizedState)||(Cn=!0),a.memoizedState=S,a.baseQueue===null&&(a.baseState=S),u.lastRenderedState=S}return[S,p]}function F1(r,a,u){var p=ut,y=vn(),S=Mt;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=a();var R=!Ri((jt||y).memoizedState,u);if(R&&(y.memoizedState=u,Cn=!0),y=y.queue,uy(W1.bind(null,p,y,r),[r]),y.getSnapshot!==a||R||wn!==null&&wn.memoizedState.tag&1){if(p.flags|=2048,ta(9,{destroy:void 0},j1.bind(null,p,y,u,a),null),Xt===null)throw Error(i(349));S||(cr&127)!==0||U1(p,a,u)}return u}function U1(r,a,u){r.flags|=16384,r={getSnapshot:a,value:u},a=ut.updateQueue,a===null?(a=gd(),ut.updateQueue=a,a.stores=[r]):(u=a.stores,u===null?a.stores=[r]:u.push(r))}function j1(r,a,u,p){a.value=u,a.getSnapshot=p,K1(a)&&q1(r)}function W1(r,a,u){return u(function(){K1(a)&&q1(r)})}function K1(r){var a=r.getSnapshot;r=r.value;try{var u=a();return!Ri(r,u)}catch{return!0}}function q1(r){var a=Ko(r,2);a!==null&&bi(a,r,2)}function ay(r){var a=oi();if(typeof r=="function"){var u=r;if(r=u(),el){xt(!0);try{u()}finally{xt(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:r},a}function Y1(r,a,u,p){return r.baseState=u,oy(r,jt,typeof p=="function"?p:ur)}function Vz(r,a,u,p,y){if(xd(r))throw Error(i(485));if(r=a.action,r!==null){var S={payload:y,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){S.listeners.push(R)}};I.T!==null?u(!0):S.isTransition=!1,p(S),u=a.pending,u===null?(S.next=a.pending=S,G1(a,S)):(S.next=u.next,a.pending=u.next=S)}}function G1(r,a){var u=a.action,p=a.payload,y=r.state;if(a.isTransition){var S=I.T,R={};I.T=R;try{var N=u(y,p),j=I.S;j!==null&&j(R,N),X1(r,a,N)}catch(te){cy(r,a,te)}finally{S!==null&&R.types!==null&&(S.types=R.types),I.T=S}}else try{S=u(y,p),X1(r,a,S)}catch(te){cy(r,a,te)}}function X1(r,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){$1(r,a,p)},function(p){return cy(r,a,p)}):$1(r,a,u)}function $1(r,a,u){a.status="fulfilled",a.value=u,Q1(a),r.state=u,a=r.pending,a!==null&&(u=a.next,u===a?r.pending=null:(u=u.next,a.next=u,G1(r,u)))}function cy(r,a,u){var p=r.pending;if(r.pending=null,p!==null){p=p.next;do a.status="rejected",a.reason=u,Q1(a),a=a.next;while(a!==p)}r.action=null}function Q1(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function Z1(r,a){return a}function J1(r,a){if(Mt){var u=Xt.formState;if(u!==null){e:{var p=ut;if(Mt){if(rn){t:{for(var y=rn,S=Wi;y.nodeType!==8;){if(!S){y=null;break t}if(y=qi(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){rn=qi(y.nextSibling),p=y.data==="F!";break e}}zr(p)}p=!1}p&&(a=u[0])}}return u=oi(),u.memoizedState=u.baseState=a,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z1,lastRenderedState:a},u.queue=p,u=vC.bind(null,ut,p),p.dispatch=u,p=ay(!1),S=my.bind(null,ut,!1,p.queue),p=oi(),y={state:a,dispatch:null,action:r,pending:null},p.queue=y,u=Vz.bind(null,ut,y,S,u),y.dispatch=u,p.memoizedState=r,[a,u,!1]}function eC(r){var a=vn();return tC(a,jt,r)}function tC(r,a,u){if(a=oy(r,a,Z1)[0],r=vd(ur)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var p=Bc(a)}catch(R){throw R===$l?ad:R}else p=a;a=vn();var y=a.queue,S=y.dispatch;return u!==a.memoizedState&&(ut.flags|=2048,ta(9,{destroy:void 0},zz.bind(null,y,u),null)),[p,S,r]}function zz(r,a){r.action=a}function nC(r){var a=vn(),u=jt;if(u!==null)return tC(a,u,r);vn(),a=a.memoizedState,u=vn();var p=u.queue.dispatch;return u.memoizedState=r,[a,p,!1]}function ta(r,a,u,p){return r={tag:r,create:u,deps:p,inst:a,next:null},a=ut.updateQueue,a===null&&(a=gd(),ut.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=r.next=r:(p=u.next,u.next=r,r.next=p,a.lastEffect=r),r}function iC(){return vn().memoizedState}function bd(r,a,u,p){var y=oi();ut.flags|=r,y.memoizedState=ta(1|a,{destroy:void 0},u,p===void 0?null:p)}function Sd(r,a,u,p){var y=vn();p=p===void 0?null:p;var S=y.memoizedState.inst;jt!==null&&p!==null&&ey(p,jt.memoizedState.deps)?y.memoizedState=ta(a,S,u,p):(ut.flags|=r,y.memoizedState=ta(1|a,S,u,p))}function sC(r,a){bd(8390656,8,r,a)}function uy(r,a){Sd(2048,8,r,a)}function _z(r){ut.flags|=4;var a=ut.updateQueue;if(a===null)a=gd(),ut.updateQueue=a,a.events=[r];else{var u=a.events;u===null?a.events=[r]:u.push(r)}}function rC(r){var a=vn().memoizedState;return _z({ref:a,nextImpl:r}),function(){if((Lt&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function oC(r,a){return Sd(4,2,r,a)}function lC(r,a){return Sd(4,4,r,a)}function aC(r,a){if(typeof a=="function"){r=r();var u=a(r);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function cC(r,a,u){u=u!=null?u.concat([r]):null,Sd(4,4,aC.bind(null,a,r),u)}function fy(){}function uC(r,a){var u=vn();a=a===void 0?null:a;var p=u.memoizedState;return a!==null&&ey(a,p[1])?p[0]:(u.memoizedState=[r,a],r)}function fC(r,a){var u=vn();a=a===void 0?null:a;var p=u.memoizedState;if(a!==null&&ey(a,p[1]))return p[0];if(p=r(),el){xt(!0);try{r()}finally{xt(!1)}}return u.memoizedState=[p,a],p}function dy(r,a,u){return u===void 0||(cr&1073741824)!==0&&(Rt&261930)===0?r.memoizedState=a:(r.memoizedState=u,r=dE(),ut.lanes|=r,Yr|=r,u)}function dC(r,a,u,p){return Ri(u,a)?u:Zl.current!==null?(r=dy(r,u,p),Ri(r,a)||(Cn=!0),r):(cr&42)===0||(cr&1073741824)!==0&&(Rt&261930)===0?(Cn=!0,r.memoizedState=u):(r=dE(),ut.lanes|=r,Yr|=r,a)}function hC(r,a,u,p,y){var S=L.p;L.p=S!==0&&8>S?S:8;var R=I.T,N={};I.T=N,my(r,!1,a,u);try{var j=y(),te=I.S;if(te!==null&&te(N,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var ce=Iz(j,p);Vc(r,a,ce,Pi(r))}else Vc(r,a,p,Pi(r))}catch(ge){Vc(r,a,{then:function(){},status:"rejected",reason:ge},Pi())}finally{L.p=S,R!==null&&N.types!==null&&(R.types=N.types),I.T=R}}function Hz(){}function hy(r,a,u,p){if(r.tag!==5)throw Error(i(476));var y=pC(r).queue;hC(r,y,a,K,u===null?Hz:function(){return mC(r),u(p)})}function pC(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:K},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:u},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function mC(r){var a=pC(r);a.next===null&&(a=r.alternate.memoizedState),Vc(r,a.next.queue,{},Pi())}function py(){return Wn(eu)}function gC(){return vn().memoizedState}function yC(){return vn().memoizedState}function Fz(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var u=Pi();r=Fr(u);var p=Ur(a,r,u);p!==null&&(bi(p,a,u),Pc(p,a,u)),a={cache:jg()},r.payload=a;return}a=a.return}}function Uz(r,a,u){var p=Pi();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},xd(r)?bC(a,u):(u=Pg(r,a,u,p),u!==null&&(bi(u,r,p),SC(u,a,p)))}function vC(r,a,u){var p=Pi();Vc(r,a,u,p)}function Vc(r,a,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(xd(r))bC(a,y);else{var S=r.alternate;if(r.lanes===0&&(S===null||S.lanes===0)&&(S=a.lastRenderedReducer,S!==null))try{var R=a.lastRenderedState,N=S(R,u);if(y.hasEagerState=!0,y.eagerState=N,Ri(N,R))return td(r,a,y,0),Xt===null&&ed(),!1}catch{}if(u=Pg(r,a,y,p),u!==null)return bi(u,r,p),SC(u,a,p),!0}return!1}function my(r,a,u,p){if(p={lane:2,revertLane:Yy(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},xd(r)){if(a)throw Error(i(479))}else a=Pg(r,u,p,2),a!==null&&bi(a,r,2)}function xd(r){var a=r.alternate;return r===ut||a!==null&&a===ut}function bC(r,a){Jl=pd=!0;var u=r.pending;u===null?a.next=a:(a.next=u.next,u.next=a),r.pending=a}function SC(r,a,u){if((u&4194048)!==0){var p=a.lanes;p&=r.pendingLanes,u|=p,a.lanes=u,Ot(r,u)}}var zc={readContext:Wn,use:yd,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};zc.useEffectEvent=pn;var xC={readContext:Wn,use:yd,useCallback:function(r,a){return oi().memoizedState=[r,a===void 0?null:a],r},useContext:Wn,useEffect:sC,useImperativeHandle:function(r,a,u){u=u!=null?u.concat([r]):null,bd(4194308,4,aC.bind(null,a,r),u)},useLayoutEffect:function(r,a){return bd(4194308,4,r,a)},useInsertionEffect:function(r,a){bd(4,2,r,a)},useMemo:function(r,a){var u=oi();a=a===void 0?null:a;var p=r();if(el){xt(!0);try{r()}finally{xt(!1)}}return u.memoizedState=[p,a],p},useReducer:function(r,a,u){var p=oi();if(u!==void 0){var y=u(a);if(el){xt(!0);try{u(a)}finally{xt(!1)}}}else y=a;return p.memoizedState=p.baseState=y,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:y},p.queue=r,r=r.dispatch=Uz.bind(null,ut,r),[p.memoizedState,r]},useRef:function(r){var a=oi();return r={current:r},a.memoizedState=r},useState:function(r){r=ay(r);var a=r.queue,u=vC.bind(null,ut,a);return a.dispatch=u,[r.memoizedState,u]},useDebugValue:fy,useDeferredValue:function(r,a){var u=oi();return dy(u,r,a)},useTransition:function(){var r=ay(!1);return r=hC.bind(null,ut,r.queue,!0,!1),oi().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,u){var p=ut,y=oi();if(Mt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),Xt===null)throw Error(i(349));(Rt&127)!==0||U1(p,a,u)}y.memoizedState=u;var S={value:u,getSnapshot:a};return y.queue=S,sC(W1.bind(null,p,S,r),[r]),p.flags|=2048,ta(9,{destroy:void 0},j1.bind(null,p,S,u,a),null),u},useId:function(){var r=oi(),a=Xt.identifierPrefix;if(Mt){var u=Rs,p=Ts;u=(p&~(1<<32-wt(p)-1)).toString(32)+u,a="_"+a+"R_"+u,u=md++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=Lz++,a="_"+a+"r_"+u.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:py,useFormState:J1,useActionState:J1,useOptimistic:function(r){var a=oi();a.memoizedState=a.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=my.bind(null,ut,!0,u),u.dispatch=a,[r,a]},useMemoCache:ry,useCacheRefresh:function(){return oi().memoizedState=Fz.bind(null,ut)},useEffectEvent:function(r){var a=oi(),u={impl:r};return a.memoizedState=u,function(){if((Lt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},gy={readContext:Wn,use:yd,useCallback:uC,useContext:Wn,useEffect:uy,useImperativeHandle:cC,useInsertionEffect:oC,useLayoutEffect:lC,useMemo:fC,useReducer:vd,useRef:iC,useState:function(){return vd(ur)},useDebugValue:fy,useDeferredValue:function(r,a){var u=vn();return dC(u,jt.memoizedState,r,a)},useTransition:function(){var r=vd(ur)[0],a=vn().memoizedState;return[typeof r=="boolean"?r:Bc(r),a]},useSyncExternalStore:F1,useId:gC,useHostTransitionStatus:py,useFormState:eC,useActionState:eC,useOptimistic:function(r,a){var u=vn();return Y1(u,jt,r,a)},useMemoCache:ry,useCacheRefresh:yC};gy.useEffectEvent=rC;var wC={readContext:Wn,use:yd,useCallback:uC,useContext:Wn,useEffect:uy,useImperativeHandle:cC,useInsertionEffect:oC,useLayoutEffect:lC,useMemo:fC,useReducer:ly,useRef:iC,useState:function(){return ly(ur)},useDebugValue:fy,useDeferredValue:function(r,a){var u=vn();return jt===null?dy(u,r,a):dC(u,jt.memoizedState,r,a)},useTransition:function(){var r=ly(ur)[0],a=vn().memoizedState;return[typeof r=="boolean"?r:Bc(r),a]},useSyncExternalStore:F1,useId:gC,useHostTransitionStatus:py,useFormState:nC,useActionState:nC,useOptimistic:function(r,a){var u=vn();return jt!==null?Y1(u,jt,r,a):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:ry,useCacheRefresh:yC};wC.useEffectEvent=rC;function yy(r,a,u,p){a=r.memoizedState,u=u(p,a),u=u==null?a:m({},a,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var vy={enqueueSetState:function(r,a,u){r=r._reactInternals;var p=Pi(),y=Fr(p);y.payload=a,u!=null&&(y.callback=u),a=Ur(r,y,p),a!==null&&(bi(a,r,p),Pc(a,r,p))},enqueueReplaceState:function(r,a,u){r=r._reactInternals;var p=Pi(),y=Fr(p);y.tag=1,y.payload=a,u!=null&&(y.callback=u),a=Ur(r,y,p),a!==null&&(bi(a,r,p),Pc(a,r,p))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var u=Pi(),p=Fr(u);p.tag=2,a!=null&&(p.callback=a),a=Ur(r,p,u),a!==null&&(bi(a,r,u),Pc(a,r,u))}};function CC(r,a,u,p,y,S,R){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(p,S,R):a.prototype&&a.prototype.isPureReactComponent?!Ec(u,p)||!Ec(y,S):!0}function EC(r,a,u,p){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,p),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,p),a.state!==r&&vy.enqueueReplaceState(a,a.state,null)}function tl(r,a){var u=a;if("ref"in a){u={};for(var p in a)p!=="ref"&&(u[p]=a[p])}if(r=r.defaultProps){u===a&&(u=m({},u));for(var y in r)u[y]===void 0&&(u[y]=r[y])}return u}function TC(r){Jf(r)}function RC(r){console.error(r)}function AC(r){Jf(r)}function wd(r,a){try{var u=r.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(p){setTimeout(function(){throw p})}}function MC(r,a,u){try{var p=r.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function by(r,a,u){return u=Fr(u),u.tag=3,u.payload={element:null},u.callback=function(){wd(r,a)},u}function OC(r){return r=Fr(r),r.tag=3,r}function DC(r,a,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=p.value;r.payload=function(){return y(S)},r.callback=function(){MC(a,u,p)}}var R=u.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){MC(a,u,p),typeof y!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var N=p.stack;this.componentDidCatch(p.value,{componentStack:N!==null?N:""})})}function jz(r,a,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(a=u.alternate,a!==null&&Yl(a,u,y,!0),u=Mi.current,u!==null){switch(u.tag){case 31:case 13:return Ki===null?Id():u.alternate===null&&mn===0&&(mn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===cd?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([p]):a.add(p),Wy(r,p,y)),!1;case 22:return u.flags|=65536,p===cd?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([p]):u.add(p)),Wy(r,p,y)),!1}throw Error(i(435,u.tag))}return Wy(r,p,y),Id(),!1}if(Mt)return a=Mi.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=y,p!==zg&&(r=Error(i(422),{cause:p}),Ac(Fi(r,u)))):(p!==zg&&(a=Error(i(423),{cause:p}),Ac(Fi(a,u))),r=r.current.alternate,r.flags|=65536,y&=-y,r.lanes|=y,p=Fi(p,u),y=by(r.stateNode,p,y),Xg(r,y),mn!==4&&(mn=2)),!1;var S=Error(i(520),{cause:p});if(S=Fi(S,u),qc===null?qc=[S]:qc.push(S),mn!==4&&(mn=2),a===null)return!0;p=Fi(p,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,r=y&-y,u.lanes|=r,r=by(u.stateNode,p,r),Xg(u,r),!1;case 1:if(a=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Gr===null||!Gr.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=OC(y),DC(y,r,u,p),Xg(u,y),!1}u=u.return}while(u!==null);return!1}var Sy=Error(i(461)),Cn=!1;function Kn(r,a,u,p){a.child=r===null?I1(a,null,u,p):Jo(a,r.child,u,p)}function kC(r,a,u,p,y){u=u.render;var S=a.ref;if("ref"in p){var R={};for(var N in p)N!=="ref"&&(R[N]=p[N])}else R=p;return Xo(a),p=ty(r,a,u,R,S,y),N=ny(),r!==null&&!Cn?(iy(r,a,y),fr(r,a,y)):(Mt&&N&&Bg(a),a.flags|=1,Kn(r,a,p,y),a.child)}function PC(r,a,u,p,y){if(r===null){var S=u.type;return typeof S=="function"&&!Ng(S)&&S.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=S,NC(r,a,S,p,y)):(r=id(u.type,null,p,a,a.mode,y),r.ref=a.ref,r.return=a,a.child=r)}if(S=r.child,!My(r,y)){var R=S.memoizedProps;if(u=u.compare,u=u!==null?u:Ec,u(R,p)&&r.ref===a.ref)return fr(r,a,y)}return a.flags|=1,r=rr(S,p),r.ref=a.ref,r.return=a,a.child=r}function NC(r,a,u,p,y){if(r!==null){var S=r.memoizedProps;if(Ec(S,p)&&r.ref===a.ref)if(Cn=!1,a.pendingProps=p=S,My(r,y))(r.flags&131072)!==0&&(Cn=!0);else return a.lanes=r.lanes,fr(r,a,y)}return xy(r,a,u,p,y)}function IC(r,a,u,p){var y=p.children,S=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((a.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,r!==null){for(p=a.child=r.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~S}else p=0,a.child=null;return LC(r,a,S,u,p)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&ld(a,S!==null?S.cachePool:null),S!==null?V1(a,S):Qg(),z1(a);else return p=a.lanes=536870912,LC(r,a,S!==null?S.baseLanes|u:u,u,p)}else S!==null?(ld(a,S.cachePool),V1(a,S),Wr(),a.memoizedState=null):(r!==null&&ld(a,null),Qg(),Wr());return Kn(r,a,y,u),a.child}function _c(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function LC(r,a,u,p,y){var S=Kg();return S=S===null?null:{parent:xn._currentValue,pool:S},a.memoizedState={baseLanes:u,cachePool:S},r!==null&&ld(a,null),Qg(),z1(a),r!==null&&Yl(r,a,p,!0),a.childLanes=y,null}function Cd(r,a){return a=Td({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function BC(r,a,u){return Jo(a,r.child,null,u),r=Cd(a,a.pendingProps),r.flags|=2,Oi(a),a.memoizedState=null,r}function Wz(r,a,u){var p=a.pendingProps,y=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(Mt){if(p.mode==="hidden")return r=Cd(a,p),a.lanes=536870912,_c(null,r);if(Jg(a),(r=rn)?(r=GE(r,Wi),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Br!==null?{id:Ts,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=b1(r),u.return=a,a.child=u,jn=a,rn=null)):r=null,r===null)throw zr(a);return a.lanes=536870912,null}return Cd(a,p)}var S=r.memoizedState;if(S!==null){var R=S.dehydrated;if(Jg(a),y)if(a.flags&256)a.flags&=-257,a=BC(r,a,u);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(i(558));else if(Cn||Yl(r,a,u,!1),y=(u&r.childLanes)!==0,Cn||y){if(p=Xt,p!==null&&(R=Vt(p,u),R!==0&&R!==S.retryLane))throw S.retryLane=R,Ko(r,R),bi(p,r,R),Sy;Id(),a=BC(r,a,u)}else r=S.treeContext,rn=qi(R.nextSibling),jn=a,Mt=!0,Vr=null,Wi=!1,r!==null&&w1(a,r),a=Cd(a,p),a.flags|=4096;return a}return r=rr(r.child,{mode:p.mode,children:p.children}),r.ref=a.ref,a.child=r,r.return=a,r}function Ed(r,a){var u=a.ref;if(u===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(r===null||r.ref!==u)&&(a.flags|=4194816)}}function xy(r,a,u,p,y){return Xo(a),u=ty(r,a,u,p,void 0,y),p=ny(),r!==null&&!Cn?(iy(r,a,y),fr(r,a,y)):(Mt&&p&&Bg(a),a.flags|=1,Kn(r,a,u,y),a.child)}function VC(r,a,u,p,y,S){return Xo(a),a.updateQueue=null,u=H1(a,p,u,y),_1(r),p=ny(),r!==null&&!Cn?(iy(r,a,S),fr(r,a,S)):(Mt&&p&&Bg(a),a.flags|=1,Kn(r,a,u,S),a.child)}function zC(r,a,u,p,y){if(Xo(a),a.stateNode===null){var S=jl,R=u.contextType;typeof R=="object"&&R!==null&&(S=Wn(R)),S=new u(p,S),a.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=vy,a.stateNode=S,S._reactInternals=a,S=a.stateNode,S.props=p,S.state=a.memoizedState,S.refs={},Yg(a),R=u.contextType,S.context=typeof R=="object"&&R!==null?Wn(R):jl,S.state=a.memoizedState,R=u.getDerivedStateFromProps,typeof R=="function"&&(yy(a,u,R,p),S.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(R=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),R!==S.state&&vy.enqueueReplaceState(S,S.state,null),Ic(a,p,S,y),Nc(),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308),p=!0}else if(r===null){S=a.stateNode;var N=a.memoizedProps,j=tl(u,N);S.props=j;var te=S.context,ce=u.contextType;R=jl,typeof ce=="object"&&ce!==null&&(R=Wn(ce));var ge=u.getDerivedStateFromProps;ce=typeof ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",N=a.pendingProps!==N,ce||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N||te!==R)&&EC(a,S,p,R),Hr=!1;var ne=a.memoizedState;S.state=ne,Ic(a,p,S,y),Nc(),te=a.memoizedState,N||ne!==te||Hr?(typeof ge=="function"&&(yy(a,u,ge,p),te=a.memoizedState),(j=Hr||CC(a,u,j,p,ne,te,R))?(ce||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(a.flags|=4194308)):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=p,a.memoizedState=te),S.props=p,S.state=te,S.context=R,p=j):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),p=!1)}else{S=a.stateNode,Gg(r,a),R=a.memoizedProps,ce=tl(u,R),S.props=ce,ge=a.pendingProps,ne=S.context,te=u.contextType,j=jl,typeof te=="object"&&te!==null&&(j=Wn(te)),N=u.getDerivedStateFromProps,(te=typeof N=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(R!==ge||ne!==j)&&EC(a,S,p,j),Hr=!1,ne=a.memoizedState,S.state=ne,Ic(a,p,S,y),Nc();var se=a.memoizedState;R!==ge||ne!==se||Hr||r!==null&&r.dependencies!==null&&rd(r.dependencies)?(typeof N=="function"&&(yy(a,u,N,p),se=a.memoizedState),(ce=Hr||CC(a,u,ce,p,ne,se,j)||r!==null&&r.dependencies!==null&&rd(r.dependencies))?(te||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,se,j),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,se,j)),typeof S.componentDidUpdate=="function"&&(a.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof S.componentDidUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(a.flags|=1024),a.memoizedProps=p,a.memoizedState=se),S.props=p,S.state=se,S.context=j,p=ce):(typeof S.componentDidUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ne===r.memoizedState||(a.flags|=1024),p=!1)}return S=p,Ed(r,a),p=(a.flags&128)!==0,S||p?(S=a.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:S.render(),a.flags|=1,r!==null&&p?(a.child=Jo(a,r.child,null,y),a.child=Jo(a,null,u,y)):Kn(r,a,u,y),a.memoizedState=S.state,r=a.child):r=fr(r,a,y),r}function _C(r,a,u,p){return Yo(),a.flags|=256,Kn(r,a,u,p),a.child}var wy={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cy(r){return{baseLanes:r,cachePool:M1()}}function Ey(r,a,u){return r=r!==null?r.childLanes&~u:0,a&&(r|=ki),r}function HC(r,a,u){var p=a.pendingProps,y=!1,S=(a.flags&128)!==0,R;if((R=S)||(R=r!==null&&r.memoizedState===null?!1:(yn.current&2)!==0),R&&(y=!0,a.flags&=-129),R=(a.flags&32)!==0,a.flags&=-33,r===null){if(Mt){if(y?jr(a):Wr(),(r=rn)?(r=GE(r,Wi),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:Br!==null?{id:Ts,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=b1(r),u.return=a,a.child=u,jn=a,rn=null)):r=null,r===null)throw zr(a);return o0(r)?a.lanes=32:a.lanes=536870912,null}var N=p.children;return p=p.fallback,y?(Wr(),y=a.mode,N=Td({mode:"hidden",children:N},y),p=qo(p,y,u,null),N.return=a,p.return=a,N.sibling=p,a.child=N,p=a.child,p.memoizedState=Cy(u),p.childLanes=Ey(r,R,u),a.memoizedState=wy,_c(null,p)):(jr(a),Ty(a,N))}var j=r.memoizedState;if(j!==null&&(N=j.dehydrated,N!==null)){if(S)a.flags&256?(jr(a),a.flags&=-257,a=Ry(r,a,u)):a.memoizedState!==null?(Wr(),a.child=r.child,a.flags|=128,a=null):(Wr(),N=p.fallback,y=a.mode,p=Td({mode:"visible",children:p.children},y),N=qo(N,y,u,null),N.flags|=2,p.return=a,N.return=a,p.sibling=N,a.child=p,Jo(a,r.child,null,u),p=a.child,p.memoizedState=Cy(u),p.childLanes=Ey(r,R,u),a.memoizedState=wy,a=_c(null,p));else if(jr(a),o0(N)){if(R=N.nextSibling&&N.nextSibling.dataset,R)var te=R.dgst;R=te,p=Error(i(419)),p.stack="",p.digest=R,Ac({value:p,source:null,stack:null}),a=Ry(r,a,u)}else if(Cn||Yl(r,a,u,!1),R=(u&r.childLanes)!==0,Cn||R){if(R=Xt,R!==null&&(p=Vt(R,u),p!==0&&p!==j.retryLane))throw j.retryLane=p,Ko(r,p),bi(R,r,p),Sy;r0(N)||Id(),a=Ry(r,a,u)}else r0(N)?(a.flags|=192,a.child=r.child,a=null):(r=j.treeContext,rn=qi(N.nextSibling),jn=a,Mt=!0,Vr=null,Wi=!1,r!==null&&w1(a,r),a=Ty(a,p.children),a.flags|=4096);return a}return y?(Wr(),N=p.fallback,y=a.mode,j=r.child,te=j.sibling,p=rr(j,{mode:"hidden",children:p.children}),p.subtreeFlags=j.subtreeFlags&65011712,te!==null?N=rr(te,N):(N=qo(N,y,u,null),N.flags|=2),N.return=a,p.return=a,p.sibling=N,a.child=p,_c(null,p),p=a.child,N=r.child.memoizedState,N===null?N=Cy(u):(y=N.cachePool,y!==null?(j=xn._currentValue,y=y.parent!==j?{parent:j,pool:j}:y):y=M1(),N={baseLanes:N.baseLanes|u,cachePool:y}),p.memoizedState=N,p.childLanes=Ey(r,R,u),a.memoizedState=wy,_c(r.child,p)):(jr(a),u=r.child,r=u.sibling,u=rr(u,{mode:"visible",children:p.children}),u.return=a,u.sibling=null,r!==null&&(R=a.deletions,R===null?(a.deletions=[r],a.flags|=16):R.push(r)),a.child=u,a.memoizedState=null,u)}function Ty(r,a){return a=Td({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function Td(r,a){return r=Ai(22,r,null,a),r.lanes=0,r}function Ry(r,a,u){return Jo(a,r.child,null,u),r=Ty(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function FC(r,a,u){r.lanes|=a;var p=r.alternate;p!==null&&(p.lanes|=a),Fg(r.return,a,u)}function Ay(r,a,u,p,y,S){var R=r.memoizedState;R===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:S}:(R.isBackwards=a,R.rendering=null,R.renderingStartTime=0,R.last=p,R.tail=u,R.tailMode=y,R.treeForkCount=S)}function UC(r,a,u){var p=a.pendingProps,y=p.revealOrder,S=p.tail;p=p.children;var R=yn.current,N=(R&2)!==0;if(N?(R=R&1|2,a.flags|=128):R&=1,U(yn,R),Kn(r,a,p,u),p=Mt?Rc:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&FC(r,u,a);else if(r.tag===19)FC(r,u,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(y){case"forwards":for(u=a.child,y=null;u!==null;)r=u.alternate,r!==null&&hd(r)===null&&(y=u),u=u.sibling;u=y,u===null?(y=a.child,a.child=null):(y=u.sibling,u.sibling=null),Ay(a,!1,y,u,S,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=a.child,a.child=null;y!==null;){if(r=y.alternate,r!==null&&hd(r)===null){a.child=y;break}r=y.sibling,y.sibling=u,u=y,y=r}Ay(a,!0,u,null,S,p);break;case"together":Ay(a,!1,null,null,void 0,p);break;default:a.memoizedState=null}return a.child}function fr(r,a,u){if(r!==null&&(a.dependencies=r.dependencies),Yr|=a.lanes,(u&a.childLanes)===0)if(r!==null){if(Yl(r,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(i(153));if(a.child!==null){for(r=a.child,u=rr(r,r.pendingProps),a.child=u,u.return=a;r.sibling!==null;)r=r.sibling,u=u.sibling=rr(r,r.pendingProps),u.return=a;u.sibling=null}return a.child}function My(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&rd(r)))}function Kz(r,a,u){switch(a.tag){case 3:ie(a,a.stateNode.containerInfo),_r(a,xn,r.memoizedState.cache),Yo();break;case 27:case 5:Se(a);break;case 4:ie(a,a.stateNode.containerInfo);break;case 10:_r(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Jg(a),null;break;case 13:var p=a.memoizedState;if(p!==null)return p.dehydrated!==null?(jr(a),a.flags|=128,null):(u&a.child.childLanes)!==0?HC(r,a,u):(jr(a),r=fr(r,a,u),r!==null?r.sibling:null);jr(a);break;case 19:var y=(r.flags&128)!==0;if(p=(u&a.childLanes)!==0,p||(Yl(r,a,u,!1),p=(u&a.childLanes)!==0),y){if(p)return UC(r,a,u);a.flags|=128}if(y=a.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),U(yn,yn.current),p)break;return null;case 22:return a.lanes=0,IC(r,a,u,a.pendingProps);case 24:_r(a,xn,r.memoizedState.cache)}return fr(r,a,u)}function jC(r,a,u){if(r!==null)if(r.memoizedProps!==a.pendingProps)Cn=!0;else{if(!My(r,u)&&(a.flags&128)===0)return Cn=!1,Kz(r,a,u);Cn=(r.flags&131072)!==0}else Cn=!1,Mt&&(a.flags&1048576)!==0&&x1(a,Rc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var p=a.pendingProps;if(r=Qo(a.elementType),a.type=r,typeof r=="function")Ng(r)?(p=tl(r,p),a.tag=1,a=zC(null,a,r,p,u)):(a.tag=0,a=xy(null,a,r,p,u));else{if(r!=null){var y=r.$$typeof;if(y===D){a.tag=11,a=kC(null,a,r,p,u);break e}else if(y===k){a.tag=14,a=PC(null,a,r,p,u);break e}}throw a=_(r)||r,Error(i(306,a,""))}}return a;case 0:return xy(r,a,a.type,a.pendingProps,u);case 1:return p=a.type,y=tl(p,a.pendingProps),zC(r,a,p,y,u);case 3:e:{if(ie(a,a.stateNode.containerInfo),r===null)throw Error(i(387));p=a.pendingProps;var S=a.memoizedState;y=S.element,Gg(r,a),Ic(a,p,null,u);var R=a.memoizedState;if(p=R.cache,_r(a,xn,p),p!==S.cache&&Ug(a,[xn],u,!0),Nc(),p=R.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:R.cache},a.updateQueue.baseState=S,a.memoizedState=S,a.flags&256){a=_C(r,a,p,u);break e}else if(p!==y){y=Fi(Error(i(424)),a),Ac(y),a=_C(r,a,p,u);break e}else for(r=a.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,rn=qi(r.firstChild),jn=a,Mt=!0,Vr=null,Wi=!0,u=I1(a,null,p,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Yo(),p===y){a=fr(r,a,u);break e}Kn(r,a,p,u)}a=a.child}return a;case 26:return Ed(r,a),r===null?(u=eT(a.type,null,a.pendingProps,null))?a.memoizedState=u:Mt||(u=a.type,r=a.pendingProps,p=Fd(J.current).createElement(u),p[hn]=a,p[ri]=r,qn(p,u,r),Vn(p),a.stateNode=p):a.memoizedState=eT(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return Se(a),r===null&&Mt&&(p=a.stateNode=QE(a.type,a.pendingProps,J.current),jn=a,Wi=!0,y=rn,Zr(a.type)?(l0=y,rn=qi(p.firstChild)):rn=y),Kn(r,a,a.pendingProps.children,u),Ed(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&Mt&&((y=p=rn)&&(p=x3(p,a.type,a.pendingProps,Wi),p!==null?(a.stateNode=p,jn=a,rn=qi(p.firstChild),Wi=!1,y=!0):y=!1),y||zr(a)),Se(a),y=a.type,S=a.pendingProps,R=r!==null?r.memoizedProps:null,p=S.children,n0(y,S)?p=null:R!==null&&n0(y,R)&&(a.flags|=32),a.memoizedState!==null&&(y=ty(r,a,Bz,null,null,u),eu._currentValue=y),Ed(r,a),Kn(r,a,p,u),a.child;case 6:return r===null&&Mt&&((r=u=rn)&&(u=w3(u,a.pendingProps,Wi),u!==null?(a.stateNode=u,jn=a,rn=null,r=!0):r=!1),r||zr(a)),null;case 13:return HC(r,a,u);case 4:return ie(a,a.stateNode.containerInfo),p=a.pendingProps,r===null?a.child=Jo(a,null,p,u):Kn(r,a,p,u),a.child;case 11:return kC(r,a,a.type,a.pendingProps,u);case 7:return Kn(r,a,a.pendingProps,u),a.child;case 8:return Kn(r,a,a.pendingProps.children,u),a.child;case 12:return Kn(r,a,a.pendingProps.children,u),a.child;case 10:return p=a.pendingProps,_r(a,a.type,p.value),Kn(r,a,p.children,u),a.child;case 9:return y=a.type._context,p=a.pendingProps.children,Xo(a),y=Wn(y),p=p(y),a.flags|=1,Kn(r,a,p,u),a.child;case 14:return PC(r,a,a.type,a.pendingProps,u);case 15:return NC(r,a,a.type,a.pendingProps,u);case 19:return UC(r,a,u);case 31:return Wz(r,a,u);case 22:return IC(r,a,u,a.pendingProps);case 24:return Xo(a),p=Wn(xn),r===null?(y=Kg(),y===null&&(y=Xt,S=jg(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),a.memoizedState={parent:p,cache:y},Yg(a),_r(a,xn,y)):((r.lanes&u)!==0&&(Gg(r,a),Ic(a,null,null,u),Nc()),y=r.memoizedState,S=a.memoizedState,y.parent!==p?(y={parent:p,cache:p},a.memoizedState=y,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=y),_r(a,xn,p)):(p=S.cache,_r(a,xn,p),p!==y.cache&&Ug(a,[xn],u,!0))),Kn(r,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function dr(r){r.flags|=4}function Oy(r,a,u,p,y){if((a=(r.mode&32)!==0)&&(a=!1),a){if(r.flags|=16777216,(y&335544128)===y)if(r.stateNode.complete)r.flags|=8192;else if(gE())r.flags|=8192;else throw Zo=cd,qg}else r.flags&=-16777217}function WC(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!rT(a))if(gE())r.flags|=8192;else throw Zo=cd,qg}function Rd(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?gt():536870912,r.lanes|=a,ra|=a)}function Hc(r,a){if(!Mt)switch(r.tailMode){case"hidden":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:p.sibling=null}}function on(r){var a=r.alternate!==null&&r.alternate.child===r.child,u=0,p=0;if(a)for(var y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=r,y=y.sibling;else for(y=r.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=r,y=y.sibling;return r.subtreeFlags|=p,r.childLanes=u,a}function qz(r,a,u){var p=a.pendingProps;switch(Vg(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(a),null;case 1:return on(a),null;case 3:return u=a.stateNode,p=null,r!==null&&(p=r.memoizedState.cache),a.memoizedState.cache!==p&&(a.flags|=2048),ar(xn),de(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(ql(a)?dr(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,_g())),on(a),null;case 26:var y=a.type,S=a.memoizedState;return r===null?(dr(a),S!==null?(on(a),WC(a,S)):(on(a),Oy(a,y,null,p,u))):S?S!==r.memoizedState?(dr(a),on(a),WC(a,S)):(on(a),a.flags&=-16777217):(r=r.memoizedProps,r!==p&&dr(a),on(a),Oy(a,y,r,p,u)),null;case 27:if(Fe(a),u=J.current,y=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==p&&dr(a);else{if(!p){if(a.stateNode===null)throw Error(i(166));return on(a),null}r=$.current,ql(a)?C1(a):(r=QE(y,p,u),a.stateNode=r,dr(a))}return on(a),null;case 5:if(Fe(a),y=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==p&&dr(a);else{if(!p){if(a.stateNode===null)throw Error(i(166));return on(a),null}if(S=$.current,ql(a))C1(a);else{var R=Fd(J.current);switch(S){case 1:S=R.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=R.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=R.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=R.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?R.createElement("select",{is:p.is}):R.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?R.createElement(y,{is:p.is}):R.createElement(y)}}S[hn]=a,S[ri]=p;e:for(R=a.child;R!==null;){if(R.tag===5||R.tag===6)S.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===a)break e;for(;R.sibling===null;){if(R.return===null||R.return===a)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}a.stateNode=S;e:switch(qn(S,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&dr(a)}}return on(a),Oy(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,u),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==p&&dr(a);else{if(typeof p!="string"&&a.stateNode===null)throw Error(i(166));if(r=J.current,ql(a)){if(r=a.stateNode,u=a.memoizedProps,p=null,y=jn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}r[hn]=a,r=!!(r.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||HE(r.nodeValue,u)),r||zr(a,!0)}else r=Fd(r).createTextNode(p),r[hn]=a,a.stateNode=r}return on(a),null;case 31:if(u=a.memoizedState,r===null||r.memoizedState!==null){if(p=ql(a),u!==null){if(r===null){if(!p)throw Error(i(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[hn]=a}else Yo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;on(a),r=!1}else u=_g(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return a.flags&256?(Oi(a),a):(Oi(a),null);if((a.flags&128)!==0)throw Error(i(558))}return on(a),null;case 13:if(p=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(y=ql(a),p!==null&&p.dehydrated!==null){if(r===null){if(!y)throw Error(i(318));if(y=a.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[hn]=a}else Yo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;on(a),y=!1}else y=_g(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=y),y=!0;if(!y)return a.flags&256?(Oi(a),a):(Oi(a),null)}return Oi(a),(a.flags&128)!==0?(a.lanes=u,a):(u=p!==null,r=r!==null&&r.memoizedState!==null,u&&(p=a.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==y&&(p.flags|=2048)),u!==r&&u&&(a.child.flags|=8192),Rd(a,a.updateQueue),on(a),null);case 4:return de(),r===null&&Qy(a.stateNode.containerInfo),on(a),null;case 10:return ar(a.type),on(a),null;case 19:if(V(yn),p=a.memoizedState,p===null)return on(a),null;if(y=(a.flags&128)!==0,S=p.rendering,S===null)if(y)Hc(p,!1);else{if(mn!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(S=hd(r),S!==null){for(a.flags|=128,Hc(p,!1),r=S.updateQueue,a.updateQueue=r,Rd(a,r),a.subtreeFlags=0,r=u,u=a.child;u!==null;)v1(u,r),u=u.sibling;return U(yn,yn.current&1|2),Mt&&or(a,p.treeForkCount),a.child}r=r.sibling}p.tail!==null&&oe()>kd&&(a.flags|=128,y=!0,Hc(p,!1),a.lanes=4194304)}else{if(!y)if(r=hd(S),r!==null){if(a.flags|=128,y=!0,r=r.updateQueue,a.updateQueue=r,Rd(a,r),Hc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Mt)return on(a),null}else 2*oe()-p.renderingStartTime>kd&&u!==536870912&&(a.flags|=128,y=!0,Hc(p,!1),a.lanes=4194304);p.isBackwards?(S.sibling=a.child,a.child=S):(r=p.last,r!==null?r.sibling=S:a.child=S,p.last=S)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=oe(),r.sibling=null,u=yn.current,U(yn,y?u&1|2:u&1),Mt&&or(a,p.treeForkCount),r):(on(a),null);case 22:case 23:return Oi(a),Zg(),p=a.memoizedState!==null,r!==null?r.memoizedState!==null!==p&&(a.flags|=8192):p&&(a.flags|=8192),p?(u&536870912)!==0&&(a.flags&128)===0&&(on(a),a.subtreeFlags&6&&(a.flags|=8192)):on(a),u=a.updateQueue,u!==null&&Rd(a,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),p=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(p=a.memoizedState.cachePool.pool),p!==u&&(a.flags|=2048),r!==null&&V($o),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),ar(xn),on(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function Yz(r,a){switch(Vg(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return ar(xn),de(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Fe(a),null;case 31:if(a.memoizedState!==null){if(Oi(a),a.alternate===null)throw Error(i(340));Yo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Oi(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(i(340));Yo()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return V(yn),null;case 4:return de(),null;case 10:return ar(a.type),null;case 22:case 23:return Oi(a),Zg(),r!==null&&V($o),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return ar(xn),null;case 25:return null;default:return null}}function KC(r,a){switch(Vg(a),a.tag){case 3:ar(xn),de();break;case 26:case 27:case 5:Fe(a);break;case 4:de();break;case 31:a.memoizedState!==null&&Oi(a);break;case 13:Oi(a);break;case 19:V(yn);break;case 10:ar(a.type);break;case 22:case 23:Oi(a),Zg(),r!==null&&V($o);break;case 24:ar(xn)}}function Fc(r,a){try{var u=a.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&r)===r){p=void 0;var S=u.create,R=u.inst;p=S(),R.destroy=p}u=u.next}while(u!==y)}}catch(N){Ft(a,a.return,N)}}function Kr(r,a,u){try{var p=a.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var S=y.next;p=S;do{if((p.tag&r)===r){var R=p.inst,N=R.destroy;if(N!==void 0){R.destroy=void 0,y=a;var j=u,te=N;try{te()}catch(ce){Ft(y,j,ce)}}}p=p.next}while(p!==S)}}catch(ce){Ft(a,a.return,ce)}}function qC(r){var a=r.updateQueue;if(a!==null){var u=r.stateNode;try{B1(a,u)}catch(p){Ft(r,r.return,p)}}}function YC(r,a,u){u.props=tl(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(p){Ft(r,a,p)}}function Uc(r,a){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var p=r.stateNode;break;case 30:p=r.stateNode;break;default:p=r.stateNode}typeof u=="function"?r.refCleanup=u(p):u.current=p}}catch(y){Ft(r,a,y)}}function As(r,a){var u=r.ref,p=r.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){Ft(r,a,y)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Ft(r,a,y)}else u.current=null}function GC(r){var a=r.type,u=r.memoizedProps,p=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){Ft(r,r.return,y)}}function Dy(r,a,u){try{var p=r.stateNode;m3(p,r.type,u,a),p[ri]=a}catch(y){Ft(r,r.return,y)}}function XC(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Zr(r.type)||r.tag===4}function ky(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||XC(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Zr(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Py(r,a,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(r),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=ir));else if(p!==4&&(p===27&&Zr(r.type)&&(u=r.stateNode,a=null),r=r.child,r!==null))for(Py(r,a,u),r=r.sibling;r!==null;)Py(r,a,u),r=r.sibling}function Ad(r,a,u){var p=r.tag;if(p===5||p===6)r=r.stateNode,a?u.insertBefore(r,a):u.appendChild(r);else if(p!==4&&(p===27&&Zr(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(Ad(r,a,u),r=r.sibling;r!==null;)Ad(r,a,u),r=r.sibling}function $C(r){var a=r.stateNode,u=r.memoizedProps;try{for(var p=r.type,y=a.attributes;y.length;)a.removeAttributeNode(y[0]);qn(a,p,u),a[hn]=r,a[ri]=u}catch(S){Ft(r,r.return,S)}}var hr=!1,En=!1,Ny=!1,QC=typeof WeakSet=="function"?WeakSet:Set,zn=null;function Gz(r,a){if(r=r.containerInfo,e0=Gd,r=c1(r),Rg(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var R=0,N=-1,j=-1,te=0,ce=0,ge=r,ne=null;t:for(;;){for(var se;ge!==u||y!==0&&ge.nodeType!==3||(N=R+y),ge!==S||p!==0&&ge.nodeType!==3||(j=R+p),ge.nodeType===3&&(R+=ge.nodeValue.length),(se=ge.firstChild)!==null;)ne=ge,ge=se;for(;;){if(ge===r)break t;if(ne===u&&++te===y&&(N=R),ne===S&&++ce===p&&(j=R),(se=ge.nextSibling)!==null)break;ge=ne,ne=ge.parentNode}ge=se}u=N===-1||j===-1?null:{start:N,end:j}}else u=null}u=u||{start:0,end:0}}else u=null;for(t0={focusedElem:r,selectionRange:u},Gd=!1,zn=a;zn!==null;)if(a=zn,r=a.child,(a.subtreeFlags&1028)!==0&&r!==null)r.return=a,zn=r;else for(;zn!==null;){switch(a=zn,S=a.alternate,r=a.flags,a.tag){case 0:if((r&4)!==0&&(r=a.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)y=r[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&S!==null){r=void 0,u=a,y=S.memoizedProps,S=S.memoizedState,p=u.stateNode;try{var Be=tl(u.type,y);r=p.getSnapshotBeforeUpdate(Be,S),p.__reactInternalSnapshotBeforeUpdate=r}catch($e){Ft(u,u.return,$e)}}break;case 3:if((r&1024)!==0){if(r=a.stateNode.containerInfo,u=r.nodeType,u===9)s0(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":s0(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=a.sibling,r!==null){r.return=a.return,zn=r;break}zn=a.return}}function ZC(r,a,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:mr(r,u),p&4&&Fc(5,u);break;case 1:if(mr(r,u),p&4)if(r=u.stateNode,a===null)try{r.componentDidMount()}catch(R){Ft(u,u.return,R)}else{var y=tl(u.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(y,a,r.__reactInternalSnapshotBeforeUpdate)}catch(R){Ft(u,u.return,R)}}p&64&&qC(u),p&512&&Uc(u,u.return);break;case 3:if(mr(r,u),p&64&&(r=u.updateQueue,r!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{B1(r,a)}catch(R){Ft(u,u.return,R)}}break;case 27:a===null&&p&4&&$C(u);case 26:case 5:mr(r,u),a===null&&p&4&&GC(u),p&512&&Uc(u,u.return);break;case 12:mr(r,u);break;case 31:mr(r,u),p&4&&tE(r,u);break;case 13:mr(r,u),p&4&&nE(r,u),p&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=i3.bind(null,u),C3(r,u))));break;case 22:if(p=u.memoizedState!==null||hr,!p){a=a!==null&&a.memoizedState!==null||En,y=hr;var S=En;hr=p,(En=a)&&!S?gr(r,u,(u.subtreeFlags&8772)!==0):mr(r,u),hr=y,En=S}break;case 30:break;default:mr(r,u)}}function JC(r){var a=r.alternate;a!==null&&(r.alternate=null,JC(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&cg(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var cn=null,mi=!1;function pr(r,a,u){for(u=u.child;u!==null;)eE(r,a,u),u=u.sibling}function eE(r,a,u){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(je,u)}catch{}switch(u.tag){case 26:En||As(u,a),pr(r,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:En||As(u,a);var p=cn,y=mi;Zr(u.type)&&(cn=u.stateNode,mi=!1),pr(r,a,u),Qc(u.stateNode),cn=p,mi=y;break;case 5:En||As(u,a);case 6:if(p=cn,y=mi,cn=null,pr(r,a,u),cn=p,mi=y,cn!==null)if(mi)try{(cn.nodeType===9?cn.body:cn.nodeName==="HTML"?cn.ownerDocument.body:cn).removeChild(u.stateNode)}catch(S){Ft(u,a,S)}else try{cn.removeChild(u.stateNode)}catch(S){Ft(u,a,S)}break;case 18:cn!==null&&(mi?(r=cn,qE(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),ha(r)):qE(cn,u.stateNode));break;case 4:p=cn,y=mi,cn=u.stateNode.containerInfo,mi=!0,pr(r,a,u),cn=p,mi=y;break;case 0:case 11:case 14:case 15:Kr(2,u,a),En||Kr(4,u,a),pr(r,a,u);break;case 1:En||(As(u,a),p=u.stateNode,typeof p.componentWillUnmount=="function"&&YC(u,a,p)),pr(r,a,u);break;case 21:pr(r,a,u);break;case 22:En=(p=En)||u.memoizedState!==null,pr(r,a,u),En=p;break;default:pr(r,a,u)}}function tE(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ha(r)}catch(u){Ft(a,a.return,u)}}}function nE(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ha(r)}catch(u){Ft(a,a.return,u)}}function Xz(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new QC),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new QC),a;default:throw Error(i(435,r.tag))}}function Md(r,a){var u=Xz(r);a.forEach(function(p){if(!u.has(p)){u.add(p);var y=s3.bind(null,r,p);p.then(y,y)}})}function gi(r,a){var u=a.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],S=r,R=a,N=R;e:for(;N!==null;){switch(N.tag){case 27:if(Zr(N.type)){cn=N.stateNode,mi=!1;break e}break;case 5:cn=N.stateNode,mi=!1;break e;case 3:case 4:cn=N.stateNode.containerInfo,mi=!0;break e}N=N.return}if(cn===null)throw Error(i(160));eE(S,R,y),cn=null,mi=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)iE(a,r),a=a.sibling}var cs=null;function iE(r,a){var u=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:gi(a,r),yi(r),p&4&&(Kr(3,r,r.return),Fc(3,r),Kr(5,r,r.return));break;case 1:gi(a,r),yi(r),p&512&&(En||u===null||As(u,u.return)),p&64&&hr&&(r=r.updateQueue,r!==null&&(p=r.callbacks,p!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=cs;if(gi(a,r),yi(r),p&512&&(En||u===null||As(u,u.return)),p&4){var S=u!==null?u.memoizedState:null;if(p=r.memoizedState,u===null)if(p===null)if(r.stateNode===null){e:{p=r.type,u=r.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":S=y.getElementsByTagName("title")[0],(!S||S[mc]||S[hn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(p),y.head.insertBefore(S,y.querySelector("head > title"))),qn(S,p,u),S[hn]=r,Vn(S),p=S;break e;case"link":var R=iT("link","href",y).get(p+(u.href||""));if(R){for(var N=0;N<R.length;N++)if(S=R[N],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){R.splice(N,1);break t}}S=y.createElement(p),qn(S,p,u),y.head.appendChild(S);break;case"meta":if(R=iT("meta","content",y).get(p+(u.content||""))){for(N=0;N<R.length;N++)if(S=R[N],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){R.splice(N,1);break t}}S=y.createElement(p),qn(S,p,u),y.head.appendChild(S);break;default:throw Error(i(468,p))}S[hn]=r,Vn(S),p=S}r.stateNode=p}else sT(y,r.type,r.stateNode);else r.stateNode=nT(y,p,r.memoizedProps);else S!==p?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,p===null?sT(y,r.type,r.stateNode):nT(y,p,r.memoizedProps)):p===null&&r.stateNode!==null&&Dy(r,r.memoizedProps,u.memoizedProps)}break;case 27:gi(a,r),yi(r),p&512&&(En||u===null||As(u,u.return)),u!==null&&p&4&&Dy(r,r.memoizedProps,u.memoizedProps);break;case 5:if(gi(a,r),yi(r),p&512&&(En||u===null||As(u,u.return)),r.flags&32){y=r.stateNode;try{Bl(y,"")}catch(Be){Ft(r,r.return,Be)}}p&4&&r.stateNode!=null&&(y=r.memoizedProps,Dy(r,y,u!==null?u.memoizedProps:y)),p&1024&&(Ny=!0);break;case 6:if(gi(a,r),yi(r),p&4){if(r.stateNode===null)throw Error(i(162));p=r.memoizedProps,u=r.stateNode;try{u.nodeValue=p}catch(Be){Ft(r,r.return,Be)}}break;case 3:if(Wd=null,y=cs,cs=Ud(a.containerInfo),gi(a,r),cs=y,yi(r),p&4&&u!==null&&u.memoizedState.isDehydrated)try{ha(a.containerInfo)}catch(Be){Ft(r,r.return,Be)}Ny&&(Ny=!1,sE(r));break;case 4:p=cs,cs=Ud(r.stateNode.containerInfo),gi(a,r),yi(r),cs=p;break;case 12:gi(a,r),yi(r);break;case 31:gi(a,r),yi(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Md(r,p)));break;case 13:gi(a,r),yi(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Dd=oe()),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Md(r,p)));break;case 22:y=r.memoizedState!==null;var j=u!==null&&u.memoizedState!==null,te=hr,ce=En;if(hr=te||y,En=ce||j,gi(a,r),En=ce,hr=te,yi(r),p&8192)e:for(a=r.stateNode,a._visibility=y?a._visibility&-2:a._visibility|1,y&&(u===null||j||hr||En||nl(r)),u=null,a=r;;){if(a.tag===5||a.tag===26){if(u===null){j=u=a;try{if(S=j.stateNode,y)R=S.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{N=j.stateNode;var ge=j.memoizedProps.style,ne=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;N.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Be){Ft(j,j.return,Be)}}}else if(a.tag===6){if(u===null){j=a;try{j.stateNode.nodeValue=y?"":j.memoizedProps}catch(Be){Ft(j,j.return,Be)}}}else if(a.tag===18){if(u===null){j=a;try{var se=j.stateNode;y?YE(se,!0):YE(j.stateNode,!1)}catch(Be){Ft(j,j.return,Be)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===r)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}p&4&&(p=r.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Md(r,u))));break;case 19:gi(a,r),yi(r),p&4&&(p=r.updateQueue,p!==null&&(r.updateQueue=null,Md(r,p)));break;case 30:break;case 21:break;default:gi(a,r),yi(r)}}function yi(r){var a=r.flags;if(a&2){try{for(var u,p=r.return;p!==null;){if(XC(p)){u=p;break}p=p.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var y=u.stateNode,S=ky(r);Ad(r,S,y);break;case 5:var R=u.stateNode;u.flags&32&&(Bl(R,""),u.flags&=-33);var N=ky(r);Ad(r,N,R);break;case 3:case 4:var j=u.stateNode.containerInfo,te=ky(r);Py(r,te,j);break;default:throw Error(i(161))}}catch(ce){Ft(r,r.return,ce)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function sE(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;sE(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),r=r.sibling}}function mr(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)ZC(r,a.alternate,a),a=a.sibling}function nl(r){for(r=r.child;r!==null;){var a=r;switch(a.tag){case 0:case 11:case 14:case 15:Kr(4,a,a.return),nl(a);break;case 1:As(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&YC(a,a.return,u),nl(a);break;case 27:Qc(a.stateNode);case 26:case 5:As(a,a.return),nl(a);break;case 22:a.memoizedState===null&&nl(a);break;case 30:nl(a);break;default:nl(a)}r=r.sibling}}function gr(r,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var p=a.alternate,y=r,S=a,R=S.flags;switch(S.tag){case 0:case 11:case 15:gr(y,S,u),Fc(4,S);break;case 1:if(gr(y,S,u),p=S,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){Ft(p,p.return,te)}if(p=S,y=p.updateQueue,y!==null){var N=p.stateNode;try{var j=y.shared.hiddenCallbacks;if(j!==null)for(y.shared.hiddenCallbacks=null,y=0;y<j.length;y++)L1(j[y],N)}catch(te){Ft(p,p.return,te)}}u&&R&64&&qC(S),Uc(S,S.return);break;case 27:$C(S);case 26:case 5:gr(y,S,u),u&&p===null&&R&4&&GC(S),Uc(S,S.return);break;case 12:gr(y,S,u);break;case 31:gr(y,S,u),u&&R&4&&tE(y,S);break;case 13:gr(y,S,u),u&&R&4&&nE(y,S);break;case 22:S.memoizedState===null&&gr(y,S,u),Uc(S,S.return);break;case 30:break;default:gr(y,S,u)}a=a.sibling}}function Iy(r,a){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&Mc(u))}function Ly(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Mc(r))}function us(r,a,u,p){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)rE(r,a,u,p),a=a.sibling}function rE(r,a,u,p){var y=a.flags;switch(a.tag){case 0:case 11:case 15:us(r,a,u,p),y&2048&&Fc(9,a);break;case 1:us(r,a,u,p);break;case 3:us(r,a,u,p),y&2048&&(r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&Mc(r)));break;case 12:if(y&2048){us(r,a,u,p),r=a.stateNode;try{var S=a.memoizedProps,R=S.id,N=S.onPostCommit;typeof N=="function"&&N(R,a.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(j){Ft(a,a.return,j)}}else us(r,a,u,p);break;case 31:us(r,a,u,p);break;case 13:us(r,a,u,p);break;case 23:break;case 22:S=a.stateNode,R=a.alternate,a.memoizedState!==null?S._visibility&2?us(r,a,u,p):jc(r,a):S._visibility&2?us(r,a,u,p):(S._visibility|=2,na(r,a,u,p,(a.subtreeFlags&10256)!==0||!1)),y&2048&&Iy(R,a);break;case 24:us(r,a,u,p),y&2048&&Ly(a.alternate,a);break;default:us(r,a,u,p)}}function na(r,a,u,p,y){for(y=y&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var S=r,R=a,N=u,j=p,te=R.flags;switch(R.tag){case 0:case 11:case 15:na(S,R,N,j,y),Fc(8,R);break;case 23:break;case 22:var ce=R.stateNode;R.memoizedState!==null?ce._visibility&2?na(S,R,N,j,y):jc(S,R):(ce._visibility|=2,na(S,R,N,j,y)),y&&te&2048&&Iy(R.alternate,R);break;case 24:na(S,R,N,j,y),y&&te&2048&&Ly(R.alternate,R);break;default:na(S,R,N,j,y)}a=a.sibling}}function jc(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=r,p=a,y=p.flags;switch(p.tag){case 22:jc(u,p),y&2048&&Iy(p.alternate,p);break;case 24:jc(u,p),y&2048&&Ly(p.alternate,p);break;default:jc(u,p)}a=a.sibling}}var Wc=8192;function ia(r,a,u){if(r.subtreeFlags&Wc)for(r=r.child;r!==null;)oE(r,a,u),r=r.sibling}function oE(r,a,u){switch(r.tag){case 26:ia(r,a,u),r.flags&Wc&&r.memoizedState!==null&&L3(u,cs,r.memoizedState,r.memoizedProps);break;case 5:ia(r,a,u);break;case 3:case 4:var p=cs;cs=Ud(r.stateNode.containerInfo),ia(r,a,u),cs=p;break;case 22:r.memoizedState===null&&(p=r.alternate,p!==null&&p.memoizedState!==null?(p=Wc,Wc=16777216,ia(r,a,u),Wc=p):ia(r,a,u));break;default:ia(r,a,u)}}function lE(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function Kc(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var p=a[u];zn=p,cE(p,r)}lE(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)aE(r),r=r.sibling}function aE(r){switch(r.tag){case 0:case 11:case 15:Kc(r),r.flags&2048&&Kr(9,r,r.return);break;case 3:Kc(r);break;case 12:Kc(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,Od(r)):Kc(r);break;default:Kc(r)}}function Od(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var p=a[u];zn=p,cE(p,r)}lE(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:Kr(8,a,a.return),Od(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,Od(a));break;default:Od(a)}r=r.sibling}}function cE(r,a){for(;zn!==null;){var u=zn;switch(u.tag){case 0:case 11:case 15:Kr(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Mc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,zn=p;else e:for(u=r;zn!==null;){p=zn;var y=p.sibling,S=p.return;if(JC(p),p===u){zn=null;break e}if(y!==null){y.return=S,zn=y;break e}zn=S}}}var $z={getCacheForType:function(r){var a=Wn(xn),u=a.data.get(r);return u===void 0&&(u=r(),a.data.set(r,u)),u},cacheSignal:function(){return Wn(xn).controller.signal}},Qz=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Xt=null,Ct=null,Rt=0,Ht=0,Di=null,qr=!1,sa=!1,By=!1,yr=0,mn=0,Yr=0,il=0,Vy=0,ki=0,ra=0,qc=null,vi=null,zy=!1,Dd=0,uE=0,kd=1/0,Pd=null,Gr=null,Nn=0,Xr=null,oa=null,vr=0,_y=0,Hy=null,fE=null,Yc=0,Fy=null;function Pi(){return(Lt&2)!==0&&Rt!==0?Rt&-Rt:I.T!==null?Yy():ln()}function dE(){if(ki===0)if((Rt&536870912)===0||Mt){var r=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),ki=r}else ki=536870912;return r=Mi.current,r!==null&&(r.flags|=32),ki}function bi(r,a,u){(r===Xt&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)&&(la(r,0),$r(r,Rt,ki,!1)),bt(r,u),((Lt&2)===0||r!==Xt)&&(r===Xt&&((Lt&2)===0&&(il|=u),mn===4&&$r(r,Rt,ki,!1)),Ms(r))}function hE(r,a,u){if((Lt&6)!==0)throw Error(i(327));var p=!u&&(a&127)===0&&(a&r.expiredLanes)===0||et(r,a),y=p?e3(r,a):jy(r,a,!0),S=p;do{if(y===0){sa&&!p&&$r(r,a,0,!1);break}else{if(u=r.current.alternate,S&&!Zz(u)){y=jy(r,a,!1),S=!1;continue}if(y===2){if(S=a,r.errorRecoveryDisabledLanes&S)var R=0;else R=r.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){a=R;e:{var N=r;y=qc;var j=N.current.memoizedState.isDehydrated;if(j&&(la(N,R).flags|=256),R=jy(N,R,!1),R!==2){if(By&&!j){N.errorRecoveryDisabledLanes|=S,il|=S,y=4;break e}S=vi,vi=y,S!==null&&(vi===null?vi=S:vi.push.apply(vi,S))}y=R}if(S=!1,y!==2)continue}}if(y===1){la(r,0),$r(r,a,0,!0);break}e:{switch(p=r,S=y,S){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:$r(p,a,ki,!qr);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(y=Dd+300-oe(),10<y)){if($r(p,a,ki,!qr),Pe(p,0,!0)!==0)break e;vr=a,p.timeoutHandle=WE(pE.bind(null,p,u,vi,Pd,zy,a,ki,il,ra,qr,S,"Throttled",-0,0),y);break e}pE(p,u,vi,Pd,zy,a,ki,il,ra,qr,S,null,-0,0)}}break}while(!0);Ms(r)}function pE(r,a,u,p,y,S,R,N,j,te,ce,ge,ne,se){if(r.timeoutHandle=-1,ge=a.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ir},oE(a,S,ge);var Be=(S&62914560)===S?Dd-oe():(S&4194048)===S?uE-oe():0;if(Be=B3(ge,Be),Be!==null){vr=S,r.cancelPendingCommit=Be(wE.bind(null,r,a,S,u,p,y,R,N,j,ce,ge,null,ne,se)),$r(r,S,R,!te);return}}wE(r,a,S,u,p,y,R,N,j)}function Zz(r){for(var a=r;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],S=y.getSnapshot;y=y.value;try{if(!Ri(S(),y))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function $r(r,a,u,p){a&=~Vy,a&=~il,r.suspendedLanes|=a,r.pingedLanes&=~a,p&&(r.warmLanes|=a),p=r.expirationTimes;for(var y=a;0<y;){var S=31-wt(y),R=1<<S;p[S]=-1,y&=~R}u!==0&&Gt(r,u,a)}function Nd(){return(Lt&6)===0?(Gc(0),!1):!0}function Uy(){if(Ct!==null){if(Ht===0)var r=Ct.return;else r=Ct,lr=Go=null,sy(r),Ql=null,Dc=0,r=Ct;for(;r!==null;)KC(r.alternate,r),r=r.return;Ct=null}}function la(r,a){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,v3(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),vr=0,Uy(),Xt=r,Ct=u=rr(r.current,null),Rt=a,Ht=0,Di=null,qr=!1,sa=et(r,a),By=!1,ra=ki=Vy=il=Yr=mn=0,vi=qc=null,zy=!1,(a&8)!==0&&(a|=a&32);var p=r.entangledLanes;if(p!==0)for(r=r.entanglements,p&=a;0<p;){var y=31-wt(p),S=1<<y;a|=r[y],p&=~S}return yr=a,ed(),u}function mE(r,a){ut=null,I.H=zc,a===$l||a===ad?(a=k1(),Ht=3):a===qg?(a=k1(),Ht=4):Ht=a===Sy?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Di=a,Ct===null&&(mn=1,wd(r,Fi(a,r.current)))}function gE(){var r=Mi.current;return r===null?!0:(Rt&4194048)===Rt?Ki===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?r===Ki:!1}function yE(){var r=I.H;return I.H=zc,r===null?zc:r}function vE(){var r=I.A;return I.A=$z,r}function Id(){mn=4,qr||(Rt&4194048)!==Rt&&Mi.current!==null||(sa=!0),(Yr&134217727)===0&&(il&134217727)===0||Xt===null||$r(Xt,Rt,ki,!1)}function jy(r,a,u){var p=Lt;Lt|=2;var y=yE(),S=vE();(Xt!==r||Rt!==a)&&(Pd=null,la(r,a)),a=!1;var R=mn;e:do try{if(Ht!==0&&Ct!==null){var N=Ct,j=Di;switch(Ht){case 8:Uy(),R=6;break e;case 3:case 2:case 9:case 6:Mi.current===null&&(a=!0);var te=Ht;if(Ht=0,Di=null,aa(r,N,j,te),u&&sa){R=0;break e}break;default:te=Ht,Ht=0,Di=null,aa(r,N,j,te)}}Jz(),R=mn;break}catch(ce){mE(r,ce)}while(!0);return a&&r.shellSuspendCounter++,lr=Go=null,Lt=p,I.H=y,I.A=S,Ct===null&&(Xt=null,Rt=0,ed()),R}function Jz(){for(;Ct!==null;)bE(Ct)}function e3(r,a){var u=Lt;Lt|=2;var p=yE(),y=vE();Xt!==r||Rt!==a?(Pd=null,kd=oe()+500,la(r,a)):sa=et(r,a);e:do try{if(Ht!==0&&Ct!==null){a=Ct;var S=Di;t:switch(Ht){case 1:Ht=0,Di=null,aa(r,a,S,1);break;case 2:case 9:if(O1(S)){Ht=0,Di=null,SE(a);break}a=function(){Ht!==2&&Ht!==9||Xt!==r||(Ht=7),Ms(r)},S.then(a,a);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:O1(S)?(Ht=0,Di=null,SE(a)):(Ht=0,Di=null,aa(r,a,S,7));break;case 5:var R=null;switch(Ct.tag){case 26:R=Ct.memoizedState;case 5:case 27:var N=Ct;if(R?rT(R):N.stateNode.complete){Ht=0,Di=null;var j=N.sibling;if(j!==null)Ct=j;else{var te=N.return;te!==null?(Ct=te,Ld(te)):Ct=null}break t}}Ht=0,Di=null,aa(r,a,S,5);break;case 6:Ht=0,Di=null,aa(r,a,S,6);break;case 8:Uy(),mn=6;break e;default:throw Error(i(462))}}t3();break}catch(ce){mE(r,ce)}while(!0);return lr=Go=null,I.H=p,I.A=y,Lt=u,Ct!==null?0:(Xt=null,Rt=0,ed(),mn)}function t3(){for(;Ct!==null&&!me();)bE(Ct)}function bE(r){var a=jC(r.alternate,r,yr);r.memoizedProps=r.pendingProps,a===null?Ld(r):Ct=a}function SE(r){var a=r,u=a.alternate;switch(a.tag){case 15:case 0:a=VC(u,a,a.pendingProps,a.type,void 0,Rt);break;case 11:a=VC(u,a,a.pendingProps,a.type.render,a.ref,Rt);break;case 5:sy(a);default:KC(u,a),a=Ct=v1(a,yr),a=jC(u,a,yr)}r.memoizedProps=r.pendingProps,a===null?Ld(r):Ct=a}function aa(r,a,u,p){lr=Go=null,sy(a),Ql=null,Dc=0;var y=a.return;try{if(jz(r,y,a,u,Rt)){mn=1,wd(r,Fi(u,r.current)),Ct=null;return}}catch(S){if(y!==null)throw Ct=y,S;mn=1,wd(r,Fi(u,r.current)),Ct=null;return}a.flags&32768?(Mt||p===1?r=!0:sa||(Rt&536870912)!==0?r=!1:(qr=r=!0,(p===2||p===9||p===3||p===6)&&(p=Mi.current,p!==null&&p.tag===13&&(p.flags|=16384))),xE(a,r)):Ld(a)}function Ld(r){var a=r;do{if((a.flags&32768)!==0){xE(a,qr);return}r=a.return;var u=qz(a.alternate,a,yr);if(u!==null){Ct=u;return}if(a=a.sibling,a!==null){Ct=a;return}Ct=a=r}while(a!==null);mn===0&&(mn=5)}function xE(r,a){do{var u=Yz(r.alternate,r);if(u!==null){u.flags&=32767,Ct=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(r=r.sibling,r!==null)){Ct=r;return}Ct=r=u}while(r!==null);mn=6,Ct=null}function wE(r,a,u,p,y,S,R,N,j){r.cancelPendingCommit=null;do Bd();while(Nn!==0);if((Lt&6)!==0)throw Error(i(327));if(a!==null){if(a===r.current)throw Error(i(177));if(S=a.lanes|a.childLanes,S|=kg,nt(r,u,S,R,N,j),r===Xt&&(Ct=Xt=null,Rt=0),oa=a,Xr=r,vr=u,_y=S,Hy=y,fE=p,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,r3(qe,function(){return AE(),null})):(r.callbackNode=null,r.callbackPriority=0),p=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||p){p=I.T,I.T=null,y=L.p,L.p=2,R=Lt,Lt|=4;try{Gz(r,a,u)}finally{Lt=R,L.p=y,I.T=p}}Nn=1,CE(),EE(),TE()}}function CE(){if(Nn===1){Nn=0;var r=Xr,a=oa,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var p=L.p;L.p=2;var y=Lt;Lt|=4;try{iE(a,r);var S=t0,R=c1(r.containerInfo),N=S.focusedElem,j=S.selectionRange;if(R!==N&&N&&N.ownerDocument&&a1(N.ownerDocument.documentElement,N)){if(j!==null&&Rg(N)){var te=j.start,ce=j.end;if(ce===void 0&&(ce=te),"selectionStart"in N)N.selectionStart=te,N.selectionEnd=Math.min(ce,N.value.length);else{var ge=N.ownerDocument||document,ne=ge&&ge.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Be=N.textContent.length,$e=Math.min(j.start,Be),Kt=j.end===void 0?$e:Math.min(j.end,Be);!se.extend&&$e>Kt&&(R=Kt,Kt=$e,$e=R);var Q=l1(N,$e),X=l1(N,Kt);if(Q&&X&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==X.node||se.focusOffset!==X.offset)){var ee=ge.createRange();ee.setStart(Q.node,Q.offset),se.removeAllRanges(),$e>Kt?(se.addRange(ee),se.extend(X.node,X.offset)):(ee.setEnd(X.node,X.offset),se.addRange(ee))}}}}for(ge=[],se=N;se=se.parentNode;)se.nodeType===1&&ge.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ge.length;N++){var he=ge[N];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Gd=!!e0,t0=e0=null}finally{Lt=y,L.p=p,I.T=u}}r.current=a,Nn=2}}function EE(){if(Nn===2){Nn=0;var r=Xr,a=oa,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var p=L.p;L.p=2;var y=Lt;Lt|=4;try{ZC(r,a.alternate,a)}finally{Lt=y,L.p=p,I.T=u}}Nn=3}}function TE(){if(Nn===4||Nn===3){Nn=0,ae();var r=Xr,a=oa,u=vr,p=fE;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Nn=5:(Nn=0,oa=Xr=null,RE(r,r.pendingLanes));var y=r.pendingLanes;if(y===0&&(Gr=null),lt(u),a=a.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(je,a,void 0,(a.current.flags&128)===128)}catch{}if(p!==null){a=I.T,y=L.p,L.p=2,I.T=null;try{for(var S=r.onRecoverableError,R=0;R<p.length;R++){var N=p[R];S(N.value,{componentStack:N.stack})}}finally{I.T=a,L.p=y}}(vr&3)!==0&&Bd(),Ms(r),y=r.pendingLanes,(u&261930)!==0&&(y&42)!==0?r===Fy?Yc++:(Yc=0,Fy=r):Yc=0,Gc(0)}}function RE(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,Mc(a)))}function Bd(){return CE(),EE(),TE(),AE()}function AE(){if(Nn!==5)return!1;var r=Xr,a=_y;_y=0;var u=lt(vr),p=I.T,y=L.p;try{L.p=32>u?32:u,I.T=null,u=Hy,Hy=null;var S=Xr,R=vr;if(Nn=0,oa=Xr=null,vr=0,(Lt&6)!==0)throw Error(i(331));var N=Lt;if(Lt|=4,aE(S.current),rE(S,S.current,R,u),Lt=N,Gc(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(je,S)}catch{}return!0}finally{L.p=y,I.T=p,RE(r,a)}}function ME(r,a,u){a=Fi(u,a),a=by(r.stateNode,a,2),r=Ur(r,a,2),r!==null&&(bt(r,2),Ms(r))}function Ft(r,a,u){if(r.tag===3)ME(r,r,u);else for(;a!==null;){if(a.tag===3){ME(a,r,u);break}else if(a.tag===1){var p=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Gr===null||!Gr.has(p))){r=Fi(u,r),u=OC(2),p=Ur(a,u,2),p!==null&&(DC(u,p,a,r),bt(p,2),Ms(p));break}}a=a.return}}function Wy(r,a,u){var p=r.pingCache;if(p===null){p=r.pingCache=new Qz;var y=new Set;p.set(a,y)}else y=p.get(a),y===void 0&&(y=new Set,p.set(a,y));y.has(u)||(By=!0,y.add(u),r=n3.bind(null,r,a,u),a.then(r,r))}function n3(r,a,u){var p=r.pingCache;p!==null&&p.delete(a),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,Xt===r&&(Rt&u)===u&&(mn===4||mn===3&&(Rt&62914560)===Rt&&300>oe()-Dd?(Lt&2)===0&&la(r,0):Vy|=u,ra===Rt&&(ra=0)),Ms(r)}function OE(r,a){a===0&&(a=gt()),r=Ko(r,a),r!==null&&(bt(r,a),Ms(r))}function i3(r){var a=r.memoizedState,u=0;a!==null&&(u=a.retryLane),OE(r,u)}function s3(r,a){var u=0;switch(r.tag){case 31:case 13:var p=r.stateNode,y=r.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=r.stateNode;break;case 22:p=r.stateNode._retryCache;break;default:throw Error(i(314))}p!==null&&p.delete(a),OE(r,u)}function r3(r,a){return Ce(r,a)}var Vd=null,ca=null,Ky=!1,zd=!1,qy=!1,Qr=0;function Ms(r){r!==ca&&r.next===null&&(ca===null?Vd=ca=r:ca=ca.next=r),zd=!0,Ky||(Ky=!0,l3())}function Gc(r,a){if(!qy&&zd){qy=!0;do for(var u=!1,p=Vd;p!==null;){if(r!==0){var y=p.pendingLanes;if(y===0)var S=0;else{var R=p.suspendedLanes,N=p.pingedLanes;S=(1<<31-wt(42|r)+1)-1,S&=y&~(R&~N),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,NE(p,S))}else S=Rt,S=Pe(p,p===Xt?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||et(p,S)||(u=!0,NE(p,S));p=p.next}while(u);qy=!1}}function o3(){DE()}function DE(){zd=Ky=!1;var r=0;Qr!==0&&y3()&&(r=Qr);for(var a=oe(),u=null,p=Vd;p!==null;){var y=p.next,S=kE(p,a);S===0?(p.next=null,u===null?Vd=y:u.next=y,y===null&&(ca=u)):(u=p,(r!==0||(S&3)!==0)&&(zd=!0)),p=y}Nn!==0&&Nn!==5||Gc(r),Qr!==0&&(Qr=0)}function kE(r,a){for(var u=r.suspendedLanes,p=r.pingedLanes,y=r.expirationTimes,S=r.pendingLanes&-62914561;0<S;){var R=31-wt(S),N=1<<R,j=y[R];j===-1?((N&u)===0||(N&p)!==0)&&(y[R]=ot(N,a)):j<=a&&(r.expiredLanes|=N),S&=~N}if(a=Xt,u=Rt,u=Pe(r,r===a?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p=r.callbackNode,u===0||r===a&&(Ht===2||Ht===9)||r.cancelPendingCommit!==null)return p!==null&&p!==null&&re(p),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||et(r,u)){if(a=u&-u,a===r.callbackPriority)return a;switch(p!==null&&re(p),lt(u)){case 2:case 8:u=Ue;break;case 32:u=qe;break;case 268435456:u=at;break;default:u=qe}return p=PE.bind(null,r),u=Ce(u,p),r.callbackPriority=a,r.callbackNode=u,a}return p!==null&&p!==null&&re(p),r.callbackPriority=2,r.callbackNode=null,2}function PE(r,a){if(Nn!==0&&Nn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Bd()&&r.callbackNode!==u)return null;var p=Rt;return p=Pe(r,r===Xt?p:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),p===0?null:(hE(r,p,a),kE(r,oe()),r.callbackNode!=null&&r.callbackNode===u?PE.bind(null,r):null)}function NE(r,a){if(Bd())return null;hE(r,a,!0)}function l3(){b3(function(){(Lt&6)!==0?Ce(Xe,o3):DE()})}function Yy(){if(Qr===0){var r=Gl;r===0&&(r=pt,pt<<=1,(pt&261888)===0&&(pt=256)),Qr=r}return Qr}function IE(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:qf(""+r)}function LE(r,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,r.id&&u.setAttribute("form",r.id),a.parentNode.insertBefore(u,a),r=new FormData(r),u.parentNode.removeChild(u),r}function a3(r,a,u,p,y){if(a==="submit"&&u&&u.stateNode===y){var S=IE((y[ri]||null).action),R=p.submitter;R&&(a=(a=R[ri]||null)?IE(a.formAction):R.getAttribute("formAction"),a!==null&&(S=a,R=null));var N=new $f("action","action",null,p,y);r.push({event:N,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Qr!==0){var j=R?LE(y,R):new FormData(y);hy(u,{pending:!0,data:j,method:y.method,action:S},null,j)}}else typeof S=="function"&&(N.preventDefault(),j=R?LE(y,R):new FormData(y),hy(u,{pending:!0,data:j,method:y.method,action:S},S,j))},currentTarget:y}]})}}for(var Gy=0;Gy<Dg.length;Gy++){var Xy=Dg[Gy],c3=Xy.toLowerCase(),u3=Xy[0].toUpperCase()+Xy.slice(1);as(c3,"on"+u3)}as(d1,"onAnimationEnd"),as(h1,"onAnimationIteration"),as(p1,"onAnimationStart"),as("dblclick","onDoubleClick"),as("focusin","onFocus"),as("focusout","onBlur"),as(Rz,"onTransitionRun"),as(Az,"onTransitionStart"),as(Mz,"onTransitionCancel"),as(m1,"onTransitionEnd"),Il("onMouseEnter",["mouseout","mouseover"]),Il("onMouseLeave",["mouseout","mouseover"]),Il("onPointerEnter",["pointerout","pointerover"]),Il("onPointerLeave",["pointerout","pointerover"]),Fo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),f3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xc));function BE(r,a){a=(a&4)!==0;for(var u=0;u<r.length;u++){var p=r[u],y=p.event;p=p.listeners;e:{var S=void 0;if(a)for(var R=p.length-1;0<=R;R--){var N=p[R],j=N.instance,te=N.currentTarget;if(N=N.listener,j!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=te;try{S(y)}catch(ce){Jf(ce)}y.currentTarget=null,S=j}else for(R=0;R<p.length;R++){if(N=p[R],j=N.instance,te=N.currentTarget,N=N.listener,j!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=te;try{S(y)}catch(ce){Jf(ce)}y.currentTarget=null,S=j}}}}function Et(r,a){var u=a[ag];u===void 0&&(u=a[ag]=new Set);var p=r+"__bubble";u.has(p)||(VE(a,r,2,!1),u.add(p))}function $y(r,a,u){var p=0;a&&(p|=4),VE(u,r,p,a)}var _d="_reactListening"+Math.random().toString(36).slice(2);function Qy(r){if(!r[_d]){r[_d]=!0,Dw.forEach(function(u){u!=="selectionchange"&&(f3.has(u)||$y(u,!1,r),$y(u,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;a===null||a[_d]||(a[_d]=!0,$y("selectionchange",!1,a))}}function VE(r,a,u,p){switch(dT(a)){case 2:var y=_3;break;case 8:y=H3;break;default:y=d0}u=y.bind(null,a,u,r),y=void 0,!yg||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(y=!0),p?y!==void 0?r.addEventListener(a,u,{capture:!0,passive:y}):r.addEventListener(a,u,!0):y!==void 0?r.addEventListener(a,u,{passive:y}):r.addEventListener(a,u,!1)}function Zy(r,a,u,p,y){var S=p;if((a&1)===0&&(a&2)===0&&p!==null)e:for(;;){if(p===null)return;var R=p.tag;if(R===3||R===4){var N=p.stateNode.containerInfo;if(N===y)break;if(R===4)for(R=p.return;R!==null;){var j=R.tag;if((j===3||j===4)&&R.stateNode.containerInfo===y)return;R=R.return}for(;N!==null;){if(R=kl(N),R===null)return;if(j=R.tag,j===5||j===6||j===26||j===27){p=S=R;continue e}N=N.parentNode}}p=p.return}Uw(function(){var te=S,ce=mg(u),ge=[];e:{var ne=g1.get(r);if(ne!==void 0){var se=$f,Be=r;switch(r){case"keypress":if(Gf(u)===0)break e;case"keydown":case"keyup":se=sz;break;case"focusin":Be="focus",se=xg;break;case"focusout":Be="blur",se=xg;break;case"beforeblur":case"afterblur":se=xg;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Kw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=qV;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=lz;break;case d1:case h1:case p1:se=XV;break;case m1:se=cz;break;case"scroll":case"scrollend":se=WV;break;case"wheel":se=fz;break;case"copy":case"cut":case"paste":se=QV;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Yw;break;case"toggle":case"beforetoggle":se=hz}var $e=(a&4)!==0,Kt=!$e&&(r==="scroll"||r==="scrollend"),Q=$e?ne!==null?ne+"Capture":null:ne;$e=[];for(var X=te,ee;X!==null;){var he=X;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||Q===null||(he=yc(X,Q),he!=null&&$e.push($c(X,he,ee))),Kt)break;X=X.return}0<$e.length&&(ne=new se(ne,Be,null,u,ce),ge.push({event:ne,listeners:$e}))}}if((a&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",se=r==="mouseout"||r==="pointerout",ne&&u!==pg&&(Be=u.relatedTarget||u.fromElement)&&(kl(Be)||Be[Ho]))break e;if((se||ne)&&(ne=ce.window===ce?ce:(ne=ce.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Be=u.relatedTarget||u.toElement,se=te,Be=Be?kl(Be):null,Be!==null&&(Kt=o(Be),$e=Be.tag,Be!==Kt||$e!==5&&$e!==27&&$e!==6)&&(Be=null)):(se=null,Be=te),se!==Be)){if($e=Kw,he="onMouseLeave",Q="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&($e=Yw,he="onPointerLeave",Q="onPointerEnter",X="pointer"),Kt=se==null?ne:gc(se),ee=Be==null?ne:gc(Be),ne=new $e(he,X+"leave",se,u,ce),ne.target=Kt,ne.relatedTarget=ee,he=null,kl(ce)===te&&($e=new $e(Q,X+"enter",Be,u,ce),$e.target=ee,$e.relatedTarget=Kt,he=$e),Kt=he,se&&Be)t:{for($e=d3,Q=se,X=Be,ee=0,he=Q;he;he=$e(he))ee++;he=0;for(var Ye=X;Ye;Ye=$e(Ye))he++;for(;0<ee-he;)Q=$e(Q),ee--;for(;0<he-ee;)X=$e(X),he--;for(;ee--;){if(Q===X||X!==null&&Q===X.alternate){$e=Q;break t}Q=$e(Q),X=$e(X)}$e=null}else $e=null;se!==null&&zE(ge,ne,se,$e,!1),Be!==null&&Kt!==null&&zE(ge,Kt,Be,$e,!0)}}e:{if(ne=te?gc(te):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var Pt=t1;else if(Jw(ne))if(n1)Pt=Cz;else{Pt=xz;var _e=Sz}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&hg(te.elementType)&&(Pt=t1):Pt=wz;if(Pt&&(Pt=Pt(r,te))){e1(ge,Pt,u,ce);break e}_e&&_e(r,ne,te),r==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&dg(ne,"number",ne.value)}switch(_e=te?gc(te):window,r){case"focusin":(Jw(_e)||_e.contentEditable==="true")&&(Hl=_e,Ag=te,Tc=null);break;case"focusout":Tc=Ag=Hl=null;break;case"mousedown":Mg=!0;break;case"contextmenu":case"mouseup":case"dragend":Mg=!1,u1(ge,u,ce);break;case"selectionchange":if(Tz)break;case"keydown":case"keyup":u1(ge,u,ce)}var dt;if(Cg)e:{switch(r){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else _l?Qw(r,u)&&(At="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(At="onCompositionStart");At&&(Gw&&u.locale!=="ko"&&(_l||At!=="onCompositionStart"?At==="onCompositionEnd"&&_l&&(dt=jw()):(Lr=ce,vg="value"in Lr?Lr.value:Lr.textContent,_l=!0)),_e=Hd(te,At),0<_e.length&&(At=new qw(At,r,null,u,ce),ge.push({event:At,listeners:_e}),dt?At.data=dt:(dt=Zw(u),dt!==null&&(At.data=dt)))),(dt=mz?gz(r,u):yz(r,u))&&(At=Hd(te,"onBeforeInput"),0<At.length&&(_e=new qw("onBeforeInput","beforeinput",null,u,ce),ge.push({event:_e,listeners:At}),_e.data=dt)),a3(ge,r,te,u,ce)}BE(ge,a)})}function $c(r,a,u){return{instance:r,listener:a,currentTarget:u}}function Hd(r,a){for(var u=a+"Capture",p=[];r!==null;){var y=r,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=yc(r,u),y!=null&&p.unshift($c(r,y,S)),y=yc(r,a),y!=null&&p.push($c(r,y,S))),r.tag===3)return p;r=r.return}return[]}function d3(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function zE(r,a,u,p,y){for(var S=a._reactName,R=[];u!==null&&u!==p;){var N=u,j=N.alternate,te=N.stateNode;if(N=N.tag,j!==null&&j===p)break;N!==5&&N!==26&&N!==27||te===null||(j=te,y?(te=yc(u,S),te!=null&&R.unshift($c(u,te,j))):y||(te=yc(u,S),te!=null&&R.push($c(u,te,j)))),u=u.return}R.length!==0&&r.push({event:a,listeners:R})}var h3=/\r\n?/g,p3=/\u0000|\uFFFD/g;function _E(r){return(typeof r=="string"?r:""+r).replace(h3,`
9
+ `).replace(p3,"")}function HE(r,a){return a=_E(a),_E(r)===a}function Wt(r,a,u,p,y,S){switch(u){case"children":typeof p=="string"?a==="body"||a==="textarea"&&p===""||Bl(r,p):(typeof p=="number"||typeof p=="bigint")&&a!=="body"&&Bl(r,""+p);break;case"className":Wf(r,"class",p);break;case"tabIndex":Wf(r,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Wf(r,u,p);break;case"style":Hw(r,p,S);break;case"data":if(a!=="object"){Wf(r,"data",p);break}case"src":case"href":if(p===""&&(a!=="a"||u!=="href")){r.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=qf(""+p),r.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(a!=="input"&&Wt(r,a,"name",y.name,y,null),Wt(r,a,"formEncType",y.formEncType,y,null),Wt(r,a,"formMethod",y.formMethod,y,null),Wt(r,a,"formTarget",y.formTarget,y,null)):(Wt(r,a,"encType",y.encType,y,null),Wt(r,a,"method",y.method,y,null),Wt(r,a,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){r.removeAttribute(u);break}p=qf(""+p),r.setAttribute(u,p);break;case"onClick":p!=null&&(r.onclick=ir);break;case"onScroll":p!=null&&Et("scroll",r);break;case"onScrollEnd":p!=null&&Et("scrollend",r);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"multiple":r.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":r.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){r.removeAttribute("xlink:href");break}u=qf(""+p),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""+p):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":p===!0?r.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?r.setAttribute(u,p):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?r.setAttribute(u,p):r.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?r.removeAttribute(u):r.setAttribute(u,p);break;case"popover":Et("beforetoggle",r),Et("toggle",r),jf(r,"popover",p);break;case"xlinkActuate":nr(r,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":nr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":nr(r,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":nr(r,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":nr(r,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":nr(r,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":nr(r,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":nr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":nr(r,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":jf(r,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=UV.get(u)||u,jf(r,u,p))}}function Jy(r,a,u,p,y,S){switch(u){case"style":Hw(r,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(i(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(i(60));r.innerHTML=u}}break;case"children":typeof p=="string"?Bl(r,p):(typeof p=="number"||typeof p=="bigint")&&Bl(r,""+p);break;case"onScroll":p!=null&&Et("scroll",r);break;case"onScrollEnd":p!=null&&Et("scrollend",r);break;case"onClick":p!=null&&(r.onclick=ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kw.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),a=u.slice(2,y?u.length-7:void 0),S=r[ri]||null,S=S!=null?S[u]:null,typeof S=="function"&&r.removeEventListener(a,S,y),typeof p=="function")){typeof S!="function"&&S!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(a,p,y);break e}u in r?r[u]=p:p===!0?r.setAttribute(u,""):jf(r,u,p)}}}function qn(r,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",r),Et("load",r);var p=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var R=u[S];if(R!=null)switch(S){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Wt(r,a,S,R,u,null)}}y&&Wt(r,a,"srcSet",u.srcSet,u,null),p&&Wt(r,a,"src",u.src,u,null);return;case"input":Et("invalid",r);var N=S=R=y=null,j=null,te=null;for(p in u)if(u.hasOwnProperty(p)){var ce=u[p];if(ce!=null)switch(p){case"name":y=ce;break;case"type":R=ce;break;case"checked":j=ce;break;case"defaultChecked":te=ce;break;case"value":S=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,a));break;default:Wt(r,a,p,ce,u,null)}}Bw(r,S,N,j,te,R,y,!1);return;case"select":Et("invalid",r),p=R=S=null;for(y in u)if(u.hasOwnProperty(y)&&(N=u[y],N!=null))switch(y){case"value":S=N;break;case"defaultValue":R=N;break;case"multiple":p=N;default:Wt(r,a,y,N,u,null)}a=S,u=R,r.multiple=!!p,a!=null?Ll(r,!!p,a,!1):u!=null&&Ll(r,!!p,u,!0);return;case"textarea":Et("invalid",r),S=y=p=null;for(R in u)if(u.hasOwnProperty(R)&&(N=u[R],N!=null))switch(R){case"value":p=N;break;case"defaultValue":y=N;break;case"children":S=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(i(91));break;default:Wt(r,a,R,N,u,null)}zw(r,p,y,S);return;case"option":for(j in u)u.hasOwnProperty(j)&&(p=u[j],p!=null)&&(j==="selected"?r.selected=p&&typeof p!="function"&&typeof p!="symbol":Wt(r,a,j,p,u,null));return;case"dialog":Et("beforetoggle",r),Et("toggle",r),Et("cancel",r),Et("close",r);break;case"iframe":case"object":Et("load",r);break;case"video":case"audio":for(p=0;p<Xc.length;p++)Et(Xc[p],r);break;case"image":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"embed":case"source":case"link":Et("error",r),Et("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(p=u[te],p!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Wt(r,a,te,p,u,null)}return;default:if(hg(a)){for(ce in u)u.hasOwnProperty(ce)&&(p=u[ce],p!==void 0&&Jy(r,a,ce,p,u,void 0));return}}for(N in u)u.hasOwnProperty(N)&&(p=u[N],p!=null&&Wt(r,a,N,p,u,null))}function m3(r,a,u,p){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,R=null,N=null,j=null,te=null,ce=null;for(se in u){var ge=u[se];if(u.hasOwnProperty(se)&&ge!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":j=ge;default:p.hasOwnProperty(se)||Wt(r,a,se,null,p,ge)}}for(var ne in p){var se=p[ne];if(ge=u[ne],p.hasOwnProperty(ne)&&(se!=null||ge!=null))switch(ne){case"type":S=se;break;case"name":y=se;break;case"checked":te=se;break;case"defaultChecked":ce=se;break;case"value":R=se;break;case"defaultValue":N=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,a));break;default:se!==ge&&Wt(r,a,ne,se,p,ge)}}fg(r,R,N,j,te,ce,S,y);return;case"select":se=R=N=ne=null;for(S in u)if(j=u[S],u.hasOwnProperty(S)&&j!=null)switch(S){case"value":break;case"multiple":se=j;default:p.hasOwnProperty(S)||Wt(r,a,S,null,p,j)}for(y in p)if(S=p[y],j=u[y],p.hasOwnProperty(y)&&(S!=null||j!=null))switch(y){case"value":ne=S;break;case"defaultValue":N=S;break;case"multiple":R=S;default:S!==j&&Wt(r,a,y,S,p,j)}a=N,u=R,p=se,ne!=null?Ll(r,!!u,ne,!1):!!p!=!!u&&(a!=null?Ll(r,!!u,a,!0):Ll(r,!!u,u?[]:"",!1));return;case"textarea":se=ne=null;for(N in u)if(y=u[N],u.hasOwnProperty(N)&&y!=null&&!p.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Wt(r,a,N,null,p,y)}for(R in p)if(y=p[R],S=u[R],p.hasOwnProperty(R)&&(y!=null||S!=null))switch(R){case"value":ne=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==S&&Wt(r,a,R,y,p,S)}Vw(r,ne,se);return;case"option":for(var Be in u)ne=u[Be],u.hasOwnProperty(Be)&&ne!=null&&!p.hasOwnProperty(Be)&&(Be==="selected"?r.selected=!1:Wt(r,a,Be,null,p,ne));for(j in p)ne=p[j],se=u[j],p.hasOwnProperty(j)&&ne!==se&&(ne!=null||se!=null)&&(j==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Wt(r,a,j,ne,p,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in u)ne=u[$e],u.hasOwnProperty($e)&&ne!=null&&!p.hasOwnProperty($e)&&Wt(r,a,$e,null,p,ne);for(te in p)if(ne=p[te],se=u[te],p.hasOwnProperty(te)&&ne!==se&&(ne!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,a));break;default:Wt(r,a,te,ne,p,se)}return;default:if(hg(a)){for(var Kt in u)ne=u[Kt],u.hasOwnProperty(Kt)&&ne!==void 0&&!p.hasOwnProperty(Kt)&&Jy(r,a,Kt,void 0,p,ne);for(ce in p)ne=p[ce],se=u[ce],!p.hasOwnProperty(ce)||ne===se||ne===void 0&&se===void 0||Jy(r,a,ce,ne,p,se);return}}for(var Q in u)ne=u[Q],u.hasOwnProperty(Q)&&ne!=null&&!p.hasOwnProperty(Q)&&Wt(r,a,Q,null,p,ne);for(ge in p)ne=p[ge],se=u[ge],!p.hasOwnProperty(ge)||ne===se||ne==null&&se==null||Wt(r,a,ge,ne,p,se)}function FE(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function g3(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],S=y.transferSize,R=y.initiatorType,N=y.duration;if(S&&N&&FE(R)){for(R=0,N=y.responseEnd,p+=1;p<u.length;p++){var j=u[p],te=j.startTime;if(te>N)break;var ce=j.transferSize,ge=j.initiatorType;ce&&FE(ge)&&(j=j.responseEnd,R+=ce*(j<N?1:(N-te)/(j-te)))}if(--p,a+=8*(S+R)/(y.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var e0=null,t0=null;function Fd(r){return r.nodeType===9?r:r.ownerDocument}function UE(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jE(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function n0(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var i0=null;function y3(){var r=window.event;return r&&r.type==="popstate"?r===i0?!1:(i0=r,!0):(i0=null,!1)}var WE=typeof setTimeout=="function"?setTimeout:void 0,v3=typeof clearTimeout=="function"?clearTimeout:void 0,KE=typeof Promise=="function"?Promise:void 0,b3=typeof queueMicrotask=="function"?queueMicrotask:typeof KE<"u"?function(r){return KE.resolve(null).then(r).catch(S3)}:WE;function S3(r){setTimeout(function(){throw r})}function Zr(r){return r==="head"}function qE(r,a){var u=a,p=0;do{var y=u.nextSibling;if(r.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){r.removeChild(y),ha(a);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Qc(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Qc(u);for(var S=u.firstChild;S;){var R=S.nextSibling,N=S.nodeName;S[mc]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=R}}else u==="body"&&Qc(r.ownerDocument.body);u=y}while(u);ha(a)}function YE(r,a){var u=r;r=0;do{var p=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=p}while(u)}function s0(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":s0(u),cg(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function x3(r,a,u,p){for(;r.nodeType===1;){var y=u;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!p&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(p){if(!r[mc])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(S=r.getAttribute("rel"),S==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(S!==y.rel||r.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||r.getAttribute("title")!==(y.title==null?null:y.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(S=r.getAttribute("src"),(S!==(y.src==null?null:y.src)||r.getAttribute("type")!==(y.type==null?null:y.type)||r.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&r.getAttribute("name")===S)return r}else return r;if(r=qi(r.nextSibling),r===null)break}return null}function w3(r,a,u){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=qi(r.nextSibling),r===null))return null;return r}function GE(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=qi(r.nextSibling),r===null))return null;return r}function r0(r){return r.data==="$?"||r.data==="$~"}function o0(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function C3(r,a){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||u.readyState!=="loading")a();else{var p=function(){a(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),r._reactRetry=p}}function qi(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var l0=null;function XE(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(a===0)return qi(r.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}r=r.nextSibling}return null}function $E(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return r;a--}else u!=="/$"&&u!=="/&"||a++}r=r.previousSibling}return null}function QE(r,a,u){switch(a=Fd(u),r){case"html":if(r=a.documentElement,!r)throw Error(i(452));return r;case"head":if(r=a.head,!r)throw Error(i(453));return r;case"body":if(r=a.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Qc(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);cg(r)}var Yi=new Map,ZE=new Set;function Ud(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var br=L.d;L.d={f:E3,r:T3,D:R3,C:A3,L:M3,m:O3,X:k3,S:D3,M:P3};function E3(){var r=br.f(),a=Nd();return r||a}function T3(r){var a=Pl(r);a!==null&&a.tag===5&&a.type==="form"?mC(a):br.r(r)}var ua=typeof document>"u"?null:document;function JE(r,a,u){var p=ua;if(p&&typeof a=="string"&&a){var y=_i(a);y='link[rel="'+r+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),ZE.has(y)||(ZE.add(y),r={rel:r,crossOrigin:u,href:a},p.querySelector(y)===null&&(a=p.createElement("link"),qn(a,"link",r),Vn(a),p.head.appendChild(a)))}}function R3(r){br.D(r),JE("dns-prefetch",r,null)}function A3(r,a){br.C(r,a),JE("preconnect",r,a)}function M3(r,a,u){br.L(r,a,u);var p=ua;if(p&&r&&a){var y='link[rel="preload"][as="'+_i(a)+'"]';a==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+_i(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+_i(u.imageSizes)+'"]')):y+='[href="'+_i(r)+'"]';var S=y;switch(a){case"style":S=fa(r);break;case"script":S=da(r)}Yi.has(S)||(r=m({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:r,as:a},u),Yi.set(S,r),p.querySelector(y)!==null||a==="style"&&p.querySelector(Zc(S))||a==="script"&&p.querySelector(Jc(S))||(a=p.createElement("link"),qn(a,"link",r),Vn(a),p.head.appendChild(a)))}}function O3(r,a){br.m(r,a);var u=ua;if(u&&r){var p=a&&typeof a.as=="string"?a.as:"script",y='link[rel="modulepreload"][as="'+_i(p)+'"][href="'+_i(r)+'"]',S=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=da(r)}if(!Yi.has(S)&&(r=m({rel:"modulepreload",href:r},a),Yi.set(S,r),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Jc(S)))return}p=u.createElement("link"),qn(p,"link",r),Vn(p),u.head.appendChild(p)}}}function D3(r,a,u){br.S(r,a,u);var p=ua;if(p&&r){var y=Nl(p).hoistableStyles,S=fa(r);a=a||"default";var R=y.get(S);if(!R){var N={loading:0,preload:null};if(R=p.querySelector(Zc(S)))N.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":a},u),(u=Yi.get(S))&&a0(r,u);var j=R=p.createElement("link");Vn(j),qn(j,"link",r),j._p=new Promise(function(te,ce){j.onload=te,j.onerror=ce}),j.addEventListener("load",function(){N.loading|=1}),j.addEventListener("error",function(){N.loading|=2}),N.loading|=4,jd(R,a,p)}R={type:"stylesheet",instance:R,count:1,state:N},y.set(S,R)}}}function k3(r,a){br.X(r,a);var u=ua;if(u&&r){var p=Nl(u).hoistableScripts,y=da(r),S=p.get(y);S||(S=u.querySelector(Jc(y)),S||(r=m({src:r,async:!0},a),(a=Yi.get(y))&&c0(r,a),S=u.createElement("script"),Vn(S),qn(S,"link",r),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(y,S))}}function P3(r,a){br.M(r,a);var u=ua;if(u&&r){var p=Nl(u).hoistableScripts,y=da(r),S=p.get(y);S||(S=u.querySelector(Jc(y)),S||(r=m({src:r,async:!0,type:"module"},a),(a=Yi.get(y))&&c0(r,a),S=u.createElement("script"),Vn(S),qn(S,"link",r),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(y,S))}}function eT(r,a,u,p){var y=(y=J.current)?Ud(y):null;if(!y)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=fa(u.href),u=Nl(y).hoistableStyles,p=u.get(a),p||(p={type:"style",instance:null,count:0,state:null},u.set(a,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=fa(u.href);var S=Nl(y).hoistableStyles,R=S.get(r);if(R||(y=y.ownerDocument||y,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(r,R),(S=y.querySelector(Zc(r)))&&!S._p&&(R.instance=S,R.state.loading=5),Yi.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Yi.set(r,u),S||N3(y,r,u,R.state))),a&&p===null)throw Error(i(528,""));return R}if(a&&p!==null)throw Error(i(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=da(u),u=Nl(y).hoistableScripts,p=u.get(a),p||(p={type:"script",instance:null,count:0,state:null},u.set(a,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function fa(r){return'href="'+_i(r)+'"'}function Zc(r){return'link[rel="stylesheet"]['+r+"]"}function tT(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function N3(r,a,u,p){r.querySelector('link[rel="preload"][as="style"]['+a+"]")?p.loading=1:(a=r.createElement("link"),p.preload=a,a.addEventListener("load",function(){return p.loading|=1}),a.addEventListener("error",function(){return p.loading|=2}),qn(a,"link",u),Vn(a),r.head.appendChild(a))}function da(r){return'[src="'+_i(r)+'"]'}function Jc(r){return"script[async]"+r}function nT(r,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var p=r.querySelector('style[data-href~="'+_i(u.href)+'"]');if(p)return a.instance=p,Vn(p),p;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(r.ownerDocument||r).createElement("style"),Vn(p),qn(p,"style",y),jd(p,u.precedence,r),a.instance=p;case"stylesheet":y=fa(u.href);var S=r.querySelector(Zc(y));if(S)return a.state.loading|=4,a.instance=S,Vn(S),S;p=tT(u),(y=Yi.get(y))&&a0(p,y),S=(r.ownerDocument||r).createElement("link"),Vn(S);var R=S;return R._p=new Promise(function(N,j){R.onload=N,R.onerror=j}),qn(S,"link",p),a.state.loading|=4,jd(S,u.precedence,r),a.instance=S;case"script":return S=da(u.src),(y=r.querySelector(Jc(S)))?(a.instance=y,Vn(y),y):(p=u,(y=Yi.get(S))&&(p=m({},u),c0(p,y)),r=r.ownerDocument||r,y=r.createElement("script"),Vn(y),qn(y,"link",p),r.head.appendChild(y),a.instance=y);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(p=a.instance,a.state.loading|=4,jd(p,u.precedence,r));return a.instance}function jd(r,a,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,S=y,R=0;R<p.length;R++){var N=p[R];if(N.dataset.precedence===a)S=N;else if(S!==y)break}S?S.parentNode.insertBefore(r,S.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(r,a.firstChild))}function a0(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function c0(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var Wd=null;function iT(r,a,u){if(Wd===null){var p=new Map,y=Wd=new Map;y.set(u,p)}else y=Wd,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(r))return p;for(p.set(r,null),u=u.getElementsByTagName(r),y=0;y<u.length;y++){var S=u[y];if(!(S[mc]||S[hn]||r==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var R=S.getAttribute(a)||"";R=r+R;var N=p.get(R);N?N.push(S):p.set(R,[S])}}return p}function sT(r,a,u){r=r.ownerDocument||r,r.head.insertBefore(u,a==="title"?r.querySelector("head > title"):null)}function I3(r,a,u){if(u===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(r=a.disabled,typeof a.precedence=="string"&&r==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function rT(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function L3(r,a,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=fa(p.href),S=a.querySelector(Zc(y));if(S){a=S._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Kd.bind(r),a.then(r,r)),u.state.loading|=4,u.instance=S,Vn(S);return}S=a.ownerDocument||a,p=tT(p),(y=Yi.get(y))&&a0(p,y),S=S.createElement("link"),Vn(S);var R=S;R._p=new Promise(function(N,j){R.onload=N,R.onerror=j}),qn(S,"link",p),u.instance=S}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Kd.bind(r),a.addEventListener("load",u),a.addEventListener("error",u))}}var u0=0;function B3(r,a){return r.stylesheets&&r.count===0&&Yd(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var p=setTimeout(function(){if(r.stylesheets&&Yd(r,r.stylesheets),r.unsuspend){var S=r.unsuspend;r.unsuspend=null,S()}},6e4+a);0<r.imgBytes&&u0===0&&(u0=62500*g3());var y=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Yd(r,r.stylesheets),r.unsuspend)){var S=r.unsuspend;r.unsuspend=null,S()}},(r.imgBytes>u0?50:800)+a);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Kd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var qd=null;function Yd(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,qd=new Map,a.forEach(V3,r),qd=null,Kd.call(r))}function V3(r,a){if(!(a.state.loading&4)){var u=qd.get(r);if(u)var p=u.get(null);else{u=new Map,qd.set(r,u);for(var y=r.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var R=y[S];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(u.set(R.dataset.precedence,R),p=R)}p&&u.set(null,p)}y=a.instance,R=y.getAttribute("data-precedence"),S=u.get(R)||p,S===p&&u.set(null,y),u.set(R,y),this.count++,p=Kd.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),S?S.parentNode.insertBefore(y,S.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(y,r.firstChild)),a.state.loading|=4}}var eu={$$typeof:T,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function z3(r,a,u,p,y,S,R,N,j){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_t(0),this.hiddenUpdates=_t(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function oT(r,a,u,p,y,S,R,N,j,te,ce,ge){return r=new z3(r,a,u,R,j,te,ce,ge,N),a=1,S===!0&&(a|=24),S=Ai(3,null,null,a),r.current=S,S.stateNode=r,a=jg(),a.refCount++,r.pooledCache=a,a.refCount++,S.memoizedState={element:p,isDehydrated:u,cache:a},Yg(S),r}function lT(r){return r?(r=jl,r):jl}function aT(r,a,u,p,y,S){y=lT(y),p.context===null?p.context=y:p.pendingContext=y,p=Fr(a),p.payload={element:u},S=S===void 0?null:S,S!==null&&(p.callback=S),u=Ur(r,p,a),u!==null&&(bi(u,r,a),Pc(u,r,a))}function cT(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<a?u:a}}function f0(r,a){cT(r,a),(r=r.alternate)&&cT(r,a)}function uT(r){if(r.tag===13||r.tag===31){var a=Ko(r,67108864);a!==null&&bi(a,r,67108864),f0(r,67108864)}}function fT(r){if(r.tag===13||r.tag===31){var a=Pi();a=tt(a);var u=Ko(r,a);u!==null&&bi(u,r,a),f0(r,a)}}var Gd=!0;function _3(r,a,u,p){var y=I.T;I.T=null;var S=L.p;try{L.p=2,d0(r,a,u,p)}finally{L.p=S,I.T=y}}function H3(r,a,u,p){var y=I.T;I.T=null;var S=L.p;try{L.p=8,d0(r,a,u,p)}finally{L.p=S,I.T=y}}function d0(r,a,u,p){if(Gd){var y=h0(p);if(y===null)Zy(r,a,p,Xd,u),hT(r,p);else if(U3(y,r,a,u,p))p.stopPropagation();else if(hT(r,p),a&4&&-1<F3.indexOf(r)){for(;y!==null;){var S=Pl(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var R=it(S.pendingLanes);if(R!==0){var N=S;for(N.pendingLanes|=2,N.entangledLanes|=2;R;){var j=1<<31-wt(R);N.entanglements[1]|=j,R&=~j}Ms(S),(Lt&6)===0&&(kd=oe()+500,Gc(0))}}break;case 31:case 13:N=Ko(S,2),N!==null&&bi(N,S,2),Nd(),f0(S,2)}if(S=h0(p),S===null&&Zy(r,a,p,Xd,u),S===y)break;y=S}y!==null&&p.stopPropagation()}else Zy(r,a,p,null,u)}}function h0(r){return r=mg(r),p0(r)}var Xd=null;function p0(r){if(Xd=null,r=kl(r),r!==null){var a=o(r);if(a===null)r=null;else{var u=a.tag;if(u===13){if(r=l(a),r!==null)return r;r=null}else if(u===31){if(r=c(a),r!==null)return r;r=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return Xd=r,null}function dT(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ie()){case Xe:return 2;case Ue:return 8;case qe:case ft:return 32;case at:return 268435456;default:return 32}default:return 32}}var m0=!1,Jr=null,eo=null,to=null,tu=new Map,nu=new Map,no=[],F3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function hT(r,a){switch(r){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":eo=null;break;case"mouseover":case"mouseout":to=null;break;case"pointerover":case"pointerout":tu.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":nu.delete(a.pointerId)}}function iu(r,a,u,p,y,S){return r===null||r.nativeEvent!==S?(r={blockedOn:a,domEventName:u,eventSystemFlags:p,nativeEvent:S,targetContainers:[y]},a!==null&&(a=Pl(a),a!==null&&uT(a)),r):(r.eventSystemFlags|=p,a=r.targetContainers,y!==null&&a.indexOf(y)===-1&&a.push(y),r)}function U3(r,a,u,p,y){switch(a){case"focusin":return Jr=iu(Jr,r,a,u,p,y),!0;case"dragenter":return eo=iu(eo,r,a,u,p,y),!0;case"mouseover":return to=iu(to,r,a,u,p,y),!0;case"pointerover":var S=y.pointerId;return tu.set(S,iu(tu.get(S)||null,r,a,u,p,y)),!0;case"gotpointercapture":return S=y.pointerId,nu.set(S,iu(nu.get(S)||null,r,a,u,p,y)),!0}return!1}function pT(r){var a=kl(r.target);if(a!==null){var u=o(a);if(u!==null){if(a=u.tag,a===13){if(a=l(u),a!==null){r.blockedOn=a,Pn(r.priority,function(){fT(u)});return}}else if(a===31){if(a=c(u),a!==null){r.blockedOn=a,Pn(r.priority,function(){fT(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function $d(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var u=h0(r.nativeEvent);if(u===null){u=r.nativeEvent;var p=new u.constructor(u.type,u);pg=p,u.target.dispatchEvent(p),pg=null}else return a=Pl(u),a!==null&&uT(a),r.blockedOn=u,!1;a.shift()}return!0}function mT(r,a,u){$d(r)&&u.delete(a)}function j3(){m0=!1,Jr!==null&&$d(Jr)&&(Jr=null),eo!==null&&$d(eo)&&(eo=null),to!==null&&$d(to)&&(to=null),tu.forEach(mT),nu.forEach(mT)}function Qd(r,a){r.blockedOn===a&&(r.blockedOn=null,m0||(m0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,j3)))}var Zd=null;function gT(r){Zd!==r&&(Zd=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zd===r&&(Zd=null);for(var a=0;a<r.length;a+=3){var u=r[a],p=r[a+1],y=r[a+2];if(typeof p!="function"){if(p0(p||u)===null)continue;break}var S=Pl(u);S!==null&&(r.splice(a,3),a-=3,hy(S,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function ha(r){function a(j){return Qd(j,r)}Jr!==null&&Qd(Jr,r),eo!==null&&Qd(eo,r),to!==null&&Qd(to,r),tu.forEach(a),nu.forEach(a);for(var u=0;u<no.length;u++){var p=no[u];p.blockedOn===r&&(p.blockedOn=null)}for(;0<no.length&&(u=no[0],u.blockedOn===null);)pT(u),u.blockedOn===null&&no.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],S=u[p+1],R=y[ri]||null;if(typeof S=="function")R||gT(u);else if(R){var N=null;if(S&&S.hasAttribute("formAction")){if(y=S,R=S[ri]||null)N=R.formAction;else if(p0(y)!==null)continue}else N=R.action;typeof N=="function"?u[p+1]=N:(u.splice(p,3),p-=3),gT(u)}}}function yT(){function r(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(R){return y=R})},focusReset:"manual",scroll:"manual"})}function a(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),y!==null&&(y(),y=null)}}}function g0(r){this._internalRoot=r}Jd.prototype.render=g0.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(i(409));var u=a.current,p=Pi();aT(u,p,r,a,null,null)},Jd.prototype.unmount=g0.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;aT(r.current,2,null,r,null,null),Nd(),a[Ho]=null}};function Jd(r){this._internalRoot=r}Jd.prototype.unstable_scheduleHydration=function(r){if(r){var a=ln();r={blockedOn:null,target:r,priority:a};for(var u=0;u<no.length&&a!==0&&a<no[u].priority;u++);no.splice(u,0,r),u===0&&pT(r)}};var vT=e.version;if(vT!=="19.2.4")throw Error(i(527,vT,"19.2.4"));L.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=d(a),r=r!==null?h(r):null,r=r===null?null:r.stateNode,r};var W3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var eh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eh.isDisabled&&eh.supportsFiber)try{je=eh.inject(W3),We=eh}catch{}}return ru.createRoot=function(r,a){if(!s(r))throw Error(i(299));var u=!1,p="",y=TC,S=RC,R=AC;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError)),a=oT(r,1,!1,null,null,u,p,null,y,S,R,yT),r[Ho]=a.current,Qy(r),new g0(a)},ru.hydrateRoot=function(r,a,u){if(!s(r))throw Error(i(299));var p=!1,y="",S=TC,R=RC,N=AC,j=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(R=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError),u.formState!==void 0&&(j=u.formState)),a=oT(r,1,!0,a,u??null,p,y,j,S,R,N,yT),a.context=lT(null),u=a.current,p=Pi(),p=tt(p),y=Fr(p),y.callback=null,Ur(u,y,p),u=p,a.current.lanes=u,bt(a,u),Ms(a),r[Ho]=a.current,Qy(r),new Jd(a)},ru.version="19.2.4",ru}var MT;function h4(){if(MT)return v0.exports;MT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),v0.exports=d4(),v0.exports}var WQ=h4();function p4(t,e){return function(i,...s){const o=new URL(t);return o.searchParams.set("code",i.toString()),s.forEach(l=>o.searchParams.append("args[]",l)),`${e} error #${i}; visit ${o} for the full message.`}}const zt=p4("https://base-ui.com/production-error","Base UI"),YO=v.createContext(void 0);function Mo(t){const e=v.useContext(YO);if(t===!1&&e===void 0)throw new Error(zt(27));return e}const OT={};function kn(t,e){const n=v.useRef(OT);return n.current===OT&&(n.current=t(e)),n}function Ar(t,e,n,i){const s=kn(GO).current;return g4(s,t,e,n,i)&&XO(s,[t,e,n,i]),s.callback}function m4(t){const e=kn(GO).current;return y4(e,t)&&XO(e,t),e.callback}function GO(){return{callback:null,cleanup:null,refs:[]}}function g4(t,e,n,i,s){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==i||t.refs[3]!==s}function y4(t,e){return t.refs.length!==e.length||t.refs.some((n,i)=>n!==e[i])}function XO(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const i=Array(e.length).fill(null);for(let s=0;s<e.length;s+=1){const o=e[s];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(i[s]=l);break}case"object":{o.current=n;break}}}t.cleanup=()=>{for(let s=0;s<e.length;s+=1){const o=e[s];if(o!=null)switch(typeof o){case"function":{const l=i[s];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}const v4=parseInt(v.version,10);function ES(t){return v4>=t}function DT(t){if(!v.isValidElement(t))return null;const e=t,n=e.props;return(ES(19)?n?.ref:e.ref)??null}function Wv(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function b4(t,e){const n={};for(const i in t){const s=t[i];if(e?.hasOwnProperty(i)){const o=e[i](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${i.toLowerCase()}`]="":s&&(n[`data-${i.toLowerCase()}`]=s.toString())}return n}function S4(t,e){return typeof t=="function"?t(e):t}function x4(t,e){return typeof t=="function"?t(e):t}const TS={};function Mr(t,e,n,i,s){if(!n&&!i&&!s&&!t)return hp(e);let o=hp(t);return e&&(o=gu(o,e)),n&&(o=gu(o,n)),i&&(o=gu(o,i)),s&&(o=gu(o,s)),o}function w4(t){if(t.length===0)return TS;if(t.length===1)return hp(t[0]);let e=hp(t[0]);for(let n=1;n<t.length;n+=1)e=gu(e,t[n]);return e}function hp(t){return RS(t)?{...QO(t,TS)}:C4(t)}function gu(t,e){return RS(e)?QO(e,t):E4(t,e)}function C4(t){const e={...t};for(const n in e){const i=e[n];$O(n,i)&&(e[n]=ZO(i))}return e}function E4(t,e){if(!e)return t;for(const n in e){const i=e[n];switch(n){case"style":{t[n]=Wv(t.style,i);break}case"className":{t[n]=JO(t.className,i);break}default:$O(n,i)?t[n]=T4(t[n],i):t[n]=i}}return t}function $O(t,e){const n=t.charCodeAt(0),i=t.charCodeAt(1),s=t.charCodeAt(2);return n===111&&i===110&&s>=65&&s<=90&&(typeof e=="function"||typeof e>"u")}function RS(t){return typeof t=="function"}function QO(t,e){return RS(t)?t(e):t??TS}function T4(t,e){return e?t?n=>{if(eD(n)){const s=n;pp(s);const o=e(s);return s.baseUIHandlerPrevented||t?.(s),o}const i=e(n);return t?.(n),i}:ZO(e):t}function ZO(t){return t&&(e=>(eD(e)&&pp(e),t(e)))}function pp(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function JO(t,e){return e?t?e+" "+t:e:t}function eD(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Hn(){}const _u=Object.freeze([]),Sn=Object.freeze({}),R4=500,tD=500,A4={style:{transition:"none"}},AS="data-base-ui-click-trigger",nD={fallbackAxisSide:"none"},MS={fallbackAxisSide:"end"},M4={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Dt(t,e,n={}){const i=e.render,s=O4(e,n);if(n.enabled===!1)return null;const o=n.state??Sn;return P4(t,i,s,o)}function O4(t,e={}){const{className:n,style:i,render:s}=t,{state:o=Sn,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=e,h=d?S4(n,o):void 0,m=d?x4(i,o):void 0,g=d?b4(o,f):Sn,b=d&&c?D4(c):void 0,x=d?Wv(g,b)??{}:Sn;return typeof document<"u"&&(d?Array.isArray(l)?x.ref=m4([x.ref,DT(s),...l]):x.ref=Ar(x.ref,DT(s),l):Ar(null,null)),d?(h!==void 0&&(x.className=JO(x.className,h)),m!==void 0&&(x.style=Wv(x.style,m)),x):Sn}function D4(t){return Array.isArray(t)?w4(t):Mr(void 0,t)}const k4=Symbol.for("react.lazy");function P4(t,e,n,i){if(e){if(typeof e=="function")return e(n,i);const s=Mr(n,e.props);s.ref=n.ref;let o=e;return o?.$$typeof===k4&&(o=v.Children.toArray(e)[0]),v.cloneElement(o,s)}if(t&&typeof t=="string")return N4(t,n);throw new Error(zt(8))}function N4(t,e){return t==="button"?v.createElement("button",{type:"button",...e,key:e.key}):t==="img"?v.createElement("img",{alt:"",...e,key:e.key}):v.createElement(t,e)}let Hu=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const I4={[Hu.startingStyle]:""},L4={[Hu.endingStyle]:""},Pr={transitionStatus(t){return t==="starting"?I4:t==="ending"?L4:null}};let ul=(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=Hu.startingStyle]="startingStyle",t[t.endingStyle=Hu.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({}),mp=(function(t){return t.popupOpen="data-popup-open",t.pressed="data-pressed",t})({});const B4={[mp.popupOpen]:""},V4={[mp.popupOpen]:"",[mp.pressed]:""},z4={[ul.open]:""},_4={[ul.closed]:""},H4={[ul.anchorHidden]:""},mf={open(t){return t?B4:null}},Fu={open(t){return t?V4:null}},Oo={open(t){return t?z4:_4},anchorHidden(t){return t?H4:null}},F4={...Oo,...Pr},KQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,forceRender:l=!1,...c}=e,{store:f}=Mo(),d=f.useState("open"),h=f.useState("nested"),m=f.useState("mounted"),g=f.useState("transitionStatus");return Dt("div",e,{state:{open:d,transitionStatus:g},ref:[f.context.backdropRef,n],stateAttributesMapping:F4,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!h})});function sm(){return typeof window<"u"}function ii(t){return OS(t)?(t.nodeName||"").toLowerCase():"#document"}function dn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zs(t){var e;return(e=(OS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function OS(t){return sm()?t instanceof Node||t instanceof dn(t).Node:!1}function Tt(t){return sm()?t instanceof Element||t instanceof dn(t).Element:!1}function Zt(t){return sm()?t instanceof HTMLElement||t instanceof dn(t).HTMLElement:!1}function Wa(t){return!sm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof dn(t).ShadowRoot}function Do(t){const{overflow:e,overflowX:n,overflowY:i,display:s}=Vi(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&s!=="inline"&&s!=="contents"}function U4(t){return/^(table|td|th)$/.test(ii(t))}function rm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const j4=/transform|translate|scale|rotate|perspective|filter/,W4=/paint|layout|strict|content/,sl=t=>!!t&&t!=="none";let w0;function DS(t){const e=Tt(t)?Vi(t):t;return sl(e.transform)||sl(e.translate)||sl(e.scale)||sl(e.rotate)||sl(e.perspective)||!om()&&(sl(e.backdropFilter)||sl(e.filter))||j4.test(e.willChange||"")||W4.test(e.contain||"")}function K4(t){let e=Xs(t);for(;Zt(e)&&!js(e);){if(DS(e))return e;if(rm(e))return null;e=Xs(e)}return null}function om(){return w0==null&&(w0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),w0}function js(t){return/^(html|body|#document)$/.test(ii(t))}function Vi(t){return dn(t).getComputedStyle(t)}function lm(t){return Tt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xs(t){if(ii(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Wa(t)&&t.host||Zs(t);return Wa(e)?e.host:e}function iD(t){const e=Xs(t);return js(e)?t.ownerDocument?t.ownerDocument.body:t.body:Zt(e)&&Do(e)?e:iD(e)}function Uu(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=iD(t),o=s===((i=t.ownerDocument)==null?void 0:i.body),l=dn(s);if(o){const c=Kv(l);return e.concat(l,l.visualViewport||[],Do(s)?s:[],c&&n?Uu(c):[])}else return e.concat(s,Uu(s,[],n))}function Kv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const C0=hf[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],q4=C0&&C0!==v.useLayoutEffect?C0:t=>t();function Ve(t){const e=kn(Y4).current;return e.next=t,q4(e.effect),e.trampoline}function Y4(){const t={next:void 0,callback:G4,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function G4(){}const X4={...hf},$4=()=>{},Oe=typeof document<"u"?v.useLayoutEffect:$4,Q4=v.createContext(void 0);function kS(t=!1){const e=v.useContext(Q4);if(e===void 0&&!t)throw new Error(zt(16));return e}function Z4(t){const{focusableWhenDisabled:e,disabled:n,composite:i=!1,tabIndex:s=0,isNativeButton:o}=t,l=i&&e!==!1,c=i&&e===!1;return{props:v.useMemo(()=>{const d={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return i||(d.tabIndex=s,!o&&n&&(d.tabIndex=e?s:-1)),(o&&(e||l)||!o&&n)&&(d["aria-disabled"]=n),o&&(!e||c)&&(d.disabled=n),d},[i,n,e,l,c,o,s])}}function ko(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:i=0,native:s=!0,composite:o}=t,l=v.useRef(null),c=kS(!0),f=o??c!==void 0,{props:d}=Z4({focusableWhenDisabled:n,disabled:e,composite:f,tabIndex:i,isNativeButton:s}),h=v.useCallback(()=>{const b=l.current;E0(b)&&f&&e&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,d.disabled,f]);Oe(h,[h]);const m=v.useCallback((b={})=>{const{onClick:x,onMouseDown:w,onKeyUp:C,onKeyDown:E,onPointerDown:M,...T}=b;return Mr({type:s?"button":void 0,onClick(O){if(e){O.preventDefault();return}x?.(O)},onMouseDown(O){e||w?.(O)},onKeyDown(O){if(e||(pp(O),E?.(O),O.baseUIHandlerPrevented))return;const A=O.target===O.currentTarget,k=O.currentTarget,P=E0(k),B=!s&&J4(k),z=A&&(s?P:!B),q=O.key==="Enter",W=O.key===" ",F=k.getAttribute("role"),_=F?.startsWith("menuitem")||F==="option"||F==="gridcell";if(A&&f&&W){if(O.defaultPrevented&&_)return;O.preventDefault(),B||s&&P?(k.click(),O.preventBaseUIHandler()):z&&(x?.(O),O.preventBaseUIHandler());return}z&&(!s&&(W||q)&&O.preventDefault(),!s&&q&&x?.(O))},onKeyUp(O){if(!e){if(pp(O),C?.(O),O.target===O.currentTarget&&s&&f&&E0(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!s&&!f&&O.key===" "&&x?.(O)}},onPointerDown(O){if(e){O.preventDefault();return}M?.(O)}},s?void 0:{role:"button"},d,T)},[e,d,f,s]),g=Ve(b=>{l.current=b,h()});return{getButtonProps:m,buttonRef:g}}function E0(t){return Zt(t)&&t.tagName==="BUTTON"}function J4(t){return!!(t?.tagName==="A"&&t?.href)}const rc="none",$s="trigger-press",An="trigger-hover",ka="trigger-focus",am="outside-press",Pa="item-press",e5="close-press",vo="focus-out",gf="escape-key",qh="list-navigation",PS="cancel-open",yu="sibling-open",t5="disabled",cm="imperative-action",n5="window-resize";function Qe(t,e,n,i){let s=!1,o=!1;const l=Sn;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...l}}const qQ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:l=!0,style:c,...f}=e,{store:d}=Mo(),h=d.useState("open");function m(w){h&&d.setOpen(!1,Qe(e5,w.nativeEvent))}const{getButtonProps:g,buttonRef:b}=ko({disabled:o,native:l});return Dt("button",e,{state:{disabled:o},ref:[n,b],props:[{onClick:m},f,g]})});let kT=0;function i5(t,e="mui"){const[n,i]=v.useState(t),s=t||n;return v.useEffect(()=>{n==null&&(kT+=1,i(`${e}-${kT}`))},[n,e]),s}const PT=X4.useId;function Po(t,e){if(PT!==void 0){const n=PT();return t??(e?`${e}-${n}`:n)}return i5(t,e)}function Ti(t){return Po(t,"base-ui")}const YQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,id:l,...c}=e,{store:f}=Mo(),d=Ti(l);return f.useSyncedValueWithCleanup("descriptionElementId",d),Dt("p",e,{ref:n,props:[{id:d},c]})}),s5=[];function um(t){v.useEffect(t,s5)}const ou=0;class ss{static create(){return new ss}currentId=ou;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ou,n()},e)}isStarted(){return this.currentId!==ou}clear=()=>{this.currentId!==ou&&(clearTimeout(this.currentId),this.currentId=ou)};disposeEffect=()=>this.clear}function On(){const t=kn(ss.create).current;return um(t.disposeEffect),t}const oc=typeof navigator<"u",T0=r5(),sD=l5(),rD=o5(),NS=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),oD=T0.platform==="MacIntel"&&T0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(T0.platform),lD=oc&&/apple/i.test(navigator.vendor),qv=oc&&/android/i.test(sD)||/android/i.test(rD),aD=oc&&sD.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,cD=rD.includes("jsdom/");function r5(){if(!oc)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t?.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function o5(){if(!oc)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function l5(){if(!oc)return"";const t=navigator.userAgentData;return t?.platform?t.platform:navigator.platform??""}function xi(t){t.preventDefault(),t.stopPropagation()}function a5(t){return"nativeEvent"in t}function uD(t){return t.pointerType===""&&t.isTrusted?!0:qv&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function fD(t){return cD?!1:!qv&&t.width===0&&t.height===0||qv&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Ka(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function dD(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function c5(t,e){return e!=null&&!Ka(e)?0:typeof t=="function"?t():t}function gp(t,e,n){const i=c5(t,n);return typeof i=="number"?i:i?.[e]}function NT(t){return typeof t=="function"?t():t}function hD(t,e){return e||t==="click"||t==="mousedown"}const pD=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ss,currentIdRef:{current:null},currentContextRef:{current:null}});function u5(t){const{children:e,delay:n,timeoutMs:i=0}=t,s=v.useRef(n),o=v.useRef(n),l=v.useRef(null),c=v.useRef(null),f=On();return ue.jsx(pD.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:l,timeoutMs:i,currentContextRef:c,timeout:f}),[i,f]),children:e})}function f5(t,e={open:!1}){const n="rootStore"in t?t.rootStore:t,i=n.useState("floatingId"),{open:s}=e,o=v.useContext(pD),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:h,hasProvider:m,timeout:g}=o,[b,x]=v.useState(!1);return Oe(()=>{function w(){x(!1),h.current?.setIsInstantPhase(!1),l.current=null,h.current=null,c.current=d.current}if(l.current&&!s&&l.current===i){if(x(!1),f){const C=i;return g.start(f,()=>{n.select("open")||l.current&&l.current!==C||w()}),()=>{g.clear()}}w()}},[s,i,l,c,f,d,h,g,n]),Oe(()=>{if(!s)return;const w=h.current,C=l.current;g.clear(),h.current={onOpenChange:n.setOpen,setIsInstantPhase:x},l.current=i,c.current={open:0,close:gp(d.current,"close")},C!==null&&C!==i?(x(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,Qe(rc))):(x(!1),w?.setIsInstantPhase(!1))},[s,i,n,l,c,f,d,h,g]),Oe(()=>()=>{h.current=null},[h]),v.useMemo(()=>({hasProvider:m,delayRef:c,isInstantPhase:b}),[m,c,b])}function ht(t,e,n,i){return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}function Ws(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Mn(t){const e=kn(d5,t).current;return e.next=t,Oe(e.effect),e}function d5(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const th=null;class h5{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const nh=new h5;class Ls{static create(){return new Ls}static request(e){return nh.request(e)}static cancel(e){return nh.cancel(e)}currentId=th;request(e){this.cancel(),this.currentId=nh.request(()=>{this.currentId=th,e()})}cancel=()=>{this.currentId!==th&&(nh.cancel(this.currentId),this.currentId=th)};disposeEffect=()=>this.cancel}function fm(){const t=kn(Ls.create).current;return um(t.disposeEffect),t}function yt(t){return t?.ownerDocument||document}const mD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},IS={...mD,position:"fixed",top:0,left:0},gD={...mD,position:"absolute"},bo=v.forwardRef(function(e,n){const[i,s]=v.useState();Oe(()=>{lD&&s("button")},[]);const o={tabIndex:0,role:i};return ue.jsx("span",{...e,ref:n,style:IS,"aria-hidden":i?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Yv="data-base-ui-focusable",yD="active",vD="selected",bD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",po="ArrowLeft",mo="ArrowRight",LS="ArrowUp",yf="ArrowDown";function Xi(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ge(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&Wa(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Zn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function yp(t,e){if(!Tt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of e.entries())if(Ge(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function fs(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function p5(t){return t.matches("html,body")}function dm(t){return Zt(t)&&t.matches(bD)}function m5(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${bD}`)!=null}function Gv(t){return t?t.getAttribute("role")==="combobox"&&dm(t):!1}function g5(t){if(!t||cD)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function ju(t){return t?t.hasAttribute(Yv)?t:t.querySelector(`[${Yv}]`)||t:null}const y5=["top","right","bottom","left"],qa=Math.min,Ii=Math.max,vp=Math.round,fl=Math.floor,Ks=t=>({x:t,y:t}),v5={left:"right",right:"left",bottom:"top",top:"bottom"};function Xv(t,e,n){return Ii(t,qa(e,n))}function Or(t,e){return typeof t=="function"?t(e):t}function Ei(t){return t.split("-")[0]}function No(t){return t.split("-")[1]}function BS(t){return t==="x"?"y":"x"}function VS(t){return t==="y"?"height":"width"}function Qi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function zS(t){return BS(Qi(t))}function b5(t,e,n){n===void 0&&(n=!1);const i=No(t),s=zS(t),o=VS(s);let l=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=bp(l)),[l,bp(l)]}function S5(t){const e=bp(t);return[$v(t),e,$v(e)]}function $v(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const IT=["left","right"],LT=["right","left"],x5=["top","bottom"],w5=["bottom","top"];function C5(t,e,n){switch(t){case"top":case"bottom":return n?e?LT:IT:e?IT:LT;case"left":case"right":return e?x5:w5;default:return[]}}function E5(t,e,n,i){const s=No(t);let o=C5(Ei(t),n==="start",i);return s&&(o=o.map(l=>l+"-"+s),e&&(o=o.concat(o.map($v)))),o}function bp(t){const e=Ei(t);return v5[e]+t.slice(e.length)}function T5(t){return{top:0,right:0,bottom:0,left:0,...t}}function SD(t){return typeof t!="number"?T5(t):{top:t,right:t,bottom:t,left:t}}function Wu(t){const{x:e,y:n,width:i,height:s}=t;return{width:i,height:s,top:n,left:e,right:e+i,bottom:n+s,x:e,y:n}}function ih(t,e,n){return Math.floor(t/e)!==n}function Sp(t,e){return e<0||e>=t.length}function R0(t,e){return li(t.current,{disabledIndices:e})}function BT(t,e){return li(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function li(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:i,amount:s=1}={}){let o=e;do o+=n?-s:s;while(o>=0&&o<=t.length-1&&Na(t,o,i));return o}function R5(t,{event:e,orientation:n,loopFocus:i,onLoop:s,rtl:o,cols:l,disabledIndices:c,minIndex:f,maxIndex:d,prevIndex:h,stopEvent:m=!1}){let g=h,b;if(e.key===LS?b="up":e.key===yf&&(b="down"),b){const x=[],w=[];let C=!1,E=0;{let B=null,z=-1;t.forEach((q,W)=>{if(q==null)return;E+=1;const F=q.closest('[role="row"]');F&&(C=!0),(F!==B||z===-1)&&(B=F,z+=1,x[z]=[]),x[z].push(W),w[W]=z})}let M=!1,T=0;if(C)for(const B of x){const z=B.length;z>T&&(T=z),z!==l&&(M=!0)}const D=M&&E<t.length,O=T||l,A=B=>{if(!M||h===-1)return;const z=w[h];if(z==null)return;const q=x[z].indexOf(h),W=B==="up"?-1:1;for(let F=z+W,_=0;_<x.length;_+=1,F+=W){if(F<0||F>=x.length){if(!i||D)return;if(F=F<0?x.length-1:0,s){const I=Math.min(q,x[F].length-1),L=x[F][I]??x[F][0],K=s(e,h,L);F=w[K]??F}}const H=x[F];for(let I=Math.min(q,H.length-1);I>=0;I-=1){const L=H[I];if(!Na(t,L,c))return L}}},k=B=>{if(!D||h===-1)return;const z=h%O,q=B==="up"?-O:O,W=d-d%O,F=fl(d/O)+1;for(let _=h-z+q,H=0;H<F;H+=1,_+=q){if(_<0||_>d){if(!i)return;_=_<0?W:0}const I=Math.min(_+O-1,d);for(let L=Math.min(_+z,I);L>=_;L-=1)if(!Na(t,L,c))return L}};m&&xi(e);const P=A(b)??k(b);if(P!==void 0)g=P;else if(h===-1)g=b==="up"?d:f;else if(g=li(t,{startingIndex:h,amount:O,decrement:b==="up",disabledIndices:c}),i){if(b==="up"&&(h-O<f||g<0)){const B=h%O,z=d%O,q=d-(z-B);z===B?g=d:g=z>B?q:q-O,s&&(g=s(e,h,g))}b==="down"&&h+O>d&&(g=li(t,{startingIndex:h%O-O,amount:O,disabledIndices:c}),s&&(g=s(e,h,g)))}Sp(t,g)&&(g=h)}if(n==="both"){const x=fl(h/l);e.key===(o?po:mo)&&(m&&xi(e),h%l!==l-1?(g=li(t,{startingIndex:h,disabledIndices:c}),i&&ih(g,l,x)&&(g=li(t,{startingIndex:h-h%l-1,disabledIndices:c}),s&&(g=s(e,h,g)))):i&&(g=li(t,{startingIndex:h-h%l-1,disabledIndices:c}),s&&(g=s(e,h,g))),ih(g,l,x)&&(g=h)),e.key===(o?mo:po)&&(m&&xi(e),h%l!==0?(g=li(t,{startingIndex:h,decrement:!0,disabledIndices:c}),i&&ih(g,l,x)&&(g=li(t,{startingIndex:h+(l-h%l),decrement:!0,disabledIndices:c}),s&&(g=s(e,h,g)))):i&&(g=li(t,{startingIndex:h+(l-h%l),decrement:!0,disabledIndices:c}),s&&(g=s(e,h,g))),ih(g,l,x)&&(g=h));const w=fl(d/l)===x;Sp(t,g)&&(i&&w?(g=e.key===(o?mo:po)?d:li(t,{startingIndex:h-h%l-1,disabledIndices:c}),s&&(g=s(e,h,g))):g=h)}return g}function A5(t,e,n){const i=[];let s=0;return t.forEach(({width:o,height:l},c)=>{let f=!1;for(;!f;){const d=[];for(let h=0;h<o;h+=1)for(let m=0;m<l;m+=1)d.push(s+h+m*e);s%e+o<=e&&d.every(h=>i[h]==null)?(d.forEach(h=>{i[h]=c}),f=!0):s+=1}}),[...i]}function M5(t,e,n,i,s){if(t===-1)return-1;const o=n.indexOf(t),l=e[t];switch(s){case"tl":return o;case"tr":return l?o+l.width-1:o;case"bl":return l?o+(l.height-1)*i:o;case"br":return n.lastIndexOf(t);default:return-1}}function O5(t,e){return e.flatMap((n,i)=>t.includes(n)?[i]:[])}function Na(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const s=t[e];return s?hm(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function hm(t){return typeof t.checkVisibility=="function"?t.checkVisibility():Vi(t).display!=="none"}const D5='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function k5(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return Wa(n)?n.host:null}function Qv(t){for(const e of Array.from(t.children))if(ii(e)==="summary")return e;return null}function P5(t,e){const n=Qv(e);return!!n&&(t===n||Ge(n,t))}function xD(t){const e=t?ii(t):"";return t!=null&&t.matches(D5)&&(e!=="summary"||t.parentElement!=null&&ii(t.parentElement)==="details"&&Qv(t.parentElement)===t)&&(e!=="details"||Qv(t)==null)&&(e!=="input"||t.type!=="hidden")}function wD(t){if(!xD(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=k5(e)){const n=ii(e)==="slot";if(e.hasAttribute("inert")||e!==t&&ii(e)==="details"&&!e.open&&!P5(t,e)||e.hasAttribute("hidden")||!n&&!hm(e))return!1}return!0}function CD(t){const e=t.tabIndex;if(e<0){const n=ii(t);if(n==="details"||n==="audio"||n==="video"||Zt(t)&&t.isContentEditable)return 0}return e}function A0(t){if(ii(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function N5(t,e){const n=A0(t);if(!n)return!0;const i=e.find(s=>{const o=A0(s);return o?.name===n.name&&o.form===n.form&&o.checked});return i?i===n:e.find(s=>{const o=A0(s);return o?.name===n.name&&o.form===n.form})===n}function ED(t){if(Zt(t)&&ii(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Zt(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function TD(t,e){ED(t).forEach(n=>{xD(n)&&e.push(n),TD(n,e)})}function RD(t,e,n){ED(t).forEach(i=>{Zt(i)&&i.matches(e)&&n.push(i),RD(i,e,n)})}function _S(t){return wD(t)&&CD(t)>=0}function AD(t){const e=[];return TD(t,e),e.filter(wD)}function vf(t){const e=AD(t);return e.filter(n=>CD(n)>=0&&N5(n,e))}function MD(t,e){const n=vf(t),i=n.length;if(i===0)return;const s=Xi(yt(t)),o=n.indexOf(s),l=o===-1?e===1?0:i-1:o+e;return n[l]}function HS(t){return MD(yt(t).body,1)||t}function OD(t){return MD(yt(t).body,-1)||t}function DD(t,e){if(!t)return null;const n=vf(yt(t).body),i=n.length;if(i===0)return null;const s=n.indexOf(t);if(s===-1)return null;const o=(s+e+i)%i;return n[o]}function I5(t){return DD(t,1)}function L5(t){return DD(t,-1)}function Ia(t,e){const n=e||t.currentTarget,i=t.relatedTarget;return!i||!Ge(n,i)}function B5(t){vf(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function VT(t){const e=[];RD(t,"[data-tabindex]",e),e.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function qs(t,e,n=!0){return t.filter(s=>s.parentId===e).flatMap(s=>[...!n||s.context?.open?[s]:[],...qs(t,s.id,n)])}function zT(t,e){let n=[],i=t.find(s=>s.id===e)?.parentId;for(;i;){const s=t.find(o=>o.id===i);i=s?.parentId,s&&(n=n.concat(s))}return n}function Ku(t){return`data-base-ui-${t}`}let sh=0;function Yh(t,e={}){const{preventScroll:n=!1,cancelPrevious:i=!0,sync:s=!1}=e;i&&cancelAnimationFrame(sh);const o=()=>t?.focus({preventScroll:n});if(s)return o(),Hn;const l=requestAnimationFrame(o);return sh=l,()=>{sh===l&&(cancelAnimationFrame(l),sh=0)}}const M0={inert:new WeakMap,"aria-hidden":new WeakMap},_T="data-base-ui-inert",Zv={inert:new WeakSet,"aria-hidden":new WeakSet};let lu=new WeakMap,O0=0;function V5(t){return Zv[t]}function kD(t){return t?Wa(t)?t.host:kD(t.parentNode):null}const D0=(t,e)=>e.map(n=>{if(t.contains(n))return n;const i=kD(n);return t.contains(i)?i:null}).filter(n=>n!=null),HT=t=>{const e=new Set;return t.forEach(n=>{let i=n;for(;i&&!e.has(i);)e.add(i),i=i.parentNode}),e},FT=(t,e,n)=>{const i=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(l=>{ii(l)!=="script"&&(e.has(l)?s(l):i.push(l))})};return s(t),i};function z5(t,e,n,i,{mark:s=!0,markerIgnoreElements:o=[]}){const l=i?"inert":n?"aria-hidden":null;let c=null,f=null;const d=D0(e,t),h=s?D0(e,o):[],m=new Set(h),g=s?FT(e,HT(d),new Set(d)).filter(w=>!m.has(w)):[],b=[],x=[];if(l){const w=M0[l],C=V5(l);f=C,c=w;const E=D0(e,Array.from(e.querySelectorAll("[aria-live]"))),M=d.concat(E);FT(e,HT(M),new Set(M)).forEach(D=>{const O=D.getAttribute(l),A=O!==null&&O!=="false",k=(w.get(D)||0)+1;w.set(D,k),b.push(D),k===1&&A&&C.add(D),A||D.setAttribute(l,l==="inert"?"":"true")})}return s&&g.forEach(w=>{const C=(lu.get(w)||0)+1;lu.set(w,C),x.push(w),C===1&&w.setAttribute(_T,"")}),O0+=1,()=>{c&&b.forEach(w=>{const E=(c.get(w)||0)-1;c.set(w,E),E||(!f?.has(w)&&l&&w.removeAttribute(l),f?.delete(w))}),s&&x.forEach(w=>{const C=(lu.get(w)||0)-1;lu.set(w,C),C||w.removeAttribute(_T)}),O0-=1,O0||(M0.inert=new WeakMap,M0["aria-hidden"]=new WeakMap,Zv.inert=new WeakSet,Zv["aria-hidden"]=new WeakSet,lu=new WeakMap)}}function UT(t,e={}){const{ariaHidden:n=!1,inert:i=!1,mark:s=!0,markerIgnoreElements:o=[]}=e,l=yt(t[0]).body;return z5(t,l,n,i,{mark:s,markerIgnoreElements:o})}var Fn=qO();const PD=q3(Fn),ND=v.createContext(null),ID=()=>v.useContext(ND),_5=Ku("portal");function LD(t={}){const{ref:e,container:n,componentProps:i=Sn,elementProps:s}=t,o=Po(),c=ID()?.portalNode,[f,d]=v.useState(null),[h,m]=v.useState(null),g=Ve(C=>{C!==null&&m(C)}),b=v.useRef(null);Oe(()=>{if(n===null){b.current&&(b.current=null,m(null),d(null));return}if(o==null)return;const C=(n&&(OS(n)?n:n.current))??c??document.body;if(C==null){b.current&&(b.current=null,m(null),d(null));return}b.current!==C&&(b.current=C,m(null),d(C))},[n,c,o]);const x=Dt("div",i,{ref:[e,g],props:[{id:o,[_5]:""},s]});return{portalNode:h,portalSubtree:f&&x?Fn.createPortal(x,f):null}}const pm=v.forwardRef(function(e,n){const{children:i,container:s,className:o,render:l,renderGuards:c,style:f,...d}=e,{portalNode:h,portalSubtree:m}=LD({container:s,ref:n,componentProps:e,elementProps:d}),g=v.useRef(null),b=v.useRef(null),x=v.useRef(null),w=v.useRef(null),[C,E]=v.useState(null),M=v.useRef(!1),T=C?.modal,D=C?.open,O=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!h;v.useEffect(()=>{if(!h||T)return;function k(P){h&&P.relatedTarget&&Ia(P)&&(P.type==="focusin"?M.current&&(VT(h),M.current=!1):(B5(h),M.current=!0))}return Ws(ht(h,"focusin",k,!0),ht(h,"focusout",k,!0))},[h,T]),v.useEffect(()=>{!h||D!==!1||(VT(h),M.current=!1)},[D,h]);const A=v.useMemo(()=>({beforeOutsideRef:g,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:w,portalNode:h,setFocusManagerState:E}),[h]);return ue.jsxs(v.Fragment,{children:[m,ue.jsxs(ND.Provider,{value:A,children:[O&&h&&ue.jsx(bo,{"data-type":"outside",ref:g,onFocus:k=>{if(Ia(k,h))x.current?.focus();else{const P=C?C.domReference:null;OD(P)?.focus()}}}),O&&h&&ue.jsx("span",{"aria-owns":h.id,style:M4}),h&&Fn.createPortal(i,h),O&&h&&ue.jsx(bo,{"data-type":"outside",ref:b,onFocus:k=>{if(Ia(k,h))w.current?.focus();else{const P=C?C.domReference:null;HS(P)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,Qe(vo,k.nativeEvent))}}})]})]})});function BD(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(i=>i(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class FS{nodesRef={current:[]};events=BD();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(i=>i===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const VD=v.createContext(null),zD=v.createContext(null),Js=()=>v.useContext(VD)?.id||null,Io=t=>{const e=v.useContext(zD);return t??e};function US(t){const e=Po(),n=Io(t),i=Js();return Oe(()=>{if(!e)return;const s={id:e,parentId:i};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,i]),e}function _D(t){const{children:e,id:n}=t,i=Js();return ue.jsx(VD.Provider,{value:v.useMemo(()=>({id:n,parentId:i}),[n,i]),children:e})}function HD(t){const{children:e,externalTree:n}=t,i=kn(()=>n??new FS).current;return ue.jsx(zD.Provider,{value:i,children:e})}function Sr(t){return t==null?t:"current"in t?t.current:t}function H5(t,e){const n=dn(Zn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const jT=20;let uo=[];function jS(){uo=uo.filter(t=>t.deref()?.isConnected)}function F5(t){jS(),t&&ii(t)!=="body"&&(uo.push(new WeakRef(t)),uo.length>jT&&(uo=uo.slice(-jT)))}function k0(){return jS(),uo[uo.length-1]?.deref()}function U5(t){return t?_S(t)?t:vf(t)[0]||t:null}function j5(t){return!t||!t.isConnected?!1:typeof t.checkVisibility=="function"?t.checkVisibility():hm(t)}function WT(t,e){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!e.current.includes("floating")&&!t.getAttribute("role")?.includes("dialog"))return;const i=AD(t).filter(o=>{const l=o.getAttribute("data-tabindex")||"";return _S(o)||o.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=t.getAttribute("tabindex");e.current.includes("floating")||i.length===0?s!=="0"&&t.setAttribute("tabindex","0"):(s!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function mm(t){const{context:e,children:n,disabled:i=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:b,getInsideElements:x}=t,w="rootStore"in e?e.rootStore:e,C=w.useState("open"),E=w.useState("domReferenceElement"),M=w.useState("floatingElement"),{events:T,dataRef:D}=w.context,O=Ve(()=>D.current.floatingContext?.nodeId),A=s===!1,k=Gv(E)&&A,P=v.useRef(["content"]),B=Mn(s),z=Mn(o),q=Mn(d),W=Io(b),F=ID(),_=v.useRef(!1),H=v.useRef(!1),I=v.useRef(!1),L=v.useRef(null),K=v.useRef(""),Y=v.useRef(""),Z=v.useRef(null),le=v.useRef(null),V=Ar(Z,g,F?.beforeInsideRef),U=Ar(le,F?.afterInsideRef),$=On(),G=On(),J=fm(),fe=F!=null,ie=ju(M),de=Ve((pe=ie)=>pe?vf(pe):[]),Se=Ve(()=>x?.().filter(pe=>pe!=null)??[]);v.useEffect(()=>{if(i||!c)return;function pe(De){De.key==="Tab"&&Ge(ie,Xi(yt(ie)))&&de().length===0&&!k&&xi(De)}const Ee=yt(ie);return ht(Ee,"keydown",pe)},[i,E,ie,c,P,k,de]),v.useEffect(()=>{if(i||!C)return;const pe=yt(ie);function Ee(){I.current=!1}function De(we){const Te=Zn(we),ke=Se(),ve=Ge(M,Te)||Ge(E,Te)||Ge(F?.portalNode,Te)||ke.some(Ce=>Ce===Te||Ge(Ce,Te));I.current=!ve,Y.current=we.pointerType||"keyboard",Te?.closest(`[${AS}]`)&&(H.current=!0)}function Le(){Y.current="keyboard"}return Ws(ht(pe,"pointerdown",De,!0),ht(pe,"pointerup",Ee,!0),ht(pe,"pointercancel",Ee,!0),ht(pe,"keydown",Le,!0))},[i,M,E,ie,C,F,Se]),v.useEffect(()=>{if(i||!f)return;const pe=yt(ie);function Ee(){H.current=!0,G.start(0,()=>{H.current=!1})}function De(ke){const ve=Zn(ke);_S(ve)&&(L.current=ve)}function Le(ke){const ve=ke.relatedTarget,Ce=ke.currentTarget,re=Zn(ke);queueMicrotask(()=>{const me=O(),ae=w.context.triggerElements,oe=Se(),Ie=ve?.hasAttribute(Ku("focus-guard"))&&[Z.current,le.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,Sr(m),Sr(h)].includes(ve),Xe=!(Ge(E,ve)||Ge(M,ve)||Ge(ve,M)||Ge(F?.portalNode,ve)||oe.some(Ue=>Ue===ve||Ge(Ue,ve))||ve!=null&&ae.hasElement(ve)||ae.hasMatchingElement(Ue=>Ge(Ue,ve))||Ie||W&&(qs(W.nodesRef.current,me).find(Ue=>Ge(Ue.context?.elements.floating,ve)||Ge(Ue.context?.elements.domReference,ve))||zT(W.nodesRef.current,me).find(Ue=>[Ue.context?.elements.floating,ju(Ue.context?.elements.floating)].includes(ve)||Ue.context?.elements.domReference===ve)));if(Ce===E&&ie&&WT(ie,P),l&&Ce!==E&&!j5(re)&&Xi(pe)===pe.body){if(Zt(ie)&&(ie.focus(),l==="popup")){J.request(()=>{ie.focus()});return}const Ue=de(),qe=L.current,ft=(qe&&Ue.includes(qe)?qe:null)||Ue[Ue.length-1]||ie;Zt(ft)&&ft.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(k||!c)&&ve&&Xe&&!H.current&&(k||ve!==k0())&&(_.current=!0,w.setOpen(!1,Qe(vo,ke)))})}function we(){I.current||(D.current.insideReactTree=!0,$.start(0,()=>{D.current.insideReactTree=!1}))}const Te=Zt(E)?E:null;if(!(!M&&!Te))return Ws(Te&&ht(Te,"focusout",Le),Te&&ht(Te,"pointerdown",Ee),M&&ht(M,"focusin",De),M&&ht(M,"focusout",Le),M&&F&&ht(M,"focusout",we,!0))},[i,E,M,ie,c,W,F,w,f,l,de,k,O,P,D,$,G,J,h,m,Se]),v.useEffect(()=>{if(i||!M||!C)return;const pe=Array.from(F?.portalNode?.querySelectorAll(`[${Ku("portal")}]`)||[]),De=(W?zT(W.nodesRef.current,O()):[]).find(Ce=>Gv(Ce.context?.elements.domReference||null))?.context?.elements.domReference,we=[...[M,...pe,Z.current,le.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...Se()],De,Sr(m),Sr(h),k?E:null].filter(Ce=>Ce!=null),Te=UT(we,{ariaHidden:c||k,mark:!1}),ke=[M,...pe].filter(Ce=>Ce!=null),ve=UT(ke);return()=>{ve(),Te()}},[C,i,E,M,c,P,F,k,W,O,h,m,Se]),Oe(()=>{if(!C||i||!Zt(ie))return;const pe=yt(ie),Ee=Xi(pe);queueMicrotask(()=>{const De=B.current,Le=typeof De=="function"?De(q.current||""):De;if(Le===void 0||Le===!1||Ge(ie,Ee))return;let Te=null;const ke=()=>(Te==null&&(Te=de(ie)),Te[0]||ie);let ve;Le===!0||Le===null?ve=ke():ve=Sr(Le),ve=ve||ke(),Yh(ve,{preventScroll:ve===ie})})},[i,C,ie,A,de,B,q]),Oe(()=>{if(i||!ie)return;const pe=yt(ie),Ee=Xi(pe);F5(Ee);function De(we){if(we.open||(K.current=H5(we.nativeEvent,Y.current)),we.reason===An&&we.nativeEvent.type==="mouseleave"&&(_.current=!0),we.reason===am)if(we.nested)_.current=!1;else if(uD(we.nativeEvent)||fD(we.nativeEvent))_.current=!1;else{let Te=!1;yt(ie).createElement("div").focus({get preventScroll(){return Te=!0,!1}}),Te?_.current=!1:_.current=!0}}T.on("openchange",De);function Le(){const we=z.current;let Te=typeof we=="function"?we(K.current):we;if(Te===void 0||Te===!1)return null;if(Te===null&&(Te=!0),typeof Te=="boolean"){const ve=E||k0();return ve&&ve.isConnected?ve:null}const ke=E||k0();return Sr(Te)||ke||null}return()=>{T.off("openchange",De);const we=Xi(pe),Te=Se(),ke=Ge(M,we)||Te.some(re=>re===we||Ge(re,we))||W&&qs(W.nodesRef.current,O(),!1).some(re=>Ge(re.context?.elements.floating,we)),ve=z.current,Ce=Le();queueMicrotask(()=>{const re=U5(Ce),me=typeof ve!="boolean";ve&&!_.current&&Zt(re)&&(!(!me&&re!==we&&we!==pe.body)||ke)&&re.focus({preventScroll:!0}),_.current=!1})}},[i,M,ie,z,D,T,W,E,O,Se]),Oe(()=>{if(!NS||C||!M)return;const pe=Xi(yt(M));!Zt(pe)||!dm(pe)||Ge(M,pe)&&pe.blur()},[C,M]),Oe(()=>{if(!(i||!F))return F.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:E}),()=>{F.setFocusManagerState(null)}},[i,F,c,C,w,f,E]),Oe(()=>{if(!(i||!ie))return WT(ie,P),()=>{queueMicrotask(jS)}},[i,ie,P]);const Fe=!i&&(c?!k:!0)&&(fe||c);return ue.jsxs(v.Fragment,{children:[Fe&&ue.jsx(bo,{"data-type":"inside",ref:V,onFocus:pe=>{if(c){const Ee=de();Yh(Ee[Ee.length-1])}else F?.portalNode&&(_.current=!1,Ia(pe,F.portalNode)?HS(E)?.focus():Sr(m??F.beforeOutsideRef)?.focus())}}),n,Fe&&ue.jsx(bo,{"data-type":"inside",ref:U,onFocus:pe=>{c?Yh(de()[0]):F?.portalNode&&(f&&(_.current=!0),Ia(pe,F.portalNode)?OD(E)?.focus():Sr(h??F.afterOutsideRef)?.focus())}})]})}function bf(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.context.dataRef,{enabled:s=!0,event:o="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:h=$s}=e,m=v.useRef(void 0),g=fm(),b=On(),x=v.useMemo(()=>({onPointerDown(w){m.current=w.pointerType},onMouseDown(w){const C=m.current,E=w.nativeEvent,M=n.select("open");if(w.button!==0||o==="click"||Ka(C,!0)&&c)return;const T=i.current.openEvent,D=T?.type,O=n.select("domReferenceElement")!==w.currentTarget,A=M&&O||!(M&&l&&(!(T&&f)||D==="click"||D==="mousedown")),k=Zn(E);if(dm(k)){const B=Qe(h,E,k);A&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,B)}):n.setOpen(A,B);return}const P=w.currentTarget;g.request(()=>{const B=Qe(h,E,P);A&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,B)}):n.setOpen(A,B)})},onClick(w){if(o==="mousedown-only")return;const C=m.current;if(o==="mousedown"&&C){m.current=void 0;return}if(Ka(C,!0)&&c)return;const E=n.select("open"),M=i.current.openEvent,T=n.select("domReferenceElement")!==w.currentTarget,D=E&&T||!(E&&l&&(!(M&&f)||dD(M))),O=Qe(h,w.nativeEvent,w.currentTarget);D&&C==="touch"&&d>0?b.start(d,()=>{n.setOpen(!0,O)}):n.setOpen(D,O)},onKeyDown(){m.current=void 0}}),[i,o,c,n,f,l,g,b,d,h]);return v.useMemo(()=>s?{reference:x}:Sn,[s,x])}function W5(t,e){let n=null,i=null,s=!1;return{contextElement:t||void 0,getBoundingClientRect(){const o=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=e.axis==="x"||e.axis==="both",c=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=o.width,h=o.height,m=o.x,g=o.y;return n==null&&e.x&&l&&(n=o.x-e.x),i==null&&e.y&&c&&(i=o.y-e.y),m-=n||0,g-=i||0,d=0,h=0,!s||f?(d=e.axis==="y"?o.width:0,h=e.axis==="x"?o.height:0,m=l&&e.x!=null?e.x:m,g=c&&e.y!=null?e.y:g):s&&!f&&(h=e.axis==="x"?o.height:h,d=e.axis==="y"?o.width:d),s=!0,{width:d,height:h,x:m,y:g,top:g,right:m+d,bottom:g+h,left:m}}}}function KT(t){return t!=null&&t.clientX!=null}function K5(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=e,d=v.useRef(!1),h=v.useRef(null),[m,g]=v.useState(),[b,x]=v.useState([]),w=Ve((D,O,A)=>{d.current||l.current.openEvent&&!KT(l.current.openEvent)||n.set("positionReference",W5(A??o,{x:D,y:O,axis:f,dataRef:l,pointerType:m}))}),C=Ve(D=>{i?h.current||x([]):w(D.clientX,D.clientY,D.currentTarget)}),E=Ka(m)?s:i,M=v.useCallback(()=>{if(!E||!c)return;const D=dn(s);function O(A){const k=Zn(A);Ge(s,k)?(h.current?.(),h.current=null):w(A.clientX,A.clientY)}if(!l.current.openEvent||KT(l.current.openEvent)){const A=()=>{h.current?.(),h.current=null};return h.current=ht(D,"mousemove",O),A}n.set("positionReference",o)},[E,c,s,l,o,n,w]);v.useEffect(()=>M(),[M,b]),v.useEffect(()=>{c&&!s&&(d.current=!1)},[c,s]),v.useEffect(()=>{!c&&i&&(d.current=!0)},[c,i]);const T=v.useMemo(()=>{function D(O){g(O.pointerType)}return{onPointerDown:D,onPointerEnter:D,onMouseMove:C,onMouseEnter:C}},[C]);return v.useMemo(()=>c?{reference:T,trigger:T}:{},[c,T])}const q5={intentional:"onClick",sloppy:"onPointerDown"};function Y5(){return!1}function G5(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function Sf(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),{dataRef:o}=n.context,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="sloppy",referencePress:h=Y5,referencePressEvent:m="sloppy",bubbles:g,externalTree:b}=e,x=Io(b),w=Ve(typeof f=="function"?f:()=>!1),C=typeof f=="function"?w:f,E=C!==!1,M=Ve(()=>d),T=v.useRef(!1),D=v.useRef(!1),O=v.useRef(!1),{escapeKey:A,outsidePress:k}=G5(g),P=v.useRef(null),B=On(),z=On(),q=Ve(()=>{z.clear(),o.current.insideReactTree=!1}),W=v.useRef(!1),F=v.useRef(""),_=Ve(h),H=Ve(le=>{if(!i||!l||!c||le.key!=="Escape"||W.current)return;const V=o.current.floatingContext?.nodeId,U=x?qs(x.nodesRef.current,V):[];if(!A&&U.length>0){let J=!0;if(U.forEach(fe=>{fe.context?.open&&!fe.context.dataRef.current.__escapeKeyBubbles&&(J=!1)}),!J)return}const $=a5(le)?le.nativeEvent:le,G=Qe(gf,$);n.setOpen(!1,G),!A&&!G.isPropagationAllowed&&le.stopPropagation()}),I=Ve(()=>{o.current.insideReactTree=!0,z.start(0,q)});v.useEffect(()=>{if(!i||!l)return;o.current.__escapeKeyBubbles=A,o.current.__outsidePressBubbles=k;const le=new ss,V=new ss;function U(){le.clear(),W.current=!0}function $(){le.start(om()?5:0,()=>{W.current=!1})}function G(){O.current=!0,V.start(0,()=>{O.current=!1})}function J(){T.current=!1,D.current=!1}function fe(){const ae=F.current,oe=ae==="pen"||!ae?"mouse":ae,Ie=M(),Xe=typeof Ie=="function"?Ie():Ie;return typeof Xe=="string"?Xe:Xe[oe]}function ie(ae){const oe=fe();return oe==="intentional"&&ae.type!=="click"||oe==="sloppy"&&ae.type==="click"}function de(ae){const oe=o.current.floatingContext?.nodeId,Ie=x&&qs(x.nodesRef.current,oe).some(Xe=>fs(ae,Xe.context?.elements.floating));return fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||Ie}function Se(ae){if(ie(ae)){q();return}if(o.current.insideReactTree){q();return}const oe=Zn(ae),Ie=`[${Ku("inert")}]`,Xe=Tt(oe)?oe.getRootNode():null,Ue=Array.from((Wa(Xe)?Xe:yt(n.select("floatingElement"))).querySelectorAll(Ie)),qe=n.context.triggerElements;if(oe&&(qe.hasElement(oe)||qe.hasMatchingElement(Ae=>Ge(Ae,oe))))return;let ft=Tt(oe)?oe:null;for(;ft&&!js(ft);){const Ae=Xs(ft);if(js(Ae)||!Tt(Ae))break;ft=Ae}if(Ue.length&&Tt(oe)&&!p5(oe)&&!Ge(oe,n.select("floatingElement"))&&Ue.every(Ae=>!Ge(ft,Ae)))return;if(Zt(oe)&&!("touches"in ae)){const Ae=js(oe),je=Vi(oe),We=/auto|scroll/,xt=Ae||We.test(je.overflowX),wt=Ae||We.test(je.overflowY),Yt=xt&&oe.clientWidth>0&&oe.scrollWidth>oe.clientWidth,Ze=wt&&oe.clientHeight>0&&oe.scrollHeight>oe.clientHeight,Ke=je.direction==="rtl",pt=Ze&&(Ke?ae.offsetX<=oe.offsetWidth-oe.clientWidth:ae.offsetX>oe.clientWidth),vt=Yt&&ae.offsetY>oe.clientHeight;if(pt||vt)return}if(de(ae))return;if(fe()==="intentional"&&O.current){V.clear(),O.current=!1;return}if(typeof C=="function"&&!C(ae))return;const at=o.current.floatingContext?.nodeId,ct=x?qs(x.nodesRef.current,at):[];if(ct.length>0){let Ae=!0;if(ct.forEach(je=>{je.context?.open&&!je.context.dataRef.current.__outsidePressBubbles&&(Ae=!1)}),!Ae)return}n.setOpen(!1,Qe(am,ae)),q()}function Fe(ae){fe()!=="sloppy"||ae.pointerType==="touch"||!n.select("open")||!l||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||Se(ae)}function pe(ae){if(fe()!=="sloppy"||!n.select("open")||!l||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement")))return;const oe=ae.touches[0];oe&&(P.current={startTime:Date.now(),startX:oe.clientX,startY:oe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}function Ee(ae,oe){const Ie=Zn(ae);if(!Ie)return;const Xe=ht(Ie,ae.type,()=>{oe(ae),Xe()})}function De(ae){F.current="touch",Ee(ae,pe)}function Le(ae){B.clear(),ae.type==="pointerdown"&&(F.current=ae.pointerType),!(ae.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)&&Ee(ae,oe=>{oe.type==="pointerdown"?Fe(oe):Se(oe)})}function we(ae){if(!T.current)return;const oe=D.current;if(J(),fe()==="intentional"){if(ae.type==="pointercancel"){oe&&G();return}if(!de(ae)){if(oe){G();return}typeof C=="function"&&!C(ae)||(V.clear(),O.current=!0,q())}}}function Te(ae){if(fe()!=="sloppy"||!P.current||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement")))return;const oe=ae.touches[0];if(!oe)return;const Ie=Math.abs(oe.clientX-P.current.startX),Xe=Math.abs(oe.clientY-P.current.startY),Ue=Math.sqrt(Ie*Ie+Xe*Xe);Ue>5&&(P.current.dismissOnTouchEnd=!0),Ue>10&&(Se(ae),B.clear(),P.current=null)}function ke(ae){Ee(ae,Te)}function ve(ae){fe()!=="sloppy"||!P.current||fs(ae,n.select("floatingElement"))||fs(ae,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&Se(ae),B.clear(),P.current=null)}function Ce(ae){Ee(ae,ve)}const re=yt(s),me=Ws(c&&Ws(ht(re,"keydown",H),ht(re,"compositionstart",U),ht(re,"compositionend",$)),E&&Ws(ht(re,"click",Le,!0),ht(re,"pointerdown",Le,!0),ht(re,"pointerup",we,!0),ht(re,"pointercancel",we,!0),ht(re,"mousedown",Le,!0),ht(re,"mouseup",we,!0),ht(re,"touchstart",De,!0),ht(re,"touchmove",ke,!0),ht(re,"touchend",Ce,!0)));return()=>{me(),le.clear(),V.clear(),J(),O.current=!1}},[o,s,c,E,C,i,l,A,k,H,q,M,x,n,B]),v.useEffect(q,[C,q]);const L=v.useMemo(()=>({onKeyDown:H,[q5[m]]:le=>{_()&&n.setOpen(!1,Qe($s,le.nativeEvent))},...m!=="intentional"&&{onClick(le){_()&&n.setOpen(!1,Qe($s,le.nativeEvent))}}}),[H,n,m,_]),K=Ve(le=>{if(!i||!l||le.button!==0)return;const V=Zn(le.nativeEvent);Ge(n.select("floatingElement"),V)&&(T.current||(T.current=!0,D.current=!1))}),Y=Ve(le=>{!i||!l||(le.defaultPrevented||le.nativeEvent.defaultPrevented)&&T.current&&(D.current=!0)}),Z=v.useMemo(()=>({onKeyDown:H,onPointerDown:Y,onMouseDown:Y,onClickCapture:I,onMouseDownCapture(le){I(),K(le)},onPointerDownCapture(le){I(),K(le)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[H,I,K,Y]);return v.useMemo(()=>l?{reference:L,floating:Z,trigger:L}:{},[l,L,Z])}function qT(t,e,n){let{reference:i,floating:s}=t;const o=Qi(e),l=zS(e),c=VS(l),f=Ei(e),d=o==="y",h=i.x+i.width/2-s.width/2,m=i.y+i.height/2-s.height/2,g=i[c]/2-s[c]/2;let b;switch(f){case"top":b={x:h,y:i.y-s.height};break;case"bottom":b={x:h,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:m};break;case"left":b={x:i.x-s.width,y:m};break;default:b={x:i.x,y:i.y}}switch(No(e)){case"start":b[l]-=g*(n&&d?-1:1);break;case"end":b[l]+=g*(n&&d?-1:1);break}return b}async function X5(t,e){var n;e===void 0&&(e={});const{x:i,y:s,platform:o,rects:l,elements:c,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=Or(e,t),x=SD(b),C=c[g?m==="floating"?"reference":"floating":m],E=Wu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:f})),M=m==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),D=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},O=Wu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:M,offsetParent:T,strategy:f}):M);return{top:(E.top-O.top+x.top)/D.y,bottom:(O.bottom-E.bottom+x.bottom)/D.y,left:(E.left-O.left+x.left)/D.x,right:(O.right-E.right+x.right)/D.x}}const $5=50,Q5=async(t,e,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:X5},f=await(l.isRTL==null?void 0:l.isRTL(e));let d=await l.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:m}=qT(d,i,f),g=i,b=0;const x={};for(let w=0;w<o.length;w++){const C=o[w];if(!C)continue;const{name:E,fn:M}=C,{x:T,y:D,data:O,reset:A}=await M({x:h,y:m,initialPlacement:i,placement:g,strategy:s,middlewareData:x,rects:d,platform:c,elements:{reference:t,floating:e}});h=T??h,m=D??m,x[E]={...x[E],...O},A&&b<$5&&(b++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(d=A.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:s}):A.rects),{x:h,y:m}=qT(d,g,f)),w=-1)}return{x:h,y:m,placement:g,strategy:s,middlewareData:x}},Z5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:s,middlewareData:o,rects:l,initialPlacement:c,platform:f,elements:d}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...C}=Or(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Ei(s),M=Qi(c),T=Ei(c)===c,D=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=g||(T||!w?[bp(c)]:S5(c)),A=x!=="none";!g&&A&&O.push(...E5(c,w,x,D));const k=[c,...O],P=await f.detectOverflow(e,C),B=[];let z=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&B.push(P[E]),m){const _=b5(s,l,D);B.push(P[_[0]],P[_[1]])}if(z=[...z,{placement:s,overflows:B}],!B.every(_=>_<=0)){var q,W;const _=(((q=o.flip)==null?void 0:q.index)||0)+1,H=k[_];if(H&&(!(m==="alignment"?M!==Qi(H):!1)||z.every(K=>Qi(K.placement)===M?K.overflows[0]>0:!0)))return{data:{index:_,overflows:z},reset:{placement:H}};let I=(W=z.filter(L=>L.overflows[0]<=0).sort((L,K)=>L.overflows[1]-K.overflows[1])[0])==null?void 0:W.placement;if(!I)switch(b){case"bestFit":{var F;const L=(F=z.filter(K=>{if(A){const Y=Qi(K.placement);return Y===M||Y==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Y=>Y>0).reduce((Y,Z)=>Y+Z,0)]).sort((K,Y)=>K[1]-Y[1])[0])==null?void 0:F[0];L&&(I=L);break}case"initialPlacement":I=c;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function YT(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function GT(t){return y5.some(e=>t[e]>=0)}const J5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:s="referenceHidden",...o}=Or(t,e);switch(s){case"referenceHidden":{const l=await i.detectOverflow(e,{...o,elementContext:"reference"}),c=YT(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:GT(c)}}}case"escaped":{const l=await i.detectOverflow(e,{...o,altBoundary:!0}),c=YT(l,n.floating);return{data:{escapedOffsets:c,escaped:GT(c)}}}default:return{}}}}},FD=new Set(["left","top"]);async function e_(t,e){const{placement:n,platform:i,elements:s}=t,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),l=Ei(n),c=No(n),f=Qi(n)==="y",d=FD.has(l)?-1:1,h=o&&f?-1:1,m=Or(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof x=="number"&&(b=c==="end"?x*-1:x),f?{x:b*h,y:g*d}:{x:g*d,y:b*h}}const t_=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:s,y:o,placement:l,middlewareData:c}=e,f=await e_(e,t);return l===((n=c.offset)==null?void 0:n.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:s+f.x,y:o+f.y,data:{...f,placement:l}}}}},n_=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:s,platform:o}=e,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:E=>{let{x:M,y:T}=E;return{x:M,y:T}}},...d}=Or(t,e),h={x:n,y:i},m=await o.detectOverflow(e,d),g=Qi(Ei(s)),b=BS(g);let x=h[b],w=h[g];if(l){const E=b==="y"?"top":"left",M=b==="y"?"bottom":"right",T=x+m[E],D=x-m[M];x=Xv(T,x,D)}if(c){const E=g==="y"?"top":"left",M=g==="y"?"bottom":"right",T=w+m[E],D=w-m[M];w=Xv(T,w,D)}const C=f.fn({...e,[b]:x,[g]:w});return{...C,data:{x:C.x-n,y:C.y-i,enabled:{[b]:l,[g]:c}}}}}},i_=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:s,rects:o,middlewareData:l}=e,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=Or(t,e),h={x:n,y:i},m=Qi(s),g=BS(m);let b=h[g],x=h[m];const w=Or(c,e),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const T=g==="y"?"height":"width",D=o.reference[g]-o.floating[T]+C.mainAxis,O=o.reference[g]+o.reference[T]-C.mainAxis;b<D?b=D:b>O&&(b=O)}if(d){var E,M;const T=g==="y"?"width":"height",D=FD.has(Ei(s)),O=o.reference[m]-o.floating[T]+(D&&((E=l.offset)==null?void 0:E[m])||0)+(D?0:C.crossAxis),A=o.reference[m]+o.reference[T]+(D?0:((M=l.offset)==null?void 0:M[m])||0)-(D?C.crossAxis:0);x<O?x=O:x>A&&(x=A)}return{[g]:b,[m]:x}}}},s_=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:s,rects:o,platform:l,elements:c}=e,{apply:f=()=>{},...d}=Or(t,e),h=await l.detectOverflow(e,d),m=Ei(s),g=No(s),b=Qi(s)==="y",{width:x,height:w}=o.floating;let C,E;m==="top"||m==="bottom"?(C=m,E=g===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(E=m,C=g==="end"?"top":"bottom");const M=w-h.top-h.bottom,T=x-h.left-h.right,D=qa(w-h[C],M),O=qa(x-h[E],T),A=!e.middlewareData.shift;let k=D,P=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=T),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(k=M),A&&!g){const z=Ii(h.left,0),q=Ii(h.right,0),W=Ii(h.top,0),F=Ii(h.bottom,0);b?P=x-2*(z!==0||q!==0?z+q:Ii(h.left,h.right)):k=w-2*(W!==0||F!==0?W+F:Ii(h.top,h.bottom))}await f({...e,availableWidth:P,availableHeight:k});const B=await l.getDimensions(c.floating);return x!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function UD(t){const e=Vi(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const s=Zt(t),o=s?t.offsetWidth:n,l=s?t.offsetHeight:i,c=vp(n)!==o||vp(i)!==l;return c&&(n=o,i=l),{width:n,height:i,$:c}}function WS(t){return Tt(t)?t:t.contextElement}function La(t){const e=WS(t);if(!Zt(e))return Ks(1);const n=e.getBoundingClientRect(),{width:i,height:s,$:o}=UD(e);let l=(o?vp(n.width):n.width)/i,c=(o?vp(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const r_=Ks(0);function jD(t){const e=dn(t);return!om()||!e.visualViewport?r_:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function o_(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==dn(t)?!1:e}function bl(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),o=WS(t);let l=Ks(1);e&&(i?Tt(i)&&(l=La(i)):l=La(t));const c=o_(o,n,i)?jD(o):Ks(0);let f=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,h=s.width/l.x,m=s.height/l.y;if(o){const g=dn(o),b=i&&Tt(i)?dn(i):i;let x=g,w=Kv(x);for(;w&&i&&b!==x;){const C=La(w),E=w.getBoundingClientRect(),M=Vi(w),T=E.left+(w.clientLeft+parseFloat(M.paddingLeft))*C.x,D=E.top+(w.clientTop+parseFloat(M.paddingTop))*C.y;f*=C.x,d*=C.y,h*=C.x,m*=C.y,f+=T,d+=D,x=dn(w),w=Kv(x)}}return Wu({width:h,height:m,x:f,y:d})}function gm(t,e){const n=lm(t).scrollLeft;return e?e.left+n:bl(Zs(t)).left+n}function WD(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-gm(t,n),s=n.top+e.scrollTop;return{x:i,y:s}}function l_(t){let{elements:e,rect:n,offsetParent:i,strategy:s}=t;const o=s==="fixed",l=Zs(i),c=e?rm(e.floating):!1;if(i===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=Ks(1);const h=Ks(0),m=Zt(i);if((m||!m&&!o)&&((ii(i)!=="body"||Do(l))&&(f=lm(i)),m)){const b=bl(i);d=La(i),h.x=b.x+i.clientLeft,h.y=b.y+i.clientTop}const g=l&&!m&&!o?WD(l,f):Ks(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-f.scrollTop*d.y+h.y+g.y}}function a_(t){return Array.from(t.getClientRects())}function c_(t){const e=Zs(t),n=lm(t),i=t.ownerDocument.body,s=Ii(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Ii(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+gm(t);const c=-n.scrollTop;return Vi(i).direction==="rtl"&&(l+=Ii(e.clientWidth,i.clientWidth)-s),{width:s,height:o,x:l,y:c}}const XT=25;function u_(t,e){const n=dn(t),i=Zs(t),s=n.visualViewport;let o=i.clientWidth,l=i.clientHeight,c=0,f=0;if(s){o=s.width,l=s.height;const h=om();(!h||h&&e==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}const d=gm(i);if(d<=0){const h=i.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(i.clientWidth-m.clientWidth-b);x<=XT&&(o-=x)}else d<=XT&&(o+=d);return{width:o,height:l,x:c,y:f}}function f_(t,e){const n=bl(t,!0,e==="fixed"),i=n.top+t.clientTop,s=n.left+t.clientLeft,o=Zt(t)?La(t):Ks(1),l=t.clientWidth*o.x,c=t.clientHeight*o.y,f=s*o.x,d=i*o.y;return{width:l,height:c,x:f,y:d}}function $T(t,e,n){let i;if(e==="viewport")i=u_(t,n);else if(e==="document")i=c_(Zs(t));else if(Tt(e))i=f_(e,n);else{const s=jD(t);i={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Wu(i)}function KD(t,e){const n=Xs(t);return n===e||!Tt(n)||js(n)?!1:Vi(n).position==="fixed"||KD(n,e)}function d_(t,e){const n=e.get(t);if(n)return n;let i=Uu(t,[],!1).filter(c=>Tt(c)&&ii(c)!=="body"),s=null;const o=Vi(t).position==="fixed";let l=o?Xs(t):t;for(;Tt(l)&&!js(l);){const c=Vi(l),f=DS(l);!f&&c.position==="fixed"&&(s=null),(o?!f&&!s:!f&&c.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Do(l)&&!f&&KD(t,l))?i=i.filter(h=>h!==l):s=c,l=Xs(l)}return e.set(t,i),i}function h_(t){let{element:e,boundary:n,rootBoundary:i,strategy:s}=t;const l=[...n==="clippingAncestors"?rm(e)?[]:d_(e,this._c):[].concat(n),i],c=$T(e,l[0],s);let f=c.top,d=c.right,h=c.bottom,m=c.left;for(let g=1;g<l.length;g++){const b=$T(e,l[g],s);f=Ii(b.top,f),d=qa(b.right,d),h=qa(b.bottom,h),m=Ii(b.left,m)}return{width:d-m,height:h-f,x:m,y:f}}function p_(t){const{width:e,height:n}=UD(t);return{width:e,height:n}}function m_(t,e,n){const i=Zt(e),s=Zs(e),o=n==="fixed",l=bl(t,!0,o,e);let c={scrollLeft:0,scrollTop:0};const f=Ks(0);function d(){f.x=gm(s)}if(i||!i&&!o)if((ii(e)!=="body"||Do(s))&&(c=lm(e)),i){const b=bl(e,!0,o,e);f.x=b.x+e.clientLeft,f.y=b.y+e.clientTop}else s&&d();o&&!i&&s&&d();const h=s&&!i&&!o?WD(s,c):Ks(0),m=l.left+c.scrollLeft-f.x-h.x,g=l.top+c.scrollTop-f.y-h.y;return{x:m,y:g,width:l.width,height:l.height}}function P0(t){return Vi(t).position==="static"}function QT(t,e){if(!Zt(t)||Vi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Zs(t)===n&&(n=n.ownerDocument.body),n}function qD(t,e){const n=dn(t);if(rm(t))return n;if(!Zt(t)){let s=Xs(t);for(;s&&!js(s);){if(Tt(s)&&!P0(s))return s;s=Xs(s)}return n}let i=QT(t,e);for(;i&&U4(i)&&P0(i);)i=QT(i,e);return i&&js(i)&&P0(i)&&!DS(i)?n:i||K4(t)||n}const g_=async function(t){const e=this.getOffsetParent||qD,n=this.getDimensions,i=await n(t.floating);return{reference:m_(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function y_(t){return Vi(t).direction==="rtl"}const YD={convertOffsetParentRelativeRectToViewportRelativeRect:l_,getDocumentElement:Zs,getClippingRect:h_,getOffsetParent:qD,getElementRects:g_,getClientRects:a_,getDimensions:p_,getScale:La,isElement:Tt,isRTL:y_};function GD(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function v_(t,e){let n=null,i;const s=Zs(t);function o(){var c;clearTimeout(i),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const d=t.getBoundingClientRect(),{left:h,top:m,width:g,height:b}=d;if(c||e(),!g||!b)return;const x=fl(m),w=fl(s.clientWidth-(h+g)),C=fl(s.clientHeight-(m+b)),E=fl(h),T={rootMargin:-x+"px "+-w+"px "+-C+"px "+-E+"px",threshold:Ii(0,qa(1,f))||1};let D=!0;function O(A){const k=A[0].intersectionRatio;if(k!==f){if(!D)return l();k?l(!1,k):i=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!GD(d,t.getBoundingClientRect())&&l(),D=!1}try{n=new IntersectionObserver(O,{...T,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,T)}n.observe(t)}return l(!0),o}function ZT(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,d=WS(t),h=s||o?[...d?Uu(d):[],...e?Uu(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=d&&c?v_(d,n):null;let g=-1,b=null;l&&(b=new ResizeObserver(E=>{let[M]=E;M&&M.target===d&&b&&e&&(b.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(e)})),n()}),d&&!f&&b.observe(d),e&&b.observe(e));let x,w=f?bl(t):null;f&&C();function C(){const E=bl(t);w&&!GD(w,E)&&n(),w=E,x=requestAnimationFrame(C)}return n(),()=>{var E;h.forEach(M=>{s&&M.removeEventListener("scroll",n),o&&M.removeEventListener("resize",n)}),m?.(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(x)}}const b_=t_,S_=n_,x_=Z5,w_=s_,C_=J5,E_=i_,T_=(t,e,n)=>{const i=new Map,s={platform:YD,...n},o={...s.platform,_c:i};return Q5(t,e,{...s,platform:o})};var R_=typeof document<"u",A_=function(){},Gh=R_?v.useLayoutEffect:A_;function xp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!xp(t[i],e[i]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,s[i]))return!1;for(i=n;i--!==0;){const o=s[i];if(!(o==="_owner"&&t.$$typeof)&&!xp(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function XD(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function JT(t,e){const n=XD(t);return Math.round(e*n)/n}function N0(t){const e=v.useRef(t);return Gh(()=>{e.current=t}),e}function M_(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:s,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=t,[h,m]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,b]=v.useState(i);xp(g,i)||b(i);const[x,w]=v.useState(null),[C,E]=v.useState(null),M=v.useCallback(K=>{K!==A.current&&(A.current=K,w(K))},[]),T=v.useCallback(K=>{K!==k.current&&(k.current=K,E(K))},[]),D=o||x,O=l||C,A=v.useRef(null),k=v.useRef(null),P=v.useRef(h),B=f!=null,z=N0(f),q=N0(s),W=N0(d),F=v.useCallback(()=>{if(!A.current||!k.current)return;const K={placement:e,strategy:n,middleware:g};q.current&&(K.platform=q.current),T_(A.current,k.current,K).then(Y=>{const Z={...Y,isPositioned:W.current!==!1};_.current&&!xp(P.current,Z)&&(P.current=Z,Fn.flushSync(()=>{m(Z)}))})},[g,e,n,q,W]);Gh(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,m(K=>({...K,isPositioned:!1})))},[d]);const _=v.useRef(!1);Gh(()=>(_.current=!0,()=>{_.current=!1}),[]),Gh(()=>{if(D&&(A.current=D),O&&(k.current=O),D&&O){if(z.current)return z.current(D,O,F);F()}},[D,O,F,z,B]);const H=v.useMemo(()=>({reference:A,floating:k,setReference:M,setFloating:T}),[M,T]),I=v.useMemo(()=>({reference:D,floating:O}),[D,O]),L=v.useMemo(()=>{const K={position:n,left:0,top:0};if(!I.floating)return K;const Y=JT(I.floating,h.x),Z=JT(I.floating,h.y);return c?{...K,transform:"translate("+Y+"px, "+Z+"px)",...XD(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:Z}},[n,c,I.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:F,refs:H,elements:I,floatingStyles:L}),[h,F,H,I,L])}const O_=(t,e)=>{const n=b_(t);return{name:n.name,fn:n.fn,options:[t,e]}},D_=(t,e)=>{const n=S_(t);return{name:n.name,fn:n.fn,options:[t,e]}},k_=(t,e)=>({fn:E_(t).fn,options:[t,e]}),P_=(t,e)=>{const n=x_(t);return{name:n.name,fn:n.fn,options:[t,e]}},N_=(t,e)=>{const n=w_(t);return{name:n.name,fn:n.fn,options:[t,e]}},I_=(t,e)=>{const n=C_(t);return{name:n.name,fn:n.fn,options:[t,e]}},be=(t,e,n,i,s,o,...l)=>{if(l.length>0)throw new Error(zt(1));let c;if(t)c=t;else throw new Error("Missing arguments");return c};var I0={exports:{}},L0={};var eR;function L_(){if(eR)return L0;eR=1;var t=nm();function e(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,s=t.useEffect,o=t.useLayoutEffect,l=t.useDebugValue;function c(m,g){var b=g(),x=i({inst:{value:b,getSnapshot:g}}),w=x[0].inst,C=x[1];return o(function(){w.value=b,w.getSnapshot=g,f(w)&&C({inst:w})},[m,b,g]),s(function(){return f(w)&&C({inst:w}),m(function(){f(w)&&C({inst:w})})},[m]),l(b),b}function f(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!n(m,b)}catch{return!0}}function d(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return L0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,L0}var tR;function $D(){return tR||(tR=1,I0.exports=L_()),I0.exports}var QD=$D(),B0={exports:{}},V0={};var nR;function B_(){if(nR)return V0;nR=1;var t=nm(),e=$D();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var i=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,o=t.useRef,l=t.useEffect,c=t.useMemo,f=t.useDebugValue;return V0.useSyncExternalStoreWithSelector=function(d,h,m,g,b){var x=o(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=c(function(){function E(A){if(!M){if(M=!0,T=A,A=g(A),b!==void 0&&w.hasValue){var k=w.value;if(b(k,A))return D=k}return D=A}if(k=D,i(T,A))return k;var P=g(A);return b!==void 0&&b(k,P)?(T=A,k):(T=A,D=P)}var M=!1,T,D,O=m===void 0?null:m;return[function(){return E(h())},O===null?void 0:function(){return E(O())}]},[h,m,g,b]);var C=s(d,x[0],x[1]);return l(function(){w.hasValue=!0,w.value=C},[C]),f(C),C},V0}var iR;function V_(){return iR||(iR=1,B0.exports=B_()),B0.exports}var z_=V_();const Jv=[];let eb;function __(){return eb}function H_(t){Jv.push(t)}function KS(t){const e=(n,i)=>{const s=kn(F_).current;let o;try{eb=s;for(const l of Jv)l.before(s);o=t(n,i);for(const l of Jv)l.after(s);s.didInitialize=!0}finally{eb=void 0}return o};return e.displayName=t.displayName||t.name,e}function ZD(t){return v.forwardRef(KS(t))}function F_(){return{didInitialize:!1}}const U_=ES(19),j_=U_?K_:q_;function rt(t,e,n,i,s){return j_(t,e,n,i,s)}function W_(t,e,n,i,s){const o=v.useCallback(()=>e(t.getSnapshot(),n,i,s),[t,e,n,i,s]);return QD.useSyncExternalStore(t.subscribe,o,o)}H_({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const i=t.syncHooks[n],s=i.selector(i.store.state,i.a1,i.a2,i.a3);(i.didChange||!Object.is(i.value,s))&&(e=!0,i.value=s,i.didChange=!1)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const i=[];for(const s of n)i.push(s.subscribe(e));return()=>{for(const s of i)s()}}),QD.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function K_(t,e,n,i,s){const o=__();if(!o)return W_(t,e,n,i,s);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==t||c.selector!==e||!Object.is(c.a1,n)||!Object.is(c.a2,i)||!Object.is(c.a3,s))&&(c.store!==t&&(o.didChangeStore=!0),c.store=t,c.selector=e,c.a1=n,c.a2=i,c.a3=s,c.didChange=!0)):(c={store:t,selector:e,a1:n,a2:i,a3:s,value:e(t.getSnapshot(),n,i,s),didChange:!1},o.syncHooks.push(c)),c.value}function q_(t,e,n,i,s){return z_.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,o=>e(o,n,i,s))}class JD{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,i,s){return rt(this,e,n,i,s)}}class xf extends JD{constructor(e,n={},i){super(e),this.context=n,this.selectors=i}useSyncedValue(e,n){v.useDebugValue(e),Oe(()=>{this.state[e]!==n&&this.set(e,n)},[e,n])}useSyncedValueWithCleanup(e,n){const i=this;Oe(()=>(i.state[e]!==n&&i.set(e,n),()=>{i.set(e,void 0)}),[i,e,n])}useSyncedValues(e){const n=this,i=Object.values(e);Oe(()=>{n.update(e)},[n,...i])}useControlledProp(e,n){v.useDebugValue(e);const i=n!==void 0;Oe(()=>{i&&!Object.is(this.state[e],n)&&super.setState({...this.state,[e]:n})},[e,n,i])}select(e,n,i,s){const o=this.selectors[e];return o(this.state,n,i,s)}useState(e,n,i,s){return v.useDebugValue(e),rt(this,this.selectors[e],n,i,s)}useContextCallback(e,n){v.useDebugValue(e);const i=Ve(n??Hn);this.context[e]=i}useStateSetter(e){const n=v.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(e,i)}),n.current}observe(e,n){let i;typeof e=="function"?i=e:i=this.selectors[e];let s=i(this.state);return n(s,s,this),this.subscribe(o=>{const l=i(o);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}const Y_={open:be(t=>t.open),transitionStatus:be(t=>t.transitionStatus),domReferenceElement:be(t=>t.domReferenceElement),referenceElement:be(t=>t.positionReference??t.referenceElement),floatingElement:be(t=>t.floatingElement),floatingId:be(t=>t.floatingId)};class qS extends xf{constructor(e){const{syncOnly:n,nested:i,onOpenChange:s,triggerElements:o,...l}=e;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:BD(),nested:i,triggerElements:o},Y_),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&dD(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const i={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function wf(t,e=!1,n=!1){const[i,s]=v.useState(t&&e?"idle":void 0),[o,l]=v.useState(t);return t&&!o&&(l(!0),s("starting")),!t&&o&&i!=="ending"&&!n&&s("ending"),!t&&!o&&i==="ending"&&s(void 0),Oe(()=>{if(!t&&o&&i!=="ending"&&n){const c=Ls.request(()=>{s("ending")});return()=>{Ls.cancel(c)}}},[t,o,i,n]),Oe(()=>{if(!t||e)return;const c=Ls.request(()=>{s(void 0)});return()=>{Ls.cancel(c)}},[e,t]),Oe(()=>{if(!t||!e)return;t&&o&&i!=="idle"&&s("starting");const c=Ls.request(()=>{s("idle")});return()=>{Ls.cancel(c)}},[e,t,o,i]),{mounted:o,setMounted:l,transitionStatus:i}}function YS(t,e=!1,n=!0){const i=fm();return Ve((s,o=null)=>{i.cancel();const l=Sr(t);if(l==null)return;const c=l,f=()=>{Fn.flushSync(s)};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{o?.aborted||f()}).catch(()=>{if(n){o?.aborted||f();return}const h=c.getAnimations();!o?.aborted&&h.length>0&&h.some(m=>m.pending||m.playState!=="finished")&&d()})}if(e){const h=Hu.startingStyle;if(!c.hasAttribute(h)){i.request(d);return}const m=new MutationObserver(()=>{c.hasAttribute(h)||(m.disconnect(),d())});m.observe(c,{attributes:!0,attributeFilter:[h]}),o?.addEventListener("abort",()=>m.disconnect(),{once:!0});return}i.request(d)})}function er(t){const{enabled:e=!0,open:n,ref:i,onComplete:s}=t,o=Ve(s),l=YS(i,n,!1);v.useEffect(()=>{if(!e)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[e,n,o,l])}function ek(t,e){const n=v.useRef(null),i=v.useRef(null);return v.useCallback(s=>{if(t!==void 0){if(n.current!==null){const o=n.current,l=i.current,c=e.context.triggerElements.getById(o);l&&c===l&&e.context.triggerElements.delete(o),n.current=null,i.current=null}s!==null&&(n.current=t,i.current=s,e.context.triggerElements.add(t,s))}},[e,t])}function ym(t,e,n,i){const s=n.useState("isMountedByTrigger",t),o=ek(t,n),l=Ve(c=>{if(o(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===t){n.update({activeTriggerElement:c,...i});return}f==null&&n.update({activeTriggerId:t,activeTriggerElement:c,...i})});return Oe(()=>{s&&n.update({activeTriggerElement:e.current,...i})},[s,n,e,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:s}}function vm(t){const e=t.useState("open");Oe(()=>{if(e&&!t.select("activeTriggerId")&&t.context.triggerElements.size===1){const n=t.context.triggerElements.entries().next();if(!n.done){const[i,s]=n.value;t.update({activeTriggerId:i,activeTriggerElement:s})}}},[e,t])}function bm(t,e,n){const{mounted:i,setMounted:s,transitionStatus:o}=wf(t);e.useSyncedValues({mounted:i,transitionStatus:o});const l=Ve(()=>{s(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)}),c=e.useState("preventUnmountingOnClose");return er({enabled:!c,open:t,ref:e.context.popupRef,onComplete(){t||l()}}),{forceUnmount:l,transitionStatus:o}}class lc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,n){const i=this.idMap.get(e);i!==n&&(i!==void 0&&this.elementsSet.delete(i),this.elementsSet.add(n),this.idMap.set(e,n))}delete(e){const n=this.idMap.get(e);n&&(this.elementsSet.delete(n),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(const n of this.elementsSet)if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function G_(){return new qS({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new lc,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function Sm(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:G_(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Sn,inactiveTriggerProps:Sn,popupProps:Sn}}const rh=be(t=>t.triggerIdProp??t.activeTriggerId),xm={open:be(t=>t.openProp??t.open),mounted:be(t=>t.mounted),transitionStatus:be(t=>t.transitionStatus),floatingRootContext:be(t=>t.floatingRootContext),preventUnmountingOnClose:be(t=>t.preventUnmountingOnClose),payload:be(t=>t.payload),activeTriggerId:rh,activeTriggerElement:be(t=>t.mounted?t.activeTriggerElement:null),isTriggerActive:be((t,e)=>e!==void 0&&rh(t)===e),isOpenedByTrigger:be((t,e)=>e!==void 0&&rh(t)===e&&t.open),isMountedByTrigger:be((t,e)=>e!==void 0&&rh(t)===e&&t.mounted),triggerProps:be((t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps),popupProps:be(t=>t.popupProps),popupElement:be(t=>t.popupElement),positionerElement:be(t=>t.positionerElement)};function tk(t){const{open:e=!1,onOpenChange:n,elements:i={}}=t,s=Po(),o=Js()!=null,l=kn(()=>new qS({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new lc,floatingId:s,syncOnly:!1,nested:o})).current;return Oe(()=>{const c={open:e,floatingId:s};i.reference!==void 0&&(c.referenceElement=i.reference,c.domReferenceElement=Tt(i.reference)?i.reference:null),i.floating!==void 0&&(c.floatingElement=i.floating),l.update(c)},[e,s,i.reference,i.floating,l]),l.context.onOpenChange=n,l.context.nested=o,l}function X_(t={}){const{nodeId:e,externalTree:n}=t,i=tk(t),s=t.rootContext||i,o={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[l,c]=v.useState(null),f=v.useRef(null),d=Io(n);Oe(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const h=M_({...t,elements:{...o,...l&&{reference:l}}}),m=v.useCallback(P=>{const B=Tt(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;c(B),h.refs.setReference(B)},[h.refs]),[g,b]=v.useState(void 0),[x,w]=v.useState(null);s.useSyncedValue("referenceElement",g??null);const C=Tt(g)?g:null;s.useSyncedValue("domReferenceElement",g===void 0?o.domReference:C),s.useSyncedValue("floatingElement",x);const E=v.useCallback(P=>{(Tt(P)||P===null)&&(f.current=P,b(P)),(Tt(h.refs.reference.current)||h.refs.reference.current===null||P!==null&&!Tt(P))&&h.refs.setReference(P)},[h.refs,b]),M=v.useCallback(P=>{w(P),h.refs.setFloating(P)},[h.refs]),T=v.useMemo(()=>({...h.refs,setReference:E,setFloating:M,setPositionReference:m,domReference:f}),[h.refs,E,M,m]),D=v.useMemo(()=>({...h.elements,domReference:o.domReference}),[h.elements,o.domReference]),O=s.useState("open"),A=s.useState("floatingId"),k=v.useMemo(()=>({...h,dataRef:s.context.dataRef,open:O,onOpenChange:s.setOpen,events:s.context.events,floatingId:A,refs:T,elements:D,nodeId:e,rootStore:s}),[h,T,D,e,s,O,A]);return Oe(()=>{s.context.dataRef.current.floatingContext=k;const P=d?.nodesRef.current.find(B=>B.id===e);P&&(P.context=k)}),v.useMemo(()=>({...h,context:k,refs:T,elements:D,rootStore:s}),[h,T,D,k,s])}function wm(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,onOpenChange:i}=t,s=Po(),o=Js()!=null,l=e.useState("open"),c=e.useState("activeTriggerElement"),f=e.useState(n?"popupElement":"positionerElement"),d=e.context.triggerElements,h=kn(()=>new qS({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:f,triggerElements:d,onOpenChange:i,floatingId:s,syncOnly:!0,nested:o})).current;return Oe(()=>{const m={open:l,floatingId:s,referenceElement:c,floatingElement:f};Tt(c)&&(m.domReferenceElement=c),h.state.positionReference===h.state.referenceElement&&(m.positionReference=c),h.update(m)},[l,s,c,f,h]),h.context.onOpenChange=i,h.context.nested=o,h}const z0=aD&&lD;function nk(t,e={}){const n="rootStore"in t?t.rootStore:t,{events:i,dataRef:s}=n.context,{enabled:o=!0,delay:l}=e,c=v.useRef(!1),f=v.useRef(null),d=On(),h=v.useRef(!0);v.useEffect(()=>{const g=n.select("domReferenceElement");if(!o)return;const b=dn(g);function x(){const E=n.select("domReferenceElement");!n.select("open")&&Zt(E)&&E===Xi(yt(E))&&(c.current=!0)}function w(){h.current=!0}function C(){h.current=!1}return Ws(ht(b,"blur",x),z0&&ht(b,"keydown",w,!0),z0&&ht(b,"pointerdown",C,!0))},[n,o]),v.useEffect(()=>{if(!o)return;function g(b){if(b.reason===$s||b.reason===gf){const x=n.select("domReferenceElement");Tt(x)&&(f.current=x,c.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,o,n]);const m=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(g){const b=g.currentTarget;if(c.current){if(f.current===b)return;c.current=!1,f.current=null}const x=Zn(g.nativeEvent);if(Tt(x)){if(z0&&!g.relatedTarget){if(!h.current&&!dm(x))return}else if(!g5(x))return}const w=yp(g.relatedTarget,n.context.triggerElements),{nativeEvent:C,currentTarget:E}=g,M=typeof l=="function"?l():l;if(n.select("open")&&w||M===0||M===void 0){n.setOpen(!0,Qe(ka,C,E));return}d.start(M,()=>{c.current||n.setOpen(!0,Qe(ka,C,E))})},onBlur(g){c.current=!1,f.current=null;const b=g.relatedTarget,x=g.nativeEvent,w=Tt(b)&&b.hasAttribute(Ku("focus-guard"))&&b.getAttribute("data-type")==="outside";d.start(0,()=>{const C=n.select("domReferenceElement"),E=Xi(yt(C));!b&&E===C||Ge(s.current.floatingContext?.refs.floating.current,E)||Ge(C,E)||w||yp(b??E,n.context.triggerElements)||n.setOpen(!1,Qe(ka,x))})}}),[s,n,d,l]);return v.useMemo(()=>o?{reference:m,trigger:m}:{},[o,m])}class GS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ss,this.restTimeout=new ss,this.handleCloseOptions=void 0}static create(){return new GS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const wp=new WeakMap;function Cp(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&wp.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),wp.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function ik(t,e){const{scopeElement:n,referenceElement:i,floatingElement:s}=e,o=wp.get(n);o&&o!==t&&Cp(o),Cp(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=i,t.pointerEventsFloatingElement=s,wp.set(n,t),n.style.pointerEvents="none",i.style.pointerEvents="auto",s.style.pointerEvents="auto"}function sk(t){const e=kn(GS.create).current,n=t.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=e),um(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function XS(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0,nodeId:d}=e,h=sk(n),m=Io(),g=Js(),b=Ve(()=>hD(l.current.openEvent?.type,h.interactedInside)),x=Ve(()=>{const D=l.current.openEvent?.type;return D?.includes("mouse")&&D!=="mousedown"}),w=Ve(D=>yp(D,n.context.triggerElements)),C=v.useCallback(D=>{const O=gp(f,"close",h.pointerType),A=()=>{n.setOpen(!1,Qe(An,D)),m?.events.emit("floating.closed",D)};O?h.openChangeTimeout.start(O,A):(h.openChangeTimeout.clear(),A())},[f,n,h,m]),E=Ve(()=>{Cp(h)}),M=Ve(D=>{const O=Zn(D);if(!m5(O)){h.interactedInside=!1;return}h.interactedInside=O?.closest("[aria-haspopup]")!=null});Oe(()=>{i||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,E())},[i,h,E]),v.useEffect(()=>E,[E]),Oe(()=>{if(c&&i&&h.handleCloseOptions?.blockPointerEvents&&x()&&Tt(o)&&s){const D=o,O=s,A=yt(s),k=m?.nodesRef.current.find(B=>B.id===g)?.context?.elements.floating;k&&(k.style.pointerEvents="");const P=h.handleCloseOptions?.getScope?.()??h.pointerEventsScopeElement??k??D.closest("[data-rootownerid]")??A.body;return ik(h,{scopeElement:P,referenceElement:D,floatingElement:O}),()=>{E()}}},[c,i,o,s,h,x,m,g,E]);const T=On();v.useEffect(()=>{if(!c)return;function D(){h.openChangeTimeout.clear(),T.clear(),m?.events.off("floating.closed",A),E()}function O(P){if(m&&g&&qs(m.nodesRef.current,g).length>0){m.events.on("floating.closed",A);return}if(w(P.relatedTarget))return;const B=l.current.floatingContext?.nodeId??d,z=P.relatedTarget;if(!(m&&B&&Tt(z)&&qs(m.nodesRef.current,B,!1).some(W=>Ge(W.context?.elements.floating,z)))){if(h.handler){h.handler(P);return}E(),b()||C(P)}}function A(P){!m||!g||qs(m.nodesRef.current,g).length>0||T.start(0,()=>{m.events.off("floating.closed",A),n.setOpen(!1,Qe(An,P)),m.events.emit("floating.closed",P)})}const k=s;return Ws(k&&ht(k,"mouseenter",D),k&&ht(k,"mouseleave",O),k&&ht(k,"pointerdown",M,!0),()=>{m?.events.off("floating.closed",A)})},[c,s,n,l,d,b,w,C,E,M,h,m,g,T])}const $_={current:null};function Cm(t,e={}){const n="rootStore"in t?t.rootStore:t,{dataRef:i,events:s}=n.context,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:h=!0,triggerElementRef:m=$_,externalTree:g,isActiveTrigger:b=!0,getHandleCloseContext:x,isClosing:w}=e,C=Io(g),E=sk(n),M=v.useRef(!1),T=Mn(c),D=Mn(l),O=Mn(d),A=Mn(o),k=Mn(w);b&&(E.handleCloseOptions=T.current?.__options);const P=Ve(()=>hD(i.current.openEvent?.type,E.interactedInside)),B=Ve(_=>yp(_,n.context.triggerElements)),z=Ve((_,H,I)=>{const L=n.context.triggerElements;if(L.hasElement(H))return!_||!Ge(_,H);if(!Tt(I))return!1;const K=I;return L.hasMatchingElement(Y=>Ge(Y,K))&&(!_||!Ge(_,K))}),q=Ve((_,H=!0)=>{const I=gp(D.current,"close",E.pointerType);I?E.openChangeTimeout.start(I,()=>{n.setOpen(!1,Qe(An,_)),C?.events.emit("floating.closed",_)}):H&&(E.openChangeTimeout.clear(),n.setOpen(!1,Qe(An,_)),C?.events.emit("floating.closed",_))}),W=Ve(()=>{if(!E.handler)return;yt(n.select("domReferenceElement")).removeEventListener("mousemove",E.handler),E.handler=void 0}),F=Ve(()=>{Cp(E)});return v.useEffect(()=>W,[W]),v.useEffect(()=>{if(!o)return;function _(H){H.open?M.current=!1:(M.current=H.reason===An,W(),E.openChangeTimeout.clear(),E.restTimeout.clear(),E.blockMouseMove=!0,E.restTimeoutPending=!1)}return s.on("openchange",_),()=>{s.off("openchange",_)}},[o,s,E,W]),v.useEffect(()=>{if(!o)return;const _=m.current??(b?n.select("domReferenceElement"):null);if(!Tt(_))return;function H(L){if(E.openChangeTimeout.clear(),E.blockMouseMove=!1,f&&!Ka(E.pointerType))return;const K=NT(O.current),Y=gp(D.current,"open",E.pointerType),Z=Zn(L),le=L.currentTarget??null,V=n.select("domReferenceElement");let U=le;if(Tt(Z)&&!n.context.triggerElements.hasElement(Z)){for(const pe of n.context.triggerElements.elements())if(Ge(pe,Z)){U=pe;break}}Tt(le)&&Tt(V)&&!n.context.triggerElements.hasElement(le)&&Ge(le,V)&&(U=V);const $=U==null?!1:z(V,U,Z),G=n.select("open"),J=k.current?.()??n.select("transitionStatus")==="ending",fe=!G&&J&&M.current,ie=!$&&Tt(U)&&Tt(V)&&Ge(V,U)&&fe,de=K>0&&!Y,Se=$&&(G||fe)||ie,Fe=!G||$;if(Se){n.setOpen(!0,Qe(An,L,U));return}de||(Y?E.openChangeTimeout.start(Y,()=>{Fe&&n.setOpen(!0,Qe(An,L,U))}):Fe&&n.setOpen(!0,Qe(An,L,U)))}function I(L){if(P()){F();return}W();const K=n.select("domReferenceElement"),Y=yt(K);E.restTimeout.clear(),E.restTimeoutPending=!1;const Z=i.current.floatingContext??x?.();if(B(L.relatedTarget))return;if(T.current&&Z){n.select("open")||E.openChangeTimeout.clear();const U=m.current;E.handler=T.current({...Z,tree:C,x:L.clientX,y:L.clientY,onClose(){F(),W(),A.current&&!P()&&U===n.select("domReferenceElement")&&q(L,!0)}}),Y.addEventListener("mousemove",E.handler),E.handler(L);return}(E.pointerType!=="touch"||!Ge(n.select("floatingElement"),L.relatedTarget))&&q(L)}return h?Ws(ht(_,"mousemove",H,{once:!0}),ht(_,"mouseenter",H),ht(_,"mouseleave",I)):Ws(ht(_,"mouseenter",H),ht(_,"mouseleave",I))},[W,F,i,D,q,n,o,T,E,b,z,P,B,f,h,O,m,C,A,x,k]),v.useMemo(()=>{if(!o)return;function _(H){E.pointerType=H.pointerType}return{onPointerDown:_,onPointerEnter:_,onMouseMove(H){const{nativeEvent:I}=H,L=H.currentTarget,K=n.select("domReferenceElement"),Y=n.select("open"),Z=z(K,L,H.target);if(f&&!Ka(E.pointerType))return;if(Y&&Z&&E.handleCloseOptions?.blockPointerEvents){const U=n.select("floatingElement");if(U){const $=E.handleCloseOptions?.getScope?.()??L.ownerDocument.body;ik(E,{scopeElement:$,referenceElement:L,floatingElement:U})}}const le=NT(O.current);if(Y&&!Z||le===0||!Z&&E.restTimeoutPending&&H.movementX**2+H.movementY**2<2)return;E.restTimeout.clear();function V(){if(E.restTimeoutPending=!1,P())return;const U=n.select("open");!E.blockMouseMove&&(!U||Z)&&n.setOpen(!0,Qe(An,I,L))}E.pointerType==="touch"?Fn.flushSync(()=>{V()}):Z&&Y?V():(E.restTimeoutPending=!0,E.restTimeout.start(le,V))}}},[o,E,P,z,f,n,O])}function Nr(t=[]){const e=t.map(d=>d?.reference),n=t.map(d=>d?.floating),i=t.map(d=>d?.item),s=t.map(d=>d?.trigger),o=v.useCallback(d=>oh(d,t,"reference"),e),l=v.useCallback(d=>oh(d,t,"floating"),n),c=v.useCallback(d=>oh(d,t,"item"),i),f=v.useCallback(d=>oh(d,t,"trigger"),s);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[o,l,c,f])}function oh(t,e,n){const i=new Map,s=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[Yv]="");for(const l in t)s&&t&&(l===yD||l===vD)||(o[l]=t[l]);for(let l=0;l<e.length;l+=1){let c;const f=e[l]?.[n];typeof f=="function"?c=t?f(t):null:c=f,c&&sR(o,c,s,i)}return sR(o,t,s,i),o}function sR(t,e,n,i){for(const s in e){const o=e[s];n&&(s===yD||s===vD)||(s.startsWith("on")?(i.has(s)||i.set(s,[]),typeof o=="function"&&(i.get(s)?.push(o),t[s]=(...l)=>i.get(s)?.map(c=>c(...l)).find(c=>c!==void 0))):t[s]=o)}}function Q_(t){const e=t.currentTarget.getBoundingClientRect();return e.top+1<=t.clientY&&t.clientY<=e.bottom-1&&e.left+1<=t.clientX&&t.clientX<=e.right-1}const Z_="Escape";function Em(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function lh(t,e){return Em(e,t===LS||t===yf,t===po||t===mo)}function _0(t,e,n){return Em(e,t===yf,n?t===po:t===mo)||t==="Enter"||t===" "||t===""}function J_(t,e,n){return Em(e,n?t===po:t===mo,t===yf)}function eH(t,e,n,i){const s=n?t===mo:t===po,o=t===LS;return e==="both"||e==="horizontal"&&i&&i>1?t===Z_:Em(e,s,o)}function rk(t,e){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:h=!0,selectedIndex:m=null,allowEscape:g=!1,loopFocus:b=!1,nested:x=!1,rtl:w=!1,virtual:C=!1,focusItemOnOpen:E="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:T=!0,disabledIndices:D=void 0,orientation:O="vertical",parentOrientation:A,cols:k=1,id:P,resetOnPointerLeave:B=!0,externalTree:z}=e,q=ju(s),W=Mn(q),F=Js(),_=Io(z);Oe(()=>{l.current.orientation=O},[l,O]);const H=Gv(o),I=v.useRef(E),L=v.useRef(m??-1),K=v.useRef(null),Y=v.useRef(!0),Z=Ve(re=>{d(L.current===-1?null:L.current,re)}),le=v.useRef(Z),V=v.useRef(!!s),U=v.useRef(i),$=v.useRef(!1),G=v.useRef(!1),J=v.useRef(null),fe=Mn(D),ie=Mn(i),de=Mn(m),Se=Mn(B),Fe=Ve(()=>{function re(Ie){C?_?.events.emit("virtualfocus",Ie):J.current=Yh(Ie,{sync:$.current,preventScroll:!0})}const me=c.current[L.current],ae=G.current;me&&re(me),($.current?Ie=>Ie():requestAnimationFrame)(()=>{const Ie=c.current[L.current]||me;if(!Ie)return;me||re(Ie),De&&(ae||!Y.current)&&Ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Oe(()=>{h&&(i&&s?(L.current=m??-1,I.current&&m!=null&&(G.current=!0,Z())):V.current&&(L.current=-1,le.current()))},[h,i,s,m,Z]),Oe(()=>{if(h){if(!i){$.current=!1;return}if(s)if(f==null){if($.current=!1,de.current!=null)return;if(V.current&&(L.current=-1,Fe()),(!U.current||!V.current)&&I.current&&(K.current!=null||I.current===!0&&K.current==null)){let re=0;const me=()=>{c.current[0]==null?(re<2&&(re?requestAnimationFrame:queueMicrotask)(me),re+=1):(L.current=K.current==null||_0(K.current,O,w)||x?R0(c):BT(c),K.current=null,Z())};me()}}else Sp(c.current,f)||(L.current=f,Fe(),G.current=!1)}},[h,i,s,f,de,x,c,O,w,Z,Fe,fe]),Oe(()=>{if(!h||s||!_||C||!V.current)return;const re=_.nodesRef.current,me=re.find(Ie=>Ie.id===F)?.context?.elements.floating,ae=Xi(yt(s)),oe=re.some(Ie=>Ie.context&&Ge(Ie.context.elements.floating,ae));me&&!oe&&Y.current&&me.focus({preventScroll:!0})},[h,s,_,F,C]),Oe(()=>{le.current=Z,U.current=i,V.current=!!s}),Oe(()=>{i||(K.current=null,I.current=E)},[i,E]);const pe=f!=null,Ee=Ve(re=>{if(!ie.current)return;const me=c.current.indexOf(re.currentTarget);me!==-1&&(L.current!==me||f!==me)&&(L.current=me,Z(re))}),De=v.useMemo(()=>({onFocus(me){$.current=!0,Ee(me)},onClick:({currentTarget:me})=>me.focus({preventScroll:!0}),onMouseMove(me){$.current=!0,G.current=!1,M&&Ee(me)},onPointerLeave(me){if(!ie.current||!Y.current||me.pointerType==="touch")return;$.current=!0;const ae=me.relatedTarget;if(!Q_(me)&&!(!M||c.current.includes(ae))&&Se.current&&(J.current?.(),J.current=null,L.current=-1,Z(me),!C)){const oe=W.current,Ie=Xi(yt(oe));oe&&Ge(oe,Ie)&&oe.focus({preventScroll:!0})}}}),[Ee,ie,W,M,c,Z,Se,C]),Le=v.useCallback(()=>A??_?.nodesRef.current.find(re=>re.id===F)?.context?.dataRef?.current.orientation,[F,_,A]),we=Ve(re=>{if(Y.current=!1,$.current=!0,re.which===229||!ie.current&&re.currentTarget===W.current)return;if(x&&eH(re.key,O,w,k)){lh(re.key,Le())||xi(re),n.setOpen(!1,Qe(qh,re.nativeEvent)),Zt(o)&&(C?_?.events.emit("virtualfocus",o):o.focus());return}const me=L.current,ae=R0(c,D),oe=BT(c,D);if(H||(re.key==="Home"&&(xi(re),L.current=ae,Z(re)),re.key==="End"&&(xi(re),L.current=oe,Z(re))),k>1){const Ie=Array.from({length:c.current.length},()=>({width:1,height:1})),Xe=A5(Ie,k),Ue=Xe.findIndex(at=>at!=null&&!Na(c.current,at,D)),qe=Xe.reduce((at,ct,Ae)=>ct!=null&&!Na(c.current,ct,D)?Ae:at,-1),ft=Xe[R5(Xe.map(at=>at!=null?c.current[at]:null),{event:re,orientation:O,loopFocus:b,rtl:w,cols:k,disabledIndices:O5([...(typeof D!="function"?D:null)||c.current.map((at,ct)=>Na(c.current,ct,D)?ct:void 0),void 0],Xe),minIndex:Ue,maxIndex:qe,prevIndex:M5(L.current>oe?ae:L.current,Ie,Xe,k,re.key===yf?"bl":re.key===(w?po:mo)?"tr":"tl"),stopEvent:!0})];if(ft!=null&&(L.current=ft,Z(re)),O==="both")return}if(lh(re.key,O)){if(xi(re),i&&!C&&Xi(re.currentTarget.ownerDocument)===re.currentTarget){L.current=_0(re.key,O,w)?ae:oe,Z(re);return}_0(re.key,O,w)?b?me>=oe?g&&me!==c.current.length?L.current=-1:($.current=!1,L.current=ae):L.current=li(c.current,{startingIndex:me,disabledIndices:D}):L.current=Math.min(oe,li(c.current,{startingIndex:me,disabledIndices:D})):b?me<=ae?g&&me!==-1?L.current=c.current.length:($.current=!1,L.current=oe):L.current=li(c.current,{startingIndex:me,decrement:!0,disabledIndices:D}):L.current=Math.max(ae,li(c.current,{startingIndex:me,decrement:!0,disabledIndices:D})),Sp(c.current,L.current)&&(L.current=-1),Z(re)}}),Te=v.useMemo(()=>C&&i&&pe&&{"aria-activedescendant":`${P}-${f}`},[C,i,pe,P,f]),ke=v.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...H?{}:Te,onKeyDown(re){if(re.key==="Tab"&&re.shiftKey&&i&&!C){const me=Zn(re.nativeEvent);if(me&&!Ge(W.current,me))return;xi(re),n.setOpen(!1,Qe(vo,re.nativeEvent)),Zt(o)&&o.focus();return}we(re)},onPointerMove(){Y.current=!0}}),[Te,we,W,O,H,n,i,C,o]),ve=v.useMemo(()=>{function re(ae){E==="auto"&&uD(ae.nativeEvent)&&(I.current=!C)}function me(ae){I.current=E,E==="auto"&&fD(ae.nativeEvent)&&(I.current=!0)}return{onKeyDown(ae){const oe=n.select("open");Y.current=!1;const Ie=ae.key.startsWith("Arrow"),Xe=J_(ae.key,Le(),w),Ue=lh(ae.key,O),qe=(x?Xe:Ue)||ae.key==="Enter"||ae.key.trim()==="";if(C&&oe)return we(ae);if(!(!oe&&!T&&Ie)){if(qe){const ft=lh(ae.key,Le());K.current=x&&ft?null:ae.key}if(x){Xe&&(xi(ae),oe?(L.current=R0(c,fe.current),Z(ae)):n.setOpen(!0,Qe(qh,ae.nativeEvent,ae.currentTarget)));return}Ue&&(de.current!=null&&(L.current=de.current),xi(ae),!oe&&T?n.setOpen(!0,Qe(qh,ae.nativeEvent,ae.currentTarget)):we(ae),oe&&Z(ae))}},onFocus(ae){n.select("open")&&!C&&(L.current=-1,Z(ae))},onPointerDown:me,onPointerEnter:me,onMouseDown:re,onClick:re}},[we,fe,E,c,x,Z,n,T,O,Le,w,de,C]),Ce=v.useMemo(()=>({...Te,...ve}),[Te,ve]);return v.useMemo(()=>h?{reference:Ce,floating:ke,item:De,trigger:ve}:{},[h,Ce,ke,ve,De])}const tH=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function $S(t,e={}){const n="rootStore"in t?t.rootStore:t,i=n.useState("open"),s=n.useState("floatingId"),o=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=e,f=Po(),d=o?.id||f,h=v.useMemo(()=>ju(l)?.id||s,[l,s]),m=tH.get(c)??c,b=Js()!=null,x=v.useMemo(()=>m==="tooltip"||c==="label"?Sn:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&b&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[m,b,c]),w=v.useMemo(()=>m==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:i?h:void 0}:{...x,"aria-expanded":i?"true":"false","aria-controls":i?h:void 0,...m==="menu"&&{id:d}},[m,h,i,d,c,x]),C=v.useMemo(()=>{const M={id:h,...m&&{role:m}};return m==="tooltip"||c==="label"?M:{...M,...m==="menu"&&{"aria-labelledby":d}}},[m,h,d,c]),E=v.useCallback(({active:M,selected:T})=>{const D={role:"option",...M&&{id:`${h}-fui-option`}};switch(c){case"select":case"combobox":return{...D,"aria-selected":T}}return{}},[h,c]);return v.useMemo(()=>({reference:w,floating:C,item:E,trigger:x}),[w,C,x,E])}function ok(t,e){const n="rootStore"in t?t.rootStore:t,i=n.context.dataRef,s=n.useState("open"),{listRef:o,elementsRef:l,activeIndex:c,onMatch:f,onTypingChange:d,enabled:h=!0,resetMs:m=750,selectedIndex:g=null}=e,b=On(),x=v.useRef(""),w=v.useRef(g??c??-1),C=v.useRef(null);Oe(()=>{!s&&g!==null||(b.clear(),C.current=null,x.current!==""&&(x.current=""))},[s,g,b]),Oe(()=>{s&&x.current===""&&(w.current=g??c??-1)},[s,g,c]);const E=Ve(A=>{A?i.current.typing||(i.current.typing=A,d?.(A)):i.current.typing&&(i.current.typing=A,d?.(A))}),M=Ve(A=>{function k(H){const I=l?.current[H];return!I||hm(I)}function P(H,I,L=0){if(H.length===0)return-1;const K=(L%H.length+H.length)%H.length,Y=I.toLocaleLowerCase();for(let Z=0;Z<H.length;Z+=1){const le=(K+Z)%H.length;if(!(!H[le]?.toLocaleLowerCase().startsWith(Y)||!k(le)))return le}return-1}const B=o.current;if(x.current.length>0&&A.key===" "&&(xi(A),E(!0)),x.current.length>0&&x.current[0]!==" "&&P(B,x.current)===-1&&A.key!==" "&&E(!1),B==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;s&&A.key!==" "&&(xi(A),E(!0));const z=x.current==="";z&&(w.current=g??c??-1),B.every(H=>H?H[0]?.toLocaleLowerCase()!==H[1]?.toLocaleLowerCase():!0)&&x.current===A.key&&(x.current="",w.current=C.current),x.current+=A.key,b.start(m,()=>{x.current="",w.current=C.current,E(!1)});const F=((z?g??c??-1:w.current)??0)+1,_=P(B,x.current,F);_!==-1?(f?.(_),C.current=_):A.key!==" "&&(x.current="",E(!1))}),T=Ve(A=>{const k=A.relatedTarget,P=n.select("domReferenceElement"),B=n.select("floatingElement"),z=Ge(P,k),q=Ge(B,k);z||q||(b.clear(),x.current="",w.current=C.current,E(!1))}),D=v.useMemo(()=>({onKeyDown:M,onBlur:T}),[M,T]),O=v.useMemo(()=>({onKeyDown:M,onBlur:T}),[M,T]);return v.useMemo(()=>h?{reference:D,floating:O}:{},[h,D,O])}const rR=.1,nH=rR*rR,qt=.5;function ah(t,e,n,i,s,o){return i>=e!=o>=e&&t<=(s-n)*(e-i)/(o-i)+n}function ch(t,e,n,i,s,o,l,c,f,d){let h=!1;return ah(t,e,n,i,s,o)&&(h=!h),ah(t,e,s,o,l,c)&&(h=!h),ah(t,e,l,c,f,d)&&(h=!h),ah(t,e,f,d,n,i)&&(h=!h),h}function iH(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function uh(t,e,n,i,s,o){const l=Math.min(n,s),c=Math.max(n,s),f=Math.min(i,o),d=Math.max(i,o);return t>=l&&t<=c&&e>=f&&e<=d}function Tm(t={}){const{blockPointerEvents:e=!1}=t,n=new ss,i=({x:s,y:o,placement:l,elements:c,onClose:f,nodeId:d,tree:h})=>{const m=l?.split("-")[0];let g=!1,b=null,x=null,w=typeof performance<"u"?performance.now():0;function C(M,T){const D=performance.now(),O=D-w;if(b===null||x===null||O===0)return b=M,x=T,w=D,!1;const A=M-b,k=T-x,P=A*A+k*k,B=O*O*nH;return b=M,x=T,w=D,P<B}function E(){n.clear(),f()}return function(T){n.clear();const D=c.domReference,O=c.floating;if(!D||!O||m==null||s==null||o==null)return;const{clientX:A,clientY:k}=T,P=Zn(T),B=T.type==="mouseleave",z=Ge(O,P),q=Ge(D,P);if(z&&(g=!0,!B))return;if(q&&(g=!1,!B)){g=!0;return}if(B&&Tt(T.relatedTarget)&&Ge(O,T.relatedTarget))return;function W(){return!!(h&&qs(h.nodesRef.current,d).length>0)}function F(){W()||E()}if(W())return;const _=D.getBoundingClientRect(),H=O.getBoundingClientRect(),I=s>H.right-H.width/2,L=o>H.bottom-H.height/2,K=H.width>_.width,Y=H.height>_.height,Z=(K?_:H).left,le=(K?_:H).right,V=(Y?_:H).top,U=(Y?_:H).bottom;if(m==="top"&&o>=_.bottom-1||m==="bottom"&&o<=_.top+1||m==="left"&&s>=_.right-1||m==="right"&&s<=_.left+1){F();return}let $=!1;switch(m){case"top":$=uh(A,k,Z,_.top+1,le,H.bottom-1);break;case"bottom":$=uh(A,k,Z,H.top+1,le,_.bottom-1);break;case"left":$=uh(A,k,H.right-1,U,_.left+1,V);break;case"right":$=uh(A,k,_.right-1,U,H.left+1,V);break}if($)return;if(g&&!iH(A,k,_)){F();return}if(!B&&C(A,k)){F();return}let G=!1;switch(m){case"top":{const J=K?qt/2:qt*4,fe=K||I?s+J:s-J,ie=K?s-J:I?s+J:s-J,de=o+qt+1,Se=I||K?H.bottom-qt:H.top,Fe=I?K?H.bottom-qt:H.top:H.bottom-qt;G=ch(A,k,fe,de,ie,de,H.left,Se,H.right,Fe);break}case"bottom":{const J=K?qt/2:qt*4,fe=K||I?s+J:s-J,ie=K?s-J:I?s+J:s-J,de=o-qt,Se=I||K?H.top+qt:H.bottom,Fe=I?K?H.top+qt:H.bottom:H.top+qt;G=ch(A,k,fe,de,ie,de,H.left,Se,H.right,Fe);break}case"left":{const J=Y?qt/2:qt*4,fe=Y||L?o+J:o-J,ie=Y?o-J:L?o+J:o-J,de=s+qt+1,Se=L||Y?H.right-qt:H.left,Fe=L?Y?H.right-qt:H.left:H.right-qt;G=ch(A,k,Se,H.top,Fe,H.bottom,de,fe,de,ie);break}case"right":{const J=Y?qt/2:qt*4,fe=Y||L?o+J:o-J,ie=Y?o-J:L?o+J:o-J,de=s-qt,Se=L||Y?H.left+qt:H.right,Fe=L?Y?H.left+qt:H.right:H.left+qt;G=ch(A,k,de,fe,de,ie,Se,H.top,Fe,H.bottom);break}}G?g||n.start(40,F):F()}};return i.__options={...t,blockPointerEvents:e},i}let sH=(function(t){return t.nestedDialogs="--nested-dialogs",t})({}),rH=(function(t){return t[t.open=ul.open]="open",t[t.closed=ul.closed]="closed",t[t.startingStyle=ul.startingStyle]="startingStyle",t[t.endingStyle=ul.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});const lk=v.createContext(void 0);function oH(){const t=v.useContext(lk);if(t===void 0)throw new Error(zt(26));return t}const ak="ArrowUp",ck="ArrowDown",uk="ArrowLeft",fk="ArrowRight",dk="Home",hk="End",lH=new Set([uk,fk]),aH=new Set([ak,ck]),cH=new Set([...lH,...aH]);[...cH];const Rm=new Set([ak,ck,uk,fk,dk,hk]),uH={...Oo,...Pr,nestedDialogOpen(t){return t?{[rH.nestedDialogOpen]:""}:null}},GQ=v.forwardRef(function(e,n){const{className:i,finalFocus:s,initialFocus:o,render:l,style:c,...f}=e,{store:d}=Mo(),h=d.useState("descriptionElementId"),m=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),w=d.useState("mounted"),C=d.useState("nested"),E=d.useState("nestedOpenDialogCount"),M=d.useState("open"),T=d.useState("openMethod"),D=d.useState("titleElementId"),O=d.useState("transitionStatus"),A=d.useState("role");oH(),er({open:M,ref:d.context.popupRef,onComplete(){M&&d.context.onOpenChangeComplete?.(!0)}});function k(W){return W==="touch"?d.context.popupRef.current:!0}const P=o===void 0?k:o,B=E>0,q=Dt("div",e,{state:{open:M,nested:C,transitionStatus:O,nestedDialogOpen:B},props:[b,{"aria-labelledby":D??void 0,"aria-describedby":h??void 0,role:A,tabIndex:-1,hidden:!w,onKeyDown(W){Rm.has(W.key)&&W.stopPropagation()},style:{[sH.nestedDialogs]:E}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:uH});return ue.jsx(mm,{context:g,openInteractionType:T,disabled:!w,closeOnFocusOut:!m,initialFocus:P,returnFocus:s,modal:x!==!1,restoreFocus:"popup",children:q})});function Am(t){return ES(19)?t:t?"true":void 0}const Mm=v.forwardRef(function(e,n){const{cutout:i,...s}=e;let o;if(i){const l=i.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return ue.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),XQ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=Mo(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||i?ue.jsx(lk.Provider,{value:i,children:ue.jsxs(pm,{ref:n,...s,children:[l&&c===!0&&ue.jsx(Mm,{ref:o.context.internalBackdropRef,inert:Am(!f)}),e.children]})}):null});function Cf(t){const e=v.useRef(!0);e.current&&(e.current=!1,t())}let oR={},lR={},aR="";function fH(t){if(typeof document>"u")return!1;const e=yt(t);return dn(e).innerWidth-e.documentElement.clientWidth>0}function dH(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=yt(t),i=n.documentElement,s=n.body,o=Do(i)?i:s,l=o.style.overflowY,c=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=l,i.style.scrollbarGutter=c,f===d}function hH(t){const e=yt(t),n=e.documentElement,i=e.body,s=Do(n)?n:i,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function pH(t){const e=yt(t),n=e.documentElement,i=e.body,s=dn(n);let o=0,l=0,c=!1;const f=Ls.create();if(NS&&(s.visualViewport?.scale??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),x=s.getComputedStyle(i),E=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,oR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},aR=n.style.scrollBehavior,lR={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const M=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,D=b.overflowY==="scroll"||x.overflowY==="scroll",O=b.overflowX==="scroll"||x.overflowX==="scroll",A=Math.max(0,s.innerWidth-i.clientWidth),k=Math.max(0,s.innerHeight-i.clientHeight),P=parseFloat(x.marginTop)+parseFloat(x.marginBottom),B=parseFloat(x.marginLeft)+parseFloat(x.marginRight),z=Do(n)?n:i;if(c=dH(t),c){n.style.scrollbarGutter=E,z.style.overflowY="hidden",z.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(M||D)&&(n.style.overflowY="scroll"),(T||O)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:P||k?`calc(100dvh - ${P+k}px)`:"100dvh",width:B||A?`calc(100vw - ${B+A}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=o,i.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,oR),Object.assign(i.style,lR),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=aR)}function m(){h(),f.request(d)}d();const g=ht(s,"resize",m);return()=>{f.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class mH{lockCount=0;restore=null;timeoutLock=ss.create();timeoutUnlock=ss.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const i=yt(e).documentElement,s=dn(i).getComputedStyle(i).overflowY;if(s==="hidden"||s==="clip"){this.restore=Hn;return}const o=oD||!fH(e);this.restore=o?hH(e):pH(e)}}const gH=new mH;function pk(t=!0,e=null){Oe(()=>{if(t)return gH.acquire(e)},[t,e])}function yH(t){const e=v.useRef(""),n=v.useCallback(s=>{s.defaultPrevented||(e.current=s.pointerType,t(s,s.pointerType))},[t]);return{onClick:v.useCallback(s=>{if(s.detail===0){t(s,"keyboard");return}"pointerType"in s?t(s,s.pointerType):t(s,e.current),e.current=""},[t]),onPointerDown:n}}function QS(t,e){const n=v.useRef(t),i=Ve(e);Oe(()=>{n.current!==t&&i(n.current)},[t,i]),Oe(()=>{n.current=t},[t])}function Om(t){const[e,n]=v.useState(null),i=Ve((l,c)=>{t||n(c||(oD?"touch":""))});QS(t,l=>{l&&!t&&n(null)});const{onClick:s,onPointerDown:o}=yH(i);return v.useMemo(()=>({openMethod:e,triggerProps:{onClick:s,onPointerDown:o}}),[e,s,o])}function vH(t){const{store:e,parentContext:n,actionsRef:i,isDrawer:s}=t,o=e.useState("open"),l=e.useState("disablePointerDismissal"),c=e.useState("modal"),f=e.useState("popupElement"),{openMethod:d,triggerProps:h}=Om(o);vm(e);const{forceUnmount:m}=bm(o,e),g=Ve(W=>{const F=Qe(W);return F.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},F}),b=v.useCallback(()=>{e.setOpen(!1,g(cm))},[e,g]);v.useImperativeHandle(i,()=>({unmount:m,close:b}),[m,b]);const x=wm({popupStore:e,onOpenChange:e.setOpen,treatPopupAsFloatingElement:!0}),[w,C]=v.useState(0),[E,M]=v.useState(0),T=w===0,D=$S(x),O=Sf(x,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(W){if(!e.context.outsidePressEnabledRef.current||"button"in W&&W.button!==0||"touches"in W&&W.touches.length!==1)return!1;const F=Zn(W);if(T&&!l){const _=F;return c&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===_||e.context.backdropRef.current===_||Ge(_,f)&&!_?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:T});pk(o&&c===!0,f);const{getReferenceProps:A,getFloatingProps:k,getTriggerProps:P}=Nr([D,O]);e.useContextCallback("onNestedDialogOpen",(W,F)=>{C(W),M(F)}),e.useContextCallback("onNestedDialogClose",()=>{C(0),M(0)}),v.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(w+1,E+(s?1:0)),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[s,o,w,E,n]);const B=v.useMemo(()=>A(h),[A,h]),z=v.useMemo(()=>P(h),[P,h]),q=v.useMemo(()=>k(),[k]);e.useSyncedValues({openMethod:d,activeTriggerProps:B,inactiveTriggerProps:z,popupProps:q,floatingRootContext:x,nestedOpenDialogCount:w,nestedOpenDrawerCount:E})}const bH={...xm,modal:be(t=>t.modal),nested:be(t=>t.nested),nestedOpenDialogCount:be(t=>t.nestedOpenDialogCount),nestedOpenDrawerCount:be(t=>t.nestedOpenDrawerCount),disablePointerDismissal:be(t=>t.disablePointerDismissal),openMethod:be(t=>t.openMethod),descriptionElementId:be(t=>t.descriptionElementId),titleElementId:be(t=>t.titleElementId),viewportElement:be(t=>t.viewportElement),role:be(t=>t.role)};class ZS extends xf{constructor(e){super(SH(e),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new lc,onOpenChange:void 0,onOpenChangeComplete:void 0},bH)}setOpen=(e,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const i={open:e},s=n.trigger?.id??null;(s||e)&&(i.activeTriggerId=s,i.activeTriggerElement=n.trigger??null),this.update(i)};static useStore(e,n){const i=kn(()=>new ZS(n)).current;return e??i}}function SH(t={}){return{...Sm(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}const cR=v.createContext(!1);function $Q(t){const{children:e,open:n,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:h,defaultTriggerId:m=null}=t,g=Mo(!0),b=v.useContext(cR),x=!!g,w=ZS.useStore(d?.store,{open:i,openProp:n,activeTriggerId:m,triggerIdProp:h,modal:c,disablePointerDismissal:l,nested:x});Cf(()=>{n===void 0&&w.state.open===!1&&i===!0&&w.update({open:!0,activeTriggerId:m})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",h),w.useSyncedValues({disablePointerDismissal:l,nested:x,modal:c}),w.useContextCallback("onOpenChange",s),w.useContextCallback("onOpenChangeComplete",o);const C=w.useState("payload");vH({store:w,actionsRef:f,parentContext:g?.store.context,isDrawer:b});const E=v.useMemo(()=>({store:w}),[w]);return ue.jsx(cR.Provider,{value:!1,children:ue.jsx(YO.Provider,{value:E,children:typeof e=="function"?e({payload:C}):e})})}const QQ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,id:l,...c}=e,{store:f}=Mo(),d=Ti(l);return f.useSyncedValueWithCleanup("titleElementId",d),Dt("h2",e,{ref:n,props:[{id:d},c]})}),ZQ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:l=!0,id:c,payload:f,handle:d,style:h,...m}=e,g=Mo(!0),b=d?.store??g?.store;if(!b)throw new Error(zt(79));const x=Ti(c),w=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",x),E=v.useRef(null),{registerTrigger:M,isMountedByThisTrigger:T}=ym(x,E,b,{payload:f}),{getButtonProps:D,buttonRef:O}=ko({disabled:o,native:l}),A=bf(w,{enabled:w!=null}),k=Nr([A]),P={disabled:o,open:C},B=b.useState("triggerProps",T);return Dt("button",e,{state:P,ref:[O,n,M,E],props:[k.getReferenceProps(),B,{[AS]:"",id:x},m,D],stateAttributesMapping:mf})}),uR=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fR=Y3,JQ=(t,e)=>n=>{var i;if(e?.variants==null)return fR(t,n?.class,n?.className);const{variants:s,defaultVariants:o}=e,l=Object.keys(s).map(d=>{const h=n?.[d],m=o?.[d];if(h===null)return null;const g=uR(h)||uR(m);return s[d][g]}),c=n&&Object.entries(n).reduce((d,h)=>{let[m,g]=h;return g===void 0||(d[m]=g),d},{}),f=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((d,h)=>{let{class:m,className:g,...b}=h;return Object.entries(b).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...o,...c}[w]):{...o,...c}[w]===C})?[...d,m,g]:d},[]);return fR(t,l,f,n?.class,n?.className)},mk=v.createContext(void 0);function Ef(t){const e=v.useContext(mk);if(e===void 0&&!t)throw new Error(zt(72));return e}const xH={...xm,disabled:be(t=>t.disabled),instantType:be(t=>t.instantType),isInstantPhase:be(t=>t.isInstantPhase),trackCursorAxis:be(t=>t.trackCursorAxis),disableHoverablePopup:be(t=>t.disableHoverablePopup),lastOpenChangeReason:be(t=>t.openChangeReason),closeOnClick:be(t=>t.closeOnClick),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport)};class JS extends xf{constructor(e){super({...wH(),...e},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new lc},xH)}setOpen=(e,n)=>{const i=n.reason,s=i===An,o=e&&i===ka,l=!e&&(i===$s||i===gf);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const c=()=>{const f={open:e,openChangeReason:i};o?f.instantType="focus":l?f.instantType="dismiss":i===An&&(f.instantType=void 0);const d=n.trigger?.id??null;(d||e)&&(f.activeTriggerId=d,f.activeTriggerElement=n.trigger??null),this.update(f)};s?Fn.flushSync(c):c()};static useStore(e,n){const i=kn(()=>new JS(n)).current,s=e??i,o=wm({popupStore:s,onOpenChange:s.setOpen});return s.state.floatingRootContext=o,s}}function wH(){return{...Sm(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const eZ=KS(function(e){const{disabled:n=!1,defaultOpen:i=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:h,triggerId:m,defaultTriggerId:g=null,children:b}=e,x=JS.useStore(h?.store,{open:i,openProp:s,activeTriggerId:g,triggerIdProp:m});Cf(()=>{s===void 0&&x.state.open===!1&&i===!0&&x.update({open:!0,activeTriggerId:g})}),x.useControlledProp("openProp",s),x.useControlledProp("triggerIdProp",m),x.useContextCallback("onOpenChange",f),x.useContextCallback("onOpenChangeComplete",d);const w=x.useState("open"),C=!n&&w,E=x.useState("activeTriggerId"),M=x.useState("payload");x.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),Oe(()=>{w&&n&&x.setOpen(!1,Qe(t5))},[w,n,x]),x.useSyncedValue("disabled",n),vm(x);const{forceUnmount:T,transitionStatus:D}=bm(C,x),O=x.select("floatingRootContext"),A=x.useState("isInstantPhase"),k=x.useState("instantType"),P=x.useState("lastOpenChangeReason"),B=v.useRef(null);Oe(()=>{D==="ending"&&P===rc||D!=="ending"&&A?(k!=="delay"&&(B.current=k),x.set("instantType","delay")):B.current!==null&&(x.set("instantType",B.current),B.current=null)},[D,A,P,k,x]),Oe(()=>{C&&E==null&&x.set("payload",void 0)},[x,E,C]);const z=v.useCallback(()=>{x.setOpen(!1,CH(x,cm))},[x]);v.useImperativeHandle(c,()=>({unmount:T,close:z}),[T,z]);const q=Sf(O,{enabled:!n,referencePress:()=>x.select("closeOnClick")}),W=K5(O,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:F,getFloatingProps:_,getTriggerProps:H}=Nr([q,W]),I=v.useMemo(()=>F(),[F]),L=v.useMemo(()=>H(),[H]),K=v.useMemo(()=>_(),[_]);return x.useSyncedValues({activeTriggerProps:I,inactiveTriggerProps:L,popupProps:K}),ue.jsx(mk.Provider,{value:x,children:typeof b=="function"?b({payload:M}):b})});function CH(t,e){const n=Qe(e);return n.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},n}const gk=v.createContext(void 0);function EH(){return v.useContext(gk)}let TH=(function(t){return t[t.popupOpen=mp.popupOpen]="popupOpen",t.triggerDisabled="data-trigger-disabled",t})({});const RH=600,tZ=ZD(function(e,n){const{className:i,render:s,handle:o,payload:l,disabled:c,delay:f,closeOnClick:d=!0,closeDelay:h,id:m,style:g,...b}=e,x=Ef(!0),w=o?.store??x;if(!w)throw new Error(zt(82));const C=Ti(m),E=w.useState("isTriggerActive",C),M=w.useState("isOpenedByTrigger",C),T=w.useState("floatingRootContext"),D=v.useRef(null),O=f??RH,A=h??0,{registerTrigger:k,isMountedByThisTrigger:P}=ym(C,D,w,{payload:l,closeOnClick:d,closeDelay:A}),B=EH(),{delayRef:z,isInstantPhase:q,hasProvider:W}=f5(T,{open:M});w.useSyncedValue("isInstantPhase",q);const F=w.useState("disabled"),_=c??F,H=w.useState("trackCursorAxis"),I=w.useState("disableHoverablePopup"),L=Cm(T,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!I&&H!=="both"?Tm():null,restMs(){const V=B?.delay,U=typeof z.current=="object"?z.current.open:void 0;let $=O;return W&&(U!==0?$=f??V??O:$=0),$},delay(){const V=typeof z.current=="object"?z.current.close:void 0;let U=A;return h==null&&W&&(U=V),{close:U}},triggerElementRef:D,isActiveTrigger:E,isClosing:()=>w.select("transitionStatus")==="ending"}),K=nk(T,{enabled:!_}).reference,Y={open:M},Z=w.useState("triggerProps",P);return Dt("button",e,{state:Y,ref:[n,k,D],props:[L,K,Z,{onPointerDown(){w.set("closeOnClick",d)},id:C,[TH.triggerDisabled]:_?"":void 0},b],stateAttributesMapping:mf})}),yk=v.createContext(void 0);function AH(){const t=v.useContext(yk);if(t===void 0)throw new Error(zt(70));return t}const MH=v.forwardRef(function(e,n){const{children:i,container:s,className:o,render:l,style:c,...f}=e,{portalNode:d,portalSubtree:h}=LD({container:s,ref:n,componentProps:e,elementProps:f});return!h&&!d?null:ue.jsxs(v.Fragment,{children:[h,d&&Fn.createPortal(i,d)]})}),nZ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e;return Ef().useState("mounted")||i?ue.jsx(yk.Provider,{value:i,children:ue.jsx(MH,{ref:n,...s})}):null}),vk=v.createContext(void 0);function bk(){const t=v.useContext(vk);if(t===void 0)throw new Error(zt(71));return t}const OH=v.createContext(void 0);function ex(){return v.useContext(OH)?.direction??"ltr"}const DH=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:s,rects:o,platform:l,elements:c,middlewareData:f}=e,{element:d,padding:h=0,offsetParent:m="real"}=Or(t,e)||{};if(d==null)return{};const g=SD(h),b={x:n,y:i},x=zS(s),w=VS(x),C=await l.getDimensions(d),E=x==="y",M=E?"top":"left",T=E?"bottom":"right",D=E?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[x]-b[x]-o.floating[w],A=b[x]-o.reference[x],k=m==="real"?await l.getOffsetParent?.(d):c.floating;let P=c.floating[D]||o.floating[w];(!P||!await l.isElement?.(k))&&(P=c.floating[D]||o.floating[w]);const B=O/2-A/2,z=P/2-C[w]/2-1,q=Math.min(g[M],z),W=Math.min(g[T],z),F=q,_=P-C[w]-W,H=P/2-C[w]/2+B,I=Xv(F,H,_),L=!f.arrow&&No(s)!=null&&H!==I&&o.reference[w]/2-(H<F?q:W)-C[w]/2<0,K=L?H<F?H-F:H-_:0;return{[x]:b[x]+K,data:{[x]:I,centerOffset:H-I-K,...L&&{alignmentOffset:K}},reset:L}}}),kH=(t,e)=>({...DH(t),options:[t,e]}),PH={name:"hide",async fn(t){const{width:e,height:n,x:i,y:s}=t.rects.reference,o=e===0&&n===0&&i===0&&s===0;return{data:{referenceHidden:(await I_().fn(t)).data?.referenceHidden||o}}}},Xh={sideX:"left",sideY:"top"},tx={name:"adaptiveOrigin",async fn(t){const{x:e,y:n,rects:{floating:i},elements:{floating:s},platform:o,strategy:l,placement:c}=t,f=dn(s),d=f.getComputedStyle(s);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:e,y:n,data:Xh};const m=await o.getOffsetParent?.(s);let g={width:0,height:0};if(l==="fixed"&&f?.visualViewport)g={width:f.visualViewport.width,height:f.visualViewport.height};else if(m===f){const M=yt(s);g={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await o.isElement?.(m)&&(g=await o.getDimensions(m));const b=Ei(c);let x=e,w=n;b==="left"&&(x=g.width-(e+i.width)),b==="top"&&(w=g.height-(n+i.height));const C=b==="left"?"right":Xh.sideX,E=b==="top"?"bottom":Xh.sideY;return{x,y:w,data:{sideX:C,sideY:E}}}};function Sk(t,e,n){const i=t==="inline-start"||t==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[e]}function dR(t,e,n){const{rects:i,placement:s}=t;return{side:Sk(e,Ei(s),n),align:No(s)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Dm(t){const{anchor:e,positionMethod:n="absolute",side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:h=5,disableAnchorTracking:m=!1,keepMounted:g=!1,floatingRootContext:b,mounted:x,collisionAvoidance:w,shiftCrossAxis:C=!1,nodeId:E,adaptiveOrigin:M,lazyFlip:T=!1,externalTree:D}=t,[O,A]=v.useState(null);!x&&O!==null&&A(null);const k=w.side||"flip",P=w.align||"flip",B=w.fallbackAxisSide||"end",z=typeof e=="function"?e:void 0,q=Ve(z),W=z?q:e,F=Mn(e),_=Mn(x),I=ex()==="rtl",L=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[i],K=o==="center"?L:`${L}-${o}`;let Y=f;const Z=1,le=i==="bottom"?Z:0,V=i==="top"?Z:0,U=i==="right"?Z:0,$=i==="left"?Z:0;typeof Y=="number"?Y={top:Y+le,right:Y+$,bottom:Y+V,left:Y+U}:Y&&(Y={top:(Y.top||0)+le,right:(Y.right||0)+$,bottom:(Y.bottom||0)+V,left:(Y.left||0)+U});const G={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:Y},J=v.useRef(null),fe=Mn(s),ie=Mn(l),Fe=[O_(Ze=>{const Ke=dR(Ze,i,I),pt=typeof fe.current=="function"?fe.current(Ke):fe.current,vt=typeof ie.current=="function"?ie.current(Ke):ie.current;return{mainAxis:pt,crossAxis:vt,alignmentAxis:vt}},[typeof s!="function"?s:0,typeof l!="function"?l:0,I,i])],pe=P==="none"&&k!=="shift",Ee=!pe&&(d||C||k==="shift"),De=k==="none"?null:P_({...G,padding:{top:Y.top+Z,right:Y.right+Z,bottom:Y.bottom+Z,left:Y.left+Z},mainAxis:!C&&k==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),Le=pe?null:D_(Ze=>{const Ke=yt(Ze.elements.floating).documentElement;return{...G,rootBoundary:C?{x:0,y:0,width:Ke.clientWidth,height:Ke.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:Ee,limiter:d||C?void 0:k_(pt=>{if(!J.current)return{};const{width:vt,height:mt}=J.current.getBoundingClientRect(),it=Qi(Ei(pt.placement)),Pe=it==="y"?vt:mt,et=it==="y"?Y.left+Y.right:Y.top+Y.bottom;return{offset:Pe/2+et/2}})}},[G,d,C,Y,P]);k==="shift"||P==="shift"||o==="center"?Fe.push(Le,De):Fe.push(De,Le),Fe.push(N_({...G,apply({elements:{floating:Ze},availableWidth:Ke,availableHeight:pt,rects:vt}){if(!_.current)return;const mt=Ze.style;mt.setProperty("--available-width",`${Ke}px`),mt.setProperty("--available-height",`${pt}px`);const it=dn(Ze).devicePixelRatio||1,{x:Pe,y:et,width:ot,height:gt}=vt.reference,_t=(Math.round((Pe+ot)*it)-Math.round(Pe*it))/it,bt=(Math.round((et+gt)*it)-Math.round(et*it))/it;mt.setProperty("--anchor-width",`${_t}px`),mt.setProperty("--anchor-height",`${bt}px`)}}),kH(()=>({element:J.current||yt(J.current).createElement("div"),padding:h,offsetParent:"floating"}),[h]),{name:"transformOrigin",fn(Ze){const{elements:Ke,middlewareData:pt,placement:vt,rects:mt,y:it}=Ze,Pe=Ei(vt),et=Qi(Pe),ot=J.current,gt=pt.arrow?.x||0,_t=pt.arrow?.y||0,bt=ot?.clientWidth||0,nt=ot?.clientHeight||0,Gt=gt+bt/2,Ot=_t+nt/2,Vt=Math.abs(pt.shift?.y||0),tt=mt.reference.height/2,lt=typeof s=="function"?s(dR(Ze,i,I)):s,ln=Vt>lt,Pn={top:`${Gt}px calc(100% + ${lt}px)`,bottom:`${Gt}px ${-lt}px`,left:`calc(100% + ${lt}px) ${Ot}px`,right:`${-lt}px ${Ot}px`}[Pe],an=`${Gt}px ${mt.reference.y+tt-it}px`;return Ke.floating.style.setProperty("--transform-origin",Ee&&et==="y"&&ln?an:Pn),{}}},PH,M),Oe(()=>{!x&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,b]);const we=v.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Te,elements:ke,x:ve,y:Ce,middlewareData:re,update:me,placement:ae,context:oe,isPositioned:Ie,floatingStyles:Xe}=X_({rootContext:b,open:g?x:void 0,placement:K,middleware:Fe,strategy:n,whileElementsMounted:g?void 0:(...Ze)=>ZT(...Ze,we),nodeId:E,externalTree:D}),{sideX:Ue,sideY:qe}=re.adaptiveOrigin||Xh,ft=Ie?n:"fixed",at=v.useMemo(()=>{const Ze=M?{position:ft,[Ue]:ve,[qe]:Ce}:{position:ft,...Xe};return Ie||(Ze.opacity=0),Ze},[M,ft,Ue,ve,qe,Ce,Xe,Ie]),ct=v.useRef(null);Oe(()=>{if(!x)return;const Ze=F.current,Ke=typeof Ze=="function"?Ze():Ze,vt=(hR(Ke)?Ke.current:Ke)||null||null;vt!==ct.current&&(Te.setPositionReference(vt),ct.current=vt)},[x,Te,W,F]),v.useEffect(()=>{if(!x)return;const Ze=F.current;typeof Ze!="function"&&hR(Ze)&&Ze.current!==ct.current&&(Te.setPositionReference(Ze.current),ct.current=Ze.current)},[x,Te,W,F]),v.useEffect(()=>{if(g&&x&&ke.domReference&&ke.floating)return ZT(ke.domReference,ke.floating,me,we)},[g,x,ke,me,we]);const Ae=Ei(ae),je=Sk(i,Ae,I),We=No(ae)||"center",xt=!!re.hide?.referenceHidden;Oe(()=>{T&&x&&Ie&&A(Ae)},[T,x,Ie,Ae]);const wt=v.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),Yt=re.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:at,arrowStyles:wt,arrowRef:J,arrowUncentered:Yt,side:je,align:We,physicalSide:Ae,anchorHidden:xt,refs:Te,context:oe,isPositioned:Ie,update:me}),[at,wt,J,Yt,je,We,Ae,xt,Te,oe,Ie,me])}function hR(t){return t!=null&&"current"in t}function Tf(t){return t==="starting"?A4:Sn}function km(t,e,{styles:n,transitionStatus:i,props:s,refs:o,hidden:l,inert:c=!1}){const f={...n};return c&&(f.pointerEvents="none"),Dt("div",t,{state:e,ref:o,props:[{role:"presentation",hidden:l,style:f},Tf(i),s],stateAttributesMapping:Oo})}const iZ=v.forwardRef(function(e,n){const{render:i,className:s,anchor:o,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=MS,style:E,...M}=e,T=Ef(),D=AH(),O=T.useState("open"),A=T.useState("mounted"),k=T.useState("trackCursorAxis"),P=T.useState("disableHoverablePopup"),B=T.useState("floatingRootContext"),z=T.useState("instantType"),q=T.useState("transitionStatus"),W=T.useState("hasViewport"),F=Dm({anchor:o,positionMethod:l,floatingRootContext:B,mounted:A,side:c,sideOffset:d,align:f,alignOffset:h,collisionBoundary:m,collisionPadding:g,sticky:x,arrowPadding:b,disableAnchorTracking:w,keepMounted:D,collisionAvoidance:C,adaptiveOrigin:W?tx:void 0}),_=v.useMemo(()=>({open:O,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:k!=="none"?"tracking-cursor":z}),[O,F.side,F.align,F.anchorHidden,k,z]),H=km(e,_,{styles:F.positionerStyles,transitionStatus:q,props:M,refs:[n,T.useStateSetter("positionerElement")],hidden:!A,inert:!O||k==="both"||P});return ue.jsx(vk.Provider,{value:F,children:H})}),NH={...Oo,...Pr},sZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...l}=e,c=Ef(),{side:f,align:d}=bk(),h=c.useState("open"),m=c.useState("instantType"),g=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext");er({open:h,ref:c.context.popupRef,onComplete(){h&&c.context.onOpenChangeComplete?.(!0)}});const w=c.useState("disabled"),C=c.useState("closeDelay");return XS(x,{enabled:!w,closeDelay:C}),Dt("div",e,{state:{open:h,side:f,align:d,instant:m,transitionStatus:g},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[b,Tf(g),l],stateAttributesMapping:NH})}),rZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...l}=e,c=Ef(),f=c.useState("open"),d=c.useState("instantType"),{arrowRef:h,side:m,align:g,arrowUncentered:b,arrowStyles:x}=bk();return Dt("div",e,{state:{open:f,side:m,align:g,uncentered:b,instant:d},ref:[n,h],props:[{style:x,"aria-hidden":!0},l],stateAttributesMapping:Oo})}),oZ=function(e){const{delay:n,closeDelay:i,timeout:s=400}=e,o=v.useMemo(()=>({delay:n,closeDelay:i}),[n,i]),l=v.useMemo(()=>({open:n,close:i}),[n,i]);return ue.jsx(gk.Provider,{value:o,children:ue.jsx(u5,{delay:l,timeoutMs:s,children:e.children})})};function IH(t){const[e,n]=v.useState({current:t,previous:null});return t!==e.current&&n({current:t,previous:e.current}),e.previous}function LH(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const BH=t=>{switch(t){case"success":return _H;case"info":return FH;case"warning":return HH;case"error":return UH;default:return null}},VH=Array(12).fill(0),zH=({visible:t,className:e})=>ye.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ye.createElement("div",{className:"sonner-spinner"},VH.map((n,i)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),_H=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),HH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),FH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),UH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ye.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),jH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WH=()=>{const[t,e]=ye.useState(document.hidden);return ye.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let tb=1;class KH{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:i,...s}=e,o=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:tb++,l=this.toasts.find(f=>f.id===o),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...e,id:o,title:i}),{...f,...e,id:o,dismissible:c,title:i}):f):this.addToast({title:i,...s,dismissible:c,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(i=>i({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let i;n.loading!==void 0&&(i=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let o=i!==void 0,l;const c=s.then(async d=>{if(l=["resolve",d],ye.isValidElement(d))o=!1,this.create({id:i,type:"default",message:d});else if(YH(d)&&!d.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:g,...x})}else if(d instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:g,...x})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(d):n.success,g=typeof n.description=="function"?await n.description(d):n.description,x=typeof m=="object"&&!ye.isValidElement(m)?m:{message:m};this.create({id:i,type:"success",description:g,...x})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,b=typeof h=="object"&&!ye.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:m,...b})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,h)=>c.then(()=>l[0]==="reject"?h(l[1]):d(l[1])).catch(h));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(e,n)=>{const i=n?.id||tb++;return this.create({jsx:e(i),id:i,...n}),i},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Si=new KH,qH=(t,e)=>{const n=e?.id||tb++;return Si.addToast({title:t,...e,id:n}),n},YH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",GH=qH,XH=()=>Si.toasts,$H=()=>Si.getActiveToasts(),QH=Object.assign(GH,{success:Si.success,info:Si.info,warning:Si.warning,error:Si.error,custom:Si.custom,message:Si.message,promise:Si.promise,dismiss:Si.dismiss,loading:Si.loading},{getHistory:XH,getToasts:$H});LH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function fh(t){return t.label!==void 0}const ZH=3,JH="24px",eF="16px",pR=4e3,tF=356,nF=14,iF=45,sF=200;function Os(...t){return t.filter(Boolean).join(" ")}function rF(t){const[e,n]=t.split("-"),i=[];return e&&i.push(e),n&&i.push(n),i}const oF=t=>{var e,n,i,s,o,l,c,f,d;const{invert:h,toast:m,unstyled:g,interacting:b,setHeights:x,visibleToasts:w,heights:C,index:E,toasts:M,expanded:T,removeToast:D,defaultRichColors:O,closeButton:A,style:k,cancelButtonStyle:P,actionButtonStyle:B,className:z="",descriptionClassName:q="",duration:W,position:F,gap:_,expandByDefault:H,classNames:I,icons:L,closeButtonAriaLabel:K="Close toast"}=t,[Y,Z]=ye.useState(null),[le,V]=ye.useState(null),[U,$]=ye.useState(!1),[G,J]=ye.useState(!1),[fe,ie]=ye.useState(!1),[de,Se]=ye.useState(!1),[Fe,pe]=ye.useState(!1),[Ee,De]=ye.useState(0),[Le,we]=ye.useState(0),Te=ye.useRef(m.duration||W||pR),ke=ye.useRef(null),ve=ye.useRef(null),Ce=E===0,re=E+1<=w,me=m.type,ae=m.dismissible!==!1,oe=m.className||"",Ie=m.descriptionClassName||"",Xe=ye.useMemo(()=>C.findIndex(Pe=>Pe.toastId===m.id)||0,[C,m.id]),Ue=ye.useMemo(()=>{var Pe;return(Pe=m.closeButton)!=null?Pe:A},[m.closeButton,A]),qe=ye.useMemo(()=>m.duration||W||pR,[m.duration,W]),ft=ye.useRef(0),at=ye.useRef(0),ct=ye.useRef(0),Ae=ye.useRef(null),[je,We]=F.split("-"),xt=ye.useMemo(()=>C.reduce((Pe,et,ot)=>ot>=Xe?Pe:Pe+et.height,0),[C,Xe]),wt=WH(),Yt=m.invert||h,Ze=me==="loading";at.current=ye.useMemo(()=>Xe*_+xt,[Xe,xt]),ye.useEffect(()=>{Te.current=qe},[qe]),ye.useEffect(()=>{$(!0)},[]),ye.useEffect(()=>{const Pe=ve.current;if(Pe){const et=Pe.getBoundingClientRect().height;return we(et),x(ot=>[{toastId:m.id,height:et,position:m.position},...ot]),()=>x(ot=>ot.filter(gt=>gt.toastId!==m.id))}},[x,m.id]),ye.useLayoutEffect(()=>{if(!U)return;const Pe=ve.current,et=Pe.style.height;Pe.style.height="auto";const ot=Pe.getBoundingClientRect().height;Pe.style.height=et,we(ot),x(gt=>gt.find(bt=>bt.toastId===m.id)?gt.map(bt=>bt.toastId===m.id?{...bt,height:ot}:bt):[{toastId:m.id,height:ot,position:m.position},...gt])},[U,m.title,m.description,x,m.id,m.jsx,m.action,m.cancel]);const Ke=ye.useCallback(()=>{J(!0),De(at.current),x(Pe=>Pe.filter(et=>et.toastId!==m.id)),setTimeout(()=>{D(m)},sF)},[m,D,x,at]);ye.useEffect(()=>{if(m.promise&&me==="loading"||m.duration===1/0||m.type==="loading")return;let Pe;return T||b||wt?(()=>{if(ct.current<ft.current){const gt=new Date().getTime()-ft.current;Te.current=Te.current-gt}ct.current=new Date().getTime()})():Te.current!==1/0&&(ft.current=new Date().getTime(),Pe=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ke()},Te.current)),()=>clearTimeout(Pe)},[T,b,m,me,wt,Ke]),ye.useEffect(()=>{m.delete&&(Ke(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ke,m.delete]);function pt(){var Pe;if(L?.loading){var et;return ye.createElement("div",{className:Os(I?.loader,m==null||(et=m.classNames)==null?void 0:et.loader,"sonner-loader"),"data-visible":me==="loading"},L.loading)}return ye.createElement(zH,{className:Os(I?.loader,m==null||(Pe=m.classNames)==null?void 0:Pe.loader),visible:me==="loading"})}const vt=m.icon||L?.[me]||BH(me);var mt,it;return ye.createElement("li",{tabIndex:0,ref:ve,className:Os(z,oe,I?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,I?.default,I?.[me],m==null||(n=m.classNames)==null?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":(mt=m.richColors)!=null?mt:O,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":U,"data-promise":!!m.promise,"data-swiped":Fe,"data-removed":G,"data-visible":re,"data-y-position":je,"data-x-position":We,"data-index":E,"data-front":Ce,"data-swiping":fe,"data-dismissible":ae,"data-type":me,"data-invert":Yt,"data-swipe-out":de,"data-swipe-direction":le,"data-expanded":!!(T||H&&U),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":M.length-E,"--offset":`${G?Ee:at.current}px`,"--initial-height":H?"auto":`${Le}px`,...k,...m.style},onDragEnd:()=>{ie(!1),Z(null),Ae.current=null},onPointerDown:Pe=>{Pe.button!==2&&(Ze||!ae||(ke.current=new Date,De(at.current),Pe.target.setPointerCapture(Pe.pointerId),Pe.target.tagName!=="BUTTON"&&(ie(!0),Ae.current={x:Pe.clientX,y:Pe.clientY})))},onPointerUp:()=>{var Pe,et,ot;if(de||!ae)return;Ae.current=null;const gt=Number(((Pe=ve.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),_t=Number(((et=ve.current)==null?void 0:et.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((ot=ke.current)==null?void 0:ot.getTime()),nt=Y==="x"?gt:_t,Gt=Math.abs(nt)/bt;if(Math.abs(nt)>=iF||Gt>.11){De(at.current),m.onDismiss==null||m.onDismiss.call(m,m),V(Y==="x"?gt>0?"right":"left":_t>0?"down":"up"),Ke(),Se(!0);return}else{var Ot,Vt;(Ot=ve.current)==null||Ot.style.setProperty("--swipe-amount-x","0px"),(Vt=ve.current)==null||Vt.style.setProperty("--swipe-amount-y","0px")}pe(!1),ie(!1),Z(null)},onPointerMove:Pe=>{var et,ot,gt;if(!Ae.current||!ae||((et=window.getSelection())==null?void 0:et.toString().length)>0)return;const bt=Pe.clientY-Ae.current.y,nt=Pe.clientX-Ae.current.x;var Gt;const Ot=(Gt=t.swipeDirections)!=null?Gt:rF(F);!Y&&(Math.abs(nt)>1||Math.abs(bt)>1)&&Z(Math.abs(nt)>Math.abs(bt)?"x":"y");let Vt={x:0,y:0};const tt=lt=>1/(1.5+Math.abs(lt)/20);if(Y==="y"){if(Ot.includes("top")||Ot.includes("bottom"))if(Ot.includes("top")&&bt<0||Ot.includes("bottom")&&bt>0)Vt.y=bt;else{const lt=bt*tt(bt);Vt.y=Math.abs(lt)<Math.abs(bt)?lt:bt}}else if(Y==="x"&&(Ot.includes("left")||Ot.includes("right")))if(Ot.includes("left")&&nt<0||Ot.includes("right")&&nt>0)Vt.x=nt;else{const lt=nt*tt(nt);Vt.x=Math.abs(lt)<Math.abs(nt)?lt:nt}(Math.abs(Vt.x)>0||Math.abs(Vt.y)>0)&&pe(!0),(ot=ve.current)==null||ot.style.setProperty("--swipe-amount-x",`${Vt.x}px`),(gt=ve.current)==null||gt.style.setProperty("--swipe-amount-y",`${Vt.y}px`)}},Ue&&!m.jsx&&me!=="loading"?ye.createElement("button",{"aria-label":K,"data-disabled":Ze,"data-close-button":!0,onClick:Ze||!ae?()=>{}:()=>{Ke(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Os(I?.closeButton,m==null||(i=m.classNames)==null?void 0:i.closeButton)},(it=L?.close)!=null?it:jH):null,(me||m.icon||m.promise)&&m.icon!==null&&(L?.[me]!==null||m.icon)?ye.createElement("div",{"data-icon":"",className:Os(I?.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||pt():null,m.type!=="loading"?vt:null):null,ye.createElement("div",{"data-content":"",className:Os(I?.content,m==null||(o=m.classNames)==null?void 0:o.content)},ye.createElement("div",{"data-title":"",className:Os(I?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Os(q,Ie,I?.description,m==null||(c=m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),ye.isValidElement(m.cancel)?m.cancel:m.cancel&&fh(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||P,onClick:Pe=>{fh(m.cancel)&&ae&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Pe),Ke())},className:Os(I?.cancelButton,m==null||(f=m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,ye.isValidElement(m.action)?m.action:m.action&&fh(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||B,onClick:Pe=>{fh(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Pe),!Pe.defaultPrevented&&Ke())},className:Os(I?.actionButton,m==null||(d=m.classNames)==null?void 0:d.actionButton)},m.action.label):null)};function mR(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function lF(t,e){const n={};return[t,e].forEach((i,s)=>{const o=s===1,l=o?"--mobile-offset":"--offset",c=o?eF:JH;function f(d){["top","right","bottom","left"].forEach(h=>{n[`${l}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(d=>{i[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof i[d]=="number"?`${i[d]}px`:i[d]}):f(c)}),n}const aF=ye.forwardRef(function(e,n){const{id:i,invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:h,mobileOffset:m,theme:g="light",richColors:b,duration:x,style:w,visibleToasts:C=ZH,toastOptions:E,dir:M=mR(),gap:T=nF,icons:D,containerAriaLabel:O="Notifications"}=e,[A,k]=ye.useState([]),P=ye.useMemo(()=>i?A.filter(U=>U.toasterId===i):A.filter(U=>!U.toasterId),[A,i]),B=ye.useMemo(()=>Array.from(new Set([o].concat(P.filter(U=>U.position).map(U=>U.position)))),[P,o]),[z,q]=ye.useState([]),[W,F]=ye.useState(!1),[_,H]=ye.useState(!1),[I,L]=ye.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=ye.useRef(null),Y=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=ye.useRef(null),le=ye.useRef(!1),V=ye.useCallback(U=>{k($=>{var G;return(G=$.find(J=>J.id===U.id))!=null&&G.delete||Si.dismiss(U.id),$.filter(({id:J})=>J!==U.id)})},[]);return ye.useEffect(()=>Si.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{k($=>$.map(G=>G.id===U.id?{...G,delete:!0}:G))});return}setTimeout(()=>{PD.flushSync(()=>{k($=>{const G=$.findIndex(J=>J.id===U.id);return G!==-1?[...$.slice(0,G),{...$[G],...U},...$.slice(G+1)]:[U,...$]})})})}),[A]),ye.useEffect(()=>{if(g!=="system"){L(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:$})=>{L($?"dark":"light")})}catch{U.addListener(({matches:G})=>{try{L(G?"dark":"light")}catch(J){console.error(J)}})}},[g]),ye.useEffect(()=>{A.length<=1&&F(!1)},[A]),ye.useEffect(()=>{const U=$=>{var G;if(l.every(ie=>$[ie]||$.code===ie)){var fe;F(!0),(fe=K.current)==null||fe.focus()}$.code==="Escape"&&(document.activeElement===K.current||(G=K.current)!=null&&G.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[l]),ye.useEffect(()=>{if(K.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,le.current=!1)}},[K.current]),ye.createElement("section",{ref:n,"aria-label":`${O} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((U,$)=>{var G;const[J,fe]=U.split("-");return P.length?ye.createElement("ol",{key:U,dir:M==="auto"?mR():M,tabIndex:-1,ref:K,className:d,"data-sonner-toaster":!0,"data-sonner-theme":I,"data-y-position":J,"data-x-position":fe,style:{"--front-toast-height":`${((G=z[0])==null?void 0:G.height)||0}px`,"--width":`${tF}px`,"--gap":`${T}px`,...w,...lF(h,m)},onBlur:ie=>{le.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(le.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||le.current||(le.current=!0,Z.current=ie.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{_||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},P.filter(ie=>!ie.position&&$===0||ie.position===U).map((ie,de)=>{var Se,Fe;return ye.createElement(oF,{key:ie.id,icons:D,index:de,toast:ie,defaultRichColors:b,duration:(Se=E?.duration)!=null?Se:x,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:s,visibleToasts:C,closeButton:(Fe=E?.closeButton)!=null?Fe:f,interacting:_,position:U,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:V,toasts:P.filter(pe=>pe.position==ie.position),heights:z.filter(pe=>pe.position==ie.position),setHeights:q,expandByDefault:c,gap:T,expanded:W,swipeDirections:e.swipeDirections})})):null}))}),lZ=Object.freeze(Object.defineProperty({__proto__:null,Toaster:aF,toast:QH},Symbol.toStringTag,{value:"Module"}));function Ep({controlled:t,default:e,name:n,state:i="value"}){const{current:s}=v.useRef(t!==void 0),[o,l]=v.useState(e),c=s?t:o,f=v.useCallback(d=>{s||l(d)},[]);return[c,f]}let gR=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({}),yR=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const cF={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},uF={disabled:!1,...vu},nx={valid(t){return t===null?null:t?{[yR.valid]:""}:{[yR.invalid]:""}}};function xk(t){return v.useMemo(()=>({checked(e){return t.indeterminate?{}:e?{[gR.checked]:""}:{[gR.unchecked]:""}},...nx}),[t.indeterminate])}const fF=v.createContext({invalid:void 0,name:void 0,validityData:{state:cF,errors:[],error:"",value:"",initialValue:null},setValidityData:Hn,disabled:void 0,touched:vu.touched,setTouched:Hn,dirty:vu.dirty,setDirty:Hn,filled:vu.filled,setFilled:Hn,focused:vu.focused,setFocused:Hn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:uF,markedDirtyRef:{current:!1},registerFieldControl:Hn,validation:{getValidationProps:(t=Sn)=>t,getInputValidationProps:(t=Sn)=>t,inputRef:{current:null},commit:async()=>{}}});function Pm(t=!0){const e=v.useContext(fF);if(e.setValidityData===Hn&&!t)throw new Error(zt(28));return e}function wk(t,e){const{enabled:n=!0,getValue:i,id:s,value:o}=e,{registerFieldControl:l}=Pm(),c=v.useRef(null);c.current||(c.current=Symbol()),Oe(()=>{const f=c.current;if(!(!f||!n))return l(f,{controlRef:t,getValue:i,id:s,value:o}),()=>{l(f,void 0)}},[t,n,i,s,l,o])}const dF=v.createContext({disabled:!1});function hF(){return v.useContext(dF)}const pF=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Hn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Ck(){return v.useContext(pF)}const mF=v.createContext({controlId:void 0,registerControlId:Hn,labelId:void 0,setLabelId:Hn,messageIds:[],setMessageIds:Hn,getDescriptionProps:t=>t});function ix(){return v.useContext(mF)}function gF(t,e,n,i=!0,s){const[o,l]=v.useState(),c=Ti(s?`${s}-label`:void 0),f=t??e??o;return Oe(()=>{const d=t||e||!i?void 0:yF(n.current,c);o!==d&&l(d)}),f}function yF(t,e){const n=vF(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}function vF(t){if(!t)return;const e=t.parentElement;if(e&&e.tagName==="LABEL")return e;const n=t.id;if(n){const s=t.nextElementSibling;if(s&&s.htmlFor===n)return s}const i=t.labels;return i&&i[0]}const bF=v.createContext(void 0);function SF(t=!0){const e=v.useContext(bF);if(e===void 0&&!t)throw new Error(zt(3));return e}const Ek=v.createContext(void 0);function xF(){const t=v.useContext(Ek);if(t===void 0)throw new Error(zt(14));return t}const wF="data-parent",aZ=v.forwardRef(function(e,n){const{checked:i,className:s,defaultChecked:o=!1,"aria-labelledby":l,disabled:c=!1,form:f,id:d,indeterminate:h=!1,inputRef:m,name:g,onCheckedChange:b,parent:x=!1,readOnly:w=!1,render:C,required:E=!1,uncheckedValue:M,value:T,nativeButton:D=!1,style:O,...A}=e,{clearErrors:k}=Ck(),{disabled:P,name:B,setDirty:z,setFilled:q,setFocused:W,setTouched:F,state:_,validationMode:H,validityData:I,shouldValidateOnChange:L,validation:K}=Pm(),Y=hF(),{labelId:Z,controlId:le,registerControlId:V,getDescriptionProps:U}=ix(),$=SF(),G=$?.parent,J=G&&$.allValues,fe=P||Y.disabled||$?.disabled||c,ie=B??g,de=T??ie,Se=Ti(),Fe=Ti();let pe=le;J?pe=x?Fe:`${G.id}-${de}`:d&&(pe=d);let Ee={};J&&(x?Ee=$.parent.getParentProps():de&&(Ee=$.parent.getChildProps(de)));const De=Ve(b),{checked:Le=i,indeterminate:we=h,onCheckedChange:Te,...ke}=Ee,ve=$?.value,Ce=$?.setValue,re=$?.defaultValue,me=v.useRef(null),ae=kn(()=>Symbol("checkbox-control")),oe=v.useRef(!1),{getButtonProps:Ie,buttonRef:Xe}=ko({disabled:fe,native:D}),Ue=$?.validation??K,[qe,ft]=Ep({controlled:de&&ve&&!x?ve.includes(de):Le,default:de&&re&&!x?re.includes(de):o,name:"Checkbox",state:"checked"});Oe(()=>{V!==Hn&&(oe.current=!0,V(ae.current,pe))},[pe,$,V,x,ae]),v.useEffect(()=>{const Ke=ae.current;return()=>{!oe.current||V===Hn||(oe.current=!1,V(Ke,void 0))}},[V,ae]),wk(me,{enabled:!$,id:Se,value:qe});const at=v.useRef(null),ct=Ar(m,at,Ue.inputRef),Ae=gF(l,Z,at,!D,pe??void 0);Oe(()=>{at.current&&(at.current.indeterminate=we,qe&&q(!0))},[qe,we,q]),QS(qe,()=>{$&&!x||(k(ie),q(qe),z(qe!==I.initialValue),L()?Ue.commit(qe):Ue.commit(qe,!0))});const je=Mr({checked:qe,disabled:fe,form:f,name:x?void 0:ie,id:D?void 0:pe??void 0,required:E,ref:ct,style:ie?gD:IS,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Ke){if(Ke.nativeEvent.defaultPrevented)return;if(w){Ke.preventDefault();return}const pt=Ke.currentTarget.checked,vt=Qe(rc,Ke.nativeEvent);if(Te?.(pt,vt),De(pt,vt),!vt.isCanceled&&(ft(pt),de&&ve&&Ce&&!x&&!J)){const mt=pt?[...ve,de]:ve.filter(it=>it!==de);Ce(mt,vt)}},onFocus(){me.current?.focus()}},T!==void 0?{value:($?qe&&T:T)||""}:Sn,U,$?Ue.getValidationProps:Ue.getInputValidationProps),We=J?!!Le:qe,xt=J&&we||h;v.useEffect(()=>{if(!G||!de)return;const Ke=G.disabledStatesRef.current;return Ke.set(de,fe),()=>{Ke.delete(de)}},[G,fe,de]);const wt=v.useMemo(()=>({..._,checked:We,disabled:fe,readOnly:w,required:E,indeterminate:xt}),[_,We,fe,w,E,xt]),Yt=xk(wt),Ze=Dt("span",e,{state:wt,ref:[Xe,me,n,$?.registerControlRef],props:[{id:D?pe??void 0:Se,role:"checkbox","aria-checked":we?"mixed":qe,"aria-readonly":w||void 0,"aria-required":E||void 0,"aria-labelledby":Ae,[wF]:x?"":void 0,onFocus(){W(!0)},onBlur(){const Ke=at.current;Ke&&(F(!0),W(!1),H==="onBlur"&&Ue.commit($?ve:Ke.checked))},onClick(Ke){w||fe||(Ke.preventDefault(),at.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Ke.shiftKey,ctrlKey:Ke.ctrlKey,altKey:Ke.altKey,metaKey:Ke.metaKey})))}},U,Ue.getValidationProps,A,ke,Ie],stateAttributesMapping:Yt});return ue.jsxs(Ek.Provider,{value:wt,children:[Ze,!qe&&!$&&ie&&!x&&M!==void 0&&ue.jsx("input",{type:"hidden",form:f,name:ie,value:M}),ue.jsx("input",{...je,suppressHydrationWarning:!0})]})}),cZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,keepMounted:l=!1,...c}=e,f=xF(),d=f.checked||f.indeterminate,{mounted:h,transitionStatus:m,setMounted:g}=wf(d),b=v.useRef(null),x={...f,transitionStatus:m};er({open:d,ref:b,onComplete(){d||g(!1)}});const w=xk(f),C=v.useMemo(()=>({...w,...Pr,...nx}),[w]),E=l||h,M=Dt("span",e,{ref:[n,b],state:x,stateAttributesMapping:C,props:c});return E?M:null});function Bs(t){const e=new Uint8Array(t);let n="";for(const s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Tp(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=(4-e.length%4)%4,i=e.padEnd(e.length+n,"="),s=atob(i),o=new ArrayBuffer(s.length),l=new Uint8Array(o);for(let c=0;c<s.length;c++)l[c]=s.charCodeAt(c);return o}function sx(){return CF.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const CF={stubThis:t=>t};function Tk(t){const{id:e}=t;return{...t,id:Tp(e),transports:t.transports}}function Rk(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class Yn extends Error{constructor({message:e,code:n,cause:i,name:s}){super(e,{cause:i}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s??i.name,this.code=n}}function EF({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Yn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new Yn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new Yn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(n.authenticatorSelection?.userVerification==="required")return new Yn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Yn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Yn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return n.pubKeyCredParams.filter(s=>s.type==="public-key").length===0?new Yn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Yn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(Rk(i)){if(n.rp.id!==i)return new Yn({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Yn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Yn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Yn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class TF{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Ak=new TF,RF=["cross-platform","platform"];function Mk(t){if(t&&!(RF.indexOf(t)<0))return t}async function uZ(t){!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useAutoRegister:n=!1}=t;if(!sx())throw new Error("WebAuthn is not supported in this browser");const i={...e,challenge:Tp(e.challenge),user:{...e.user,id:Tp(e.user.id)},excludeCredentials:e.excludeCredentials?.map(Tk)},s={};n&&(s.mediation="conditional"),s.publicKey=i,s.signal=Ak.createNewAbortSignal();let o;try{o=await navigator.credentials.create(s)}catch(x){throw EF({error:x,options:s})}if(!o)throw new Error("Registration was not completed");const{id:l,rawId:c,response:f,type:d}=o;let h;typeof f.getTransports=="function"&&(h=f.getTransports());let m;if(typeof f.getPublicKeyAlgorithm=="function")try{m=f.getPublicKeyAlgorithm()}catch(x){H0("getPublicKeyAlgorithm()",x)}let g;if(typeof f.getPublicKey=="function")try{const x=f.getPublicKey();x!==null&&(g=Bs(x))}catch(x){H0("getPublicKey()",x)}let b;if(typeof f.getAuthenticatorData=="function")try{b=Bs(f.getAuthenticatorData())}catch(x){H0("getAuthenticatorData()",x)}return{id:l,rawId:Bs(c),response:{attestationObject:Bs(f.attestationObject),clientDataJSON:Bs(f.clientDataJSON),transports:h,publicKeyAlgorithm:m,publicKey:g,authenticatorData:b},type:d,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:Mk(o.authenticatorAttachment)}}function H0(t,e){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
10
+ `,e)}function AF(){if(!sx())return F0.stubThis(new Promise(e=>e(!1)));const t=globalThis.PublicKeyCredential;return t?.isConditionalMediationAvailable===void 0?F0.stubThis(new Promise(e=>e(!1))):F0.stubThis(t.isConditionalMediationAvailable())}const F0={stubThis:t=>t};function MF({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Yn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Yn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const i=globalThis.location.hostname;if(Rk(i)){if(n.rpId!==i)return new Yn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Yn({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Yn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function fZ(t){!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:e,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:i=!0}=t;if(!sx())throw new Error("WebAuthn is not supported in this browser");let s;e.allowCredentials?.length!==0&&(s=e.allowCredentials?.map(Tk));const o={...e,challenge:Tp(e.challenge),allowCredentials:s},l={};if(n){if(!await AF())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&i)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');l.mediation="conditional",o.allowCredentials=[]}l.publicKey=o,l.signal=Ak.createNewAbortSignal();let c;try{c=await navigator.credentials.get(l)}catch(b){throw MF({error:b,options:l})}if(!c)throw new Error("Authentication was not completed");const{id:f,rawId:d,response:h,type:m}=c;let g;return h.userHandle&&(g=Bs(h.userHandle)),{id:f,rawId:Bs(d),response:{authenticatorData:Bs(h.authenticatorData),clientDataJSON:Bs(h.clientDataJSON),signature:Bs(h.signature),userHandle:g},type:m,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:Mk(c.authenticatorAttachment)}}let nb=[],Ok=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?Ok:nb).push(n=n+t[e])})();function OF(t){if(t<768)return!1;for(let e=0,n=nb.length;;){let i=e+n>>1;if(t<nb[i])n=i;else if(t>=Ok[i])e=i+1;else return!0;if(e==n)return!1}}function vR(t){return t>=127462&&t<=127487}const bR=8205;function DF(t,e,n=!0,i=!0){return(n?Dk:kF)(t,e,i)}function Dk(t,e,n){if(e==t.length)return e;e&&kk(t.charCodeAt(e))&&Pk(t.charCodeAt(e-1))&&e--;let i=U0(t,e);for(e+=SR(i);e<t.length;){let s=U0(t,e);if(i==bR||s==bR||n&&OF(s))e+=SR(s),i=s;else if(vR(s)){let o=0,l=e-2;for(;l>=0&&vR(U0(t,l));)o++,l-=2;if(o%2==0)break;e+=2}else break}return e}function kF(t,e,n){for(;e>0;){let i=Dk(t,e-2,n);if(i<e)return i;e--}return 0}function U0(t,e){let n=t.charCodeAt(e);if(!Pk(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return kk(i)?(n-55296<<10)+(i-56320)+65536:n}function kk(t){return t>=56320&&t<57344}function Pk(t){return t>=55296&&t<56320}function SR(t){return t<65536?1:2}class It{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=Ya(this,e,n);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(n,this.length,s,1),Vs.from(s,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Ya(this,e,n);let i=[];return this.decompose(e,n,i,0),Vs.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Tu(this),o=new Tu(e);for(let l=n,c=n;;){if(s.next(l),o.next(l),l=0,s.lineBreak!=o.lineBreak||s.done!=o.done||s.value!=o.value)return!1;if(c+=s.value.length,s.done||c>=i)return!0}}iter(e=1){return new Tu(this,e)}iterRange(e,n=this.length){return new Nk(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new Ik(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?It.empty:e.length<=32?new bn(e):Vs.from(bn.split(e,[]))}}class bn extends It{constructor(e,n=PF(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,s){for(let o=0;;o++){let l=this.text[o],c=s+l.length;if((n?i:c)>=e)return new NF(s,c,i,l);s=c+1,i++}}decompose(e,n,i,s){let o=e<=0&&n>=this.length?this:new bn(xR(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let l=i.pop(),c=$h(o.text,l.text.slice(),0,o.length);if(c.length<=32)i.push(new bn(c,l.length+o.length));else{let f=c.length>>1;i.push(new bn(c.slice(0,f)),new bn(c.slice(f)))}}else i.push(o)}replace(e,n,i){if(!(i instanceof bn))return super.replace(e,n,i);[e,n]=Ya(this,e,n);let s=$h(this.text,$h(i.text,xR(this.text,0,e)),n),o=this.length+i.length-(n-e);return s.length<=32?new bn(s,o):Vs.from(bn.split(s,[]),o)}sliceString(e,n=this.length,i=`
11
+ `){[e,n]=Ya(this,e,n);let s="";for(let o=0,l=0;o<=n&&l<this.text.length;l++){let c=this.text[l],f=o+c.length;o>e&&l&&(s+=i),e<f&&n>o&&(s+=c.slice(Math.max(0,e-o),n-o)),o=f+1}return s}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],s=-1;for(let o of e)i.push(o),s+=o.length+1,i.length==32&&(n.push(new bn(i,s)),i=[],s=-1);return s>-1&&n.push(new bn(i,s)),n}}class Vs extends It{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,s){for(let o=0;;o++){let l=this.children[o],c=s+l.length,f=i+l.lines-1;if((n?f:c)>=e)return l.lineInner(e,n,i,s);s=c+1,i=f+1}}decompose(e,n,i,s){for(let o=0,l=0;l<=n&&o<this.children.length;o++){let c=this.children[o],f=l+c.length;if(e<=f&&n>=l){let d=s&((l<=e?1:0)|(f>=n?2:0));l>=e&&f<=n&&!d?i.push(c):c.decompose(e-l,n-l,i,d)}l=f+1}}replace(e,n,i){if([e,n]=Ya(this,e,n),i.lines<this.lines)for(let s=0,o=0;s<this.children.length;s++){let l=this.children[s],c=o+l.length;if(e>=o&&n<=c){let f=l.replace(e-o,n-o,i),d=this.lines-l.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let h=this.children.slice();return h[s]=f,new Vs(h,this.length-(n-e)+i.length)}return super.replace(o,c,f)}o=c+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
12
+ `){[e,n]=Ya(this,e,n);let s="";for(let o=0,l=0;o<this.children.length&&l<=n;o++){let c=this.children[o],f=l+c.length;l>e&&o&&(s+=i),e<f&&n>l&&(s+=c.sliceString(e-l,n-l,i)),l=f+1}return s}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Vs))return 0;let i=0,[s,o,l,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=n,o+=n){if(s==l||o==c)return i;let f=this.children[s],d=e.children[o];if(f!=d)return i+f.scanIdentical(d,n);i+=f.length+1}}static from(e,n=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let b of e)i+=b.lines;if(i<32){let b=[];for(let x of e)x.flatten(b);return new bn(b,n)}let s=Math.max(32,i>>5),o=s<<1,l=s>>1,c=[],f=0,d=-1,h=[];function m(b){let x;if(b.lines>o&&b instanceof Vs)for(let w of b.children)m(w);else b.lines>l&&(f>l||!f)?(g(),c.push(b)):b instanceof bn&&f&&(x=h[h.length-1])instanceof bn&&b.lines+x.lines<=32?(f+=b.lines,d+=b.length+1,h[h.length-1]=new bn(x.text.concat(b.text),x.length+1+b.length)):(f+b.lines>s&&g(),f+=b.lines,d+=b.length+1,h.push(b))}function g(){f!=0&&(c.push(h.length==1?h[0]:Vs.from(h,d)),d=-1,f=h.length=0)}for(let b of e)m(b);return g(),c.length==1?c[0]:new Vs(c,n)}}It.empty=new bn([""],0);function PF(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $h(t,e,n=0,i=1e9){for(let s=0,o=0,l=!0;o<t.length&&s<=i;o++){let c=t[o],f=s+c.length;f>=n&&(f>i&&(c=c.slice(0,i-s)),s<n&&(c=c.slice(n-s)),l?(e[e.length-1]+=c,l=!1):e.push(c)),s=f+1}return e}function xR(t,e,n){return $h(t,[""],e,n)}class Tu{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof bn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],o=this.offsets[i],l=o>>1,c=s instanceof bn?s.text.length:s.children.length;if(l==(n>0?c:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
13
+ `,this;e--}else if(s instanceof bn){let f=s.text[l+(n<0?-1:0)];if(this.offsets[i]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=s.children[l+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof bn?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Nk{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new Tu(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*n,this.value=s.length<=i?s:n<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ik{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:s}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(It.prototype[Symbol.iterator]=function(){return this.iter()},Tu.prototype[Symbol.iterator]=Nk.prototype[Symbol.iterator]=Ik.prototype[Symbol.iterator]=function(){return this});class NF{constructor(e,n,i,s){this.from=e,this.to=n,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ya(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Qn(t,e,n=!0,i=!0){return DF(t,e,n,i)}function IF(t){return t>=56320&&t<57344}function LF(t){return t>=55296&&t<56320}function BF(t,e){let n=t.charCodeAt(e);if(!LF(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return IF(i)?(n-55296<<10)+(i-56320)+65536:n}function dZ(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function VF(t){return t<65536?1:2}const ib=/\r\n?|\n/;var Li=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Li||(Li={}));class Ys{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,s=0;n<this.sections.length;){let o=this.sections[n++],l=this.sections[n++];l<0?(e(i,s,o),s+=o):s+=l,i+=o}}iterChangedRanges(e,n=!1){sb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?e.push(i,s):e.push(s,i)}return new Ys(e)}composeDesc(e){return this.empty?e:e.empty?this:Lk(this,e)}mapDesc(e,n=!1){return e.empty?this:rb(this,e,n)}mapPos(e,n=-1,i=Li.Simple){let s=0,o=0;for(let l=0;l<this.sections.length;){let c=this.sections[l++],f=this.sections[l++],d=s+c;if(f<0){if(d>e)return o+(e-s);o+=c}else{if(i!=Li.Simple&&d>=e&&(i==Li.TrackDel&&s<e&&d>e||i==Li.TrackBefore&&s<e||i==Li.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!c)return e==s||n<0?o:o+f;o+=f}s=d}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return o}touchesRange(e,n=e){for(let i=0,s=0;i<this.sections.length&&s<=n;){let o=this.sections[i++],l=this.sections[i++],c=s+o;if(l>=0&&s<=n&&c>=e)return s<e&&c>n?"cover":!0;s=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ys(e)}static create(e){return new Ys(e)}}class In extends Ys{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return sb(this,(n,i,s,o,l)=>e=e.replace(s,s+(i-n),l),!1),e}mapDesc(e,n=!1){return rb(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let s=0,o=0;s<n.length;s+=2){let l=n[s],c=n[s+1];if(c>=0){n[s]=c,n[s+1]=l;let f=s>>1;for(;i.length<f;)i.push(It.empty);i.push(l?e.slice(o,o+l):It.empty)}o+=l}return new In(n,i)}compose(e){return this.empty?e:e.empty?this:Lk(this,e,!0)}map(e,n=!1){return e.empty?this:rb(this,e,n,!0)}iterChanges(e,n=!1){sb(this,e,n)}get desc(){return Ys.create(this.sections)}filter(e){let n=[],i=[],s=[],o=new qu(this);e:for(let l=0,c=0;;){let f=l==e.length?1e9:e[l++];for(;c<f||c==f&&o.len==0;){if(o.done)break e;let h=Math.min(o.len,f-c);ti(s,h,-1);let m=o.ins==-1?-1:o.off==0?o.ins:0;ti(n,h,m),m>0&&fo(i,n,o.text),o.forward(h),c+=h}let d=e[l++];for(;c<d;){if(o.done)break e;let h=Math.min(o.len,d-c);ti(n,h,-1),ti(s,h,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(h),c+=h}}return{changes:new In(n,i),filtered:Ys.create(s)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],s=this.sections[n+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let s=[],o=[],l=0,c=null;function f(h=!1){if(!h&&!s.length)return;l<n&&ti(s,n-l,-1);let m=new In(s,o);c=c?c.compose(m.map(c)):m,s=[],o=[],l=0}function d(h){if(Array.isArray(h))for(let m of h)d(m);else if(h instanceof In){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);f(),c=c?c.compose(h.map(c)):h}else{let{from:m,to:g=m,insert:b}=h;if(m>g||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let x=b?typeof b=="string"?It.of(b.split(i||ib)):b:It.empty,w=x.length;if(m==g&&w==0)return;m<l&&f(),m>l&&ti(s,m-l,-1),ti(s,g-m,w),fo(o,s,x),l=g}}return d(e),f(!c),c}static empty(e){return new In(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let s=0;s<e.length;s++){let o=e[s];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((l,c)=>c&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;i.length<s;)i.push(It.empty);i[s]=It.of(o.slice(1)),n.push(o[0],i[s].length)}}}return new In(n,i)}static createSet(e,n){return new In(e,n)}}function ti(t,e,n,i=!1){if(e==0&&n<=0)return;let s=t.length-2;s>=0&&n<=0&&n==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=n:i?(t[s]+=e,t[s+1]+=n):t.push(e,n)}function fo(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(It.empty);t.push(n)}}function sb(t,e,n){let i=t.inserted;for(let s=0,o=0,l=0;l<t.sections.length;){let c=t.sections[l++],f=t.sections[l++];if(f<0)s+=c,o+=c;else{let d=s,h=o,m=It.empty;for(;d+=c,h+=f,f&&i&&(m=m.append(i[l-2>>1])),!(n||l==t.sections.length||t.sections[l+1]<0);)c=t.sections[l++],f=t.sections[l++];e(s,d,o,h,m),s=d,o=h}}}function rb(t,e,n,i=!1){let s=[],o=i?[]:null,l=new qu(t),c=new qu(e);for(let f=-1;;){if(l.done&&c.len||c.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&c.ins==-1){let d=Math.min(l.len,c.len);ti(s,d,-1),l.forward(d),c.forward(d)}else if(c.ins>=0&&(l.ins<0||f==l.i||l.off==0&&(c.len<l.len||c.len==l.len&&!n))){let d=c.len;for(ti(s,c.ins,-1);d;){let h=Math.min(l.len,d);l.ins>=0&&f<l.i&&l.len<=h&&(ti(s,0,l.ins),o&&fo(o,s,l.text),f=l.i),l.forward(h),d-=h}c.next()}else if(l.ins>=0){let d=0,h=l.len;for(;h;)if(c.ins==-1){let m=Math.min(h,c.len);d+=m,h-=m,c.forward(m)}else if(c.ins==0&&c.len<h)h-=c.len,c.next();else break;ti(s,d,f<l.i?l.ins:0),o&&f<l.i&&fo(o,s,l.text),f=l.i,l.forward(l.len-h)}else{if(l.done&&c.done)return o?In.createSet(s,o):Ys.create(s);throw new Error("Mismatched change set lengths")}}}function Lk(t,e,n=!1){let i=[],s=n?[]:null,o=new qu(t),l=new qu(e);for(let c=!1;;){if(o.done&&l.done)return s?In.createSet(i,s):Ys.create(i);if(o.ins==0)ti(i,o.len,0,c),o.next();else if(l.len==0&&!l.done)ti(i,0,l.ins,c),s&&fo(s,i,l.text),l.next();else{if(o.done||l.done)throw new Error("Mismatched change set lengths");{let f=Math.min(o.len2,l.len),d=i.length;if(o.ins==-1){let h=l.ins==-1?-1:l.off?0:l.ins;ti(i,f,h,c),s&&h&&fo(s,i,l.text)}else l.ins==-1?(ti(i,o.off?0:o.len,f,c),s&&fo(s,i,o.textBit(f))):(ti(i,o.off?0:o.len,l.off?0:l.ins,c),s&&!l.off&&fo(s,i,l.text));c=(o.ins>f||l.ins>=0&&l.len>f)&&(c||i.length>d),o.forward2(f),l.forward(f)}}}}class qu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?It.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?It.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class dl{constructor(e,n,i){this.from=e,this.to=n,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new dl(i,s,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return xe.range(e,n);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return xe.range(this.anchor,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return xe.range(e.anchor,e.head)}static create(e,n,i){return new dl(e,n,i)}}class xe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:xe.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new xe([this.main],0)}addRange(e,n=!0){return xe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,xe.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new xe(e.ranges.map(n=>dl.fromJSON(n)),e.main)}static single(e,n=e){return new xe([xe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let o=e[s];if(o.empty?o.from<=i:o.from<i)return xe.normalized(e.slice(),n);i=o.to}return new xe(e,n)}static cursor(e,n=0,i,s){return dl.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(e,n,i,s){let o=(i??16777215)<<6|(s==null?7:Math.min(6,s));return n<e?dl.create(n,e,48|o):dl.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let i=e[n];e.sort((s,o)=>s.from-o.from),n=e.indexOf(i);for(let s=1;s<e.length;s++){let o=e[s],l=e[s-1];if(o.empty?o.from<=l.to:o.from<l.to){let c=l.from,f=Math.max(o.to,l.to);s<=n&&n--,e.splice(--s,2,o.anchor>o.head?xe.range(f,c):xe.range(c,f))}}return new xe(e,n)}}function Bk(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let rx=0;class He{constructor(e,n,i,s,o){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=s,this.id=rx++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new He(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:ox),!!e.static,e.enables)}of(e){return new Qh([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Qh(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Qh(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}}function ox(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}class Qh{constructor(e,n,i,s){this.dependencies=e,this.facet=n,this.type=i,this.value=s,this.id=rx++}dynamicSlot(e){var n;let i=this.value,s=this.facet.compareInput,o=this.id,l=e[o]>>1,c=this.type==2,f=!1,d=!1,h=[];for(let m of this.dependencies)m=="doc"?f=!0:m=="selection"?d=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[l]=i(m),1},update(m,g){if(f&&g.docChanged||d&&(g.docChanged||g.selection)||ob(m,h)){let b=i(m);if(c?!wR(b,m.values[l],s):!s(b,m.values[l]))return m.values[l]=b,1}return 0},reconfigure:(m,g)=>{let b,x=g.config.address[o];if(x!=null){let w=Ap(g,x);if(this.dependencies.every(C=>C instanceof He?g.facet(C)===m.facet(C):C instanceof tr?g.field(C,!1)==m.field(C,!1):!0)||(c?wR(b=i(m),w,s):s(b=i(m),w)))return m.values[l]=w,0}else b=i(m);return m.values[l]=b,1}}}}function wR(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function ob(t,e){let n=!1;for(let i of e)Ru(t,i)&1&&(n=!0);return n}function zF(t,e,n){let i=n.map(f=>t[f.id]),s=n.map(f=>f.type),o=i.filter(f=>!(f&1)),l=t[e.id]>>1;function c(f){let d=[];for(let h=0;h<i.length;h++){let m=Ap(f,i[h]);if(s[h]==2)for(let g of m)d.push(g);else d.push(m)}return e.combine(d)}return{create(f){for(let d of i)Ru(f,d);return f.values[l]=c(f),1},update(f,d){if(!ob(f,o))return 0;let h=c(f);return e.compare(h,f.values[l])?0:(f.values[l]=h,1)},reconfigure(f,d){let h=ob(f,i),m=d.config.facets[e.id],g=d.facet(e);if(m&&!h&&ox(n,m))return f.values[l]=g,0;let b=c(f);return e.compare(b,g)?(f.values[l]=g,0):(f.values[l]=b,1)}}}const dh=He.define({static:!0});class tr{constructor(e,n,i,s,o){this.id=e,this.createF=n,this.updateF=i,this.compareF=s,this.spec=o,this.provides=void 0}static define(e){let n=new tr(rx++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(dh).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,s)=>{let o=i.values[n],l=this.updateF(o,s);return this.compareF(o,l)?0:(i.values[n]=l,1)},reconfigure:(i,s)=>{let o=i.facet(dh),l=s.facet(dh),c;return(c=o.find(f=>f.field==this))&&c!=l.find(f=>f.field==this)?(i.values[n]=c.create(i),1):s.config.address[this.id]!=null?(i.values[n]=s.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,dh.of({field:this,create:e})]}get extension(){return this}}const cl={lowest:4,low:3,default:2,high:1,highest:0};function au(t){return e=>new Vk(e,t)}const Nm={highest:au(cl.highest),high:au(cl.high),default:au(cl.default),low:au(cl.low),lowest:au(cl.lowest)};class Vk{constructor(e,n){this.inner=e,this.prec=n}}class Im{of(e){return new lb(this,e)}reconfigure(e){return Im.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class lb{constructor(e,n){this.compartment=e,this.inner=n}}class Rp{constructor(e,n,i,s,o,l){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=s,this.staticValues=o,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let s=[],o=Object.create(null),l=new Map;for(let g of _F(e,n,l))g instanceof tr?s.push(g):(o[g.facet.id]||(o[g.facet.id]=[])).push(g);let c=Object.create(null),f=[],d=[];for(let g of s)c[g.id]=d.length<<1,d.push(b=>g.slot(b));let h=i?.config.facets;for(let g in o){let b=o[g],x=b[0].facet,w=h&&h[g]||[];if(b.every(C=>C.type==0))if(c[x.id]=f.length<<1|1,ox(w,b))f.push(i.facet(x));else{let C=x.combine(b.map(E=>E.value));f.push(i&&x.compare(C,i.facet(x))?i.facet(x):C)}else{for(let C of b)C.type==0?(c[C.id]=f.length<<1|1,f.push(C.value)):(c[C.id]=d.length<<1,d.push(E=>C.dynamicSlot(E)));c[x.id]=d.length<<1,d.push(C=>zF(C,x,b))}}let m=d.map(g=>g(c));return new Rp(e,l,m,c,f,o)}}function _F(t,e,n){let i=[[],[],[],[],[]],s=new Map;function o(l,c){let f=s.get(l);if(f!=null){if(f<=c)return;let d=i[f].indexOf(l);d>-1&&i[f].splice(d,1),l instanceof lb&&n.delete(l.compartment)}if(s.set(l,c),Array.isArray(l))for(let d of l)o(d,c);else if(l instanceof lb){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(l.compartment)||l.inner;n.set(l.compartment,d),o(d,c)}else if(l instanceof Vk)o(l.inner,l.prec);else if(l instanceof tr)i[c].push(l),l.provides&&o(l.provides,c);else if(l instanceof Qh)i[c].push(l),l.facet.extensions&&o(l.facet.extensions,cl.default);else{let d=l.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(d,c)}}return o(t,cl.default),i.reduce((l,c)=>l.concat(c))}function Ru(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let s=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|s}function Ap(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const zk=He.define(),ab=He.define({combine:t=>t.some(e=>e),static:!0}),_k=He.define({combine:t=>t.length?t[0]:void 0,static:!0}),Hk=He.define(),Fk=He.define(),Uk=He.define(),jk=He.define({combine:t=>t.length?t[0]:!1});class Lo{constructor(e,n){this.type=e,this.value=n}static define(){return new HF}}class HF{of(e){return new Lo(this,e)}}class FF{constructor(e){this.map=e}of(e){return new Jt(this,e)}}class Jt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Jt(this.type,n)}is(e){return this.type==e}static define(e={}){return new FF(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let s of e){let o=s.map(n);o&&i.push(o)}return i}}Jt.reconfigure=Jt.define();Jt.appendConfig=Jt.define();class Bn{constructor(e,n,i,s,o,l){this.startState=e,this.changes=n,this.selection=i,this.effects=s,this.annotations=o,this.scrollIntoView=l,this._doc=null,this._state=null,i&&Bk(i,n.newLength),o.some(c=>c.type==Bn.time)||(this.annotations=o.concat(Bn.time.of(Date.now())))}static create(e,n,i,s,o,l){return new Bn(e,n,i,s,o,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Bn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Bn.time=Lo.define();Bn.userEvent=Lo.define();Bn.addToHistory=Lo.define();Bn.remote=Lo.define();function UF(t,e){let n=[];for(let i=0,s=0;;){let o,l;if(i<t.length&&(s==e.length||e[s]>=t[i]))o=t[i++],l=t[i++];else if(s<e.length)o=e[s++],l=e[s++];else return n;!n.length||n[n.length-1]<o?n.push(o,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function Wk(t,e,n){var i;let s,o,l;return n?(s=e.changes,o=In.empty(e.changes.length),l=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),l=t.changes.compose(s)),{changes:l,selection:e.selection?e.selection.map(o):(i=t.selection)===null||i===void 0?void 0:i.map(s),effects:Jt.mapEffects(t.effects,s).concat(Jt.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function cb(t,e,n){let i=e.selection,s=Ba(e.annotations);return e.userEvent&&(s=s.concat(Bn.userEvent.of(e.userEvent))),{changes:e.changes instanceof In?e.changes:In.of(e.changes||[],n,t.facet(_k)),selection:i&&(i instanceof xe?i:xe.single(i.anchor,i.head)),effects:Ba(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Kk(t,e,n){let i=cb(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let l=!!e[o].sequential;i=Wk(i,cb(t,e[o],l?i.changes.newLength:t.doc.length),l)}let s=Bn.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return WF(n?jF(s):s)}function jF(t){let e=t.startState,n=!0;for(let s of e.facet(Hk)){let o=s(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:UF(n,o))}if(n!==!0){let s,o;if(n===!1)o=t.changes.invertedDesc,s=In.empty(e.doc.length);else{let l=t.changes.filter(n);s=l.changes,o=l.filtered.mapDesc(l.changes).invertedDesc}t=Bn.create(e,s,t.selection&&t.selection.map(o),Jt.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let i=e.facet(Fk);for(let s=i.length-1;s>=0;s--){let o=i[s](t);o instanceof Bn?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Bn?t=o[0]:t=Kk(e,Ba(o),!1)}return t}function WF(t){let e=t.startState,n=e.facet(Uk),i=t;for(let s=n.length-1;s>=0;s--){let o=n[s](t);o&&Object.keys(o).length&&(i=Wk(i,cb(e,o,t.changes.newLength),!0))}return i==t?t:Bn.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const KF=[];function Ba(t){return t==null?KF:Array.isArray(t)?t:[t]}var Cr=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Cr||(Cr={}));const qF=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ub;try{ub=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function YF(t){if(ub)return ub.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||qF.test(n)))return!0}return!1}function GF(t){return e=>{if(!/\S/.test(e))return Cr.Space;if(YF(e))return Cr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Cr.Word;return Cr.Other}}class Ut{constructor(e,n,i,s,o,l){this.config=e,this.doc=n,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=o,l&&(l._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)Ru(this,c<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Ru(this,i),Ap(this,i)}update(...e){return Kk(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:s}=n;for(let c of e.effects)c.is(Im.reconfigure)?(n&&(s=new Map,n.compartments.forEach((f,d)=>s.set(d,f)),n=null),s.set(c.value.compartment,c.value.extension)):c.is(Jt.reconfigure)?(n=null,i=c.value):c.is(Jt.appendConfig)&&(n=null,i=Ba(i).concat(c.value));let o;n?o=e.startState.values.slice():(n=Rp.resolve(i,s,this),o=new Ut(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let l=e.startState.facet(ab)?e.newSelection:e.newSelection.asSingle();new Ut(n,e.newDoc,l,o,(c,f)=>f.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:xe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),s=this.changes(i.changes),o=[i.range],l=Ba(i.effects);for(let c=1;c<n.ranges.length;c++){let f=e(n.ranges[c]),d=this.changes(f.changes),h=d.map(s);for(let g=0;g<c;g++)o[g]=o[g].map(h);let m=s.mapDesc(d,!0);o.push(f.range.map(m)),s=s.compose(h),l=Jt.mapEffects(l,h).concat(Jt.mapEffects(Ba(f.effects),m))}return{changes:s,selection:xe.create(o,n.mainIndex),effects:l}}changes(e=[]){return e instanceof In?e:In.of(e,this.doc.length,this.facet(Ut.lineSeparator))}toText(e){return It.of(e.split(this.facet(Ut.lineSeparator)||ib))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Ru(this,n),Ap(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof tr&&this.config.address[s.id]!=null&&(n[i]=s.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let l=i[o],c=e[o];s.push(l.init(f=>l.spec.fromJSON(c,f)))}}return Ut.create({doc:e.doc,selection:xe.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=Rp.resolve(e.extensions||[],new Map),i=e.doc instanceof It?e.doc:It.of((e.doc||"").split(n.staticFacet(Ut.lineSeparator)||ib)),s=e.selection?e.selection instanceof xe?e.selection:xe.single(e.selection.anchor,e.selection.head):xe.single(0);return Bk(s,i.length),n.staticFacet(ab)||(s=s.asSingle()),new Ut(n,i,s,n.dynamicSlots.map(()=>null),(o,l)=>l.create(o),null)}get tabSize(){return this.facet(Ut.tabSize)}get lineBreak(){return this.facet(Ut.lineSeparator)||`
14
+ `}get readOnly(){return this.facet(jk)}phrase(e,...n){for(let i of this.facet(Ut.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let o=+(s||1);return!o||o>n.length?i:n[o-1]})),e}languageDataAt(e,n,i=-1){let s=[];for(let o of this.facet(zk))for(let l of o(this,n,i))Object.prototype.hasOwnProperty.call(l,e)&&s.push(l[e]);return s}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return GF(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:s}=this.doc.lineAt(e),o=this.charCategorizer(e),l=e-i,c=e-i;for(;l>0;){let f=Qn(n,l,!1);if(o(n.slice(f,l))!=Cr.Word)break;l=f}for(;c<s;){let f=Qn(n,c);if(o(n.slice(c,f))!=Cr.Word)break;c=f}return l==c?null:xe.range(l+i,c+i)}}Ut.allowMultipleSelections=ab;Ut.tabSize=He.define({combine:t=>t.length?t[0]:4});Ut.lineSeparator=_k;Ut.readOnly=jk;Ut.phrases=He.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(s=>t[s]==e[s])}});Ut.languageData=zk;Ut.changeFilter=Hk;Ut.transactionFilter=Fk;Ut.transactionExtender=Uk;Im.reconfigure=Jt.define();function Lm(t,e,n={}){let i={};for(let s of t)for(let o of Object.keys(s)){let l=s[o],c=i[o];if(c===void 0)i[o]=l;else if(!(c===l||l===void 0))if(Object.hasOwnProperty.call(n,o))i[o]=n[o](c,l);else throw new Error("Config merge conflict for field "+o)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Sl{eq(e){return this==e}range(e,n=e){return fb.create(e,n,this)}}Sl.prototype.startSide=Sl.prototype.endSide=0;Sl.prototype.point=!1;Sl.prototype.mapMode=Li.TrackDel;function lx(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let fb=class qk{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new qk(e,n,i)}};function db(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class ax{constructor(e,n,i,s){this.from=e,this.to=n,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,s=0){let o=i?this.to:this.from;for(let l=s,c=o.length;;){if(l==c)return l;let f=l+c>>1,d=o[f]-e||(i?this.value[f].endSide:this.value[f].startSide)-n;if(f==l)return d>=0?l:c;d>=0?c=f:l=f+1}}between(e,n,i,s){for(let o=this.findIndex(n,-1e9,!0),l=this.findIndex(i,1e9,!1,o);o<l;o++)if(s(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let i=[],s=[],o=[],l=-1,c=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],h=this.from[f]+e,m=this.to[f]+e,g,b;if(h==m){let x=n.mapPos(h,d.startSide,d.mapMode);if(x==null||(g=b=x,d.startSide!=d.endSide&&(b=n.mapPos(h,d.endSide),b<g)))continue}else if(g=n.mapPos(h,d.startSide),b=n.mapPos(m,d.endSide),g>b||g==b&&d.startSide>0&&d.endSide<=0)continue;(b-g||d.endSide-d.startSide)<0||(l<0&&(l=g),d.point&&(c=Math.max(c,b-g)),i.push(d),s.push(g-l),o.push(b-l))}return{mapped:i.length?new ax(s,o,i,c):null,pos:l}}}class kt{constructor(e,n,i,s){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=s}static create(e,n,i,s){return new kt(e,n,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:s=0,filterTo:o=this.length}=e,l=e.filter;if(n.length==0&&!l)return this;if(i&&(n=n.slice().sort(db)),this.isEmpty)return n.length?kt.of(n):this;let c=new Yk(this,null,-1).goto(0),f=0,d=[],h=new Yu;for(;c.value||f<n.length;)if(f<n.length&&(c.from-n[f].from||c.startSide-n[f].value.startSide)>=0){let m=n[f++];h.addInner(m.from,m.to,m.value)||d.push(m)}else c.rangeIndex==1&&c.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(c.chunkIndex)<n[f].from)&&(!l||s>this.chunkEnd(c.chunkIndex)||o<this.chunkPos[c.chunkIndex])&&h.addChunk(this.chunkPos[c.chunkIndex],this.chunk[c.chunkIndex])?c.nextChunk():((!l||s>c.to||o<c.from||l(c.from,c.to,c.value))&&(h.addInner(c.from,c.to,c.value)||d.push(fb.create(c.from,c.to,c.value))),c.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?kt.empty:this.nextLayer.update({add:d,filter:l,filterFrom:s,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],s=-1;for(let l=0;l<this.chunk.length;l++){let c=this.chunkPos[l],f=this.chunk[l],d=e.touchesRange(c,c+f.length);if(d===!1)s=Math.max(s,f.maxPoint),n.push(f),i.push(e.mapPos(c));else if(d===!0){let{mapped:h,pos:m}=f.map(c,e);h&&(s=Math.max(s,h.maxPoint),n.push(h),i.push(m))}}let o=this.nextLayer.map(e);return n.length==0?o:new kt(i,n,o||kt.empty,s)}between(e,n,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let o=this.chunkPos[s],l=this.chunk[s];if(n>=o&&e<=o+l.length&&l.between(o,e-o,n-o,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return Gu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Gu.from(e).goto(n)}static compare(e,n,i,s,o=-1){let l=e.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),c=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=o),f=CR(l,c,i),d=new cu(l,f,o),h=new cu(c,f,o);i.iterGaps((m,g,b)=>ER(d,m,h,g,b,s)),i.empty&&i.length==0&&ER(d,0,h,0,0,s)}static eq(e,n,i=0,s){s==null&&(s=999999999);let o=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),l=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(o.length!=l.length)return!1;if(!o.length)return!0;let c=CR(o,l),f=new cu(o,c,0).goto(i),d=new cu(l,c,0).goto(i);for(;;){if(f.to!=d.to||!hb(f.active,d.active)||f.point&&(!d.point||!lx(f.point,d.point)))return!1;if(f.to>s)return!0;f.next(),d.next()}}static spans(e,n,i,s,o=-1){let l=new cu(e,null,o).goto(n),c=n,f=l.openStart;for(;;){let d=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),m=l.pointFrom<n?h.length+1:l.point.startSide<0?h.length:Math.min(h.length,f);s.point(c,d,l.point,h,m,l.pointRank),f=Math.min(l.openEnd(d),h.length)}else d>c&&(s.span(c,d,l.active,f),f=l.openEnd(d));if(l.to>i)return f+(l.point&&l.to>i?1:0);c=l.to,l.next()}}static of(e,n=!1){let i=new Yu;for(let s of e instanceof fb?[e]:n?XF(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return kt.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=kt.empty;s=s.nextLayer)n=new kt(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}kt.empty=new kt([],[],null,-1);function XF(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(db(e,i)>0)return t.slice().sort(db);e=i}return t}kt.empty.nextLayer=kt.empty;class Yu{finishChunk(e){this.chunks.push(new ax(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new Yu)).add(e,n,i)}addInner(e,n,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(kt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=kt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function CR(t,e,n){let i=new Map;for(let o of t)for(let l=0;l<o.chunk.length;l++)o.chunk[l].maxPoint<=0&&i.set(o.chunk[l],o.chunkPos[l]);let s=new Set;for(let o of e)for(let l=0;l<o.chunk.length;l++){let c=i.get(o.chunk[l]);c!=null&&(n?n.mapPos(c):c)==o.chunkPos[l]&&!n?.touchesRange(c,c+o.chunk[l].length)&&s.add(o.chunk[l])}return s}class Yk{constructor(e,n,i,s=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Gu{constructor(e){this.heap=e}static from(e,n=null,i=-1){let s=[];for(let o=0;o<e.length;o++)for(let l=e[o];!l.isEmpty;l=l.nextLayer)l.maxPoint>=i&&s.push(new Yk(l,n,i,o));return s.length==1?s[0]:new Gu(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)j0(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)j0(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),j0(this.heap,0)}}}function j0(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let s=t[i];if(i+1<t.length&&s.compare(t[i+1])>=0&&(s=t[i+1],i++),n.compare(s)<0)break;t[i]=n,t[e]=s,e=i}}class cu{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Gu.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){hh(this.active,e),hh(this.activeTo,e),hh(this.activeRank,e),this.minActive=TR(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:s,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||s-this.activeTo[n])>0;)n++;ph(this.active,n,i),ph(this.activeTo,n,s),ph(this.activeRank,n,o),e&&ph(e,n,this.cursor.from),this.minActive=TR(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&hh(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}}function ER(t,e,n,i,s,o){t.goto(e),n.goto(i);let l=i+s,c=i,f=i-e,d=!!o.boundChange;for(let h=!1;;){let m=t.to+f-n.to,g=m||t.endSide-n.endSide,b=g<0?t.to+f:n.to,x=Math.min(b,l);if(t.point||n.point?(t.point&&n.point&&lx(t.point,n.point)&&hb(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(c,x,t.point,n.point),h=!1):(h&&o.boundChange(c),x>c&&!hb(t.active,n.active)&&o.compareRange(c,x,t.active,n.active),d&&x<l&&(m||t.openEnd(b)!=n.openEnd(b))&&(h=!0)),b>l)break;c=b,g<=0&&t.next(),g>=0&&n.next()}}function hb(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!lx(t[n],e[n]))return!1;return!0}function hh(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function ph(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function TR(t,e){let n=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||t[s].endSide-t[n].endSide)<0&&(n=s,i=e[s]);return n}function Bm(t,e,n=t.length){let i=0;for(let s=0;s<n&&s<t.length;)t.charCodeAt(s)==9?(i+=e-i%e,s++):(i++,s=Qn(t,s));return i}function $F(t,e,n,i){for(let s=0,o=0;;){if(o>=e)return s;if(s==t.length)break;o+=t.charCodeAt(s)==9?n-o%n:1,s=Qn(t,s)}return t.length}const pb="ͼ",RR=typeof Symbol>"u"?"__"+pb:Symbol.for(pb),mb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),AR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class So{constructor(e,n){this.rules=[];let{finish:i}=n||{};function s(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function o(l,c,f,d){let h=[],m=/^@(\w+)\b/.exec(l[0]),g=m&&m[1]=="keyframes";if(m&&c==null)return f.push(l[0]+";");for(let b in c){let x=c[b];if(/&/.test(b))o(b.split(/,\s*/).map(w=>l.map(C=>w.replace(/&/,C))).reduce((w,C)=>w.concat(C)),x,f);else if(x&&typeof x=="object"){if(!m)throw new RangeError("The value of a property ("+b+") should be a primitive value.");o(s(b),x,h,g)}else x!=null&&h.push(b.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+x+";")}(h.length||g)&&f.push((i&&!m&&!d?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)o(s(l),e[l],this.rules)}getRules(){return this.rules.join(`
15
+ `)}static newName(){let e=AR[RR]||1;return AR[RR]=e+1,pb+e.toString(36)}static mount(e,n,i){let s=e[mb],o=i&&i.nonce;s?o&&s.setNonce(o):s=new QF(e,o),s.mount(Array.isArray(n)?n:[n],e)}}let MR=new Map;class QF{constructor(e,n){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let o=MR.get(i);if(o)return e[mb]=o;this.sheet=new s.CSSStyleSheet,MR.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[mb]=this}mount(e,n){let i=this.sheet,s=0,o=0;for(let l=0;l<e.length;l++){let c=e[l],f=this.modules.indexOf(c);if(f<o&&f>-1&&(this.modules.splice(f,1),o--,f=-1),f==-1){if(this.modules.splice(o++,0,c),i)for(let d=0;d<c.rules.length;d++)i.insertRule(c.rules[d],s++)}else{for(;o<f;)s+=this.modules[o++].rules.length;s+=c.rules.length,o++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let f=0;f<this.modules.length;f++)l+=this.modules[f].getRules()+`
16
+ `;this.styleTag.textContent=l;let c=n.head||n;this.styleTag.parentNode!=c&&c.insertBefore(this.styleTag,c.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var xo={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:"'"},Xu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ZF=typeof navigator<"u"&&/Mac/.test(navigator.platform),JF=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $n=0;$n<10;$n++)xo[48+$n]=xo[96+$n]=String($n);for(var $n=1;$n<=24;$n++)xo[$n+111]="F"+$n;for(var $n=65;$n<=90;$n++)xo[$n]=String.fromCharCode($n+32),Xu[$n]=String.fromCharCode($n);for(var W0 in xo)Xu.hasOwnProperty(W0)||(Xu[W0]=xo[W0]);function eU(t){var e=ZF&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||JF&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Xu:xo)[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}function pa(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=n[i];typeof s=="string"?t.setAttribute(i,s):s!=null&&(t[i]=s)}e++}for(;e<arguments.length;e++)Gk(t,arguments[e]);return t}function Gk(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Gk(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let ai=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},gb=typeof document<"u"?document:{documentElement:{style:{}}};const yb=/Edge\/(\d+)/.exec(ai.userAgent),Xk=/MSIE \d/.test(ai.userAgent),vb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai.userAgent),Vm=!!(Xk||vb||yb),OR=!Vm&&/gecko\/(\d+)/i.test(ai.userAgent),K0=!Vm&&/Chrome\/(\d+)/.exec(ai.userAgent),tU="webkitFontSmoothing"in gb.documentElement.style,bb=!Vm&&/Apple Computer/.test(ai.vendor),DR=bb&&(/Mobile\/\w+/.test(ai.userAgent)||ai.maxTouchPoints>2);var Ne={mac:DR||/Mac/.test(ai.platform),windows:/Win/.test(ai.platform),linux:/Linux|X11/.test(ai.platform),ie:Vm,ie_version:Xk?gb.documentMode||6:vb?+vb[1]:yb?+yb[1]:0,gecko:OR,gecko_version:OR?+(/Firefox\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,chrome:!!K0,chrome_version:K0?+K0[1]:0,ios:DR,android:/Android\b/.test(ai.userAgent),webkit_version:tU?+(/\bAppleWebKit\/(\d+)/.exec(ai.userAgent)||[0,0])[1]:0,safari:bb,safari_version:bb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ai.userAgent)||[0,0])[1]:0,tabSize:gb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function cx(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Mp=Object.create(null);function ux(t,e,n){if(t==e)return!0;t||(t=Mp),e||(e=Mp);let i=Object.keys(t),s=Object.keys(e);if(i.length-0!=s.length-0)return!1;for(let o of i)if(o!=n&&(s.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function nU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function kR(t,e,n){let i=!1;if(e)for(let s in e)n&&s in n||(i=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(n)for(let s in n)e&&e[s]==n[s]||(i=!0,s=="style"?t.style.cssText=n[s]:t.setAttribute(s,n[s]));return i}function iU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}class Ol{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Jn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Jn||(Jn={}));class nn extends Sl{constructor(e,n,i,s){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Rf(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new xl(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:o,end:l}=$k(e,n);i=(o?n?-3e8:-1:5e8)-1,s=(l?n?2e8:1:-6e8)+1}return new xl(e,i,s,n,e.widget||null,!0)}static line(e){return new Af(e)}static set(e,n=!1){return kt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}nn.none=kt.empty;class Rf extends nn{constructor(e){let{start:n,end:i}=$k(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?cx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Mp}eq(e){return this==e||e instanceof Rf&&this.tagName==e.tagName&&ux(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Rf.prototype.point=!1;class Af extends nn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Af&&this.spec.class==e.spec.class&&ux(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Af.prototype.mapMode=Li.TrackBefore;Af.prototype.point=!0;class xl extends nn{constructor(e,n,i,s,o,l){super(n,i,o,e),this.block=s,this.isReplace=l,this.mapMode=s?n<=0?Li.TrackBefore:Li.TrackAfter:Li.TrackDel}get type(){return this.startSide!=this.endSide?Jn.WidgetRange:this.startSide<=0?Jn.WidgetBefore:Jn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof xl&&sU(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}xl.prototype.point=!0;function $k(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function sU(t,e){return t==e||!!(t&&e&&t.compare(e))}function Va(t,e,n,i=0){let s=n.length-1;s>=0&&n[s]+i>=t?n[s]=Math.max(n[s],e):n.push(t,e)}class $u extends Sl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof $u&&this.tagName==e.tagName&&ux(this.attributes,e.attributes)}static create(e){return new $u(e.tagName,e.attributes||Mp)}static set(e,n=!1){return kt.of(e,n)}}$u.prototype.startSide=$u.prototype.endSide=-1;function Ga(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Sb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Au(t,e){if(!e.anchorNode)return!1;try{return Sb(t,e.anchorNode)}catch{return!1}}function Mu(t){return t.nodeType==3?Zu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ou(t,e,n,i){return n?PR(t,e,n,i,-1)||PR(t,e,n,i,1):!1}function wo(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Op(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function PR(t,e,n,i,s){for(;;){if(t==n&&e==i)return!0;if(e==(s<0?0:Dr(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=wo(t)+(s<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?Dr(t):0}else return!1}}function Dr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Qu(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function rU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Qk(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function oU(t,e,n,i,s,o,l,c){let f=t.ownerDocument,d=f.defaultView||window;for(let h=t,m=!1;h&&!m;)if(h.nodeType==1){let g,b=h==f.body,x=1,w=1;if(b)g=rU(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(m=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let M=h.getBoundingClientRect();({scaleX:x,scaleY:w}=Qk(h,M)),g={left:M.left,right:M.left+h.clientWidth*x,top:M.top,bottom:M.top+h.clientHeight*w}}let C=0,E=0;if(s=="nearest")e.top<g.top?(E=e.top-(g.top+l),n>0&&e.bottom>g.bottom+E&&(E=e.bottom-g.bottom+l)):e.bottom>g.bottom&&(E=e.bottom-g.bottom+l,n<0&&e.top-E<g.top&&(E=e.top-(g.top+l)));else{let M=e.bottom-e.top,T=g.bottom-g.top;E=(s=="center"&&M<=T?e.top+M/2-T/2:s=="start"||s=="center"&&n<0?e.top-l:e.bottom-T+l)-g.top}if(i=="nearest"?e.left<g.left?(C=e.left-(g.left+o),n>0&&e.right>g.right+C&&(C=e.right-g.right+o)):e.right>g.right&&(C=e.right-g.right+o,n<0&&e.left<g.left+C&&(C=e.left-(g.left+o))):C=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==c?e.left-o:e.right-(g.right-g.left)+o)-g.left,C||E)if(b)d.scrollBy(C,E);else{let M=0,T=0;if(E){let D=h.scrollTop;h.scrollTop+=E/w,T=(h.scrollTop-D)*w}if(C){let D=h.scrollLeft;h.scrollLeft+=C/x,M=(h.scrollLeft-D)*x}e={left:e.left-M,top:e.top-T,right:e.right-M,bottom:e.bottom-T},M&&Math.abs(M-C)<1&&(i="nearest"),T&&Math.abs(T-E)<1&&(s="nearest")}if(b)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function lU(t){let e=t.ownerDocument,n,i;for(let s=t.parentNode;s&&!(s==e.body||n&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:i}}class aU{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?Dr(n):0),i,Math.min(e.focusOffset,i?Dr(i):0))}set(e,n,i,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=s}}let ll=null;Ne.safari&&Ne.safari_version>=26&&(ll=!1);function Zk(t){if(t.setActive)return t.setActive();if(ll)return t.focus(ll);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ll==null?{get preventScroll(){return ll={preventScroll:!0},!0}}:void 0),!ll){ll=!1;for(let n=0;n<e.length;){let i=e[n++],s=e[n++],o=e[n++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let NR;function Zu(t,e,n=e){let i=NR||(NR=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function za(t,e,n,i){let s={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let o=new KeyboardEvent("keydown",s);o.synthetic=!0,t.dispatchEvent(o);let l=new KeyboardEvent("keyup",s);return l.synthetic=!0,t.dispatchEvent(l),o.defaultPrevented||l.defaultPrevented}function cU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function uU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Dr(n));;)if(i){if(n.nodeType!=1)return!1;let s=n.childNodes[i-1];s.contentEditable=="false"?i--:(n=s,i=Dr(n))}else{if(n==t)return!0;i=wo(n),n=n.parentNode}}function Jk(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function eP(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Dr(n)}else if(n.parentNode&&!Op(n))i=wo(n),n=n.parentNode;else return null}}function tP(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Op(n))i=wo(n)+1,n=n.parentNode;else return null}}class ms{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new ms(e.parentNode,wo(e),n)}static after(e,n){return new ms(e.parentNode,wo(e)+1,n)}}var fn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(fn||(fn={}));const wl=fn.LTR,fx=fn.RTL;function nP(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const fU=nP("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),dU=nP("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),xb=Object.create(null),Ds=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);xb[e]=n,xb[n]=-e}function iP(t){return t<=247?fU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?dU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const hU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Er{get dir(){return this.level%2?fx:wl}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,s){let o=-1;for(let l=0;l<e.length;l++){let c=e[l];if(c.from<=n&&c.to>=n){if(c.level==i)return l;(o<0||(s!=0?s<0?c.from<n:c.to>n:e[o].level>c.level))&&(o=l)}}if(o<0)throw new RangeError("Index out of range");return o}}function sP(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],s=e[n];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!sP(i.inner,s.inner))return!1}return!0}const $t=[];function pU(t,e,n,i,s){for(let o=0;o<=i.length;o++){let l=o?i[o-1].to:e,c=o<i.length?i[o].from:n,f=o?256:s;for(let d=l,h=f,m=f;d<c;d++){let g=iP(t.charCodeAt(d));g==512?g=h:g==8&&m==4&&(g=16),$t[d]=g==4?2:g,g&7&&(m=g),h=g}for(let d=l,h=f,m=f;d<c;d++){let g=$t[d];if(g==128)d<c-1&&h==$t[d+1]&&h&24?g=$t[d]=h:$t[d]=256;else if(g==64){let b=d+1;for(;b<c&&$t[b]==64;)b++;let x=d&&h==8||b<n&&$t[b]==8?m==1?1:8:256;for(let w=d;w<b;w++)$t[w]=x;d=b-1}else g==8&&m==1&&($t[d]=1);h=g,g&7&&(m=g)}}}function mU(t,e,n,i,s){let o=s==1?2:1;for(let l=0,c=0,f=0;l<=i.length;l++){let d=l?i[l-1].to:e,h=l<i.length?i[l].from:n;for(let m=d,g,b,x;m<h;m++)if(b=xb[g=t.charCodeAt(m)])if(b<0){for(let w=c-3;w>=0;w-=3)if(Ds[w+1]==-b){let C=Ds[w+2],E=C&2?s:C&4?C&1?o:s:0;E&&($t[m]=$t[Ds[w]]=E),c=w;break}}else{if(Ds.length==189)break;Ds[c++]=m,Ds[c++]=g,Ds[c++]=f}else if((x=$t[m])==2||x==1){let w=x==s;f=w?0:1;for(let C=c-3;C>=0;C-=3){let E=Ds[C+2];if(E&2)break;if(w)Ds[C+2]|=2;else{if(E&4)break;Ds[C+2]|=4}}}}}function gU(t,e,n,i){for(let s=0,o=i;s<=n.length;s++){let l=s?n[s-1].to:t,c=s<n.length?n[s].from:e;for(let f=l;f<c;){let d=$t[f];if(d==256){let h=f+1;for(;;)if(h==c){if(s==n.length)break;h=n[s++].to,c=s<n.length?n[s].from:e}else if($t[h]==256)h++;else break;let m=o==1,g=(h<e?$t[h]:i)==1,b=m==g?m?1:2:i;for(let x=h,w=s,C=w?n[w-1].to:t;x>f;)x==C&&(x=n[--w].from,C=w?n[w-1].to:t),$t[--x]=b;f=h}else o=d,f++}}}function wb(t,e,n,i,s,o,l){let c=i%2?2:1;if(i%2==s%2)for(let f=e,d=0;f<n;){let h=!0,m=!1;if(d==o.length||f<o[d].from){let w=$t[f];w!=c&&(h=!1,m=w==16)}let g=!h&&c==1?[]:null,b=h?i:i+1,x=f;e:for(;;)if(d<o.length&&x==o[d].from){if(m)break e;let w=o[d];if(!h)for(let C=w.to,E=d+1;;){if(C==n)break e;if(E<o.length&&o[E].from==C)C=o[E++].to;else{if($t[C]==c)break e;break}}if(d++,g)g.push(w);else{w.from>f&&l.push(new Er(f,w.from,b));let C=w.direction==wl!=!(b%2);Cb(t,C?i+1:i,s,w.inner,w.from,w.to,l),f=w.to}x=w.to}else{if(x==n||(h?$t[x]!=c:$t[x]==c))break;x++}g?wb(t,f,x,i+1,s,g,l):f<x&&l.push(new Er(f,x,b)),f=x}else for(let f=n,d=o.length;f>e;){let h=!0,m=!1;if(!d||f>o[d-1].to){let w=$t[f-1];w!=c&&(h=!1,m=w==16)}let g=!h&&c==1?[]:null,b=h?i:i+1,x=f;e:for(;;)if(d&&x==o[d-1].to){if(m)break e;let w=o[--d];if(!h)for(let C=w.from,E=d;;){if(C==e)break e;if(E&&o[E-1].to==C)C=o[--E].from;else{if($t[C-1]==c)break e;break}}if(g)g.push(w);else{w.to<f&&l.push(new Er(w.to,f,b));let C=w.direction==wl!=!(b%2);Cb(t,C?i+1:i,s,w.inner,w.from,w.to,l),f=w.from}x=w.from}else{if(x==e||(h?$t[x-1]!=c:$t[x-1]==c))break;x--}g?wb(t,x,f,i+1,s,g,l):x<f&&l.push(new Er(x,f,b)),f=x}}function Cb(t,e,n,i,s,o,l){let c=e%2?2:1;pU(t,s,o,i,c),mU(t,s,o,i,c),gU(s,o,i,c),wb(t,s,o,e,n,i,l)}function yU(t,e,n){if(!t)return[new Er(0,0,e==fx?1:0)];if(e==wl&&!n.length&&!hU.test(t))return rP(t.length);if(n.length)for(;t.length>$t.length;)$t[$t.length]=256;let i=[],s=e==wl?0:1;return Cb(t,s,s,n,0,t.length,i),i}function rP(t){return[new Er(0,t,0)]}let oP="";function vU(t,e,n,i,s){var o;let l=i.head-t.from,c=Er.find(e,l,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc),f=e[c],d=f.side(s,n);if(l==d){let g=c+=s?1:-1;if(g<0||g>=e.length)return null;f=e[c=g],l=f.side(!s,n),d=f.side(s,n)}let h=Qn(t.text,l,f.forward(s,n));(h<f.from||h>f.to)&&(h=d),oP=t.text.slice(Math.min(l,h),Math.max(l,h));let m=c==(s?e.length-1:0)?null:e[c+(s?1:-1)];return m&&h==d&&m.level+(s?0:1)<f.level?xe.cursor(m.side(!s,n)+t.from,m.forward(s,n)?1:-1,m.level):xe.cursor(h+t.from,f.forward(s,n)?-1:1,f.level)}function bU(t,e,n){for(let i=e;i<n;i++){let s=iP(t.charCodeAt(i));if(s==1)return wl;if(s==2||s==4)return fx}return wl}const lP=He.define(),aP=He.define(),cP=He.define(),uP=He.define(),Eb=He.define(),fP=He.define(),dP=He.define(),dx=He.define(),hx=He.define(),hP=He.define({combine:t=>t.some(e=>e)}),pP=He.define({combine:t=>t.some(e=>e)}),mP=He.define();class _a{constructor(e,n="nearest",i="nearest",s=5,o=5,l=!1){this.range=e,this.y=n,this.x=i,this.yMargin=s,this.xMargin=o,this.isSnapshot=l}map(e){return e.empty?this:new _a(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new _a(xe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const mh=Jt.define({map:(t,e)=>t.map(e)}),gP=Jt.define();function Hs(t,e,n){let i=t.facet(uP);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const wr=He.define({combine:t=>t.length?t[0]:!0});let SU=0;const Ca=He.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}});class ys{constructor(e,n,i,s,o){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=s,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(Ca.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ca.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:i,eventObservers:s,provide:o,decorations:l}=n||{};return new ys(SU++,e,i,s,c=>{let f=[];return l&&f.push(zm.of(d=>{let h=d.plugin(c);return h?l(h):nn.none})),o&&f.push(o(c)),f})}static fromClass(e,n){return ys.define((i,s)=>new e(i,s),n)}}class q0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Hs(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Hs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){Hs(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const yP=He.define(),px=He.define(),zm=He.define(),vP=He.define(),mx=He.define(),Mf=He.define(),bP=He.define();function IR(t,e){let n=t.state.facet(bP);if(!n.length)return n;let i=n.map(o=>o instanceof Function?o(t):o),s=[];return kt.spans(i,e.from,e.to,{point(){},span(o,l,c,f){let d=o-e.from,h=l-e.from,m=s;for(let g=c.length-1;g>=0;g--,f--){let b=c[g].spec.bidiIsolate,x;if(b==null&&(b=bU(e.text,d,h)),f>0&&m.length&&(x=m[m.length-1]).to==d&&x.direction==b)x.to=h,m=x.inner;else{let w={from:d,to:h,direction:b,inner:[]};m.push(w),m=w.inner}}}}),s}const SP=He.define();function xP(t){let e=0,n=0,i=0,s=0;for(let o of t.state.facet(SP)){let l=o(t);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(s=Math.max(s,l.bottom)))}return{left:e,right:n,top:i,bottom:s}}const bu=He.define();class Zi{constructor(e,n,i,s){this.fromA=e,this.toA=n,this.fromB=i,this.toB=s}join(e){return new Zi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let s=e[n-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let s=0,o=0,l=0;;){let c=s<e.length?e[s].fromB:1e9,f=o<n.length?n[o]:1e9,d=Math.min(c,f);if(d==1e9)break;let h=d+l,m=d,g=h;for(;;)if(o<n.length&&n[o]<=m){let b=n[o+1];o+=2,m=Math.max(m,b);for(let x=s;x<e.length&&e[x].fromB<=m;x++)l=e[x].toA-e[x].toB;g=Math.max(g,b+l)}else if(s<e.length&&e[s].fromB<=m){let b=e[s++];m=Math.max(m,b.toB),g=Math.max(g,b.toA),l=b.toA-b.toB}else break;i.push(new Zi(h,g,d,m))}return i}}class Dp{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=In.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,l,c,f)=>s.push(new Zi(o,l,c,f))),this.changedRanges=s}static create(e,n,i){return new Dp(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const xU=[];class Dn{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return xU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&nU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let s of this.children){if(s==e)return i;i+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let i=wo(this.dom),s=this.length?e>0:n>0;return new ms(this.parent.dom,i+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Hm)return e;return null}static get(e){return e.cmTile}}class _m extends Dn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,s,o=e?.node==n?e:null,l=0;for(let c of this.children){if(c.sync(e),l+=c.length+c.breakAfter,s=i?i.nextSibling:n.firstChild,o&&s!=c.dom&&(o.written=!0),c.dom.parentNode==n)for(;s&&s!=c.dom;)s=LR(s);else n.insertBefore(c.dom,s);i=c.dom}for(s=i?i.nextSibling:n.firstChild,o&&s&&(o.written=!0);s;)s=LR(s);this.length=l}}function LR(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Hm extends _m{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Dn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,s=0,o=0;;)if(s==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&o++,s=n.pop()}else{let l=i.children[s++];if(l instanceof go)n.push(s),i=l,s=0;else{let c=o+l.length,f=e(l,o);if(f!==void 0)return f;o=c+l.breakAfter}}}resolveBlock(e,n){let i,s=-1,o,l=-1;if(this.blockTiles((c,f)=>{let d=f+c.length;if(e>=f&&e<=d){if(c.isWidget()&&n>=-1&&n<=1){if(c.flags&32)return!0;c.flags&16&&(i=void 0)}(f<e||e==d&&(n<-1?c.length:c.covers(1)))&&(!i||!c.isWidget()&&i.isWidget())&&(i=c,s=e-f),(d>e||e==f&&(n>1?c.length:c.covers(-1)))&&(!o||!c.isWidget()&&o.isWidget())&&(o=c,l=e-f)}}),!i&&!o)throw new Error("No tile at position "+e);return i&&n<0||!o?{tile:i,offset:s}:{tile:o,offset:l}}}class go extends _m{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new go(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class Xa extends _m{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let s=new Xa(n||document.createElement("div"),e);return(!n||!i)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,n,i){let s=null,o=-1,l=null,c=-1;function f(h,m){for(let g=0,b=0;g<h.children.length&&b<=m;g++){let x=h.children[g],w=b+x.length;w>=m&&(x.isComposite()?f(x,m-b):(!l||l.isHidden&&(n>0||i&&CU(l,x)))&&(w>m||x.flags&32)?(l=x,c=m-b):(b<m||x.flags&16&&!x.isHidden)&&(s=x,o=m-b)),b=w}}f(this,e);let d=(n<0?s:l)||s||l;return d?{tile:d,offset:d==s?o:c}:null}coordsIn(e,n){let i=this.resolveInline(e,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n):wU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:s,offset:o}=i;if(this.dom.contains(s.dom))return s.isText()?new ms(s.dom,Math.min(s.dom.nodeValue.length,o)):s.domPosFor(o,s.flags&16?1:s.flags&32?-1:n);let l=i.tile.parent,c=!1;for(let f of l.children){if(c)return new ms(f.dom,0);f==i.tile&&(c=!0)}}return new ms(this.dom,0)}}function wU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Mu(e);return n[n.length-1]||null}function CU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}class wi extends _m{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new wi(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}}class hl extends Dn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let i=this.dom.nodeValue.length;e>i&&(e=i);let s=e,o=e,l=0;e==0&&n<0||e==i&&n>=0?Ne.chrome||Ne.gecko||(e?(s--,l=1):o<i&&(o++,l=-1)):n<0?s--:o<i&&o++;let c=Zu(this.dom,s,o).getClientRects();if(!c.length)return null;let f=c[(l?l<0:n>=0)?0:c.length-1];return Ne.safari&&!l&&f.width==0&&(f=Array.prototype.find.call(c,d=>d.width)||f),l?Qu(f,l<0):f||null}static of(e,n){let i=new hl(n||document.createTextNode(e),e);return n||(i.flags|=2),i}}class Cl extends Dn{constructor(e,n,i,s){super(e,n,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let s=this.widget.coordsAt(this.dom,e,n);if(s)return s;if(i)return Qu(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let o=this.dom.getClientRects(),l=null;if(!o.length)return null;let c=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=c?o.length-1:0;l=o[f],!(e>0?f==0:f==o.length-1||l.top<l.bottom);f+=c?-1:1);return Qu(l,!c)}}get overrideDOMText(){if(!this.length)return It.empty;let{root:e}=this;if(!e)return It.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,s,o){return o||(o=e.toDOM(n),e.editable||(o.contentEditable="false")),new Cl(o,i,e,s)}}class kp extends Dn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return It.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class EU{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:s,index:o,beforeBreak:l,parents:c}=this;for(;e||n>0;)if(s.isComposite())if(l){if(!e)break;i&&i.break(),e--,l=!1}else if(o==s.children.length){if(!e&&!c.length)break;i&&i.leave(s),l=!!s.breakAfter,{tile:s,index:o}=c.pop(),o++}else{let f=s.children[o],d=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!i||i.skip(f,0,f.length)!==!1||!f.isComposite)?(l=!!d,o++,e-=f.length):(c.push({tile:s,index:o}),s=f,o=0,i&&f.isComposite()&&i.enter(f))}else if(o==s.length)l=!!s.breakAfter,{tile:s,index:o}=c.pop(),o++;else if(e){let f=Math.min(e,s.length-o);i&&i.skip(s,o,o+f),e-=f,o+=f}else break;return this.tile=s,this.index=o,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class TU{constructor(e,n,i,s){this.from=e,this.to=n,this.wrapper=i,this.rank=s}}class RU{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,s){var o;this.flushBuffer();let l=this.ensureMarks(n,i),c=l.lastChild;if(c&&c.isText()&&!(c.flags&8)&&c.length+e.length<512){this.cache.reused.set(c,2);let f=l.children[l.children.length-1]=new hl(c.dom,c.text+e);f.parent=l}else l.append(s||hl.of(e,(o=this.cache.find(hl))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?Y0(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let s=i;for(let c=n.marks.length-1;c>=0;c--){let f=n.marks[c],d=s.lastChild;if(d instanceof wi&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(Y0(f.dom)),s=d;else{if(this.cache.reused.get(f)){let m=Dn.get(f.dom);m&&m.setDOM(Y0(f.dom))}let h=wi.of(f.mark,f.dom);s.append(h),s=h}this.cache.reused.set(f,2)}let o=Dn.get(e.text);o&&this.cache.reused.set(o,2);let l=new hl(e.text,e.text.nodeValue);l.flags|=8,s.append(l)}addInlineWidget(e,n,i){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let o=this.ensureMarks(n,i);!s&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=wP);let s=Xa.start(e,n||((i=this.cache.find(Xa))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let s=this.curLine;for(let o=e.length-1;o>=0;o--){let l=e[o],c;if(n>0&&(c=s.lastChild)&&c instanceof wi&&c.mark.eq(l))s=c,n--;else{let f=wi.of(l,(i=this.cache.find(wi,d=>d.mark.eq(l)))===null||i===void 0?void 0:i.dom);s.append(f),s=f,n=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!BR(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Ne.ios&&BR(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(G0,0,32)||new Cl(G0.toDOM(),0,G0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new TU(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-n.rank||this.wrappers[i-1].to-n.to)<0;)i--;this.wrappers.splice(i,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let s=n.lastChild;if(i.from<this.pos&&s instanceof go&&s.wrapper.eq(i.wrapper))n=s;else{let o=go.of(i.wrapper,(e=this.cache.find(go,l=>l.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(o),n=o}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(kp,void 0,1);return i&&(i.flags=n),i||new kp(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class AU{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=s;let c=this.textOff=Math.min(e,s.length);return o?null:s.slice(0,c)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}}const Pp=[Cl,Xa,hl,wi,kp,go,Hm];for(let t=0;t<Pp.length;t++)Pp[t].bucket=t;class MU{constructor(e){this.view=e,this.buckets=Pp.map(()=>[]),this.index=Pp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let s=e.bucket,o=this.buckets[s],l=this.index[s];for(let c=o.length-1;c>=0;c--){let f=(c+l)%o.length,d=o[f];if((!n||n(d))&&!this.reused.has(d))return o.splice(f,1),f<l&&this.index[s]--,this.reused.set(d,i),d}return null}findWidget(e,n,i){let s=this.buckets[0];if(s.length)for(let o=0,l=0;;o++){if(o==s.length){if(l)return null;l=1,o=0}let c=s[o];if(!this.reused.has(c)&&(l==0?c.widget.compare(e):c.widget.constructor==e.constructor&&e.updateDOM(c.dom,this.view)))return s.splice(o,1),o<this.index[0]&&this.index[0]--,c.widget==e&&c.length==n&&(c.flags&497)==i?(this.reused.set(c,1),c):(this.reused.set(c,2),new Cl(c.dom,n,e,c.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class OU{constructor(e,n,i,s,o){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new MU(e),this.text=new AU(e.state.doc),this.builder=new RU(this.cache,new Hm(e,e.contentDOM),kt.iter(i)),this.cache.reused.set(n,2),this.old=new EU(n),this.reuseWalker={skip:(l,c,f)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let s=0,o=0,l=0;;){let c=l<e.length?e[l++]:null,f=c?c.fromA:this.old.root.length;if(f>s){let d=f-s;this.preserve(d,!l,!c),s=f,o+=d}if(!c)break;n&&c.fromA<=n.range.fromA&&c.toA>=n.range.toA?(this.forward(c.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(o,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,c.toA),this.emit(n.range.toB,c.toB)):(this.forward(c.fromA,c.toA),this.emit(o,c.toB)),o=c.toB,s=c.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let s=PU(this.old),o=this.openMarks;this.old.advance(e,i?1:-1,{skip:(l,c,f)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(f-c);else{let d=f>0||c<l.length?Cl.of(l.widget,this.view,f-c,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,s,o),o=s.length)}else if(l.isText())this.builder.ensureLine(null),!c&&f==l.length?this.builder.addText(l.text,s,o,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(c,f),s,o)),o=s.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof kp)this.cache.add(l);else if(l instanceof wi)this.builder.ensureLine(null),this.builder.addMark(l,s,o),this.cache.reused.set(l,1),o=s.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof wi&&s.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?s.length&&(s.length=o=0):l instanceof wi&&(s.shift(),o=Math.min(o,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,s=this.builder,o=0,l=kt.spans(this.decorations,e,n,{point:(c,f,d,h,m,g)=>{if(d instanceof xl){if(this.disallowBlockEffectsFor[g]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(c).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=h.length,m>h.length)s.continueWidget(f-c);else{let b=d.widget||(d.block?$a.block:$a.inline),x=DU(d),w=this.cache.findWidget(b,f-c,x)||Cl.of(b,this.view,f-c,x);d.block?(d.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(w)):(s.ensureLine(i),s.addInlineWidget(w,h,m))}i=null}else i=kU(i,d);f>c&&this.text.skip(f-c)},span:(c,f,d,h)=>{for(let m=c;m<f;){let g=this.text.next(Math.min(512,f-m));g==null?(s.addLineStartIfNotCovered(i),s.addBreak(),m++):(s.ensureLine(i),s.addText(g,d,m==c?h:d.length),m+=g.length),i=null}}});s.addLineStartIfNotCovered(i),this.openWidget=l>o,this.openMarks=l}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let s=e.parentNode;;s=s.parentNode){let o=Dn.get(s);if(s==this.view.contentDOM)break;o instanceof wi?n.push(o):o?.isLine()?i=o:s.nodeName=="DIV"&&!i&&s!=this.view.contentDOM?i=new Xa(s,wP):n.push(wi.of(new Rf({tagName:s.nodeName.toLowerCase(),attributes:iU(s)}),s))}return{line:i,marks:n}}}function BR(t,e){let n=i=>{for(let s of i.children)if((e?s.isText():s.length)||n(s))return!0;return!1};return n(t)}function DU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const wP={class:"cm-line"};function kU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&cx(n,t),i&&(t.class+=" "+i)),t}function PU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof wi&&e.push(i.mark)}return e}function Y0(t){let e=Dn.get(t);return e&&e.setDOM(t.cloneNode()),t}class $a extends Ol{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}$a.inline=new $a("span");$a.block=new $a("div");const G0=new class extends Ol{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class VR{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=nn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Hm(e,e.contentDOM),this.updateInner([new Zi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:m})=>m<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?s=this.domChanged.newSel.head:!FU(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let o=s>-1?IU(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:m}=this.hasComposition;i=new Zi(h,m,e.changes.mapPos(h,-1),e.changes.mapPos(m,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Ne.ie||Ne.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,c=this.blockWrappers;this.updateDeco();let f=VU(l,this.decorations,e.changes);f.length&&(i=Zi.extendWithRanges(i,f));let d=_U(c,this.blockWrappers,e.changes);return d.length&&(i=Zi.extendWithRanges(i,d)),o&&!i.some(h=>h.fromA<=o.range.fromA&&h.toA>=o.range.toA)&&(i=o.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let l=this.tile,c=new OU(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=c.run(e,n),Tb(l,c.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Ne.chrome||Ne.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||i.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof X0&&s.push(o.dom);i.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(gP)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,s=this.view.root.activeElement,o=s==i,l=!o&&!(this.view.state.facet(wr)||i.tabIndex>-1)&&Au(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(o||n||l))return;let c=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,h;if(f.empty?h=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(h=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Ne.gecko&&f.empty&&!this.hasComposition&&NU(d)){let g=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(g,d.node.childNodes[d.offset]||null)),d=h=new ms(g,0),c=!0}let m=this.view.observer.selectionRange;(c||!m.focusNode||(!Ou(d.node,d.offset,m.anchorNode,m.anchorOffset)||!Ou(h.node,h.offset,m.focusNode,m.focusOffset))&&!this.suppressWidgetCursorChange(m,f))&&(this.view.observer.ignore(()=>{Ne.android&&Ne.chrome&&i.contains(m.focusNode)&&HU(m.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=Ga(this.view.root);if(g)if(f.empty){if(Ne.gecko){let b=LU(d.node,d.offset);if(b&&b!=3){let x=(b==1?eP:tP)(d.node,d.offset);x&&(d=new ms(x.node,x.offset))}}g.collapse(d.node,d.offset),f.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=f.bidiLevel)}else if(g.extend){g.collapse(d.node,d.offset);try{g.extend(h.node,h.offset)}catch{}}else{let b=document.createRange();f.anchor>f.head&&([d,h]=[h,d]),b.setEnd(h.node,h.offset),b.setStart(d.node,d.offset),g.removeAllRanges(),g.addRange(b)}l&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new ms(m.anchorNode,m.anchorOffset),this.impreciseHead=h.precise?null:new ms(m.focusNode,m.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ou(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Ga(e.root),{anchorNode:s,anchorOffset:o}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let l=this.lineAt(n.head,n.assoc);if(!l)return;let c=l.posAtStart;if(n.head==c||n.head==c+l.length)return;let f=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!f||!d||f.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(h.node,h.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let m=e.observer.selectionRange;e.docView.posFromDOM(m.anchorNode,m.anchorOffset)!=n.from&&i.collapse(s,o)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=i.posAtStart;if(i.isComposite()){let o;if(e==i.dom)o=i.dom.childNodes[n];else{let l=Dr(e)==0?0:n==0?-1:1;for(;;){let c=e.parentNode;if(c==i.dom)break;l==0&&c.firstChild!=c.lastChild&&(e==c.firstChild?l=-1:l=1),e=c}l<0?o=e:o=e.nextSibling}if(o==i.dom.firstChild)return s;for(;o&&!Dn.get(o);)o=o.nextSibling;if(!o)return s+i.length;for(let l=0,c=s;;l++){let f=i.children[l];if(f.dom==o)return c;c+=f.length+f.breakAfter}}else return i.isText()?e==i.dom?s+n:s+(n?i.length:0):s}domAtPos(e,n){let{tile:i,offset:s}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(e,n):i.domIn(s,n)}inlineDOMNearPos(e,n){let i,s=-1,o=!1,l,c=-1,f=!1;return this.tile.blockTiles((d,h)=>{if(d.isWidget()){if(d.flags&32&&h>=e)return!0;d.flags&16&&(o=!0)}else{let m=h+d.length;if(h<=e&&(i=d,s=e-h,o=m<e),m>=e&&!l&&(l=d,c=e-h,f=h>e),h>e&&l)return!0}}),!i&&!l?this.domAtPos(e,n):(o&&l?i=null:f&&i&&(l=null),i&&n<0||!l?i.domIn(s,n):l.domIn(c,n))}coordsAt(e,n){let{tile:i,offset:s}=this.tile.resolveBlock(e,n);return i.isWidget()?i.widget instanceof X0?null:i.coordsInWidget(s,n,!0):i.coordsIn(s,n)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function s(o,l){if(o.isComposite())for(let c of o.children){if(c.length>=l){let f=s(c,l);if(f)return f}if(l-=c.length,l<0)break}else if(o.isText()&&l<o.length){let c=Qn(o.text,l);if(c==l)return null;let f=Zu(o.dom,l,c).getClientRects();for(let d=0;d<f.length;d++){let h=f[d];if(d==f.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return s(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:s}=e,o=this.view.contentDOM.clientWidth,l=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,f=this.view.textDirection==fn.LTR,d=0,h=(m,g,b)=>{for(let x=0;x<m.children.length&&!(g>s);x++){let w=m.children[x],C=g+w.length,E=w.dom.getBoundingClientRect(),{height:M}=E;if(b&&!x&&(d+=E.top-b.top),w instanceof go)C>i&&h(w,g,E);else if(g>=i&&(d>0&&n.push(-d),n.push(M+d),d=0,l)){let T=w.dom.lastChild,D=T?Mu(T):[];if(D.length){let O=D[D.length-1],A=f?O.right-E.left:E.right-O.left;A>c&&(c=A,this.minWidth=o,this.minWidthFrom=g,this.minWidthTo=C)}}b&&x==m.children.length-1&&(d+=b.bottom-E.bottom),g=C+w.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?fn.RTL:fn.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let c=0,f;for(let d of l.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let h=Mu(d.dom);if(h.length!=1)return;c+=h[0].width,f=h[0].height}if(c)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:c/l.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),i,s,o;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let l=Mu(n.firstChild)[0];i=n.getBoundingClientRect().height,s=l&&l.width?l.width/27:7,o=l&&l.height?l.height:i,n.remove()}),{lineHeight:i,charWidth:s,textHeight:o}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,s=0;;s++){let o=s==n.viewports.length?null:n.viewports[s],l=o?o.from-1:this.view.state.doc.length;if(l>i){let c=(n.lineBlockAt(l).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(nn.replace({widget:new X0(c),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!o)break;i=o.to+1}return nn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(zm).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,s=this.view.state.facet(mx).map((o,l)=>{let c=typeof o=="function";return c&&(i=!0),c?o(this.view):o});for(s.length&&(this.dynamicDecorationMap[e++]=i,n.push(kt.join(s))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(vP).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(mP))try{if(d(this.view,e.range,e))return!0}catch(h){Hs(this.view.state,h,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),s;if(!i)return;!n.empty&&(s=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=xP(this.view),l={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:c,offsetHeight:f}=this.view.scrollDOM;oU(this.view.scrollDOM,l,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==fn.LTR)}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Tb(this.tile)}}function Tb(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)Tb(i,e)}}function NU(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function CP(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=eP(n.focusNode,n.focusOffset),s=tP(n.focusNode,n.focusOffset),o=i||s;if(s&&i&&s.node!=i.node){let c=Dn.get(s.node);if(!c||c.isText()&&c.text!=s.node.nodeValue)o=s;else if(t.docView.lastCompositionAfterCursor){let f=Dn.get(i.node);!f||f.isText()&&f.text!=i.node.nodeValue||(o=s)}}if(t.docView.lastCompositionAfterCursor=o!=i,!o)return null;let l=e-o.offset;return{from:l,to:l+o.node.nodeValue.length,node:o.node}}function IU(t,e,n){let i=CP(t,n);if(!i)return null;let{node:s,from:o,to:l}=i,c=s.nodeValue;if(/[\n\r]/.test(c)||t.state.doc.sliceString(i.from,i.to)!=c)return null;let f=e.invertedDesc;return{range:new Zi(f.mapPos(o),f.mapPos(l),o,l),text:s}}function LU(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let BU=class{constructor(){this.changes=[]}compareRange(e,n){Va(e,n,this.changes)}comparePoint(e,n){Va(e,n,this.changes)}boundChange(e){Va(e,e,this.changes)}};function VU(t,e,n){let i=new BU;return kt.compare(t,e,n,i),i.changes}class zU{constructor(){this.changes=[]}compareRange(e,n){Va(e,n,this.changes)}comparePoint(){}boundChange(e){Va(e,e,this.changes)}}function _U(t,e,n){let i=new zU;return kt.compare(t,e,n,i),i.changes}function HU(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function FU(t,e){let n=!1;return e&&t.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(n=!0)}),n}class X0 extends Ol{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function UU(t,e,n=1){let i=t.charCategorizer(e),s=t.doc.lineAt(e),o=e-s.from;if(s.length==0)return xe.cursor(e);o==0?n=1:o==s.length&&(n=-1);let l=o,c=o;n<0?l=Qn(s.text,o,!1):c=Qn(s.text,o);let f=i(s.text.slice(l,c));for(;l>0;){let d=Qn(s.text,l,!1);if(i(s.text.slice(d,l))!=f)break;l=d}for(;c<s.length;){let d=Qn(s.text,c);if(i(s.text.slice(c,d))!=f)break;c=d}return xe.range(l+s.from,c+s.from)}function jU(t,e,n,i,s){let o=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let c=t.viewState.heightOracle.textHeight,f=Math.floor((s-n.top-(t.defaultLineHeight-c)*.5)/c);o+=f*t.viewState.heightOracle.lineLength}let l=t.state.sliceDoc(n.from,n.to);return n.from+$F(l,o,t.state.tabSize)}function Rb(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let s;for(let o of i.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!s||o.type==Jn.Text&&(s.type!=o.type||(n<0?o.from<e:o.to>e)))&&(s=o)}}return s||i}return i}function WU(t,e,n,i){let s=Rb(t,e.head,e.assoc||-1),o=!i||s.type!=Jn.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(o){let l=t.dom.getBoundingClientRect(),c=t.textDirectionAt(s.from),f=t.posAtCoords({x:n==(c==fn.LTR)?l.right-1:l.left+1,y:(o.top+o.bottom)/2});if(f!=null)return xe.cursor(f,n?-1:1)}return xe.cursor(n?s.to:s.from,n?-1:1)}function zR(t,e,n,i){let s=t.state.doc.lineAt(e.head),o=t.bidiSpans(s),l=t.textDirectionAt(s.from);for(let c=e,f=null;;){let d=vU(s,o,l,c,n),h=oP;if(!d){if(s.number==(n?t.state.doc.lines:1))return c;h=`
17
+ `,s=t.state.doc.line(s.number+(n?1:-1)),o=t.bidiSpans(s),d=t.visualLineSide(s,!n)}if(f){if(!f(h))return c}else{if(!i)return d;f=i(h)}c=d}}function KU(t,e,n){let i=t.state.charCategorizer(e),s=i(n);return o=>{let l=i(o);return s==Cr.Space&&(s=l),s==l}}function qU(t,e,n,i){let s=e.head,o=n?1:-1;if(s==(n?t.state.doc.length:0))return xe.cursor(s,e.assoc);let l=e.goalColumn,c,f=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(s,(e.empty?e.assoc:0)||(n?1:-1)),h=t.documentTop;if(d)l==null&&(l=d.left-f.left),c=o<0?d.top:d.bottom;else{let x=t.viewState.lineBlockAt(s);l==null&&(l=Math.min(f.right-f.left,t.defaultCharacterWidth*(s-x.from))),c=(o<0?x.top:x.bottom)+h}let m=f.left+l,g=i??t.viewState.heightOracle.textHeight>>1,b=Ab(t,{x:m,y:c+g*o},!1,o);return xe.cursor(b.pos,b.assoc,void 0,l)}function Du(t,e,n){for(;;){let i=0;for(let s of t)s.between(e-1,e+1,(o,l,c)=>{if(e>o&&e<l){let f=i||n||(e-o<l-e?-1:1);e=f<0?o:l,i=f}});if(!i)return e}}function EP(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let s=e.ranges[i],o=null;if(s.empty){let l=Du(t,s.from,0);l!=s.from&&(o=xe.cursor(l,-1))}else{let l=Du(t,s.from,-1),c=Du(t,s.to,1);(l!=s.from||c!=s.to)&&(o=xe.range(s.from==s.anchor?l:c,s.from==s.head?l:c))}o&&(n||(n=e.ranges.slice()),n[i]=o)}return n?xe.create(n,e.mainIndex):e}function $0(t,e,n){let i=Du(t.state.facet(Mf).map(s=>s(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:xe.cursor(i,i<n.from?1:-1)}class zs{constructor(e,n){this.pos=e,this.assoc=n}}function Ab(t,e,n,i){let s=t.contentDOM.getBoundingClientRect(),o=s.top+t.viewState.paddingTop,{x:l,y:c}=e,f=c-o,d;for(;;){if(f<0)return new zs(0,1);if(f>t.viewState.docHeight)return new zs(t.state.doc.length,-1);if(d=t.elementAtHeight(f),i==null)break;if(d.type==Jn.Text){if(i<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let g=t.docView.coordsAt(i<0?d.from:d.to,i>0?-1:1);if(g&&(i<0?g.top<=f+o:g.bottom>=f+o))break}let m=t.viewState.heightOracle.textHeight/2;f=i>0?d.bottom+m:d.top-m}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==Jn.Text){let m=jU(t,s,d,l,c);return new zs(m,m==d.from?1:-1)}}if(d.type!=Jn.Text)return f<(d.top+d.bottom)/2?new zs(d.from,1):new zs(d.to,-1);let h=t.docView.lineAt(d.from,2);return(!h||h.length!=d.length)&&(h=t.docView.lineAt(d.from,-2)),TP(t,h,d.from,l,c)}function TP(t,e,n,i,s){let o=-1,l=null,c=1e9,f=1e9,d=s,h=s,m=(g,b)=>{for(let x=0;x<g.length;x++){let w=g[x];if(w.top==w.bottom)continue;let C=w.left>i?w.left-i:w.right<i?i-w.right:0,E=w.top>s?w.top-s:w.bottom<s?s-w.bottom:0;w.top<=h&&w.bottom>=d&&(d=Math.min(w.top,d),h=Math.max(w.bottom,h),E=0),(o<0||(E-f||C-c)<0)&&(o>=0&&f&&c<C&&l.top<=h-2&&l.bottom>=d+2?f=0:(o=b,c=C,f=E,l=w))}};if(e.isText()){for(let b=0;b<e.length;){let x=Qn(e.text,b);if(m(Zu(e.dom,b,x).getClientRects(),b),!c&&!f)break;b=x}return i>(l.left+l.right)/2==(_R(t,o+n)==fn.LTR)?new zs(n+Qn(e.text,o),-1):new zs(n+o,1)}else{if(!e.length)return new zs(n,1);for(let w=0;w<e.children.length;w++){let C=e.children[w];if(C.flags&48)continue;let E=(C.dom.nodeType==1?C.dom:Zu(C.dom,0,C.length)).getClientRects();if(m(E,w),!c&&!f)break}let g=e.children[o],b=e.posBefore(g,n);return g.isComposite()||g.isText()?TP(t,g,b,Math.max(l.left,Math.min(l.right,i)),s):i>(l.left+l.right)/2==(_R(t,o+n)==fn.LTR)?new zs(b+g.length,-1):new zs(b,1)}}function _R(t,e){let n=t.state.doc.lineAt(e);return t.bidiSpans(n)[Er.find(t.bidiSpans(n),e-n.from,-1,1)].dir}const Su="￿";class YU{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ut.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Su}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let o=this.text.length;this.readNode(s);let l=Dn.get(s),c=s.nextSibling;if(c==n){l?.breakAfter&&!c&&i!=this.view.contentDOM&&this.lineBreak();break}let f=Dn.get(c);(l&&f?l.breakAfter:(l?l.breakAfter:Op(s))||Op(c)&&(s.nodeName!="BR"||l?.isWidget())&&this.text.length>o)&&!XU(c,n)&&this.lineBreak(),s=c}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,l=1,c;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(c=s.exec(n))&&(o=c.index,l=c[0].length),this.append(n.slice(i,o<0?n.length:o)),o<0)break;if(this.lineBreak(),l>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=l-1);i=o+l}}readNode(e){let n=Dn.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(GU(e,i.node,i.offset)?n:0))}}function GU(t,e,n){for(;;){if(!e||n<Dr(e))return!1;if(e==t)return!0;n=wo(e)+1,e=e.parentNode}}function XU(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=Dn.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let s=i.overrideDOMText;if(s?.length)return!1}return!0}class HR{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class $U{constructor(e,n,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=RP(e.docView.tile,n,i,0))){let c=o||l?[]:ZU(e),f=new YU(c,e);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=JU(c,this.bounds.from)}else{let c=e.observer.selectionRange,f=o&&o.node==c.focusNode&&o.offset==c.focusOffset||!Sb(e.contentDOM,c.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!Sb(e.contentDOM,c.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),h=e.viewport;if((Ne.ios||Ne.chrome)&&e.state.selection.main.empty&&f!=d&&(h.from>0||h.to<e.state.doc.length)){let m=Math.min(f,d),g=Math.max(f,d),b=h.from-m,x=h.to-g;(b==0||b==1||m==0)&&(x==0||x==-1||g==e.state.doc.length)&&(f=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(xe.range(d,f)):this.newSel=xe.single(d,f)}}}function RP(t,e,n,i){if(t.isComposite()){let s=-1,o=-1,l=-1,c=-1;for(let f=0,d=i,h=i;f<t.children.length;f++){let m=t.children[f],g=d+m.length;if(d<e&&g>n)return RP(m,e,n,d);if(g>=e&&s==-1&&(s=f,o=d),d>n&&m.dom.parentNode==t.dom){l=f,c=h;break}h=g,d=g+m.breakAfter}return{from:o,to:c<0?i+t.length:c,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:l<t.children.length&&l>=0?t.children[l].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function AP(t,e){let n,{newSel:i}=e,s=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:c}=e.bounds,f=s.from,d=null;(o===8||Ne.android&&e.text.length<c-l)&&(f=s.to,d="end");let h=MP(t.state.doc.sliceString(l,c,Su),e.text,f-l,d);h&&(Ne.chrome&&o==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Su+Su&&h.toB--,n={from:l+h.from,to:l+h.toA,insert:It.of(e.text.slice(h.from,h.toB).split(Su))})}else i&&(!t.hasFocus&&t.state.facet(wr)||Np(i,s))&&(i=null);if(!n&&!i)return!1;if(!n&&e.typeOver&&!s.empty&&i&&i.main.empty?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(Ne.mac||Ne.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:It.of([n.insert.toString().replace("."," ")])}):n&&n.from>=s.from&&n.to<=s.to&&(n.from!=s.from||n.to!=s.to)&&s.to-s.from-(n.to-n.from)<=4?n={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:Ne.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
18
+ `&&t.lineWrapping&&(i&&(i=xe.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:It.of([" "])}),n)return gx(t,n,i,o);if(i&&!Np(i,s)){let l=!1,c="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),c=t.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=EP(t.state.facet(Mf).map(f=>f(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function gx(t,e,n,i=-1){if(Ne.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Ne.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&za(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&za(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&za(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l,c=()=>l||(l=QU(t,e,n));return t.state.facet(fP).some(f=>f(t,e.from,e.to,o,c))||t.dispatch(c()),!0}function QU(t,e,n){let i,s=t.state,o=s.selection.main,l=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let f=e.from<o.from?-1:1,d=f<0?o.from:o.to,h=Du(s.facet(Mf).map(m=>m(t)),d,f);e.from==h&&(l=h)}if(l>-1)i={changes:e,selection:xe.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=o.from<e.from?s.sliceDoc(o.from,e.from):"",d=o.to>e.to?s.sliceDoc(e.to,o.to):"";i=s.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let f=s.changes(e),d=n&&n.main.to<=f.newLength?n.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let h=t.state.sliceDoc(e.from,e.to),m,g=n&&CP(t,n.main.head);if(g){let x=e.insert.length-(e.to-e.from);m={from:g.from,to:g.to-x}}else m=t.state.doc.lineAt(o.head);let b=o.to-e.to;i=s.changeByRange(x=>{if(x.from==o.from&&x.to==o.to)return{changes:f,range:d||x.map(f)};let w=x.to-b,C=w-h.length;if(t.state.sliceDoc(C,w)!=h||w>=m.from&&C<=m.to)return{range:x};let E=s.changes({from:C,to:w,insert:e.insert}),M=x.to-o.to;return{changes:E,range:d?xe.range(Math.max(0,d.anchor+M),Math.max(0,d.head+M)):x.map(E)}})}else i={changes:f,selection:d&&s.selection.replaceRange(d)}}let c="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,c+=".compose",t.inputState.compositionFirstChange&&(c+=".start",t.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:c,scrollIntoView:!0})}function MP(t,e,n,i){let s=Math.min(t.length,e.length),o=0;for(;o<s&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==s&&t.length==e.length)return null;let l=t.length,c=e.length;for(;l>0&&c>0&&t.charCodeAt(l-1)==e.charCodeAt(c-1);)l--,c--;if(i=="end"){let f=Math.max(0,o-Math.min(l,c));n-=l+f-o}if(l<o&&t.length<e.length){let f=n<=o&&n>=l?o-n:0;o-=f,c=o+(c-l),l=o}else if(c<o){let f=n<=o&&n>=c?o-n:0;o-=f,l=o+(l-c),c=o}return{from:o,toA:l,toB:c}}function ZU(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new HR(n,i)),(s!=n||o!=i)&&e.push(new HR(s,o))),e}function JU(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?xe.single(n+e,i+e):null}function Np(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class e8{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ne.safari&&e.contentDOM.addEventListener("input",()=>null),Ne.gecko&&m8(e.contentDOM.ownerDocument)}handleEvent(e){!a8(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,n);for(let s of i.handlers){if(n.defaultPrevented)break;if(s(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=t8(e),i=this.handlers,s=this.view.contentDOM;for(let o in n)if(o!="scroll"){let l=!n[o].handlers.length,c=i[o];c&&l!=!c.handlers.length&&(s.removeEventListener(o,this.handleEvent),c=null),c||s.addEventListener(o,this.handleEvent,{passive:l})}for(let o in i)o!="scroll"&&!n[o]&&s.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&DP.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ne.android&&Ne.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Ne.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=OP.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||n8.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,za(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Ne.safari&&!Ne.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function FR(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(s){Hs(n.state,s)}}}function t8(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let s=i.spec,o=s&&s.plugin.domEventHandlers,l=s&&s.plugin.domEventObservers;if(o)for(let c in o){let f=o[c];f&&n(c).handlers.push(FR(i.value,f))}if(l)for(let c in l){let f=l[c];f&&n(c).observers.push(FR(i.value,f))}}for(let i in vs)n(i).handlers.push(vs[i]);for(let i in rs)n(i).observers.push(rs[i]);return e}const OP=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],n8="dthko",DP=[16,17,18,20,91,92,224,225],gh=6;function yh(t){return Math.max(0,t)*.7+8}function i8(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class s8{constructor(e,n,i,s){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=lU(e.contentDOM),this.atoms=e.state.facet(Mf).map(l=>l(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ut.allowMultipleSelections)&&r8(e,n),this.dragging=l8(e,n)&&NP(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&i8(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,s=0,o=0,l=this.view.win.innerWidth,c=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:c}=this.scrollParents.y.getBoundingClientRect());let f=xP(this.view);e.clientX-f.left<=s+gh?n=-yh(s-e.clientX):e.clientX+f.right>=l-gh&&(n=yh(e.clientX-l)),e.clientY-f.top<=o+gh?i=-yh(o-e.clientY):e.clientY+f.bottom>=c-gh&&(i=yh(e.clientY-c)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=EP(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function r8(t,e){let n=t.state.facet(lP);return n.length?n[0](e):Ne.mac?e.metaKey:e.ctrlKey}function o8(t,e){let n=t.state.facet(aP);return n.length?n[0](e):Ne.mac?!e.altKey:!e.ctrlKey}function l8(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Ga(t.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let o=0;o<s.length;o++){let l=s[o];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function a8(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=Dn.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const vs=Object.create(null),rs=Object.create(null),kP=Ne.ie&&Ne.ie_version<15||Ne.ios&&Ne.webkit_version<604;function c8(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),PP(t,n.value)},50)}function Fm(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function PP(t,e){e=Fm(t.state,dx,e);let{state:n}=t,i,s=1,o=n.toText(e),l=o.lines==n.selection.ranges.length;if(Mb!=null&&n.selection.ranges.every(f=>f.empty)&&Mb==o.toString()){let f=-1;i=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==f)return{range:d};f=h.from;let m=n.toText((l?o.line(s++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:m},range:xe.cursor(d.from+m.length)}})}else l?i=n.changeByRange(f=>{let d=o.line(s++);return{changes:{from:f.from,to:f.to,insert:d.text},range:xe.cursor(f.from+d.length)}}):i=n.replaceSelection(o);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}rs.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};vs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);rs.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};rs.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};vs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(cP))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=f8(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new s8(t,e,n,i)),i&&t.observer.ignore(()=>{Zk(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function UR(t,e,n,i){if(i==1)return xe.cursor(e,n);if(i==2)return UU(t.state,e,n);{let s=t.docView.lineAt(e,n),o=t.state.doc.lineAt(s?s.posAtEnd:e),l=s?s.posAtStart:o.from,c=s?s.posAtEnd:o.to;return c<t.state.doc.length&&c==o.to&&c++,xe.range(l,c)}}const u8=Ne.ie&&Ne.ie_version<=11;let jR=null,WR=0,KR=0;function NP(t){if(!u8)return t.detail;let e=jR,n=KR;return jR=t,KR=Date.now(),WR=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(WR+1)%3:1}function f8(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=NP(e),s=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),s=s.map(o.changes))},get(o,l,c){let f=t.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),d,h=UR(t,f.pos,f.assoc,i);if(n.pos!=f.pos&&!l){let m=UR(t,n.pos,n.assoc,i),g=Math.min(m.from,h.from),b=Math.max(m.to,h.to);h=g<h.from?xe.range(g,b):xe.range(b,g)}return l?s.replaceRange(s.main.extend(h.from,h.to)):c&&i==1&&s.ranges.length>1&&(d=d8(s,f.pos))?d:c?s.addRange(h):xe.create([h])}}}function d8(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:s}=t.ranges[n];if(i<=e&&s>=e)return xe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}vs.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let o=s.posAtStart,l=o+s.length;(o>=n.to||l<=n.from)&&(n=xe.range(o,l))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Fm(t.state,hx,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};vs.dragend=t=>(t.inputState.draggedContent=null,!1);function qR(t,e,n,i){if(n=Fm(t.state,dx,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,l=i&&o&&o8(t,e)?{from:o.from,to:o.to}:null,c={from:s,insert:n},f=t.state.changes(l?[l,c]:c);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(s,-1),head:f.mapPos(s,1)},userEvent:l?"move.drop":"input.drop"}),t.inputState.draggedContent=null}vs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),s=0,o=()=>{++s==n.length&&qR(t,e,i.filter(l=>l!=null).join(t.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let c=new FileReader;c.onerror=o,c.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(i[l]=c.result),o()},c.readAsText(n[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return qR(t,e,i,!0),!0}return!1};vs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=kP?null:e.clipboardData;return n?(PP(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(c8(t),!1)};function h8(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function p8(t){let e=[],n=[],i=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),n.push(s));if(!e.length){let s=-1;for(let{from:o}of t.selection.ranges){let l=t.doc.lineAt(o);l.number>s&&(e.push(l.text),n.push({from:l.from,to:Math.min(t.doc.length,l.to+1)})),s=l.number}i=!0}return{text:Fm(t,hx,e.join(t.lineBreak)),ranges:n,linewise:i}}let Mb=null;vs.copy=vs.cut=(t,e)=>{let n=Ga(t.root);if(n&&!Au(t.contentDOM,n))return!1;let{text:i,ranges:s,linewise:o}=p8(t.state);if(!i&&!o)return!1;Mb=o?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});let l=kP?null:e.clipboardData;return l?(l.clearData(),l.setData("text/plain",i),!0):(h8(t,i),!1)};const IP=Lo.define();function LP(t,e){let n=[];for(let i of t.facet(dP)){let s=i(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:IP.of(!0)}):null}function BP(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=LP(t.state,e);n?t.dispatch(n):t.update([])}},10)}rs.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),BP(t)};rs.blur=t=>{t.observer.clearSelectionRange(),BP(t)};rs.compositionstart=rs.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};rs.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ne.chrome&&Ne.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};rs.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};vs.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),l=e.getTargetRanges();if(o&&l.length){let c=l[0],f=t.posAtDOM(c.startContainer,c.startOffset),d=t.posAtDOM(c.endContainer,c.endOffset);return gx(t,{from:f,to:d,insert:t.state.toText(o)},null),!0}}let s;if(Ne.chrome&&Ne.android&&(s=OP.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Ne.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Ne.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>rs.compositionend(t,e),20),!1};const YR=new Set;function m8(t){YR.has(t)||(YR.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const GR=["pre-wrap","normal","pre-line","break-spaces"];let Qa=!1;function XR(){Qa=!1}class g8{constructor(e){this.lineWrapping=e,this.doc=It.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return GR.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let s=e[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(n=!0,this.heightSamples[Math.floor(s*10)]=!0)}return n}refresh(e,n,i,s,o,l){let c=GR.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=c||Math.abs(i-this.charWidth)>.1;if(this.lineWrapping=c,this.lineHeight=n,this.charWidth=i,this.textHeight=s,this.lineLength=o,f){this.heightSamples={};for(let d=0;d<l.length;d++){let h=l[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return f}}class y8{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ps{constructor(e,n,i,s,o){this.from=e,this.length=n,this.top=i,this.height=s,this._content=o}get type(){return typeof this._content=="number"?Jn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof xl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ps(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var tn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(tn||(tn={}));const Zh=.001;class fi{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Zh&&(Qa=!0),this.height=e)}replace(e,n,i){return fi.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,s){let o=this,l=i.doc;for(let c=s.length-1;c>=0;c--){let{fromA:f,toA:d,fromB:h,toB:m}=s[c],g=o.lineAt(f,tn.ByPosNoHeight,i.setDoc(n),0,0),b=g.to>=d?g:o.lineAt(d,tn.ByPosNoHeight,i,0,0);for(m+=b.to-d,d=b.to;c>0&&g.from<=s[c-1].toA;)f=s[c-1].fromA,h=s[c-1].fromB,c--,f<g.from&&(g=o.lineAt(f,tn.ByPosNoHeight,i,0,0));h+=g.from-f,f=g.from;let x=yx.build(i.setDoc(l),e,h,m);o=Ip(o,o.replace(f,d,x))}return o.updateHeight(i,0)}static empty(){return new Ni(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,s=0,o=0;for(;;)if(n==i)if(s>o*2){let c=e[n-1];c.break?e.splice(--n,1,c.left,null,c.right):e.splice(--n,1,c.left,c.right),i+=1+c.break,s-=c.size}else if(o>s*2){let c=e[i];c.break?e.splice(i,1,c.left,null,c.right):e.splice(i,1,c.left,c.right),i+=2+c.break,o-=c.size}else break;else if(s<o){let c=e[n++];c&&(s+=c.size)}else{let c=e[--i];c&&(o+=c.size)}let l=0;return e[n-1]==null?(l=1,n--):e[n]==null&&(l=1,i++),new b8(fi.of(e.slice(0,n)),l,fi.of(e.slice(i)))}}function Ip(t,e){return t==e?t:(t.constructor!=e.constructor&&(Qa=!0),e)}fi.prototype.size=1;const v8=nn.replace({});class VP extends fi{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new ps(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,s){return this.spaceAbove&&e<i+this.spaceAbove?new ps(s,0,i,this.spaceAbove,v8):this.mainBlock(i,s)}lineAt(e,n,i,s,o){let l=this.mainBlock(s,o);return this.spaceAbove?this.blockAt(0,i,s,o).join(l):l}forEachLine(e,n,i,s,o,l){e<=o+this.length&&n>=o&&l(this.lineAt(0,tn.ByPos,i,s,o))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,s){return s&&s.from<=n&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ni extends VP{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new ps(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let s=i[0];return i.length==1&&(s instanceof Ni||s instanceof Xn&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Xn?s=new Ni(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):fi.of(i)}updateHeight(e,n=0,i=!1,s){return s&&s.from<=n&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Xn extends fi{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,s=e.doc.lineAt(n+this.length).number,o=s-i+1,l,c=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*o);l=f/o,this.length>o+1&&(c=(this.height-f)/(this.length-o-1))}else l=this.height/o;return{firstLine:i,lastLine:s,perLine:l,perChar:c}}blockAt(e,n,i,s){let{firstLine:o,lastLine:l,perLine:c,perChar:f}=this.heightMetrics(n,s);if(n.lineWrapping){let d=s+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=n.doc.lineAt(d),m=c+h.length*f,g=Math.max(i,e-m/2);return new ps(h.from,h.length,g,m,0)}else{let d=Math.max(0,Math.min(l-o,Math.floor((e-i)/c))),{from:h,length:m}=n.doc.line(o+d);return new ps(h,m,i+c*d,c,0)}}lineAt(e,n,i,s,o){if(n==tn.ByHeight)return this.blockAt(e,i,s,o);if(n==tn.ByPosNoHeight){let{from:b,to:x}=i.doc.lineAt(e);return new ps(b,x-b,0,0,0)}let{firstLine:l,perLine:c,perChar:f}=this.heightMetrics(i,o),d=i.doc.lineAt(e),h=c+d.length*f,m=d.number-l,g=s+c*m+f*(d.from-o-m);return new ps(d.from,d.length,Math.max(s,Math.min(g,s+this.height-h)),h,0)}forEachLine(e,n,i,s,o,l){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:c,perLine:f,perChar:d}=this.heightMetrics(i,o);for(let h=e,m=s;h<=n;){let g=i.doc.lineAt(h);if(h==e){let x=g.number-c;m+=f*x+d*(e-o-x)}let b=f+d*g.length;l(new ps(g.from,g.length,m,b,0)),m+=b,h=g.to+1}}replace(e,n,i){let s=this.length-n;if(s>0){let o=i[i.length-1];o instanceof Xn?i[i.length-1]=new Xn(o.length+s):i.push(null,new Xn(s-1))}if(e>0){let o=i[0];o instanceof Xn?i[0]=new Xn(e+o.length):i.unshift(new Xn(e-1),null)}return fi.of(i)}decomposeLeft(e,n){n.push(new Xn(e-1),null)}decomposeRight(e,n){n.push(null,new Xn(this.length-e-1))}updateHeight(e,n=0,i=!1,s){let o=n+this.length;if(s&&s.from<=n+this.length&&s.more){let l=[],c=Math.max(n,s.from),f=-1;for(s.from>n&&l.push(new Xn(s.from-n-1).updateHeight(e,n));c<=o&&s.more;){let h=e.doc.lineAt(c).length;l.length&&l.push(null);let m=s.heights[s.index++],g=0;m<0&&(g=-m,m=s.heights[s.index++]),f==-1?f=m:Math.abs(m-f)>=Zh&&(f=-2);let b=new Ni(h,m,g);b.outdated=!1,l.push(b),c+=h+1}c<=o&&l.push(null,new Xn(o-c).updateHeight(e,c));let d=fi.of(l);return(f<0||Math.abs(d.height-this.height)>=Zh||Math.abs(f-this.heightMetrics(e,n).perLine)>=Zh)&&(Qa=!0),Ip(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class b8 extends fi{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,s){let o=i+this.left.height;return e<o?this.left.blockAt(e,n,i,s):this.right.blockAt(e,n,o,s+this.left.length+this.break)}lineAt(e,n,i,s,o){let l=s+this.left.height,c=o+this.left.length+this.break,f=n==tn.ByHeight?e<l:e<c,d=f?this.left.lineAt(e,n,i,s,o):this.right.lineAt(e,n,i,l,c);if(this.break||(f?d.to<c:d.from>c))return d;let h=n==tn.ByPosNoHeight?tn.ByPosNoHeight:tn.ByPos;return f?d.join(this.right.lineAt(c,h,i,l,c)):this.left.lineAt(c,h,i,s,o).join(d)}forEachLine(e,n,i,s,o,l){let c=s+this.left.height,f=o+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,i,s,o,l),n>=f&&this.right.forEachLine(e,n,i,c,f,l);else{let d=this.lineAt(f,tn.ByPos,i,s,o);e<d.from&&this.left.forEachLine(e,d.from-1,i,s,o,l),d.to>=e&&d.from<=n&&l(d),n>d.to&&this.right.forEachLine(d.to+1,n,i,c,f,l)}}replace(e,n,i){let s=this.left.length+this.break;if(n<s)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,n-s,i));let o=[];e>0&&this.decomposeLeft(e,o);let l=o.length;for(let c of i)o.push(c);if(e>0&&$R(o,l-1),n<this.length){let c=o.length;this.decomposeRight(n,o),$R(o,c)}return fi.of(o)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<s&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?fi.of(this.break?[e,null,n]:[e,n]):(this.left=Ip(this.left,e),this.right=Ip(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,s){let{left:o,right:l}=this,c=n+o.length+this.break,f=null;return s&&s.from<=n+o.length&&s.more?f=o=o.updateHeight(e,n,i,s):o.updateHeight(e,n,i),s&&s.from<=c+l.length&&s.more?f=l=l.updateHeight(e,c,i,s):l.updateHeight(e,c,i),f?this.balanced(o,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function $R(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof Xn&&(i=t[e+1])instanceof Xn&&t.splice(e-1,3,new Xn(n.length+1+i.length))}const S8=5;class yx{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ni?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ni(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let l=n-e;i.block?this.addBlock(new VP(l,s,i)):(l||o||s>=S8)&&this.addLineDeco(s,o,l)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ni(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new Xn(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ni)return e;let n=new Ni(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ni)&&!this.isCovered?this.nodes.push(new Ni(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let s of this.nodes)s instanceof Ni&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,n,i,s){let o=new yx(i,e);return kt.spans(n,i,s,o,0),o.finish(i)}}function x8(t,e,n){let i=new w8;return kt.compare(t,e,n,i,0),i.changes}class w8{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,s){(e<n||i&&i.heightRelevant||s&&s.heightRelevant)&&Va(e,n,this.changes,5)}}function C8(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,s=i.defaultView||window,o=Math.max(0,n.left),l=Math.min(s.innerWidth,n.right),c=Math.max(0,n.top),f=Math.min(s.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=i.body;)if(d.nodeType==1){let h=d,m=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&m.overflow!="visible"){let g=h.getBoundingClientRect();o=Math.max(o,g.left),l=Math.min(l,g.right),c=Math.max(c,g.top),f=Math.min(d==t.parentNode?s.innerHeight:f,g.bottom)}d=m.position=="absolute"||m.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:o-n.left,right:Math.max(o,l)-n.left,top:c-(n.top+e),bottom:Math.max(c,f)-(n.top+e)}}function E8(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function T8(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Q0{constructor(e,n,i,s){this.from=e,this.to=n,this.size=i,this.displaySize=s}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],o=n[i];if(s.from!=o.from||s.to!=o.to||s.size!=o.size)return!1}return!0}draw(e,n){return nn.replace({widget:new R8(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class R8 extends Ol{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class QR{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ZR,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=fn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(px).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new g8(n),this.stateDeco=JR(e),this.heightMap=fi.empty().applyChanges(this.stateDeco,It.empty,this.heightOracle.setDoc(e.doc),[new Zi(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=nn.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let s=i?n.head:n.anchor;if(!e.some(({from:o,to:l})=>s>=o&&s<=l)){let{from:o,to:l}=this.lineBlockAt(s);e.push(new vh(o,l))}}return this.viewports=e.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ZR:new vx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(xu(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=JR(this.state);let s=e.changedRanges,o=Zi.extendWithRanges(s,x8(i,this.stateDeco,e?e.changes:In.empty(this.state.doc.length))),l=this.heightMap.height,c=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);XR(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=l||Qa)&&(e.flags|=2),c?(this.scrollAnchorPos=e.changes.mapPos(c.from,-1),this.scrollAnchorHeight=c.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let f=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pP)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,i=window.getComputedStyle(n),s=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?fn.RTL:fn.LTR;let l=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent,c=n.getBoundingClientRect(),f=l||this.mustMeasureContent||this.contentDOMHeight!=c.height;this.contentDOMHeight=c.height,this.mustMeasureContent=!1;let d=0,h=0;if(c.width&&c.height){let{scaleX:D,scaleY:O}=Qk(n,c);(D>.005&&Math.abs(this.scaleX-D)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=D,this.scaleY=O,d|=16,l=f=!0)}let m=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=m||this.paddingBottom!=g)&&(this.paddingTop=m,this.paddingBottom=g,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let b=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=b&&(this.scrollAnchorHeight=-1,this.scrollTop=b),this.scrolledToBottom=Jk(e.scrollDOM);let x=(this.printing?T8:C8)(n,this.paddingTop),w=x.top-this.pixelViewport.top,C=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(f=!0)),!this.inView&&!this.scrollTarget&&!E8(e.dom))return 0;let M=c.width;if((this.contentDOMWidth!=M||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=c.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let D=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(D)&&(l=!0),l||s.lineWrapping&&Math.abs(M-this.contentDOMWidth)>s.charWidth){let{lineHeight:O,charWidth:A,textHeight:k}=e.docView.measureTextSize();l=O>0&&s.refresh(o,O,A,k,Math.max(5,M/A),D),l&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?h=Math.max(w,C):w<0&&C<0&&(h=Math.min(w,C)),XR();for(let O of this.viewports){let A=O.from==this.viewport.from?D:e.docView.measureVisibleLineHeights(O);this.heightMap=(l?fi.empty().applyChanges(this.stateDeco,It.empty,this.heightOracle,[new Zi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new y8(O.from,A))}Qa&&(d|=2)}let T=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,o=this.heightOracle,{visibleTop:l,visibleBottom:c}=this,f=new vh(s.lineAt(l-i*1e3,tn.ByHeight,o,0,0).from,s.lineAt(c+(1-i)*1e3,tn.ByHeight,o,0,0).to);if(n){let{head:d}=n.range;if(d<f.from||d>f.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(d,tn.ByPos,o,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<f.from?g=m.top:g=m.bottom-h,f=new vh(s.lineAt(g-1e3/2,tn.ByHeight,o,0,0).from,s.lineAt(g+h+1e3/2,tn.ByHeight,o,0,0).to)}}return f}mapViewport(e,n){let i=n.mapPos(e.from,-1),s=n.mapPos(e.to,1);return new vh(this.heightMap.lineAt(i,tn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,tn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,tn.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:c}=this;return(e==0||s<=l-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||o>=c+Math.max(10,Math.min(i,250)))&&s>l-2*1e3&&o<c+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let s of e)n.touchesRange(s.from,s.to)||i.push(new Q0(n.mapPos(s.from),n.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,o=s>>1,l=s<<1;if(this.defaultTextDirection!=fn.LTR&&!i)return[];let c=[],f=(h,m,g,b)=>{if(m-h<o)return;let x=this.state.selection.main,w=[x.from];x.empty||w.push(x.to);for(let E of w)if(E>h&&E<m){f(h,E-10,g,b),f(E+10,m,g,b);return}let C=M8(e,E=>E.from>=g.from&&E.to<=g.to&&Math.abs(E.from-h)<o&&Math.abs(E.to-m)<o&&!w.some(M=>E.from<M&&E.to>M));if(!C){if(m<g.to&&n&&i&&n.visibleRanges.some(T=>T.from<=m&&T.to>=m)){let T=n.moveToLineBoundary(xe.cursor(m),!1,!0).head;T>h&&(m=T)}let E=this.gapSize(g,h,m,b),M=i||E<2e6?E:2e6;C=new Q0(h,m,E,M)}c.push(C)},d=h=>{if(h.length<l||h.type!=Jn.Text)return;let m=A8(h.from,h.to,this.stateDeco);if(m.total<l)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,b,x;if(i){let w=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,C,E;if(g!=null){let M=Sh(m,g),T=((this.visibleBottom-this.visibleTop)/2+w)/h.height;C=M-T,E=M+T}else C=(this.visibleTop-h.top-w)/h.height,E=(this.visibleBottom-h.top+w)/h.height;b=bh(m,C),x=bh(m,E)}else{let w=m.total*this.heightOracle.charWidth,C=s*this.heightOracle.charWidth,E=0;if(w>2e6)for(let A of e)A.from>=h.from&&A.from<h.to&&A.size!=A.displaySize&&A.from*this.heightOracle.charWidth+E<this.pixelViewport.left&&(E=A.size-A.displaySize);let M=this.pixelViewport.left+E,T=this.pixelViewport.right+E,D,O;if(g!=null){let A=Sh(m,g),k=((T-M)/2+C)/w;D=A-k,O=A+k}else D=(M-C)/w,O=(T+C)/w;b=bh(m,D),x=bh(m,O)}b>h.from&&f(h.from,b,h,m),x<h.to&&f(x,h.to,h,m)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return c}gapSize(e,n,i,s){let o=Sh(s,i)-Sh(s,n);return this.heightOracle.lineWrapping?e.height*o:s.total*this.heightOracle.charWidth*o}updateLineGaps(e){Q0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=nn.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];kt.spans(n,this.viewport.from,this.viewport.to,{span(o,l){i.push({from:o,to:l})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let o=0;o<i.length&&!(s&8);o++){let l=this.visibleRanges[o],c=i[o];(l.from!=c.from||l.to!=c.to)&&(s|=4,e&&e.mapPos(l.from,-1)==c.from&&e.mapPos(l.to,1)==c.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||xu(this.heightMap.lineAt(e,tn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||xu(this.heightMap.lineAt(this.scaler.fromDOM(e),tn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return xu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class vh{constructor(e,n){this.from=e,this.to=n}}function A8(t,e,n){let i=[],s=t,o=0;return kt.spans(n,t,e,{span(){},point(l,c){l>s&&(i.push({from:s,to:l}),o+=l-s),s=c}},20),s<e&&(i.push({from:s,to:e}),o+=e-s),{total:o,ranges:i}}function bh({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let s=0;;s++){let{from:o,to:l}=e[s],c=l-o;if(i<=c)return o+i;i-=c}}function Sh(t,e){let n=0;for(let{from:i,to:s}of t.ranges){if(e<=s){n+=e-i;break}n+=s-i}return n/t.total}function M8(t,e){for(let n of t)if(e(n))return n}const ZR={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function JR(t){let e=t.facet(zm).filter(i=>typeof i!="function"),n=t.facet(mx).filter(i=>typeof i!="function");return n.length&&e.push(kt.join(n)),e}class vx{constructor(e,n,i){let s=0,o=0,l=0;this.viewports=i.map(({from:c,to:f})=>{let d=n.lineAt(c,tn.ByPos,e,0,0).top,h=n.lineAt(f,tn.ByPos,e,0,0).bottom;return s+=h-d,{from:c,to:f,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let c of this.viewports)c.domTop=l+(c.top-o)*this.scale,l=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}toDOM(e){for(let n=0,i=0,s=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return s+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,s=o.domBottom}}fromDOM(e){for(let n=0,i=0,s=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return i+(e-s)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,s=o.domBottom}}eq(e){return e instanceof vx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}}function xu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ps(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(s=>xu(s,e)):t._content)}const xh=He.define({combine:t=>t.join(" ")}),Ob=He.define({combine:t=>t.indexOf(!0)>-1}),Db=So.newName(),zP=So.newName(),_P=So.newName(),HP={"&light":"."+zP,"&dark":"."+_P};function kb(t,e,n){return new So(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return t;if(!n||!n[s])throw new RangeError(`Unsupported selector: ${s}`);return n[s]}):t+" "+i}})}const O8=kb("."+Db,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},HP),D8={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Z0=Ne.ie&&Ne.ie_version<=11;class k8{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new aU,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(Ne.ie&&Ne.ie_version<=11||Ne.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ne.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ne.chrome&&Ne.chrome_version<126)&&(this.editContext=new N8(e),e.state.facet(wr)&&(e.contentDOM.editContext=this.editContext.editContext)),Z0&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(wr)?i.root.activeElement!=this.dom:!Au(this.dom,s))return;let o=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Ne.ie&&Ne.ie_version<=11||Ne.android&&Ne.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Ou(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Ga(e.root);if(!n)return!1;let i=Ne.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&P8(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let s=Au(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&uU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,D8),Z0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Z0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let s=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&za(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,s=!1;for(let o of e){let l=this.readMutation(o);l&&(l.typeOver&&(s=!0),n==-1?{from:n,to:i}=l:(n=Math.min(l.from,n),i=Math.max(l.to,i)))}return{from:n,to:i,typeOver:s}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),s=this.selectionChanged&&Au(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new $U(this.view,e,n,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,s=AP(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Np(this.view.state.selection,n.newSel.main))&&this.view.update([]),s}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=eA(n,e.previousSibling||e.target.previousSibling,-1),s=eA(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:s?n.posBefore(s):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(wr)!=e.state.facet(wr)&&(e.view.contentDOM.editContext=e.state.facet(wr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function eA(t,e,n){for(;e;){let i=Dn.get(e);if(i&&i.parent==t)return i;let s=e.parentNode;e=s!=t.dom?s:n>0?e.nextSibling:e.previousSibling}return null}function tA(t,e){let n=e.startContainer,i=e.startOffset,s=e.endContainer,o=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor,1);return Ou(l.node,l.offset,s,o)&&([n,i,s,o]=[s,o,n,i]),{anchorNode:n,anchorOffset:i,focusNode:s,focusOffset:o}}function P8(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return tA(t,s)}let n=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?tA(t,n):null}class N8{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let s=e.state.selection.main,{anchor:o,head:l}=s,c=this.toEditorPos(i.updateRangeStart),f=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:c,drifted:!1});let d=f-c>i.text.length;c==this.from&&o<this.from?c=o:f==this.to&&o>this.to&&(f=o);let h=MP(e.state.sliceDoc(c,f),i.text,(d?s.from:s.to)-c,d?"end":null);if(!h){let g=xe.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Np(g,s)||e.dispatch({selection:g,userEvent:"select"});return}let m={from:h.from+c,to:h.toA+c,insert:It.of(i.text.slice(h.from,h.toB).split(`
19
+ `))};if((Ne.mac||Ne.android)&&m.from==l-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:c,to:f,insert:It.of([i.text.replace("."," ")])}),this.pendingContextChange=m,!e.state.readOnly){let g=this.to-this.from+(m.to-m.from+m.insert.length);gx(e,m,xe.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),m.from<m.to&&!m.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],o=null;for(let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);l<c;l++){let f=e.coordsForChar(l);o=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||o||new DOMRect,s.push(o)}n.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let o of i.getTextFormats()){let l=o.underlineStyle,c=o.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(c)){let f=this.toEditorPos(o.rangeStart),d=this.toEditorPos(o.rangeEnd);if(f<d){let h=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(c)?1:2}px`;s.push(nn.mark({attributes:{style:h}}).range(f,d))}}}e.dispatch({effects:gP.of(nn.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Ga(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((o,l,c,f,d)=>{if(i)return;let h=d.length-(l-o);if(s&&l>=s.to)if(s.from==o&&s.to==l&&s.insert.eq(d)){s=this.pendingContextChange=null,n+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(o+=n,l+=n,l<=this.from)this.from+=h,this.to+=h;else if(o<this.to){if(o<this.from||l>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(l),d.toString()),this.to+=h}n+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),s=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Je{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(o=>i(o,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||cU(e.parent)||document,this.viewState=new QR(e.state||Ut.create(e)),e.scrollTo&&e.scrollTo.is(mh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ca).map(s=>new q0(s));for(let s of this.plugins)s.update(this);this.observer=new k8(this),this.inputState=new e8(this),this.inputState.ensureHandlers(this.plugins),this.docView=new VR(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Bn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,s,o=this.state;for(let g of e){if(g.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=g.state}if(this.destroyed){this.viewState.state=o;return}let l=this.hasFocus,c=0,f=null;e.some(g=>g.annotation(IP))?(this.inputState.notifiedFocused=l,c=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,f=LP(o,l),f||(c=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(h=null)):this.observer.clear(),o.facet(Ut.phrases)!=this.state.facet(Ut.phrases))return this.setState(o);s=Dp.create(this,o,e),s.flags|=c;let m=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(m&&(m=m.map(g.changes)),g.scrollIntoView){let{main:b}=g.state.selection;m=new _a(b.empty?b:xe.cursor(b.head,b.head>b.anchor?-1:1))}for(let b of g.effects)b.is(mh)&&(m=b.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=Lp.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(bu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(xh)!=s.state.facet(xh)&&(this.viewState.mustMeasureContent=!0),(n||i||m||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(Eb))try{g(s)}catch(b){Hs(this.state,b,"update listener")}(f||h)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),h&&!AP(this,h)&&d.force&&za(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new QR(e),this.plugins=e.facet(Ca).map(i=>new q0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new VR(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Ca),i=e.state.facet(Ca);if(n!=i){let s=[];for(let o of i){let l=n.indexOf(o);if(l<0)s.push(new q0(o));else{let c=this.plugins[l];c.mustUpdate=e,s.push(c)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){Hs(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:l}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let c=0;;c++){if(l<0)if(Jk(i))o=-1,l=this.viewState.heightMap.height;else{let b=this.viewState.scrollAnchorAt(s);o=b.from,l=b.top}this.updateState=1;let f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(c>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(b=>{try{return b.read(this)}catch(x){return Hs(this.state,x),nA}}),m=Dp.create(this,this.state,[]),g=!1;m.flags|=f,n?n.flags|=f:n=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m),g&&this.docViewUpdate());for(let b=0;b<d.length;b++)if(h[b]!=nA)try{let x=d[b];x.write&&x.write(h[b],this)}catch(x){Hs(this.state,x)}if(g&&this.docView.updateSelection(!0),!m.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let x=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-l;if(x>1||x<-1){s=s+x,i.scrollTop=s/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let c of this.state.facet(Eb))c(n)}get themeClasses(){return Db+" "+(this.state.facet(Ob)?_P:zP)+" "+this.state.facet(xh)}updateAttrs(){let e=iA(this,yP,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(wr)?"true":"false",class:"cm-content",style:`${Ne.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),iA(this,px,n);let i=this.observer.ignore(()=>{let s=kR(this.contentDOM,this.contentAttrs,n),o=kR(this.dom,this.editorAttrs,e);return s||o});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let s of i.effects)if(s.is(Je.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(bu);let e=this.state.facet(Je.cspNonce);So.mount(this.root,this.styleModules.concat(O8).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return $0(this,e,zR(this,e,n,i))}moveByGroup(e,n){return $0(this,e,zR(this,e,n,i=>KU(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),o=i[n?i.length-1:0];return xe.cursor(o.side(n,s)+e.from,o.forward(!n,s)?1:-1)}moveToLineBoundary(e,n,i=!0){return WU(this,e,n,i)}moveVertically(e,n,i){return $0(this,e,qU(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=Ab(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Ab(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.docView.coordsAt(e,n);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),o=this.bidiSpans(s),l=o[Er.find(o,e-s.from,-1,n)];return Qu(i,l.dir==fn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(hP)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>I8)return rP(e.length);let n=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||sP(o.isolates,i=IR(this,e))))return o.order;i||(i=IR(this,e));let s=yU(e.text,n,i);return this.bidiCache.push(new Lp(e.from,e.to,n,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Ne.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Zk(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return mh.of(new _a(typeof e=="number"?xe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return mh.of(new _a(xe.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ys.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ys.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=So.newName(),s=[xh.of(i),bu.of(kb(`.${i}`,e))];return n&&n.dark&&s.push(Ob.of(!0)),s}static baseTheme(e){return Nm.lowest(bu.of(kb("."+Db,e,HP)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),s=i&&Dn.get(i)||Dn.get(e);return((n=s?.root)===null||n===void 0?void 0:n.view)||null}}Je.styleModule=bu;Je.inputHandler=fP;Je.clipboardInputFilter=dx;Je.clipboardOutputFilter=hx;Je.scrollHandler=mP;Je.focusChangeEffect=dP;Je.perLineTextDirection=hP;Je.exceptionSink=uP;Je.updateListener=Eb;Je.editable=wr;Je.mouseSelectionStyle=cP;Je.dragMovesSelection=aP;Je.clickAddsSelectionRange=lP;Je.decorations=zm;Je.blockWrappers=vP;Je.outerDecorations=mx;Je.atomicRanges=Mf;Je.bidiIsolatedRanges=bP;Je.scrollMargins=SP;Je.darkTheme=Ob;Je.cspNonce=He.define({combine:t=>t.length?t[0]:""});Je.contentAttributes=px;Je.editorAttributes=yP;Je.lineWrapping=Je.contentAttributes.of({class:"cm-lineWrapping"});Je.announce=Jt.define();const I8=4096,nA={};class Lp{constructor(e,n,i,s,o,l){this.from=e,this.to=n,this.dir=i,this.isolates=s,this.fresh=o,this.order=l}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:fn.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let l=e[o];l.dir==s&&!n.touchesRange(l.from,l.to)&&i.push(new Lp(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return i}}function iA(t,e,n){for(let i=t.state.facet(e),s=i.length-1;s>=0;s--){let o=i[s],l=typeof o=="function"?o(t):o;l&&cx(l,n)}return n}const L8=Ne.mac?"mac":Ne.windows?"win":Ne.linux?"linux":"key";function B8(t,e){const n=t.split(/-(?!$)/);let i=n[n.length-1];i=="Space"&&(i=" ");let s,o,l,c;for(let f=0;f<n.length-1;++f){const d=n[f];if(/^(cmd|meta|m)$/i.test(d))c=!0;else if(/^a(lt)?$/i.test(d))s=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))e=="mac"?c=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return s&&(i="Alt-"+i),o&&(i="Ctrl-"+i),c&&(i="Meta-"+i),l&&(i="Shift-"+i),i}function wh(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const V8=Nm.default(Je.domEventHandlers({keydown(t,e){return UP(FP(e.state),t,e,"editor")}})),z8=He.define({enables:V8}),sA=new WeakMap;function FP(t){let e=t.facet(z8),n=sA.get(e);return n||sA.set(e,n=H8(e.reduce((i,s)=>i.concat(s),[]))),n}function pZ(t,e,n){return UP(FP(t.state),e,t,n)}let co=null;const _8=4e3;function H8(t,e=L8){let n=Object.create(null),i=Object.create(null),s=(l,c)=>{let f=i[l];if(f==null)i[l]=c;else if(f!=c)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},o=(l,c,f,d,h)=>{var m,g;let b=n[l]||(n[l]=Object.create(null)),x=c.split(/ (?!$)/).map(E=>B8(E,e));for(let E=1;E<x.length;E++){let M=x.slice(0,E).join(" ");s(M,!0),b[M]||(b[M]={preventDefault:!0,stopPropagation:!1,run:[T=>{let D=co={view:T,prefix:M,scope:l};return setTimeout(()=>{co==D&&(co=null)},_8),!0}]})}let w=x.join(" ");s(w,!1);let C=b[w]||(b[w]={preventDefault:!1,stopPropagation:!1,run:((g=(m=b._any)===null||m===void 0?void 0:m.run)===null||g===void 0?void 0:g.slice())||[]});f&&C.run.push(f),d&&(C.preventDefault=!0),h&&(C.stopPropagation=!0)};for(let l of t){let c=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let d of c){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=l;for(let g in h)h[g].run.push(b=>m(b,Pb))}let f=l[e]||l.key;if(f)for(let d of c)o(d,f,l.run,l.preventDefault,l.stopPropagation),l.shift&&o(d,"Shift-"+f,l.shift,l.preventDefault,l.stopPropagation)}return n}let Pb=null;function UP(t,e,n,i){Pb=e;let s=eU(e),o=BF(s,0),l=VF(o)==s.length&&s!=" ",c="",f=!1,d=!1,h=!1;co&&co.view==n&&co.scope==i&&(c=co.prefix+" ",DP.indexOf(e.keyCode)<0&&(d=!0,co=null));let m=new Set,g=C=>{if(C){for(let E of C.run)if(!m.has(E)&&(m.add(E),E(n)))return C.stopPropagation&&(h=!0),!0;C.preventDefault&&(C.stopPropagation&&(h=!0),d=!0)}return!1},b=t[i],x,w;return b&&(g(b[c+wh(s,e,!l)])?f=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ne.windows&&e.ctrlKey&&e.altKey)&&!(Ne.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(x=xo[e.keyCode])&&x!=s?(g(b[c+wh(x,e,!0)])||e.shiftKey&&(w=Xu[e.keyCode])!=s&&w!=x&&g(b[c+wh(w,e,!1)]))&&(f=!0):l&&e.shiftKey&&g(b[c+wh(s,e,!0)])&&(f=!0),!f&&g(b._any)&&(f=!0)),d&&(f=!0),f&&h&&e.stopPropagation(),Pb=null,f}class Of{constructor(e,n,i,s,o){this.className=e,this.left=n,this.top=i,this.width=s,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let o=jP(e);return[new Of(n,s.left-o.left,s.top-o.top,null,s.bottom-s.top)]}else return F8(e,n,i)}}function jP(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==fn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function rA(t,e,n,i){let s=t.coordsAtPos(e,n*2);if(!s)return i;let o=t.dom.getBoundingClientRect(),l=(s.top+s.bottom)/2,c=t.posAtCoords({x:o.left+1,y:l}),f=t.posAtCoords({x:o.right-1,y:l});return c==null||f==null?i:{from:Math.max(i.from,Math.min(c,f)),to:Math.min(i.to,Math.max(c,f))}}function F8(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let i=Math.max(n.from,t.viewport.from),s=Math.min(n.to,t.viewport.to),o=t.textDirection==fn.LTR,l=t.contentDOM,c=l.getBoundingClientRect(),f=jP(t),d=l.querySelector(".cm-line"),h=d&&window.getComputedStyle(d),m=c.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),g=c.right-(h?parseInt(h.paddingRight):0),b=Rb(t,i,1),x=Rb(t,s,-1),w=b.type==Jn.Text?b:null,C=x.type==Jn.Text?x:null;if(w&&(t.lineWrapping||b.widgetLineBreaks)&&(w=rA(t,i,1,w)),C&&(t.lineWrapping||x.widgetLineBreaks)&&(C=rA(t,s,-1,C)),w&&C&&w.from==C.from&&w.to==C.to)return M(T(n.from,n.to,w));{let O=w?T(n.from,null,w):D(b,!1),A=C?T(null,n.to,C):D(x,!0),k=[];return(w||b).to<(C||x).from-(w&&C?1:0)||b.widgetLineBreaks>1&&O.bottom+t.defaultLineHeight/2<A.top?k.push(E(m,O.bottom,g,A.top)):O.bottom<A.top&&t.elementAtHeight((O.bottom+A.top)/2).type==Jn.Text&&(O.bottom=A.top=(O.bottom+A.top)/2),M(O).concat(k).concat(M(A))}function E(O,A,k,P){return new Of(e,O-f.left,A-f.top,Math.max(0,k-O),P-A)}function M({top:O,bottom:A,horizontal:k}){let P=[];for(let B=0;B<k.length;B+=2)P.push(E(k[B],O,k[B+1],A));return P}function T(O,A,k){let P=1e9,B=-1e9,z=[];function q(_,H,I,L,K){let Y=t.coordsAtPos(_,_==k.to?-2:2),Z=t.coordsAtPos(I,I==k.from?2:-2);!Y||!Z||(P=Math.min(Y.top,Z.top,P),B=Math.max(Y.bottom,Z.bottom,B),K==fn.LTR?z.push(o&&H?m:Y.left,o&&L?g:Z.right):z.push(!o&&L?m:Z.left,!o&&H?g:Y.right))}let W=O??k.from,F=A??k.to;for(let _ of t.visibleRanges)if(_.to>W&&_.from<F)for(let H=Math.max(_.from,W),I=Math.min(_.to,F);;){let L=t.state.doc.lineAt(H);for(let K of t.bidiSpans(L)){let Y=K.from+L.from,Z=K.to+L.from;if(Y>=I)break;Z>H&&q(Math.max(Y,H),O==null&&Y<=W,Math.min(Z,I),A==null&&Z>=F,K.dir)}if(H=L.to+1,H>=I)break}return z.length==0&&q(W,O==null,F,A==null,t.textDirection),{top:P,bottom:B,horizontal:z}}function D(O,A){let k=c.top+(A?O.top:O.bottom);return{top:k,bottom:k,horizontal:[]}}}function U8(t,e){return t.constructor==e.constructor&&t.eq(e)}class j8{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Jh)!=e.state.facet(Jh)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,i=e.facet(Jh);for(;n<i.length&&i[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,i)=>!U8(n,this.drawn[i]))){let n=this.dom.firstChild,i=0;for(let s of e)s.update&&n&&s.constructor&&this.drawn[i].constructor&&s.update(n,this.drawn[i])?(n=n.nextSibling,i++):this.dom.insertBefore(s.draw(),n);for(;n;){let s=n.nextSibling;n.remove(),n=s}this.drawn=e,Ne.safari&&Ne.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Jh=He.define();function WP(t){return[ys.define(e=>new j8(e,t)),Jh.of(t)]}const Za=He.define({combine(t){return Lm(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function mZ(t={}){return[Za.of(t),W8,K8,q8,pP.of(!0)]}function gZ(t){return t.facet(Za)}function KP(t){return t.startState.facet(Za)!=t.state.facet(Za)}const W8=WP({above:!0,markers(t){let{state:e}=t,n=e.facet(Za),i=[];for(let s of e.selection.ranges){let o=s==e.selection.main;if(s.empty||n.drawRangeCursor){let l=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",c=s.empty?s:xe.cursor(s.head,s.head>s.anchor?-1:1);for(let f of Of.forRange(t,l,c))i.push(f)}}return i},update(t,e){t.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=KP(t);return n&&oA(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){oA(e.state,t)},class:"cm-cursorLayer"});function oA(t,e){e.style.animationDuration=t.facet(Za).cursorBlinkRate+"ms"}const K8=WP({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Of.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||KP(t)},class:"cm-selectionLayer"}),q8=Nm.highest(Je.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));class Y8 extends Ol{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Mu(e.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(e.parentNode),s=Qu(n[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return s.bottom-s.top>o*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+o}:s}ignoreEvent(){return!1}}function yZ(t){let e=ys.fromClass(class{constructor(n){this.view=n,this.placeholder=t?nn.set([nn.widget({widget:new Y8(t),side:1}).range(0)]):nn.none}get decorations(){return this.view.state.doc.length?nn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Je.contentAttributes.of({"aria-placeholder":t})]:e}const lA=He.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});function vZ(t,e){let n=t.plugin(qP),i=n?n.specs.indexOf(e):-1;return i>-1?n.panels[i]:null}const qP=ys.fromClass(class{constructor(t){this.input=t.state.facet(Nb),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(lA);this.top=new Ch(t,!0,e.topContainer),this.bottom=new Ch(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(lA);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ch(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ch(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Nb);if(n!=this.input){let i=n.filter(f=>f),s=[],o=[],l=[],c=[];for(let f of i){let d=this.specs.indexOf(f),h;d<0?(h=f(t.view),c.push(h)):(h=this.panels[d],h.update&&h.update(t)),s.push(h),(h.top?o:l).push(h)}this.specs=i,this.panels=s,this.top.sync(o),this.bottom.sync(l);for(let f of c)f.dom.classList.add("cm-panel"),f.mount&&f.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Je.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Ch{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=aA(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=aA(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function aA(t){let e=t.nextSibling;return t.remove(),e}const Nb=He.define({enables:qP});function bZ(t,e){let n,i=new Promise(l=>n=l),s=l=>G8(l,e,n);t.state.field(J0,!1)?t.dispatch({effects:YP.of(s)}):t.dispatch({effects:Jt.appendConfig.of(J0.init(()=>[s]))});let o=GP.of(s);return{close:o,result:i.then(l=>((t.win.queueMicrotask||(f=>t.win.setTimeout(f,10)))(()=>{t.state.field(J0).indexOf(s)>-1&&t.dispatch({effects:o})}),l))}}const J0=tr.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(YP)?t=[n.value].concat(t):n.is(GP)&&(t=t.filter(i=>i!=n.value));return t},provide:t=>Nb.computeN([t],e=>e.field(t))}),YP=Jt.define(),GP=Jt.define();function G8(t,e,n){let i=e.content?e.content(t,()=>l(null)):null;if(!i){if(i=pa("form"),e.input){let c=pa("input",e.input);/^(text|password|number|email|tel|url)$/.test(c.type)&&c.classList.add("cm-textfield"),c.name||(c.name="input"),i.appendChild(pa("label",(e.label||"")+": ",c))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(pa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let c=0;c<s.length;c++){let f=s[c];f.addEventListener("keydown",d=>{d.keyCode==27?(d.preventDefault(),l(null)):d.keyCode==13&&(d.preventDefault(),l(f))}),f.addEventListener("submit",d=>{d.preventDefault(),l(f)})}let o=pa("div",i,pa("button",{onclick:()=>l(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(o.className=e.class),o.classList.add("cm-dialog");function l(c){o.contains(o.ownerDocument.activeElement)&&t.focus(),n(c)}return{dom:o,top:e.top,mount:()=>{if(e.focus){let c;typeof e.focus=="string"?c=i.querySelector(e.focus):c=i.querySelector("input")||i.querySelector("button"),c&&"select"in c?c.select():c&&"focus"in c&&c.focus()}}}}class El extends Sl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}El.prototype.elementClass="";El.prototype.toDOM=void 0;El.prototype.mapMode=Li.TrackBefore;El.prototype.startSide=El.prototype.endSide=-1;El.prototype.point=!0;const ev=He.define(),X8=He.define(),ep=He.define(),Ib=He.define({combine:t=>t.some(e=>e)});function $8(t){let e=[Q8];return t&&t.fixed===!1&&e.push(Ib.of(!0)),e}const Q8=ys.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ep).map(e=>new uA(t,e)),this.fixed=!t.state.facet(Ib);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Ib)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=kt.iter(this.view.state.facet(ev),this.view.viewport.from),i=[],s=this.gutters.map(o=>new Z8(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let l=!0;for(let c of o.type)if(c.type==Jn.Text&&l){Lb(n,i,c.from);for(let f of s)f.line(this.view,c,i);l=!1}else if(c.widget)for(let f of s)f.widget(this.view,c)}else if(o.type==Jn.Text){Lb(n,i,o.from);for(let l of s)l.line(this.view,o,i)}else if(o.widget)for(let l of s)l.widget(this.view,o);for(let o of s)o.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(ep),n=t.state.facet(ep),i=t.docChanged||t.heightChanged||t.viewportChanged||!kt.eq(t.startState.facet(ev),t.state.facet(ev),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let s of this.gutters)s.update(t)&&(i=!0);else{i=!0;let s=[];for(let o of n){let l=e.indexOf(o);l<0?s.push(new uA(this.view,o)):(this.gutters[l].update(t),s.push(this.gutters[l]))}for(let o of this.gutters)o.dom.remove(),s.indexOf(o)<0&&o.destroy();for(let o of s)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=s}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Je.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,s=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==fn.LTR?{left:i,right:s}:{right:i,left:s}})});function cA(t){return Array.isArray(t)?t:[t]}function Lb(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Z8{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=kt.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:s}=this,o=(n.top-this.height)/e.scaleY,l=n.height/e.scaleY;if(this.i==s.elements.length){let c=new XP(e,l,o,i);s.elements.push(c),s.dom.appendChild(c.dom)}else s.elements[this.i].update(e,l,o,i);this.height=n.bottom,this.i++}line(e,n,i){let s=[];Lb(this.cursor,s,n.from),i.length&&(s=s.concat(i));let o=this.gutter.config.lineMarker(e,n,s);o&&s.unshift(o);let l=this.gutter;s.length==0&&!l.config.renderEmptyElements||this.addElement(e,n,s)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),s=i?[i]:null;for(let o of e.state.facet(X8)){let l=o(e,n.widget,n);l&&(s||(s=[])).push(l)}s&&this.addElement(e,n,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class uA{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,s=>{let o=s.target,l;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let f=o.getBoundingClientRect();l=(f.top+f.bottom)/2}else l=s.clientY;let c=e.lineBlockAtHeight(l-e.documentTop);n.domEventHandlers[i](e,c,s)&&s.preventDefault()});this.markers=cA(n.markers(e)),n.initialSpacer&&(this.spacer=new XP(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=cA(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!kt.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class XP{constructor(e,n,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,s)}update(e,n,i,s){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),J8(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,n){let i="cm-gutterElement",s=this.dom.firstChild;for(let o=0,l=0;;){let c=l,f=o<n.length?n[o++]:null,d=!1;if(f){let h=f.elementClass;h&&(i+=" "+h);for(let m=l;m<this.markers.length;m++)if(this.markers[m].compare(f)){c=m,d=!0;break}}else c=this.markers.length;for(;l<c;){let h=this.markers[l++];if(h.toDOM){h.destroy(s);let m=s.nextSibling;s.remove(),s=m}}if(!f)break;f.toDOM&&(d?s=s.nextSibling:this.dom.insertBefore(f.toDOM(e),s)),d&&l++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}}function J8(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const e6=He.define(),t6=He.define(),Ea=He.define({combine(t){return Lm(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let s in n){let o=i[s],l=n[s];i[s]=o?(c,f,d)=>o(c,f,d)||l(c,f,d):l}return i}})}});class tv extends El{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function nv(t,e){return t.state.facet(Ea).formatNumber(e,t.state)}const n6=ep.compute([Ea],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(e6)},lineMarker(e,n,i){return i.some(s=>s.toDOM)?null:new tv(nv(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let s of e.state.facet(t6)){let o=s(e,n,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Ea)!=e.state.facet(Ea),initialSpacer(e){return new tv(nv(e,fA(e.state.doc.lines)))},updateSpacer(e,n){let i=nv(n.view,fA(n.view.state.doc.lines));return i==e.number?e:new tv(i)},domEventHandlers:t.facet(Ea).domEventHandlers,side:"before"}));function SZ(t={}){return[Ea.of(t),$8(),n6]}function fA(t){let e=9;for(;e<t;)e=e*10+9;return e}const dA=t=>Symbol.iterator in t,hA=t=>"entries"in t,pA=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),i=e instanceof Map?e:new Map(e.entries());if(n.size!==i.size)return!1;for(const[s,o]of n)if(!i.has(s)||!Object.is(o,i.get(s)))return!1;return!0},i6=(t,e)=>{const n=t[Symbol.iterator](),i=e[Symbol.iterator]();let s=n.next(),o=i.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=n.next(),o=i.next()}return!!s.done&&!!o.done};function s6(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:dA(t)&&dA(e)?hA(t)&&hA(e)?pA(t,e):i6(t,e):pA({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function xZ(t){const e=ye.useRef(void 0);return n=>{const i=t(n);return s6(e.current,i)?e.current:e.current=i}}const $P=v.createContext(null),QP=v.createContext(null);function Bo(){const t=v.useContext($P);if(t===null)throw new Error(zt(60));return t}function ZP(){const t=v.useContext(QP);if(t===null)throw new Error(zt(61));return t}function JP(t={}){const{id:e,implicit:n=!1,controlRef:i}=t,{controlId:s,registerControlId:o}=ix(),l=Ti(e),c=n?s:void 0,f=kn(()=>Symbol("labelable-control")),d=v.useRef(!1),h=v.useRef(e!=null),m=Ve(()=>{!d.current||o===Hn||(d.current=!1,o(f.current,void 0))});return Oe(()=>{if(o===Hn)return;let g;if(n){const b=i?.current;Tt(b)&&b.closest("label")!=null?g=e??null:g=c??l}else if(e!=null)h.current=!0,g=e;else if(h.current)g=l;else{m();return}if(g===void 0){m();return}d.current=!0,o(f.current,g)},[e,i,c,o,n,l,f,m]),v.useEffect(()=>m,[m]),s??l}const r6=(t,e)=>Object.is(t,e);function Ja(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function o6(t,e,n){return!t||t.length===0?!1:t.some(i=>i===void 0?!1:Ja(e,i,n))}function ku(t,e,n){return!t||t.length===0?-1:t.findIndex(i=>i===void 0?!1:Ja(i,e,n))}function l6(t,e,n){return t.filter(i=>!Ja(e,i,n))}function Bb(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function eN(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function a6(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(eN(e)){for(const n of e)for(const i of n.items)if(i&&i.value==null&&i.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function tN(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Bb(t)}function ba(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Bb(t.value):Bb(t)}function nN(t,e,n){function i(){return tN(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return e[t]??i();if(Array.isArray(e)){const s=e,o=eN(s)?s.flatMap(l=>l.items):s;if(t==null||typeof t!="object"){const l=o.find(c=>c.value===t);return l&&l.label!=null?l.label:i()}if("value"in t){const l=o.find(c=>c&&c.value===t.value);if(l&&l.label!=null)return l.label}}return i()}function c6(t,e,n){return t.reduce((i,s,o)=>(o>0&&i.push(", "),i.push(ue.jsx(v.Fragment,{children:nN(s,e,n)},o)),i),[])}const st={id:be(t=>t.id),labelId:be(t=>t.labelId),modal:be(t=>t.modal),multiple:be(t=>t.multiple),items:be(t=>t.items),itemToStringLabel:be(t=>t.itemToStringLabel),itemToStringValue:be(t=>t.itemToStringValue),isItemEqualToValue:be(t=>t.isItemEqualToValue),value:be(t=>t.value),hasSelectedValue:be(t=>{const{value:e,multiple:n,itemToStringValue:i}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:ba(e,i)!==""}),hasNullItemLabel:be((t,e)=>e?a6(t.items):!1),open:be(t=>t.open),mounted:be(t=>t.mounted),forceMount:be(t=>t.forceMount),transitionStatus:be(t=>t.transitionStatus),openMethod:be(t=>t.openMethod),activeIndex:be(t=>t.activeIndex),selectedIndex:be(t=>t.selectedIndex),isActive:be((t,e)=>t.activeIndex===e),isSelected:be((t,e,n)=>{const i=t.isItemEqualToValue,s=t.value;return t.multiple?Array.isArray(s)&&s.some(o=>Ja(n,o,i)):t.selectedIndex===e&&t.selectedIndex!==null?!0:Ja(n,s,i)}),isSelectedByFocus:be((t,e)=>t.selectedIndex===e),popupProps:be(t=>t.popupProps),triggerProps:be(t=>t.triggerProps),triggerElement:be(t=>t.triggerElement),positionerElement:be(t=>t.positionerElement),listElement:be(t=>t.listElement),scrollUpArrowVisible:be(t=>t.scrollUpArrowVisible),scrollDownArrowVisible:be(t=>t.scrollDownArrowVisible),hasScrollArrows:be(t=>t.hasScrollArrows)};function wu(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const xr=1;function iN(t,e){return Math.max(0,t-e)}function u6(t,e){if(e<=0)return 0;const n=wu(t,0,e),i=n,s=e-n,o=i<=xr,l=s<=xr;return o&&l?i<=s?0:e:o?0:l?e:n}function wZ(t){const{id:e,value:n,defaultValue:i=null,onValueChange:s,open:o,defaultOpen:l=!1,onOpenChange:c,name:f,form:d,autoComplete:h,disabled:m=!1,readOnly:g=!1,required:b=!1,modal:x=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:E,items:M,multiple:T=!1,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A=r6,highlightItemOnHover:k=!0,children:P}=t,{clearErrors:B}=Ck(),{setDirty:z,setTouched:q,setFocused:W,shouldValidateOnChange:F,validityData:_,setFilled:H,name:I,disabled:L,validation:K,validationMode:Y}=Pm(),Z=JP({id:e}),le=L||m,V=I??f,[U,$]=Ep({controlled:n,default:T?i??_u:i,name:"Select",state:"value"}),[G,J]=Ep({controlled:o,default:l,name:"Select",state:"open"}),fe=v.useRef([]),ie=v.useRef([]),de=v.useRef(null),Se=v.useRef(null),Fe=v.useRef(0),pe=v.useRef(null),Ee=v.useRef([]),De=v.useRef(!1),Le=v.useRef(!1),we=v.useRef(null),Te=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ke=v.useRef(!1),{mounted:ve,setMounted:Ce,transitionStatus:re}=wf(G),{openMethod:me,triggerProps:ae}=Om(G),oe=kn(()=>new JD({id:Z,labelId:void 0,modal:x,multiple:T,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A,value:U,open:G,mounted:ve,transitionStatus:re,items:M,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ie=rt(oe,st.activeIndex),Xe=rt(oe,st.selectedIndex),Ue=rt(oe,st.triggerElement),qe=rt(oe,st.positionerElement),ft=IH(me),at=me??ft,ct=v.useMemo(()=>T&&Array.isArray(U)&&U.length===0?"":ba(U,O),[T,U,O]),Ae=v.useMemo(()=>T&&Array.isArray(U)?U.map(tt=>ba(tt,O)):ba(U,O),[T,U,O]),je=Mn(oe.state.triggerElement),We=Ve(()=>Ae);wk(je,{id:Z,value:U,getValue:We});const xt=v.useRef(U);Oe(()=>{U!==xt.current&&oe.set("forceMount",!0)},[oe,U]),Oe(()=>{H(T?Array.isArray(U)&&U.length>0:U!=null)},[T,U,H]),Oe(function(){if(G)return;const lt=Ee.current;if(T){const Pn=Array.isArray(U)?U:[];if(Pn.length===0){oe.set("selectedIndex",null);return}const an=Pn[Pn.length-1],hn=ku(lt,an,A);oe.set("selectedIndex",hn===-1?null:hn);return}const ln=ku(lt,U,A);oe.set("selectedIndex",ln===-1?null:ln)},[T,G,U,Ee,A,oe]),QS(U,()=>{B(V),z(U!==_.initialValue),F()?K.commit(U):K.commit(U,!0)});const wt=Ve((tt,lt)=>{if(c?.(tt,lt),!lt.isCanceled&&(J(tt),!tt&&(lt.reason===vo||lt.reason===am)&&(q(!0),W(!1),Y==="onBlur"&&K.commit(U)),!tt&&oe.state.activeIndex!==null)){const ln=fe.current[oe.state.activeIndex];queueMicrotask(()=>{ln?.setAttribute("tabindex","-1")})}}),Yt=Ve(()=>{Ce(!1),oe.update({activeIndex:null,openMethod:null}),E?.(!1)});er({enabled:!w,open:G,ref:de,onComplete(){G||Yt()}}),v.useImperativeHandle(w,()=>({unmount:Yt}),[Yt]);const Ze=Ve((tt,lt)=>{s?.(tt,lt),!lt.isCanceled&&$(tt)}),Ke=Ve(()=>{const tt=oe.state.listElement||de.current;if(!tt)return;const lt=iN(tt.scrollHeight,tt.clientHeight),ln=u6(tt.scrollTop,lt),Pn=ln>0,an=ln<lt;oe.state.scrollUpArrowVisible!==Pn&&oe.set("scrollUpArrowVisible",Pn),oe.state.scrollDownArrowVisible!==an&&oe.set("scrollDownArrowVisible",an)}),pt=tk({open:G,onOpenChange:wt,elements:{reference:Ue,floating:qe}}),vt=bf(pt,{enabled:!g&&!le,event:"mousedown"}),mt=Sf(pt,{bubbles:!1}),it=rk(pt,{enabled:!g&&!le,listRef:fe,activeIndex:Ie,selectedIndex:Xe,disabledIndices:_u,onNavigate(tt){tt===null&&!G||oe.set("activeIndex",tt)},focusItemOnHover:k}),Pe=ok(pt,{enabled:!g&&!le&&(G||!T),listRef:ie,activeIndex:Ie,selectedIndex:Xe,onMatch(tt){G?oe.set("activeIndex",tt):Ze(Ee.current[tt],Qe("none"))},onTypingChange(tt){De.current=tt}}),{getReferenceProps:et,getFloatingProps:ot,getItemProps:gt}=Nr([vt,mt,it,Pe]),_t=v.useMemo(()=>Mr(et(),ae,Z?{id:Z}:Sn),[et,ae,Z]);Cf(()=>{oe.update({popupProps:ot(),triggerProps:_t})}),Oe(()=>{oe.update({id:Z,modal:x,multiple:T,value:U,open:G,mounted:ve,transitionStatus:re,popupProps:ot(),triggerProps:_t,items:M,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:A,openMethod:at})},[oe,Z,x,T,U,G,ve,re,ot,_t,M,D,O,A,at]);const bt=v.useMemo(()=>({store:oe,name:V,required:b,disabled:le,readOnly:g,multiple:T,itemToStringLabel:D,itemToStringValue:O,highlightItemOnHover:k,setValue:Ze,setOpen:wt,listRef:fe,popupRef:de,scrollHandlerRef:Se,handleScrollArrowVisibility:Ke,scrollArrowsMountedCountRef:Fe,getItemProps:gt,events:pt.context.events,valueRef:pe,valuesRef:Ee,labelsRef:ie,typingRef:De,selectionRef:Te,selectedItemTextRef:we,validation:K,onOpenChangeComplete:E,keyboardActiveRef:Le,alignItemWithTriggerActiveRef:ke,initialValueRef:xt}),[oe,V,b,le,g,T,D,O,k,Ze,wt,gt,pt.context.events,K,E,Ke]),nt=Ar(C,K.inputRef),Gt=T&&Array.isArray(U)&&U.length>0,Ot=T?void 0:V,Vt=v.useMemo(()=>!T||!Array.isArray(U)||!V?null:U.map(tt=>{const lt=ba(tt,O);return ue.jsx("input",{type:"hidden",form:d,name:V,value:lt},lt)}),[T,U,d,V,O]);return ue.jsx($P.Provider,{value:bt,children:ue.jsxs(QP.Provider,{value:pt,children:[P,ue.jsx("input",{...K.getInputValidationProps({onFocus(){oe.state.triggerElement?.focus({focusVisible:!0})},onChange(tt){if(tt.nativeEvent.defaultPrevented)return;const lt=tt.currentTarget.value,ln=Qe(rc,tt.nativeEvent);function Pn(){if(T)return;const an=Ee.current.find(hn=>ba(hn,O).toLowerCase()===lt.toLowerCase()||tN(hn,D).toLowerCase()===lt.toLowerCase());an!=null&&(z(an!==_.initialValue),Ze(an,ln),F()&&K.commit(an))}oe.set("forceMount",!0),queueMicrotask(Pn)}}),id:Z&&Ot==null?`${Z}-hidden-input`:void 0,form:d,name:Ot,autoComplete:h,value:ct,disabled:le,required:b&&!Gt,readOnly:g,ref:nt,style:V?gD:IS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Vt]})})}function f6(t,e){return t??e}function sN(t){const e=t.getBoundingClientRect(),n=dn(t),i=n.getComputedStyle(t,"::before"),s=n.getComputedStyle(t,"::after");if(!(i.content!=="none"||s.content!=="none"))return e;const l=parseFloat(i.width)||0,c=parseFloat(i.height)||0,f=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(e.width,l,f),m=Math.max(e.height,c,d),g=h-e.width,b=m-e.height;return{left:e.left-g/2,right:e.right+g/2,top:e.top-b/2,bottom:e.bottom+b/2}}const Eh=2,d6=400,mA=200,h6={...Fu,...nx,value:()=>null},CZ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,disabled:l=!1,nativeButton:c=!0,style:f,...d}=e,{setTouched:h,setFocused:m,validationMode:g,state:b,disabled:x}=Pm(),{labelId:w}=ix(),{store:C,setOpen:E,selectionRef:M,validation:T,readOnly:D,required:O,alignItemWithTriggerActiveRef:A,disabled:k,keyboardActiveRef:P}=Bo(),B=x||k||l,z=rt(C,st.open),q=rt(C,st.value),W=rt(C,st.triggerProps),F=rt(C,st.positionerElement),_=rt(C,st.listElement),H=rt(C,st.id),I=rt(C,st.labelId),L=rt(C,st.hasSelectedValue),K=!L&&z,Y=rt(C,st.hasNullItemLabel,K),Z=o??H,le=f6(w,I);JP({id:Z});const V=Mn(F),U=v.useRef(null),{getButtonProps:$,buttonRef:G}=ko({disabled:B,native:c}),J=Ve(Le=>{C.set("triggerElement",Le)}),fe=Ar(n,U,G,J),ie=On(),de=On(),Se=On(),Fe=On();v.useEffect(()=>{if(z)return!(L||Y)?Se.start(d6,()=>{M.current.allowUnselectedMouseUp=!0,M.current.allowSelectedMouseUp=!0}):Fe.start(mA,()=>{M.current.allowUnselectedMouseUp=!0,Se.start(mA,()=>{M.current.allowSelectedMouseUp=!0})}),()=>{Se.clear(),Fe.clear()};M.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},de.clear()},[z,L,Y,M,de,Se,Fe]);const pe=v.useMemo(()=>_?.id??ju(F)?.id,[_,F]),Ee=Mr(W,{id:Z,role:"combobox","aria-expanded":z?"true":"false","aria-haspopup":"listbox","aria-controls":z?pe:void 0,"aria-labelledby":le,"aria-readonly":D||void 0,"aria-required":O||void 0,tabIndex:B?-1:0,ref:fe,onFocus(Le){m(!0),z&&A.current&&E(!1,Qe(rc,Le.nativeEvent)),ie.start(0,()=>{C.set("forceMount",!0)})},onBlur(Le){Ge(F,Le.relatedTarget)||(h(!0),m(!1),g==="onBlur"&&T.commit(q))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(Le){if(z)return;const we=yt(Le.currentTarget);function Te(ke){if(!U.current)return;const ve=ke.target;if(Ge(U.current,ve)||Ge(V.current,ve)||ve===U.current)return;const Ce=sN(U.current);ke.clientX>=Ce.left-Eh&&ke.clientX<=Ce.right+Eh&&ke.clientY>=Ce.top-Eh&&ke.clientY<=Ce.bottom+Eh||E(!1,Qe(PS,ke))}de.start(0,()=>{we.addEventListener("mouseup",Te,{once:!0})})}},T.getValidationProps,d,$);Ee.role="combobox";const De={...b,open:z,disabled:B,value:q,readOnly:D,placeholder:!L};return Dt("button",e,{ref:[n,U],state:De,stateAttributesMapping:h6,props:Ee})}),p6={value:()=>null},EZ=v.forwardRef(function(e,n){const{className:i,render:s,children:o,placeholder:l,style:c,...f}=e,{store:d,valueRef:h}=Bo(),m=rt(d,st.value),g=rt(d,st.items),b=rt(d,st.itemToStringLabel),x=rt(d,st.hasSelectedValue),w=!x&&l!=null&&o==null,C=rt(d,st.hasNullItemLabel,w),E={value:m,placeholder:!x};let M=null;return typeof o=="function"?M=o(m):o!=null?M=o:!x&&l!=null&&!C?M=l:Array.isArray(m)?M=c6(m,g,b):M=nN(m,g,b),Dt("span",e,{state:E,ref:[n,h],props:[{children:M},f],stateAttributesMapping:p6})}),TZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...l}=e,{store:c}=Bo(),d={open:rt(c,st.open)};return Dt("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:mf})}),m6=v.createContext(void 0),RZ=v.forwardRef(function(e,n){const{store:i}=Bo(),s=rt(i,st.mounted),o=rt(i,st.forceMount);return s||o?ue.jsx(m6.Provider,{value:!0,children:ue.jsx(pm,{ref:n,...e})}):null}),rN=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function g6(){return v.useContext(rN)}function oN(t){const{children:e,elementsRef:n,labelsRef:i,onMapChange:s}=t,o=Ve(s),l=v.useRef(0),c=kn(v6).current,f=kn(y6).current,[d,h]=v.useState(0),m=v.useRef(d),g=Ve((E,M)=>{f.set(E,M??null),m.current+=1,h(m.current)}),b=Ve(E=>{f.delete(E),m.current+=1,h(m.current)}),x=v.useMemo(()=>{const E=new Map;return Array.from(f.keys()).filter(T=>T.isConnected).sort(b6).forEach((T,D)=>{const O=f.get(T)??{};E.set(T,{...O,index:D})}),E},[f,d]);Oe(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const E=new MutationObserver(M=>{const T=new Set,D=O=>T.has(O)?T.delete(O):T.add(O);M.forEach(O=>{O.removedNodes.forEach(D),O.addedNodes.forEach(D)}),T.size===0&&(m.current+=1,h(m.current))});return x.forEach((M,T)=>{T.parentElement&&E.observe(T.parentElement,{childList:!0})}),()=>{E.disconnect()}},[x]),Oe(()=>{m.current===d&&(n.current.length!==x.size&&(n.current.length=x.size),i&&i.current.length!==x.size&&(i.current.length=x.size),l.current=x.size),o(x)},[o,x,n,i,d]),Oe(()=>()=>{n.current=[]},[n]),Oe(()=>()=>{i&&(i.current=[])},[i]);const w=Ve(E=>(c.add(E),()=>{c.delete(E)}));Oe(()=>{c.forEach(E=>E(x))},[c,x]);const C=v.useMemo(()=>({register:g,unregister:b,subscribeMapChange:w,elementsRef:n,labelsRef:i,nextIndexRef:l}),[g,b,w,n,i,l]);return ue.jsx(rN.Provider,{value:C,children:e})}function y6(){return new Map}function v6(){return new Set}function b6(t,e){const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const lN=v.createContext(void 0);function S6(){const t=v.useContext(lN);if(!t)throw new Error(zt(59));return t}function Bp(t,e){t&&Object.assign(t.style,e)}const x6={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},w6=20;function bx(t,e,n,i){const[s,o]=v.useState(!1);Oe(()=>{if(!t||!e||n==null){o(!1);return}const l=yt(n).documentElement.clientWidth,c=n.offsetWidth;o(l>0&&c>0&&c>=l-w6)},[t,e,n]),pk(t&&(!e||s),i)}const C6={position:"fixed"},AZ=v.forwardRef(function(e,n){const{anchor:i,positionMethod:s="absolute",className:o,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w,alignItemWithTrigger:C=!0,collisionAvoidance:E=nD,style:M,...T}=e,{store:D,listRef:O,labelsRef:A,alignItemWithTriggerActiveRef:k,selectedItemTextRef:P,valuesRef:B,initialValueRef:z,popupRef:q,setValue:W}=Bo(),F=ZP(),_=rt(D,st.open),H=rt(D,st.mounted),I=rt(D,st.modal),L=rt(D,st.value),K=rt(D,st.openMethod),Y=rt(D,st.positionerElement),Z=rt(D,st.triggerElement),le=rt(D,st.isItemEqualToValue),V=rt(D,st.transitionStatus),U=v.useRef(null),$=v.useRef(null),[G,J]=v.useState(C),fe=H&&G&&K!=="touch";!H&&G!==C&&J(C),Oe(()=>{H||(st.scrollUpArrowVisible(D.state)&&D.set("scrollUpArrowVisible",!1),st.scrollDownArrowVisible(D.state)&&D.set("scrollDownArrowVisible",!1))},[D,H]),v.useImperativeHandle(k,()=>fe),bx((fe||I)&&_,K==="touch",Y,Z);const ie=Dm({anchor:i,floatingRootContext:F,positionMethod:s,mounted:H,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:b,collisionBoundary:m,collisionPadding:g,sticky:x,disableAnchorTracking:w??fe,collisionAvoidance:E,keepMounted:!0}),de=fe?"none":ie.side,Se=fe?C6:ie.positionerStyles,Fe={open:_,side:de,align:ie.align,anchorHidden:ie.anchorHidden},pe=Ve(Te=>{D.set("positionerElement",Te)}),Ee=km(e,Fe,{styles:Se,transitionStatus:V,props:T,refs:[n,pe],hidden:!H,inert:!_}),De=v.useRef(0),Le=Ve(Te=>{if(Te.size===0&&De.current===0||B.current.length===0)return;const ke=De.current;if(De.current=Te.size,Te.size===ke)return;const ve=Qe(rc);if(ke!==0&&!D.state.multiple&&L!==null&&ku(B.current,L,le)===-1){const re=z.current,ae=re!=null&&ku(B.current,re,le)!==-1?re:null;W(ae,ve),ae===null&&(D.set("selectedIndex",null),P.current=null)}if(ke!==0&&D.state.multiple&&Array.isArray(L)){const Ce=me=>ku(B.current,me,le)!==-1,re=L.filter(me=>Ce(me));(re.length!==L.length||re.some(me=>!o6(L,me,le)))&&(W(re,ve),re.length===0&&(D.set("selectedIndex",null),P.current=null))}if(_&&fe){D.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ce={height:""};Bp(Y,Ce),Bp(q.current,Ce)}}),we=v.useMemo(()=>({...ie,side:de,alignItemWithTriggerActive:fe,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:U,scrollDownArrowRef:$}),[ie,de,fe,J]);return ue.jsx(oN,{elementsRef:O,labelsRef:A,onMapChange:Le,children:ue.jsxs(lN.Provider,{value:we,children:[H&&I&&ue.jsx(Mm,{inert:Am(!_),cutout:Z}),Ee]})})}),Th="base-ui-disable-scrollbar",gA={className:Th,getElement(t){return ue.jsx("style",{nonce:t,href:Th,precedence:"base-ui:low",children:`.${Th}{scrollbar-width:none}.${Th}::-webkit-scrollbar{display:none}`})}},E6=v.createContext(void 0);function Sx(t){return v.useContext(E6)}const T6=v.createContext(void 0),R6={disableStyleElements:!1};function A6(){return v.useContext(T6)??R6}const M6={...Oo,...Pr},MZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,finalFocus:l,...c}=e,{store:f,popupRef:d,onOpenChangeComplete:h,setOpen:m,valueRef:g,selectedItemTextRef:b,keyboardActiveRef:x,multiple:w,handleScrollArrowVisibility:C,scrollHandlerRef:E,listRef:M,highlightItemOnHover:T}=Bo(),{side:D,align:O,alignItemWithTriggerActive:A,isPositioned:k,setControlledAlignItemWithTrigger:P,scrollDownArrowRef:B,scrollUpArrowRef:z}=S6(),q=Sx()!=null,W=ZP(),F=ex(),{nonce:_,disableStyleElements:H}=A6(),I=rt(f,st.id),L=rt(f,st.open),K=rt(f,st.mounted),Y=rt(f,st.popupProps),Z=rt(f,st.transitionStatus),le=rt(f,st.triggerElement),V=rt(f,st.positionerElement),U=rt(f,st.listElement),$=v.useRef(!1),G=v.useRef(!1),J=v.useRef({}),fe=fm(),ie=Ve(pe=>{if(!V||!d.current||!G.current)return;if($.current||!A){C();return}const Ee=V.style.top==="0px",De=V.style.bottom==="0px";if(!Ee&&!De){C();return}const Le=vA(V),we=Cu(V.getBoundingClientRect().height,"y",Le),Te=yt(V),ke=getComputedStyle(V),ve=parseFloat(ke.marginTop),Ce=parseFloat(ke.marginBottom),re=yA(getComputedStyle(d.current)),me=Math.min(Te.documentElement.clientHeight-ve-Ce,re),ae=pe.scrollTop,oe=Rh(pe);let Ie=0,Xe=null,Ue=!1,qe=!1;const ft=je=>{V.style.height=`${je}px`},at=(je,We)=>{const xt=wu(je,0,me-we);xt>0&&ft(we+xt),pe.scrollTop=We,me-(we+xt)<=xr&&($.current=!0),C()},ct=Ee?oe-ae:ae,Ae=Math.min(we+ct,me);if(Ie=Ae,ct<=xr){at(ct,Ee?oe:0);return}if(me-Ae>xr)Ee?qe=!0:Xe=0;else if(Ue=!0,De&&ae<oe){const je=we+ct-me;Xe=ae-(ct-je)}if(Ie=Math.ceil(Ie),Ie!==0&&ft(Ie),qe||Xe!=null){const je=Rh(pe),We=qe?je:wu(Xe,0,je);Math.abs(pe.scrollTop-We)>xr&&(pe.scrollTop=We)}(Ue||Ie>=me-xr)&&($.current=!0),C()});v.useImperativeHandle(E,()=>ie,[ie]),er({open:L,ref:d,onComplete(){L&&h?.(!0)}});const de={open:L,transitionStatus:Z,side:D,align:O};Oe(()=>{!V||!d.current||Object.keys(J.current).length||(J.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),Oe(()=>{L||A||(G.current=!1,$.current=!1,Bp(V,J.current))},[L,A,V,d]),Oe(()=>{const pe=d.current;if(!L||!le||!V||!pe||A&&!k||f.state.transitionStatus==="ending")return;if(!A){G.current=!0,fe.request(C),pe.style.removeProperty("--transform-origin");return}const Ee=O6(pe);pe.style.removeProperty("--transform-origin");try{const De=b.current,Le=g.current,we=getComputedStyle(V),Te=getComputedStyle(pe),ke=yt(le),ve=dn(V),Ce=vA(le),re=Ah(le.getBoundingClientRect(),Ce),me=Ah(V.getBoundingClientRect(),Ce),ae=re.height,oe=U||pe,Ie=oe.scrollHeight,Xe=parseFloat(Te.borderBottomWidth),Ue=parseFloat(we.marginTop)||10,qe=parseFloat(we.marginBottom)||10,ft=parseFloat(we.minHeight)||100,at=yA(Te),ct=5,Ae=5,je=20,We=ke.documentElement.clientHeight-Ue-qe,xt=ke.documentElement.clientWidth,wt=We-re.bottom+ae;let Yt,Ze=F==="rtl"?re.right-me.width:re.left,Ke=0;if(De&&Le){const nt=Ah(Le.getBoundingClientRect(),Ce);Yt=Ah(De.getBoundingClientRect(),Ce),Ze=me.left+(F==="rtl"?nt.right-Yt.right:nt.left-Yt.left);const Gt=nt.top-re.top+nt.height/2;Ke=Yt.top-me.top+Yt.height/2-Gt}const pt=wt+Ke+qe+Xe;let vt=Math.min(We,pt);const mt=We-Ue-qe,it=pt-vt,Pe=xt-Ae;V.style.left=`${wu(Ze,ct,Pe-me.width)}px`,V.style.height=`${vt}px`,V.style.maxHeight="auto",V.style.marginTop=`${Ue}px`,V.style.marginBottom=`${qe}px`,pe.style.height="100%";const et=Rh(oe),ot=it>=et-xr;ot&&(vt=Math.min(We,me.height)-(it-et));const gt=re.top<je||re.bottom>We-je||Math.ceil(vt)+xr<Math.min(Ie,ft),_t=(ve.visualViewport?.scale??1)!==1&&NS;if(gt||_t){G.current=!0,Bp(V,J.current),P(!1);return}const bt=Math.max(ft,vt);if(ot){const nt=Math.max(0,We-pt);V.style.top=me.height>=mt?"0":`${nt}px`,V.style.height=`${vt}px`,oe.scrollTop=Rh(oe)}else V.style.bottom="0",oe.scrollTop=it;if(Yt){const nt=me.top,Gt=me.height,Ot=Yt.top+Yt.height/2,Vt=Gt>0?(Ot-nt)/Gt*100:50,tt=wu(Vt,0,100);pe.style.setProperty("--transform-origin",`50% ${tt}%`)}(bt===We||vt>=at)&&($.current=!0),C(),T&&f.state.selectedIndex===null&&f.state.activeIndex===null&&M.current[0]!=null&&f.set("activeIndex",0),G.current=!0}finally{Ee()}},[f,L,V,le,g,b,d,C,A,P,fe,B,z,U,M,T,F,k]),v.useEffect(()=>{if(!A||!V||!L)return;const pe=dn(V);function Ee(De){m(!1,Qe(n5,De))}return ht(pe,"resize",Ee)},[m,A,V,L]);const Se={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${I}-list`},onKeyDown(pe){x.current=!0,q&&Rm.has(pe.key)&&pe.stopPropagation()},onMouseMove(){x.current=!1},onScroll(pe){U||ie(pe.currentTarget)},...A&&{style:U?{height:"100%"}:x6}},Fe=Dt("div",e,{ref:[n,d],state:de,stateAttributesMapping:M6,props:[Y,Se,Tf(Z),{className:!U&&A?gA.className:void 0},c]});return ue.jsxs(v.Fragment,{children:[!H&&gA.getElement(_),ue.jsx(mm,{context:W,modal:!1,disabled:!K,returnFocus:l,restoreFocus:!0,children:Fe})]})});function yA(t){const e=t.maxHeight||"";return e.endsWith("px")&&parseFloat(e)||1/0}function Rh(t){return iN(t.scrollHeight,t.clientHeight)}function vA(t){return YD.getScale(t)}function Cu(t,e,n){return t/n[e]}function Ah(t,e){return Wu({x:Cu(t.x,"x",e),y:Cu(t.y,"y",e),width:Cu(t.width,"x",e),height:Cu(t.height,"y",e)})}const bA=[["transform","none"],["scale","1"],["translate","0 0"]];function O6(t){const{style:e}=t,n={};for(const[i,s]of bA)n[i]=e.getPropertyValue(i),e.setProperty(i,s,"important");return()=>{for(const[i]of bA){const s=n[i];s?e.setProperty(i,s):e.removeProperty(i)}}}let aN=(function(t){return t[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t})({});function Df(t={}){const{label:e,metadata:n,textRef:i,indexGuessBehavior:s,index:o}=t,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:h,nextIndexRef:m}=g6(),g=v.useRef(-1),[b,x]=v.useState(o??(s===aN.GuessFromOrder?()=>{if(g.current===-1){const E=m.current;m.current+=1,g.current=E}return g.current}:-1)),w=v.useRef(null),C=v.useCallback(E=>{if(w.current=E,b!==-1&&E!==null&&(d.current[b]=E,h)){const M=e!==void 0;h.current[b]=M?e:i?.current?.textContent??E.textContent}},[b,d,h,e,i]);return Oe(()=>{if(o!=null)return;const E=w.current;if(E)return l(E,n),()=>{c(E)}},[o,l,c,n]),Oe(()=>{if(o==null)return f(E=>{const M=w.current?E.get(w.current)?.index:null;M!=null&&x(M)})},[o,f,x]),v.useMemo(()=>({ref:C,index:b}),[b,C])}const cN=v.createContext(void 0);function xx(){const t=v.useContext(cN);if(!t)throw new Error(zt(57));return t}const OZ=v.memo(v.forwardRef(function(e,n){const{render:i,className:s,value:o=null,label:l,disabled:c=!1,nativeButton:f=!1,style:d,...h}=e,m=v.useRef(null),g=Df({label:l,textRef:m,indexGuessBehavior:aN.GuessFromOrder}),{store:b,getItemProps:x,setOpen:w,setValue:C,selectionRef:E,typingRef:M,valuesRef:T,multiple:D,selectedItemTextRef:O}=Bo(),A=rt(b,st.isActive,g.index),k=rt(b,st.isSelected,g.index,o),P=rt(b,st.isSelectedByFocus,g.index),B=rt(b,st.isItemEqualToValue),z=g.index,q=z!==-1,W=v.useRef(null),F=Mn(z);Oe(()=>{if(!q)return;const G=T.current;return G[z]=o,()=>{delete G[z]}},[q,z,o,T]),Oe(()=>{if(!q)return;const G=b.state.value;let J=G;D&&Array.isArray(G)&&G.length>0&&(J=G[G.length-1]),J!==void 0&&Ja(o,J,B)&&(b.set("selectedIndex",z),m.current&&(O.current=m.current))},[q,z,D,B,b,o,O]);const _={disabled:c,selected:k,highlighted:A},H=x({active:A,selected:k});H.id=void 0;const I=v.useRef(null),L=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:Y,buttonRef:Z}=ko({disabled:c,focusableWhenDisabled:!0,native:f,composite:!0});function le(G){const J=b.state.value;if(D){const fe=Array.isArray(J)?J:[],ie=k?l6(fe,o,B):[...fe,o];C(ie,Qe(Pa,G))}else C(o,Qe(Pa,G)),w(!1,Qe(Pa,G))}const V={role:"option","aria-selected":k,tabIndex:A?0:-1,onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(G){I.current=G.key,b.set("activeIndex",z),G.key===" "&&M.current&&G.preventDefault()},onClick(G){K.current=!1,!(G.type==="keydown"&&I.current===null)&&(c||G.type==="keydown"&&I.current===" "&&M.current||L.current!=="touch"&&!A||(I.current=null,le(G.nativeEvent)))},onPointerEnter(G){L.current=G.pointerType},onPointerDown(G){L.current=G.pointerType,K.current=!0},onMouseUp(){if(c)return;if(K.current){K.current=!1;return}const G=!E.current.allowSelectedMouseUp&&k,J=!E.current.allowUnselectedMouseUp&&!k;G||J||L.current!=="touch"&&!A||W.current?.click()}},U=Dt("div",e,{ref:[Z,n,g.ref,W],state:_,props:[H,V,h,Y]}),$=v.useMemo(()=>({selected:k,indexRef:F,textRef:m,selectedByFocus:P,hasRegistered:q}),[k,F,m,P,q]);return ue.jsx(cN.Provider,{value:$,children:U})})),DZ=v.forwardRef(function(e,n){const i=e.keepMounted??!1,{selected:s}=xx();return i||s?ue.jsx(D6,{...e,ref:n}):null}),D6=v.memo(v.forwardRef((t,e)=>{const{render:n,className:i,style:s,keepMounted:o,...l}=t,{selected:c}=xx(),f=v.useRef(null),{transitionStatus:d,setMounted:h}=wf(c),g=Dt("span",t,{ref:[e,f],state:{selected:c,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:Pr});return er({open:c,ref:f,onComplete(){c||h(!1)}}),g})),kZ=v.memo(v.forwardRef(function(e,n){const{indexRef:i,textRef:s,selectedByFocus:o,hasRegistered:l}=xx(),{selectedItemTextRef:c}=Bo(),{className:f,render:d,style:h,...m}=e,g=v.useCallback(x=>{if(!x||!l)return;const w=c.current===null||!c.current.isConnected;(o||w&&i.current===0)&&(c.current=x)},[c,i,o,l]);return Dt("div",e,{ref:[g,n,s],props:m})})),uN=v.createContext(void 0);function k6(){const t=v.useContext(uN);if(t===void 0)throw new Error(zt(56));return t}const PZ=v.forwardRef(function(e,n){const{className:i,render:s,style:o,...l}=e,[c,f]=v.useState(),d=v.useMemo(()=>({labelId:c,setLabelId:f}),[c,f]),h=Dt("div",e,{ref:n,props:[{role:"group","aria-labelledby":c},l]});return ue.jsx(uN.Provider,{value:d,children:h})}),NZ=v.forwardRef(function(e,n){const{className:i,render:s,id:o,style:l,...c}=e,{setLabelId:f}=k6(),d=Ti(o);return Oe(()=>{f(d)},[d,f]),Dt("div",e,{ref:n,props:[{id:d},c]})}),IZ=v.forwardRef(function(e,n){const{className:i,render:s,orientation:o="horizontal",style:l,...c}=e;return Dt("div",e,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},c]})});function P6(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>i=>{e.forEach(s=>s(i))},e)}const Um=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ac(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function wx(t){return"nodeType"in t}function hi(t){var e,n;return t?ac(t)?t:wx(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Cx(t){const{Document:e}=hi(t);return t instanceof e}function kf(t){return ac(t)?!1:t instanceof hi(t).HTMLElement}function fN(t){return t instanceof hi(t).SVGElement}function cc(t){return t?ac(t)?t.document:wx(t)?Cx(t)?t:kf(t)||fN(t)?t.ownerDocument:document:document:document}const bs=Um?v.useLayoutEffect:v.useEffect;function jm(t){const e=v.useRef(t);return bs(()=>{e.current=t}),v.useCallback(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return e.current==null?void 0:e.current(...i)},[])}function N6(){const t=v.useRef(null),e=v.useCallback((i,s)=>{t.current=setInterval(i,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Ju(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return bs(()=>{n.current!==t&&(n.current=t)},e),n}function Pf(t,e){const n=v.useRef();return v.useMemo(()=>{const i=t(n.current);return n.current=i,i},[...e])}function Vp(t){const e=jm(t),n=v.useRef(null),i=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,i]}function zp(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let iv={};function Nf(t,e){return v.useMemo(()=>{if(e)return e;const n=iv[t]==null?0:iv[t]+1;return iv[t]=n,t+"-"+n},[t,e])}function dN(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];return i.reduce((o,l)=>{const c=Object.entries(l);for(const[f,d]of c){const h=o[f];h!=null&&(o[f]=h+t*d)}return o},{...e})}}const Ha=dN(1),_p=dN(-1);function I6(t){return"clientX"in t&&"clientY"in t}function Wm(t){if(!t)return!1;const{KeyboardEvent:e}=hi(t.target);return e&&t instanceof e}function L6(t){if(!t)return!1;const{TouchEvent:e}=hi(t.target);return e&&t instanceof e}function Hp(t){if(L6(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return I6(t)?{x:t.clientX,y:t.clientY}:null}const Tl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Tl.Translate.toString(t),Tl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:i}=t;return e+" "+n+"ms "+i}}}),SA="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function B6(t){return t.matches(SA)?t:t.querySelector(SA)}const V6={display:"none"};function z6(t){let{id:e,value:n}=t;return ye.createElement("div",{id:e,style:V6},n)}function _6(t){let{id:e,announcement:n,ariaLiveType:i="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ye.createElement("div",{id:e,style:s,role:"status","aria-live":i,"aria-atomic":!0},n)}function H6(){const[t,e]=v.useState("");return{announce:v.useCallback(i=>{i!=null&&e(i)},[]),announcement:t}}const hN=v.createContext(null);function F6(t){const e=v.useContext(hN);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function U6(){const[t]=v.useState(()=>new Set),e=v.useCallback(i=>(t.add(i),()=>t.delete(i)),[t]);return[v.useCallback(i=>{let{type:s,event:o}=i;t.forEach(l=>{var c;return(c=l[s])==null?void 0:c.call(l,o)})},[t]),e]}const j6={draggable:`
20
+ To pick up a draggable item, press the space bar.
21
+ While dragging, use the arrow keys to move the item.
22
+ Press space again to drop the item in its new position, or press escape to cancel.
23
+ `},W6={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function K6(t){let{announcements:e=W6,container:n,hiddenTextDescribedById:i,screenReaderInstructions:s=j6}=t;const{announce:o,announcement:l}=H6(),c=Nf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),F6(v.useMemo(()=>({onDragStart(m){let{active:g}=m;o(e.onDragStart({active:g}))},onDragMove(m){let{active:g,over:b}=m;e.onDragMove&&o(e.onDragMove({active:g,over:b}))},onDragOver(m){let{active:g,over:b}=m;o(e.onDragOver({active:g,over:b}))},onDragEnd(m){let{active:g,over:b}=m;o(e.onDragEnd({active:g,over:b}))},onDragCancel(m){let{active:g,over:b}=m;o(e.onDragCancel({active:g,over:b}))}}),[o,e])),!f)return null;const h=ye.createElement(ye.Fragment,null,ye.createElement(z6,{id:i,value:s.draggable}),ye.createElement(_6,{id:c,announcement:l}));return n?Fn.createPortal(h,n):h}var Ln;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Ln||(Ln={}));function Fp(){}function LZ(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function BZ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(i=>i!=null),[...e])}const Ss=Object.freeze({x:0,y:0});function q6(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Y6(t,e){const n=Hp(t);if(!n)return"0 0";const i={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return i.x+"% "+i.y+"%"}function G6(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return n-i}function X6(t,e){let{data:{value:n}}=t,{data:{value:i}}=e;return i-n}function $6(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function xA(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const VZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const s=xA(e,e.left,e.top),o=[];for(const l of i){const{id:c}=l,f=n.get(c);if(f){const d=q6(xA(f),s);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(G6)};function Q6(t,e){const n=Math.max(e.top,t.top),i=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),l=s-i,c=o-n;if(i<s&&n<o){const f=e.width*e.height,d=t.width*t.height,h=l*c,m=h/(f+d-h);return Number(m.toFixed(4))}return 0}const Z6=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:i}=t;const s=[];for(const o of i){const{id:l}=o,c=n.get(l);if(c){const f=Q6(c,e);f>0&&s.push({id:l,data:{droppableContainer:o,value:f}})}}return s.sort(X6)};function J6(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function pN(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Ss}function ej(t){return function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return s.reduce((l,c)=>({...l,top:l.top+t*c.y,bottom:l.bottom+t*c.y,left:l.left+t*c.x,right:l.right+t*c.x}),{...n})}}const tj=ej(1);function mN(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function nj(t,e,n){const i=mN(e);if(!i)return t;const{scaleX:s,scaleY:o,x:l,y:c}=i,f=t.left-l-(1-s)*parseFloat(n),d=t.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?t.width/s:t.width,m=o?t.height/o:t.height;return{width:h,height:m,top:d,right:f+h,bottom:d+m,left:f}}const ij={ignoreTransform:!1};function uc(t,e){e===void 0&&(e=ij);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=hi(t).getComputedStyle(t);d&&(n=nj(n,d,h))}const{top:i,left:s,width:o,height:l,bottom:c,right:f}=n;return{top:i,left:s,width:o,height:l,bottom:c,right:f}}function wA(t){return uc(t,{ignoreTransform:!0})}function sj(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function rj(t,e){return e===void 0&&(e=hi(t).getComputedStyle(t)),e.position==="fixed"}function oj(t,e){e===void 0&&(e=hi(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=e[s];return typeof o=="string"?n.test(o):!1})}function Ex(t,e){const n=[];function i(s){if(e!=null&&n.length>=e||!s)return n;if(Cx(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!kf(s)||fN(s)||n.includes(s))return n;const o=hi(t).getComputedStyle(s);return s!==t&&oj(s,o)&&n.push(s),rj(s,o)?n:i(s.parentNode)}return t?i(t):n}function gN(t){const[e]=Ex(t,1);return e??null}function sv(t){return!Um||!t?null:ac(t)?t:wx(t)?Cx(t)||t===cc(t).scrollingElement?window:kf(t)?t:null:null}function yN(t){return ac(t)?t.scrollX:t.scrollLeft}function vN(t){return ac(t)?t.scrollY:t.scrollTop}function Vb(t){return{x:yN(t),y:vN(t)}}var _n;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(_n||(_n={}));function bN(t){return!Um||!t?!1:t===document.scrollingElement}function SN(t){const e={x:0,y:0},n=bN(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},i={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,l=t.scrollTop>=i.y,c=t.scrollLeft>=i.x;return{isTop:s,isLeft:o,isBottom:l,isRight:c,maxScroll:i,minScroll:e}}const lj={x:.2,y:.2};function aj(t,e,n,i,s){let{top:o,left:l,right:c,bottom:f}=n;i===void 0&&(i=10),s===void 0&&(s=lj);const{isTop:d,isBottom:h,isLeft:m,isRight:g}=SN(t),b={x:0,y:0},x={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!d&&o<=e.top+w.height?(b.y=_n.Backward,x.y=i*Math.abs((e.top+w.height-o)/w.height)):!h&&f>=e.bottom-w.height&&(b.y=_n.Forward,x.y=i*Math.abs((e.bottom-w.height-f)/w.height)),!g&&c>=e.right-w.width?(b.x=_n.Forward,x.x=i*Math.abs((e.right-w.width-c)/w.width)):!m&&l<=e.left+w.width&&(b.x=_n.Backward,x.x=i*Math.abs((e.left+w.width-l)/w.width)),{direction:b,speed:x}}function cj(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:e,left:n,right:i,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:i,bottom:s,width:t.clientWidth,height:t.clientHeight}}function xN(t){return t.reduce((e,n)=>Ha(e,Vb(n)),Ss)}function uj(t){return t.reduce((e,n)=>e+yN(n),0)}function fj(t){return t.reduce((e,n)=>e+vN(n),0)}function wN(t,e){if(e===void 0&&(e=uc),!t)return;const{top:n,left:i,bottom:s,right:o}=e(t);gN(t)&&(s<=0||o<=0||n>=window.innerHeight||i>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const dj=[["x",["left","right"],uj],["y",["top","bottom"],fj]];class Tx{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Ex(n),s=xN(i);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,l,c]of dj)for(const f of l)Object.defineProperty(this,f,{get:()=>{const d=c(i),h=s[o]-d;return this.rect[f]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Pu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...n)})},this.target=e}add(e,n,i){var s;(s=this.target)==null||s.addEventListener(e,n,i),this.listeners.push([e,n,i])}}function hj(t){const{EventTarget:e}=hi(t);return t instanceof e?t:cc(t)}function rv(t,e){const n=Math.abs(t.x),i=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+i**2)>e:"x"in e&&"y"in e?n>e.x&&i>e.y:"x"in e?n>e.x:"y"in e?i>e.y:!1}var Gi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Gi||(Gi={}));function CA(t){t.preventDefault()}function pj(t){t.stopPropagation()}var Bt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Bt||(Bt={}));const CN={start:[Bt.Space,Bt.Enter],cancel:[Bt.Esc],end:[Bt.Space,Bt.Enter,Bt.Tab]},mj=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Bt.Right:return{...n,x:n.x+25};case Bt.Left:return{...n,x:n.x-25};case Bt.Down:return{...n,y:n.y+25};case Bt.Up:return{...n,y:n.y-25}}};class EN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Pu(cc(n)),this.windowListeners=new Pu(hi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,i=e.node.current;i&&wN(i),n(Ss)}handleKeyDown(e){if(Wm(e)){const{active:n,context:i,options:s}=this.props,{keyboardCodes:o=CN,coordinateGetter:l=mj,scrollBehavior:c="smooth"}=s,{code:f}=e;if(o.end.includes(f)){this.handleEnd(e);return}if(o.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:d}=i.current,h=d?{x:d.left,y:d.top}:Ss;this.referenceCoordinates||(this.referenceCoordinates=h);const m=l(e,{active:n,context:i.current,currentCoordinates:h});if(m){const g=_p(m,h),b={x:0,y:0},{scrollableAncestors:x}=i.current;for(const w of x){const C=e.code,{isTop:E,isRight:M,isLeft:T,isBottom:D,maxScroll:O,minScroll:A}=SN(w),k=cj(w),P={x:Math.min(C===Bt.Right?k.right-k.width/2:k.right,Math.max(C===Bt.Right?k.left:k.left+k.width/2,m.x)),y:Math.min(C===Bt.Down?k.bottom-k.height/2:k.bottom,Math.max(C===Bt.Down?k.top:k.top+k.height/2,m.y))},B=C===Bt.Right&&!M||C===Bt.Left&&!T,z=C===Bt.Down&&!D||C===Bt.Up&&!E;if(B&&P.x!==m.x){const q=w.scrollLeft+g.x,W=C===Bt.Right&&q<=O.x||C===Bt.Left&&q>=A.x;if(W&&!g.y){w.scrollTo({left:q,behavior:c});return}W?b.x=w.scrollLeft-q:b.x=C===Bt.Right?w.scrollLeft-O.x:w.scrollLeft-A.x,b.x&&w.scrollBy({left:-b.x,behavior:c});break}else if(z&&P.y!==m.y){const q=w.scrollTop+g.y,W=C===Bt.Down&&q<=O.y||C===Bt.Up&&q>=A.y;if(W&&!g.x){w.scrollTo({top:q,behavior:c});return}W?b.y=w.scrollTop-q:b.y=C===Bt.Down?w.scrollTop-O.y:w.scrollTop-A.y,b.y&&w.scrollBy({top:-b.y,behavior:c});break}}this.handleMove(e,Ha(_p(m,this.referenceCoordinates),b))}}}handleMove(e,n){const{onMove:i}=this.props;e.preventDefault(),i(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}EN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:i=CN,onActivation:s}=e,{active:o}=n;const{code:l}=t.nativeEvent;if(i.start.includes(l)){const c=o.activatorNode.current;return c&&t.target!==c?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function EA(t){return!!(t&&"distance"in t)}function TA(t){return!!(t&&"delay"in t)}class Rx{constructor(e,n,i){var s;i===void 0&&(i=hj(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:l}=o;this.props=e,this.events=n,this.document=cc(l),this.documentListeners=new Pu(this.document),this.listeners=new Pu(i),this.windowListeners=new Pu(hi(l)),this.initialCoordinates=(s=Hp(o))!=null?s:Ss,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:i}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.DragStart,CA),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),this.windowListeners.add(Gi.ContextMenu,CA),this.documentListeners.add(Gi.Keydown,this.handleKeydown),n){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(TA(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(EA(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:i,onPending:s}=this.props;s(i,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Gi.Click,pj,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:i,initialCoordinates:s,props:o}=this,{onMove:l,options:{activationConstraint:c}}=o;if(!s)return;const f=(n=Hp(e))!=null?n:Ss,d=_p(s,f);if(!i&&c){if(EA(c)){if(c.tolerance!=null&&rv(d,c.tolerance))return this.handleCancel();if(rv(d,c.distance))return this.handleStart()}if(TA(c)&&rv(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}e.cancelable&&e.preventDefault(),l(f)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Bt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const gj={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class TN extends Rx{constructor(e){const{event:n}=e,i=cc(n.target);super(e,gj,i)}}TN.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return!n.isPrimary||n.button!==0?!1:(i?.({event:n}),!0)}}];const yj={move:{name:"mousemove"},end:{name:"mouseup"}};var zb;(function(t){t[t.RightClick=2]="RightClick"})(zb||(zb={}));class vj extends Rx{constructor(e){super(e,yj,cc(e.event.target))}}vj.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;return n.button===zb.RightClick?!1:(i?.({event:n}),!0)}}];const ov={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class bj extends Rx{constructor(e){super(e,ov)}static setup(){return window.addEventListener(ov.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ov.move.name,e)};function e(){}}}bj.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:i}=e;const{touches:s}=n;return s.length>1?!1:(i?.({event:n}),!0)}}];var Nu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Nu||(Nu={}));var Up;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Up||(Up={}));function Sj(t){let{acceleration:e,activator:n=Nu.Pointer,canScroll:i,draggingRect:s,enabled:o,interval:l=5,order:c=Up.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:h,delta:m,threshold:g}=t;const b=wj({delta:m,disabled:!o}),[x,w]=N6(),C=v.useRef({x:0,y:0}),E=v.useRef({x:0,y:0}),M=v.useMemo(()=>{switch(n){case Nu.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Nu.DraggableRect:return s}},[n,s,f]),T=v.useRef(null),D=v.useCallback(()=>{const A=T.current;if(!A)return;const k=C.current.x*E.current.x,P=C.current.y*E.current.y;A.scrollBy(k,P)},[]),O=v.useMemo(()=>c===Up.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!M){w();return}for(const A of O){if(i?.(A)===!1)continue;const k=d.indexOf(A),P=h[k];if(!P)continue;const{direction:B,speed:z}=aj(A,P,M,e,g);for(const q of["x","y"])b[q][B[q]]||(z[q]=0,B[q]=0);if(z.x>0||z.y>0){w(),T.current=A,x(D,l),C.current=z,E.current=B;return}}C.current={x:0,y:0},E.current={x:0,y:0},w()},[e,D,i,w,o,l,JSON.stringify(M),JSON.stringify(b),x,d,O,h,JSON.stringify(g)])}const xj={x:{[_n.Backward]:!1,[_n.Forward]:!1},y:{[_n.Backward]:!1,[_n.Forward]:!1}};function wj(t){let{delta:e,disabled:n}=t;const i=zp(e);return Pf(s=>{if(n||!i||!s)return xj;const o={x:Math.sign(e.x-i.x),y:Math.sign(e.y-i.y)};return{x:{[_n.Backward]:s.x[_n.Backward]||o.x===-1,[_n.Forward]:s.x[_n.Forward]||o.x===1},y:{[_n.Backward]:s.y[_n.Backward]||o.y===-1,[_n.Forward]:s.y[_n.Forward]||o.y===1}}},[n,e,i])}function Cj(t,e){const n=e!=null?t.get(e):void 0,i=n?n.node.current:null;return Pf(s=>{var o;return e==null?null:(o=i??s)!=null?o:null},[i,e])}function Ej(t,e){return v.useMemo(()=>t.reduce((n,i)=>{const{sensor:s}=i,o=s.activators.map(l=>({eventName:l.eventName,handler:e(l.handler,i)}));return[...n,...o]},[]),[t,e])}var ef;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ef||(ef={}));var _b;(function(t){t.Optimized="optimized"})(_b||(_b={}));const RA=new Map;function Tj(t,e){let{dragging:n,dependencies:i,config:s}=e;const[o,l]=v.useState(null),{frequency:c,measure:f,strategy:d}=s,h=v.useRef(t),m=C(),g=Ju(m),b=v.useCallback(function(E){E===void 0&&(E=[]),!g.current&&l(M=>M===null?E:M.concat(E.filter(T=>!M.includes(T))))},[g]),x=v.useRef(null),w=Pf(E=>{if(m&&!n)return RA;if(!E||E===RA||h.current!==t||o!=null){const M=new Map;for(let T of t){if(!T)continue;if(o&&o.length>0&&!o.includes(T.id)&&T.rect.current){M.set(T.id,T.rect.current);continue}const D=T.node.current,O=D?new Tx(f(D),D):null;T.rect.current=O,O&&M.set(T.id,O)}return M}return E},[t,o,n,m,f]);return v.useEffect(()=>{h.current=t},[t]),v.useEffect(()=>{m||b()},[n,m]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{m||typeof c!="number"||x.current!==null||(x.current=setTimeout(()=>{b(),x.current=null},c))},[c,m,b,...i]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:o!=null};function C(){switch(d){case ef.Always:return!1;case ef.BeforeDragging:return n;default:return!n}}}function Ax(t,e){return Pf(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function Rj(t,e){return Ax(t,e)}function Aj(t){let{callback:e,disabled:n}=t;const i=jm(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(i)},[i,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Km(t){let{callback:e,disabled:n}=t;const i=jm(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(i)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function Mj(t){return new Tx(uc(t),t)}function AA(t,e,n){e===void 0&&(e=Mj);const[i,s]=v.useState(null);function o(){s(f=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=f??n)!=null?d:null}const h=e(t);return JSON.stringify(f)===JSON.stringify(h)?f:h})}const l=Aj({callback(f){if(t)for(const d of f){const{type:h,target:m}=d;if(h==="childList"&&m instanceof HTMLElement&&m.contains(t)){o();break}}}}),c=Km({callback:o});return bs(()=>{o(),t?(c?.observe(t),l?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),l?.disconnect())},[t]),i}function Oj(t){const e=Ax(t);return pN(t,e)}const MA=[];function Dj(t){const e=v.useRef(t),n=Pf(i=>t?i&&i!==MA&&t&&e.current&&t.parentNode===e.current.parentNode?i:Ex(t):MA,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function kj(t){const[e,n]=v.useState(null),i=v.useRef(t),s=v.useCallback(o=>{const l=sv(o.target);l&&n(c=>c?(c.set(l,Vb(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=i.current;if(t!==o){l(o);const c=t.map(f=>{const d=sv(f);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Vb(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),i.current=t}return()=>{l(t),l(o)};function l(c){c.forEach(f=>{const d=sv(f);d?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,l)=>Ha(o,l),Ss):xN(t):Ss,[t,e])}function OA(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const i=t!==Ss;i&&!n.current&&(n.current=t),!i&&n.current&&(n.current=null)},[t]),n.current?_p(t,n.current):Ss}function Pj(t){v.useEffect(()=>{if(!Um)return;const e=t.map(n=>{let{sensor:i}=n;return i.setup==null?void 0:i.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function Nj(t,e){return v.useMemo(()=>t.reduce((n,i)=>{let{eventName:s,handler:o}=i;return n[s]=l=>{o(l,e)},n},{}),[t,e])}function RN(t){return v.useMemo(()=>t?sj(t):null,[t])}const DA=[];function Ij(t,e){e===void 0&&(e=uc);const[n]=t,i=RN(n?hi(n):null),[s,o]=v.useState(DA);function l(){o(()=>t.length?t.map(f=>bN(f)?i:new Tx(e(f),f)):DA)}const c=Km({callback:l});return bs(()=>{c?.disconnect(),l(),t.forEach(f=>c?.observe(f))},[t]),s}function AN(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return kf(e)?e:t}function Lj(t){let{measure:e}=t;const[n,i]=v.useState(null),s=v.useCallback(d=>{for(const{target:h}of d)if(kf(h)){i(m=>{const g=e(h);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),o=Km({callback:s}),l=v.useCallback(d=>{const h=AN(d);o?.disconnect(),h&&o?.observe(h),i(h?e(h):null)},[e,o]),[c,f]=Vp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const Bj=[{sensor:TN,options:{}},{sensor:EN,options:{}}],Vj={current:{}},tp={draggable:{measure:wA},droppable:{measure:wA,strategy:ef.WhileDragging,frequency:_b.Optimized},dragOverlay:{measure:uc}};class Iu extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,i;return(n=(i=this.get(e))==null?void 0:i.node.current)!=null?n:void 0}}const zj={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Iu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:tp,measureDroppableContainers:Fp,windowRect:null,measuringScheduled:!1},MN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fp,draggableNodes:new Map,over:null,measureDroppableContainers:Fp},If=v.createContext(MN),ON=v.createContext(zj);function _j(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Iu}}}function Hj(t,e){switch(e.type){case Ln.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Ln.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Ln.DragEnd:case Ln.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ln.RegisterDroppable:{const{element:n}=e,{id:i}=n,s=new Iu(t.droppable.containers);return s.set(i,n),{...t,droppable:{...t.droppable,containers:s}}}case Ln.SetDroppableDisabled:{const{id:n,key:i,disabled:s}=e,o=t.droppable.containers.get(n);if(!o||i!==o.key)return t;const l=new Iu(t.droppable.containers);return l.set(n,{...o,disabled:s}),{...t,droppable:{...t.droppable,containers:l}}}case Ln.UnregisterDroppable:{const{id:n,key:i}=e,s=t.droppable.containers.get(n);if(!s||i!==s.key)return t;const o=new Iu(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function Fj(t){let{disabled:e}=t;const{active:n,activatorEvent:i,draggableNodes:s}=v.useContext(If),o=zp(i),l=zp(n?.id);return v.useEffect(()=>{if(!e&&!i&&o&&l!=null){if(!Wm(o)||document.activeElement===o.target)return;const c=s.get(l);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[f.current,d.current]){if(!h)continue;const m=B6(h);if(m){m.focus();break}}})}},[i,e,s,l,o]),null}function DN(t,e){let{transform:n,...i}=e;return t!=null&&t.length?t.reduce((s,o)=>o({transform:s,...i}),n):n}function Uj(t){return v.useMemo(()=>({draggable:{...tp.draggable,...t?.draggable},droppable:{...tp.droppable,...t?.droppable},dragOverlay:{...tp.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function jj(t){let{activeNode:e,measure:n,initialRect:i,config:s=!0}=t;const o=v.useRef(!1),{x:l,y:c}=typeof s=="boolean"?{x:s,y:s}:s;bs(()=>{if(!l&&!c||!e){o.current=!1;return}if(o.current||!i)return;const d=e?.node.current;if(!d||d.isConnected===!1)return;const h=n(d),m=pN(h,i);if(l||(m.x=0),c||(m.y=0),o.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=gN(d);g&&g.scrollBy({top:m.y,left:m.x})}},[e,l,c,i,n])}const qm=v.createContext({...Ss,scaleX:1,scaleY:1});var oo;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(oo||(oo={}));const zZ=v.memo(function(e){var n,i,s,o;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:h=Bj,collisionDetection:m=Z6,measuring:g,modifiers:b,...x}=e;const w=v.useReducer(Hj,void 0,_j),[C,E]=w,[M,T]=U6(),[D,O]=v.useState(oo.Uninitialized),A=D===oo.Initialized,{draggable:{active:k,nodes:P,translate:B},droppable:{containers:z}}=C,q=k!=null?P.get(k):null,W=v.useRef({initial:null,translated:null}),F=v.useMemo(()=>{var mt;return k!=null?{id:k,data:(mt=q?.data)!=null?mt:Vj,rect:W}:null},[k,q]),_=v.useRef(null),[H,I]=v.useState(null),[L,K]=v.useState(null),Y=Ju(x,Object.values(x)),Z=Nf("DndDescribedBy",l),le=v.useMemo(()=>z.getEnabled(),[z]),V=Uj(g),{droppableRects:U,measureDroppableContainers:$,measuringScheduled:G}=Tj(le,{dragging:A,dependencies:[B.x,B.y],config:V.droppable}),J=Cj(P,k),fe=v.useMemo(()=>L?Hp(L):null,[L]),ie=vt(),de=Rj(J,V.draggable.measure);jj({activeNode:k!=null?P.get(k):null,config:ie.layoutShiftCompensation,initialRect:de,measure:V.draggable.measure});const Se=AA(J,V.draggable.measure,de),Fe=AA(J?J.parentElement:null),pe=v.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=z.getNodeFor((n=pe.current.over)==null?void 0:n.id),De=Lj({measure:V.dragOverlay.measure}),Le=(i=De.nodeRef.current)!=null?i:J,we=A?(s=De.rect)!=null?s:Se:null,Te=!!(De.nodeRef.current&&De.rect),ke=Oj(Te?null:Se),ve=RN(Le?hi(Le):null),Ce=Dj(A?Ee??J:null),re=Ij(Ce),me=DN(b,{transform:{x:B.x-ke.x,y:B.y-ke.y,scaleX:1,scaleY:1},activatorEvent:L,active:F,activeNodeRect:Se,containerNodeRect:Fe,draggingNodeRect:we,over:pe.current.over,overlayNodeRect:De.rect,scrollableAncestors:Ce,scrollableAncestorRects:re,windowRect:ve}),ae=fe?Ha(fe,B):null,oe=kj(Ce),Ie=OA(oe),Xe=OA(oe,[Se]),Ue=Ha(me,Ie),qe=we?tj(we,me):null,ft=F&&qe?m({active:F,collisionRect:qe,droppableRects:U,droppableContainers:le,pointerCoordinates:ae}):null,at=$6(ft,"id"),[ct,Ae]=v.useState(null),je=Te?me:Ha(me,Xe),We=J6(je,(o=ct?.rect)!=null?o:null,Se),xt=v.useRef(null),wt=v.useCallback((mt,it)=>{let{sensor:Pe,options:et}=it;if(_.current==null)return;const ot=P.get(_.current);if(!ot)return;const gt=mt.nativeEvent,_t=new Pe({active:_.current,activeNode:ot,event:gt,options:et,context:pe,onAbort(nt){if(!P.get(nt))return;const{onDragAbort:Ot}=Y.current,Vt={id:nt};Ot?.(Vt),M({type:"onDragAbort",event:Vt})},onPending(nt,Gt,Ot,Vt){if(!P.get(nt))return;const{onDragPending:lt}=Y.current,ln={id:nt,constraint:Gt,initialCoordinates:Ot,offset:Vt};lt?.(ln),M({type:"onDragPending",event:ln})},onStart(nt){const Gt=_.current;if(Gt==null)return;const Ot=P.get(Gt);if(!Ot)return;const{onDragStart:Vt}=Y.current,tt={activatorEvent:gt,active:{id:Gt,data:Ot.data,rect:W}};Fn.unstable_batchedUpdates(()=>{Vt?.(tt),O(oo.Initializing),E({type:Ln.DragStart,initialCoordinates:nt,active:Gt}),M({type:"onDragStart",event:tt}),I(xt.current),K(gt)})},onMove(nt){E({type:Ln.DragMove,coordinates:nt})},onEnd:bt(Ln.DragEnd),onCancel:bt(Ln.DragCancel)});xt.current=_t;function bt(nt){return async function(){const{active:Ot,collisions:Vt,over:tt,scrollAdjustedTranslate:lt}=pe.current;let ln=null;if(Ot&&lt){const{cancelDrop:Pn}=Y.current;ln={activatorEvent:gt,active:Ot,collisions:Vt,delta:lt,over:tt},nt===Ln.DragEnd&&typeof Pn=="function"&&await Promise.resolve(Pn(ln))&&(nt=Ln.DragCancel)}_.current=null,Fn.unstable_batchedUpdates(()=>{E({type:nt}),O(oo.Uninitialized),Ae(null),I(null),K(null),xt.current=null;const Pn=nt===Ln.DragEnd?"onDragEnd":"onDragCancel";if(ln){const an=Y.current[Pn];an?.(ln),M({type:Pn,event:ln})}})}}},[P]),Yt=v.useCallback((mt,it)=>(Pe,et)=>{const ot=Pe.nativeEvent,gt=P.get(et);if(_.current!==null||!gt||ot.dndKit||ot.defaultPrevented)return;const _t={active:gt};mt(Pe,it.options,_t)===!0&&(ot.dndKit={capturedBy:it.sensor},_.current=et,wt(Pe,it))},[P,wt]),Ze=Ej(h,Yt);Pj(h),bs(()=>{Se&&D===oo.Initializing&&O(oo.Initialized)},[Se,D]),v.useEffect(()=>{const{onDragMove:mt}=Y.current,{active:it,activatorEvent:Pe,collisions:et,over:ot}=pe.current;if(!it||!Pe)return;const gt={active:it,activatorEvent:Pe,collisions:et,delta:{x:Ue.x,y:Ue.y},over:ot};Fn.unstable_batchedUpdates(()=>{mt?.(gt),M({type:"onDragMove",event:gt})})},[Ue.x,Ue.y]),v.useEffect(()=>{const{active:mt,activatorEvent:it,collisions:Pe,droppableContainers:et,scrollAdjustedTranslate:ot}=pe.current;if(!mt||_.current==null||!it||!ot)return;const{onDragOver:gt}=Y.current,_t=et.get(at),bt=_t&&_t.rect.current?{id:_t.id,rect:_t.rect.current,data:_t.data,disabled:_t.disabled}:null,nt={active:mt,activatorEvent:it,collisions:Pe,delta:{x:ot.x,y:ot.y},over:bt};Fn.unstable_batchedUpdates(()=>{Ae(bt),gt?.(nt),M({type:"onDragOver",event:nt})})},[at]),bs(()=>{pe.current={activatorEvent:L,active:F,activeNode:J,collisionRect:qe,collisions:ft,droppableRects:U,draggableNodes:P,draggingNode:Le,draggingNodeRect:we,droppableContainers:z,over:ct,scrollableAncestors:Ce,scrollAdjustedTranslate:Ue},W.current={initial:we,translated:qe}},[F,J,ft,qe,P,Le,we,U,z,ct,Ce,Ue]),Sj({...ie,delta:B,draggingRect:qe,pointerCoordinates:ae,scrollableAncestors:Ce,scrollableAncestorRects:re});const Ke=v.useMemo(()=>({active:F,activeNode:J,activeNodeRect:Se,activatorEvent:L,collisions:ft,containerNodeRect:Fe,dragOverlay:De,draggableNodes:P,droppableContainers:z,droppableRects:U,over:ct,measureDroppableContainers:$,scrollableAncestors:Ce,scrollableAncestorRects:re,measuringConfiguration:V,measuringScheduled:G,windowRect:ve}),[F,J,Se,L,ft,Fe,De,P,z,U,ct,$,Ce,re,V,G,ve]),pt=v.useMemo(()=>({activatorEvent:L,activators:Ze,active:F,activeNodeRect:Se,ariaDescribedById:{draggable:Z},dispatch:E,draggableNodes:P,over:ct,measureDroppableContainers:$}),[L,Ze,F,Se,E,Z,P,ct,$]);return ye.createElement(hN.Provider,{value:T},ye.createElement(If.Provider,{value:pt},ye.createElement(ON.Provider,{value:Ke},ye.createElement(qm.Provider,{value:We},d)),ye.createElement(Fj,{disabled:c?.restoreFocus===!1})),ye.createElement(K6,{...c,hiddenTextDescribedById:Z}));function vt(){const mt=H?.autoScrollEnabled===!1,it=typeof f=="object"?f.enabled===!1:f===!1,Pe=A&&!mt&&!it;return typeof f=="object"?{...f,enabled:Pe}:{enabled:Pe}}}),Wj=v.createContext(null),kA="button",Kj="Draggable";function qj(t){let{id:e,data:n,disabled:i=!1,attributes:s}=t;const o=Nf(Kj),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:h,draggableNodes:m,over:g}=v.useContext(If),{role:b=kA,roleDescription:x="draggable",tabIndex:w=0}=s??{},C=f?.id===e,E=v.useContext(C?qm:Wj),[M,T]=Vp(),[D,O]=Vp(),A=Nj(l,e),k=Ju(n);bs(()=>(m.set(e,{id:e,key:o,node:M,activatorNode:D,data:k}),()=>{const B=m.get(e);B&&B.key===o&&m.delete(e)}),[m,e]);const P=v.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":i,"aria-pressed":C&&b===kA?!0:void 0,"aria-roledescription":x,"aria-describedby":h.draggable}),[i,b,w,C,x,h.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:P,isDragging:C,listeners:i?void 0:A,node:M,over:g,setNodeRef:T,setActivatorNodeRef:O,transform:E}}function kN(){return v.useContext(ON)}const Yj="Droppable",Gj={timeout:25};function Xj(t){let{data:e,disabled:n=!1,id:i,resizeObserverConfig:s}=t;const o=Nf(Yj),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(If),h=v.useRef({disabled:n}),m=v.useRef(!1),g=v.useRef(null),b=v.useRef(null),{disabled:x,updateMeasurementsFor:w,timeout:C}={...Gj,...s},E=Ju(w??i),M=v.useCallback(()=>{if(!m.current){m.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),b.current=null},C)},[C]),T=Km({callback:M,disabled:x||!l}),D=v.useCallback((P,B)=>{T&&(B&&(T.unobserve(B),m.current=!1),P&&T.observe(P))},[T]),[O,A]=Vp(D),k=Ju(e);return v.useEffect(()=>{!T||!O.current||(T.disconnect(),m.current=!1,T.observe(O.current))},[O,T]),v.useEffect(()=>(c({type:Ln.RegisterDroppable,element:{id:i,key:o,disabled:n,node:O,rect:g,data:k}}),()=>c({type:Ln.UnregisterDroppable,key:o,id:i})),[i]),v.useEffect(()=>{n!==h.current.disabled&&(c({type:Ln.SetDroppableDisabled,id:i,key:o,disabled:n}),h.current.disabled=n)},[i,o,n,c]),{active:l,rect:g,isOver:f?.id===i,node:O,over:f,setNodeRef:A}}function $j(t){let{animation:e,children:n}=t;const[i,s]=v.useState(null),[o,l]=v.useState(null),c=zp(n);return!n&&!i&&c&&s(c),bs(()=>{if(!o)return;const f=i?.key,d=i?.props.id;if(f==null||d==null){s(null);return}Promise.resolve(e(d,o)).then(()=>{s(null)})},[e,i,o]),ye.createElement(ye.Fragment,null,n,i?v.cloneElement(i,{ref:l}):null)}const Qj={x:0,y:0,scaleX:1,scaleY:1};function Zj(t){let{children:e}=t;return ye.createElement(If.Provider,{value:MN},ye.createElement(qm.Provider,{value:Qj},e))}const Jj={position:"fixed",touchAction:"none"},e9=t=>Wm(t)?"transform 250ms ease":void 0,t9=v.forwardRef((t,e)=>{let{as:n,activatorEvent:i,adjustScale:s,children:o,className:l,rect:c,style:f,transform:d,transition:h=e9}=t;if(!c)return null;const m=s?d:{...d,scaleX:1,scaleY:1},g={...Jj,width:c.width,height:c.height,top:c.top,left:c.left,transform:Tl.Transform.toString(m),transformOrigin:s&&i?Y6(i,c):void 0,transition:typeof h=="function"?h(i):h,...f};return ye.createElement(n,{className:l,style:g,ref:e},o)}),n9=t=>e=>{let{active:n,dragOverlay:i}=e;const s={},{styles:o,className:l}=t;if(o!=null&&o.active)for(const[c,f]of Object.entries(o.active))f!==void 0&&(s[c]=n.node.style.getPropertyValue(c),n.node.style.setProperty(c,f));if(o!=null&&o.dragOverlay)for(const[c,f]of Object.entries(o.dragOverlay))f!==void 0&&i.node.style.setProperty(c,f);return l!=null&&l.active&&n.node.classList.add(l.active),l!=null&&l.dragOverlay&&i.node.classList.add(l.dragOverlay),function(){for(const[f,d]of Object.entries(s))n.node.style.setProperty(f,d);l!=null&&l.active&&n.node.classList.remove(l.active)}},i9=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Tl.Transform.toString(e)},{transform:Tl.Transform.toString(n)}]},s9={duration:250,easing:"ease",keyframes:i9,sideEffects:n9({styles:{active:{opacity:"0"}}})};function r9(t){let{config:e,draggableNodes:n,droppableContainers:i,measuringConfiguration:s}=t;return jm((o,l)=>{if(e===null)return;const c=n.get(o);if(!c)return;const f=c.node.current;if(!f)return;const d=AN(l);if(!d)return;const{transform:h}=hi(l).getComputedStyle(l),m=mN(h);if(!m)return;const g=typeof e=="function"?e:o9(e);return wN(f,s.draggable.measure),g({active:{id:o,data:c.data,node:f,rect:s.draggable.measure(f)},draggableNodes:n,dragOverlay:{node:l,rect:s.dragOverlay.measure(d)},droppableContainers:i,measuringConfiguration:s,transform:m})})}function o9(t){const{duration:e,easing:n,sideEffects:i,keyframes:s}={...s9,...t};return o=>{let{active:l,dragOverlay:c,transform:f,...d}=o;if(!e)return;const h={x:c.rect.left-l.rect.left,y:c.rect.top-l.rect.top},m={scaleX:f.scaleX!==1?l.rect.width*f.scaleX/c.rect.width:1,scaleY:f.scaleY!==1?l.rect.height*f.scaleY/c.rect.height:1},g={x:f.x-h.x,y:f.y-h.y,...m},b=s({...d,active:l,dragOverlay:c,transform:{initial:f,final:g}}),[x]=b,w=b[b.length-1];if(JSON.stringify(x)===JSON.stringify(w))return;const C=i?.({active:l,dragOverlay:c,...d}),E=c.node.animate(b,{duration:e,easing:n,fill:"forwards"});return new Promise(M=>{E.onfinish=()=>{C?.(),M()}})}}let PA=0;function l9(t){return v.useMemo(()=>{if(t!=null)return PA++,PA},[t])}const _Z=ye.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:i,style:s,transition:o,modifiers:l,wrapperElement:c="div",className:f,zIndex:d=999}=t;const{activatorEvent:h,active:m,activeNodeRect:g,containerNodeRect:b,draggableNodes:x,droppableContainers:w,dragOverlay:C,over:E,measuringConfiguration:M,scrollableAncestors:T,scrollableAncestorRects:D,windowRect:O}=kN(),A=v.useContext(qm),k=l9(m?.id),P=DN(l,{activatorEvent:h,active:m,activeNodeRect:g,containerNodeRect:b,draggingNodeRect:C.rect,over:E,overlayNodeRect:C.rect,scrollableAncestors:T,scrollableAncestorRects:D,transform:A,windowRect:O}),B=Ax(g),z=r9({config:i,draggableNodes:x,droppableContainers:w,measuringConfiguration:M}),q=B?C.setRef:void 0;return ye.createElement(Zj,null,ye.createElement($j,{animation:z},m&&k?ye.createElement(t9,{key:k,id:m.id,ref:q,as:c,activatorEvent:h,adjustScale:e,className:f,transition:o,rect:B,style:{zIndex:d,...s},transform:P},n):null))});function PN(t,e,n){const i=t.slice();return i.splice(n<0?i.length+n:n,0,i.splice(e,1)[0]),i}function a9(t,e){return t.reduce((n,i,s)=>{const o=e.get(i);return o&&(n[s]=o),n},Array(t.length))}function Mh(t){return t!==null&&t>=0}function c9(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function u9(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Oh={scaleX:1,scaleY:1},HZ=t=>{var e;let{rects:n,activeNodeRect:i,activeIndex:s,overIndex:o,index:l}=t;const c=(e=n[s])!=null?e:i;if(!c)return null;const f=f9(n,l,s);if(l===s){const d=n[o];return d?{x:s<o?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...Oh}:null}return l>s&&l<=o?{x:-c.width-f,y:0,...Oh}:l<s&&l>=o?{x:c.width+f,y:0,...Oh}:{x:0,y:0,...Oh}};function f9(t,e,n){const i=t[e],s=t[e-1],o=t[e+1];return!i||!s&&!o?0:n<e?s?i.left-(s.left+s.width):o.left-(i.left+i.width):o?o.left-(i.left+i.width):i.left-(s.left+s.width)}const NN=t=>{let{rects:e,activeIndex:n,overIndex:i,index:s}=t;const o=PN(e,i,n),l=e[s],c=o[s];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Dh={scaleX:1,scaleY:1},FZ=t=>{var e;let{activeIndex:n,activeNodeRect:i,index:s,rects:o,overIndex:l}=t;const c=(e=o[n])!=null?e:i;if(!c)return null;if(s===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...Dh}:null}const f=d9(o,s,n);return s>n&&s<=l?{x:0,y:-c.height-f,...Dh}:s<n&&s>=l?{x:0,y:c.height+f,...Dh}:{x:0,y:0,...Dh}};function d9(t,e,n){const i=t[e],s=t[e-1],o=t[e+1];return i?n<e?s?i.top-(s.top+s.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):s?i.top-(s.top+s.height):0:0}const IN="Sortable",LN=ye.createContext({activeIndex:-1,containerId:IN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:NN,disabled:{draggable:!1,droppable:!1}});function UZ(t){let{children:e,id:n,items:i,strategy:s=NN,disabled:o=!1}=t;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:h}=kN(),m=Nf(IN,n),g=c.rect!==null,b=v.useMemo(()=>i.map(A=>typeof A=="object"&&"id"in A?A.id:A),[i]),x=l!=null,w=l?b.indexOf(l.id):-1,C=d?b.indexOf(d.id):-1,E=v.useRef(b),M=!c9(b,E.current),T=C!==-1&&w===-1||M,D=u9(o);bs(()=>{M&&x&&h(b)},[M,b,x,h]),v.useEffect(()=>{E.current=b},[b]);const O=v.useMemo(()=>({activeIndex:w,containerId:m,disabled:D,disableTransforms:T,items:b,overIndex:C,useDragOverlay:g,sortedRects:a9(b,f),strategy:s}),[w,m,D.draggable,D.droppable,T,b,C,f,g,s]);return ye.createElement(LN.Provider,{value:O},e)}const h9=t=>{let{id:e,items:n,activeIndex:i,overIndex:s}=t;return PN(n,i,s).indexOf(e)},p9=t=>{let{containerId:e,isSorting:n,wasDragging:i,index:s,items:o,newIndex:l,previousItems:c,previousContainerId:f,transition:d}=t;return!d||!i||c!==o&&s===l?!1:n?!0:l!==s&&e===f},m9={duration:200,easing:"ease"},BN="transform",g9=Tl.Transition.toString({property:BN,duration:0,easing:"linear"}),y9={roleDescription:"sortable"};function v9(t){let{disabled:e,index:n,node:i,rect:s}=t;const[o,l]=v.useState(null),c=v.useRef(n);return bs(()=>{if(!e&&n!==c.current&&i.current){const f=s.current;if(f){const d=uc(i.current,{ignoreTransform:!0}),h={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(h.x||h.y)&&l(h)}}n!==c.current&&(c.current=n)},[e,n,i,s]),v.useEffect(()=>{o&&l(null)},[o]),o}function jZ(t){let{animateLayoutChanges:e=p9,attributes:n,disabled:i,data:s,getNewIndex:o=h9,id:l,strategy:c,resizeObserverConfig:f,transition:d=m9}=t;const{items:h,containerId:m,activeIndex:g,disabled:b,disableTransforms:x,sortedRects:w,overIndex:C,useDragOverlay:E,strategy:M}=v.useContext(LN),T=b9(i,b),D=h.indexOf(l),O=v.useMemo(()=>({sortable:{containerId:m,index:D,items:h},...s}),[m,s,D,h]),A=v.useMemo(()=>h.slice(h.indexOf(l)),[h,l]),{rect:k,node:P,isOver:B,setNodeRef:z}=Xj({id:l,data:O,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:q,activatorEvent:W,activeNodeRect:F,attributes:_,setNodeRef:H,listeners:I,isDragging:L,over:K,setActivatorNodeRef:Y,transform:Z}=qj({id:l,data:O,attributes:{...y9,...n},disabled:T.draggable}),le=P6(z,H),V=!!q,U=V&&!x&&Mh(g)&&Mh(C),$=!E&&L,G=$&&U?Z:null,fe=U?G??(c??M)({rects:w,activeNodeRect:F,activeIndex:g,overIndex:C,index:D}):null,ie=Mh(g)&&Mh(C)?o({id:l,items:h,activeIndex:g,overIndex:C}):D,de=q?.id,Se=v.useRef({activeId:de,items:h,newIndex:ie,containerId:m}),Fe=h!==Se.current.items,pe=e({active:q,containerId:m,isDragging:L,isSorting:V,id:l,index:D,items:h,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),Ee=v9({disabled:!pe,index:D,node:P,rect:k});return v.useEffect(()=>{V&&Se.current.newIndex!==ie&&(Se.current.newIndex=ie),m!==Se.current.containerId&&(Se.current.containerId=m),h!==Se.current.items&&(Se.current.items=h)},[V,ie,m,h]),v.useEffect(()=>{if(de===Se.current.activeId)return;if(de!=null&&Se.current.activeId==null){Se.current.activeId=de;return}const Le=setTimeout(()=>{Se.current.activeId=de},50);return()=>clearTimeout(Le)},[de]),{active:q,activeIndex:g,attributes:_,data:O,rect:k,index:D,newIndex:ie,items:h,isOver:B,isSorting:V,isDragging:L,listeners:I,node:P,overIndex:C,over:K,setNodeRef:le,setActivatorNodeRef:Y,setDroppableNodeRef:z,setDraggableNodeRef:H,transform:Ee??fe,transition:De()};function De(){if(Ee||Fe&&Se.current.newIndex===D)return g9;if(!($&&!Wm(W)||!d)&&(V||pe))return Tl.Transition.toString({...d,property:BN})}}function b9(t,e){var n,i;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(i=t?.droppable)!=null?i:e.droppable}}Bt.Down,Bt.Right,Bt.Up,Bt.Left;const VN=v.createContext(void 0);function Ym(t){const e=v.useContext(VN);if(e===void 0&&!t)throw new Error(zt(33));return e}const Mx=v.createContext(void 0);function xs(t){const e=v.useContext(Mx);if(e===void 0&&!t)throw new Error(zt(36));return e}const zN=v.createContext(void 0);function Lf(t=!0){const e=v.useContext(zN);if(e===void 0&&!t)throw new Error(zt(25));return e}function S9(t){const{closeOnClick:e,highlighted:n,id:i,nodeId:s,store:o,typingRef:l,itemRef:c,itemMetadata:f}=t,{events:d}=o.useState("floatingTreeRoot"),h=Lf(!0),m=h!==void 0;return v.useMemo(()=>({id:i,role:"menuitem",tabIndex:n?0:-1,onKeyDown(g){g.key===" "&&l?.current&&g.preventDefault()},onMouseMove(g){s&&d.emit("itemhover",{nodeId:s,target:g.currentTarget})},onClick(g){e&&d.emit("close",{domEvent:g,reason:Pa})},onMouseUp(g){if(h){const b=h.initialCursorPointRef.current;if(h.initialCursorPointRef.current=null,m&&b&&Math.abs(g.clientX-b.x)<=1&&Math.abs(g.clientY-b.y)<=1||m&&!aD&&g.button===2)return}c.current&&o.context.allowMouseUpTriggerRef.current&&(!m||g.button===2)&&(!f||f.type==="regular-item")&&c.current.click()}}),[e,n,i,d,s,o,l,c,h,m,f])}const _N={type:"regular-item"};function Ox(t){const{closeOnClick:e,disabled:n=!1,highlighted:i,id:s,store:o,typingRef:l=o.context.typingRef,nativeButton:c,itemMetadata:f,nodeId:d}=t,h=v.useRef(null),{getButtonProps:m,buttonRef:g}=ko({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),b=S9({closeOnClick:e,highlighted:i,id:s,nodeId:d,store:o,typingRef:l,itemRef:h,itemMetadata:f}),x=v.useCallback(C=>Mr(b,{onMouseEnter(){f.type==="submenu-trigger"&&f.setActive()}},C,m),[b,m,f]),w=Ar(h,g);return v.useMemo(()=>({getItemProps:x,itemRef:w}),[x,w])}let NA=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.highlighted="data-highlighted",t})({});const HN={checked(t){return t?{[NA.checked]:""}:{[NA.unchecked]:""}},...Pr},WZ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,style:h,...m}=e,g=Df({label:l}),b=Ym(!0),x=Ti(o),{store:w}=xs(),C=w.useState("isActive",g.index),E=w.useState("itemProps"),{getItemProps:M,itemRef:T}=Ox({closeOnClick:d,disabled:f,highlighted:C,id:x,store:w,nativeButton:c,nodeId:b?.context.nodeId,itemMetadata:_N});return Dt("div",e,{state:{disabled:f,highlighted:C},props:[E,m,M],ref:[T,n,g.ref]})}),x9={...Oo,...Pr},KZ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,finalFocus:l,...c}=e,{store:f}=xs(),{side:d,align:h}=Ym(),m=Sx()!=null,g=f.useState("open"),b=f.useState("transitionStatus"),x=f.useState("popupProps"),w=f.useState("mounted"),C=f.useState("instantType"),E=f.useState("activeTriggerElement"),M=f.useState("parent"),T=f.useState("lastOpenChangeReason"),D=f.useState("rootId"),O=f.useState("floatingRootContext"),A=f.useState("floatingTreeRoot"),k=f.useState("closeDelay"),P=f.useState("activeTriggerElement"),B=M.type==="context-menu";er({open:g,ref:f.context.popupRef,onComplete(){g&&f.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function I(L){f.setOpen(!1,Qe(L.reason,L.domEvent))}return A.events.on("close",I),()=>{A.events.off("close",I)}},[A.events,f]);const z=f.useState("hoverEnabled"),q=f.useState("disabled");XS(O,{enabled:z&&!q&&!B&&M.type!=="menubar",closeDelay:k});const W={transitionStatus:b,side:d,align:h,open:g,nested:M.type==="menu",instant:C},F=v.useCallback(I=>{f.set("popupElement",I)},[f]),_=Dt("div",e,{state:W,ref:[n,f.context.popupRef,F],stateAttributesMapping:x9,props:[x,{onKeyDown(I){m&&Rm.has(I.key)&&I.stopPropagation()}},Tf(b),c,{"data-rootownerid":D}]});let H=M.type===void 0||B;return(E||M.type==="menubar"&&T!==am)&&(H=!0),ue.jsx(mm,{context:O,modal:B,disabled:!w,returnFocus:l===void 0?H:l,initialFocus:M.type!=="menu",restoreFocus:!0,externalTree:M.type!=="menubar"?A:void 0,previousFocusableElement:P,nextFocusableElement:M.type===void 0?f.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:M.type===void 0?f.context.beforeContentFocusGuardRef:void 0,children:_})}),FN=v.createContext(void 0);function w9(){const t=v.useContext(FN);if(t===void 0)throw new Error(zt(32));return t}const qZ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=xs();return o.useState("mounted")||i?ue.jsx(FN.Provider,{value:i,children:ue.jsx(pm,{ref:n,...s})}):null}),YZ=v.forwardRef(function(e,n){const{anchor:i,positionMethod:s="absolute",className:o,render:l,side:c,align:f,sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=nD,style:E,...M}=e,{store:T}=xs(),D=w9(),O=Lf(!0),A=T.useState("parent"),k=T.useState("floatingRootContext"),P=T.useState("floatingTreeRoot"),B=T.useState("mounted"),z=T.useState("open"),q=T.useState("modal"),W=T.useState("openMethod"),F=T.useState("activeTriggerElement"),_=T.useState("transitionStatus"),H=T.useState("positionerElement"),I=T.useState("instantType"),L=T.useState("hasViewport"),K=T.useState("lastOpenChangeReason"),Y=T.useState("floatingNodeId"),Z=T.useState("floatingParentNodeId"),le=k.useState("domReferenceElement"),V=v.useRef(null),U=YS(H,!1,!1);let $=i,G=d,J=h,fe=f,ie=C;A.type==="context-menu"&&($=i??A.context?.anchor,fe=fe??"start",!c&&fe!=="center"&&(J=e.alignOffset??2,G=e.sideOffset??-5));let de=c,Se=fe;A.type==="menu"?(de=de??"inline-end",Se=Se??"start",ie=e.collisionAvoidance??MS):A.type==="menubar"&&(de=de??"bottom",Se=Se??"start");const Fe=A.type==="context-menu",pe=Dm({anchor:$,floatingRootContext:k,positionMethod:O?"fixed":s,mounted:B,side:de,sideOffset:G,align:Se,alignOffset:J,arrowPadding:Fe?0:b,collisionBoundary:m,collisionPadding:g,sticky:x,nodeId:Y,keepMounted:D,disableAnchorTracking:w,collisionAvoidance:ie,shiftCrossAxis:Fe&&!("side"in ie&&ie.side==="flip"),externalTree:P,adaptiveOrigin:L?tx:void 0});v.useEffect(()=>{function Ce(re){re.open&&(re.parentNodeId===Y&&T.set("hoverEnabled",!1),re.nodeId!==Y&&re.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,Qe(yu)))}return P.events.on("menuopenchange",Ce),()=>{P.events.off("menuopenchange",Ce)}},[T,P.events,Y]),v.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ce(re){if(re.open||re.nodeId!==T.select("floatingParentNodeId"))return;const me=re.reason??yu;T.setOpen(!1,Qe(me))}return P.events.on("menuopenchange",Ce),()=>{P.events.off("menuopenchange",Ce)}},[P.events,T]);const Ee=On();v.useEffect(()=>{z||Ee.clear()},[z,Ee]),v.useEffect(()=>{function Ce(re){if(!(!z||re.nodeId!==T.select("floatingParentNodeId")))if(re.target&&F&&F!==re.target){const me=T.select("closeDelay");me>0?Ee.isStarted()||Ee.start(me,()=>{T.setOpen(!1,Qe(yu))}):T.setOpen(!1,Qe(yu))}else Ee.clear()}return P.events.on("itemhover",Ce),()=>{P.events.off("itemhover",Ce)}},[P.events,z,F,T,Ee]),v.useEffect(()=>{const Ce={open:z,nodeId:Y,parentNodeId:Z,reason:T.select("lastOpenChangeReason")};P.events.emit("menuopenchange",Ce)},[P.events,z,T,Y,Z]),Oe(()=>{const Ce=le,re=V.current;if(Ce&&(V.current=Ce),re&&Ce&&Ce!==re){T.set("instantType",void 0);const me=new AbortController;return U(()=>{T.set("instantType","trigger-change")},me.signal),()=>{me.abort()}}},[le,U,T]);const De={open:z,side:pe.side,align:pe.align,anchorHidden:pe.anchorHidden,nested:A.type==="menu",instant:I},Le=A.type==="menubar"&&A.context.modal;bx(z&&(Le||q&&K!==An),W==="touch",H,F);const Te=km(e,De,{styles:pe.positionerStyles,transitionStatus:_,props:M,refs:[n,T.useStateSetter("positionerElement")],hidden:!B,inert:!z}),ke=B&&A.type!=="menu"&&(A.type!=="menubar"&&q&&K!==An||A.type==="menubar"&&A.context.modal);let ve=null;return A.type==="menubar"?ve=A.context.contentElement:A.type===void 0&&(ve=F),ue.jsxs(VN.Provider,{value:pe,children:[ke&&ue.jsx(Mm,{ref:A.type==="context-menu"||A.type==="nested-context-menu"?A.context.internalBackdropRef:null,inert:Am(!z),cutout:ve}),ue.jsx(_D,{id:Y,children:ue.jsx(oN,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:Te})})]})}),UN=v.createContext(void 0);function C9(){const t=v.useContext(UN);if(t===void 0)throw new Error(zt(34));return t}const GZ=v.memo(v.forwardRef(function(e,n){const{render:i,className:s,value:o,defaultValue:l,onValueChange:c,disabled:f=!1,style:d,...h}=e,[m,g]=Ep({controlled:o,default:l,name:"MenuRadioGroup"}),b=Ve(c),x=Ve((M,T)=>{b?.(M,T),!T.isCanceled&&g(M)}),C=Dt("div",e,{state:{disabled:f},ref:n,props:{role:"group","aria-disabled":f||void 0,...h}}),E=v.useMemo(()=>({value:m,setValue:x,disabled:f}),[m,x,f]);return ue.jsx(UN.Provider,{value:E,children:C})})),jN=v.createContext(void 0);function E9(){const t=v.useContext(jN);if(t===void 0)throw new Error(zt(35));return t}const XZ=v.forwardRef(function(e,n){const{render:i,className:s,id:o,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!1,value:h,style:m,...g}=e,b=Df({label:l}),x=Ym(!0),w=Ti(o),{store:C}=xs(),E=C.useState("isActive",b.index),M=C.useState("itemProps"),{value:T,setValue:D,disabled:O}=C9(),A=O||f,k=T===h,{getItemProps:P,itemRef:B}=Ox({closeOnClick:d,disabled:A,highlighted:E,id:w,store:C,nativeButton:c,nodeId:x?.context.nodeId,itemMetadata:_N}),z=v.useMemo(()=>({disabled:A,highlighted:E,checked:k}),[A,E,k]),q=Ve(F=>{const _={...Qe(Pa,F.nativeEvent),preventUnmountOnClose:()=>{}};D(h,_)}),W=Dt("div",e,{state:z,stateAttributesMapping:HN,props:[M,{role:"menuitemradio","aria-checked":k,onClick:q},g,P],ref:[B,n,b.ref]});return ue.jsx(jN.Provider,{value:z,children:W})}),$Z=v.forwardRef(function(e,n){const{render:i,className:s,style:o,keepMounted:l=!1,...c}=e,f=E9(),d=v.useRef(null),{transitionStatus:h,setMounted:m}=wf(f.checked);er({open:f.checked,ref:d,onComplete(){f.checked||m(!1)}});const g={checked:f.checked,disabled:f.disabled,highlighted:f.highlighted,transitionStatus:h};return Dt("span",e,{state:g,stateAttributesMapping:HN,ref:[n,d],props:{"aria-hidden":!0,...c},enabled:l||f.checked})}),T9=v.createContext(null);function WN(t){return v.useContext(T9)}const R9={...xm,disabled:be(t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled),modal:be(t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0)),openMethod:be(t=>t.openMethod),allowMouseEnter:be(t=>t.allowMouseEnter),stickIfOpen:be(t=>t.stickIfOpen),parent:be(t=>t.parent),rootId:be(t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId),activeIndex:be(t=>t.activeIndex),isActive:be((t,e)=>t.activeIndex===e),hoverEnabled:be(t=>t.hoverEnabled),instantType:be(t=>t.instantType),lastOpenChangeReason:be(t=>t.openChangeReason),floatingTreeRoot:be(t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot),floatingNodeId:be(t=>t.floatingNodeId),floatingParentNodeId:be(t=>t.floatingParentNodeId),itemProps:be(t=>t.itemProps),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport),keyboardEventRelay:be(t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")})};class Dx extends xf{constructor(e){super({...A9(),...e},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new lc},R9),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let i=n.store.select("rootId"),s=n.store.select("floatingTreeRoot"),o=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),c=n.store.select("floatingTreeRoot"),f=n.store.select("keyboardEventRelay");i===l&&s===c&&o===f||(i=l,s=c,o=f,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}static useStore(e,n){const i=kn(()=>new Dx(n)).current;return e??i}unsubscribeParentListener=null}function A9(){return{...Sm(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new FS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Sn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const KN=v.createContext(void 0);function qN(){return v.useContext(KN)}const YN=KS(function(e){const{children:n,open:i,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:h="vertical",actionsRef:m,closeParentOnEsc:g=!1,handle:b,triggerId:x,defaultTriggerId:w=null,highlightItemOnHover:C=!0}=e,E=Lf(!0),M=xs(!0),T=WN(!0),D=qN(),O=v.useMemo(()=>D&&M?{type:"menu",store:M.store}:T?{type:"menubar",context:T}:E&&!M?{type:"context-menu",context:E}:{type:void 0},[E,M,T,D]),A=Dx.useStore(b?.store,{open:l,openProp:i,activeTriggerId:w,triggerIdProp:x,parent:O});Cf(()=>{i===void 0&&A.state.open===!1&&l===!0&&A.update({open:!0,activeTriggerId:w})}),A.useControlledProp("openProp",i),A.useControlledProp("triggerIdProp",x),A.useContextCallback("onOpenChangeComplete",o);const k=A.useState("floatingTreeRoot"),P=US(k),B=Js();Oe(()=>{E&&!M?A.update({parent:{type:"context-menu",context:E},floatingNodeId:P,floatingParentNodeId:B}):M&&A.update({floatingNodeId:P,floatingParentNodeId:B})},[E,M,P,B,A]);const z=A.useState("open"),q=A.useState("activeTriggerElement"),W=A.useState("positionerElement"),F=A.useState("hoverEnabled"),_=A.useState("disabled"),H=A.useState("lastOpenChangeReason"),I=A.useState("parent"),L=A.useState("activeIndex"),K=A.useState("payload"),Y=A.useState("floatingParentNodeId"),Z=v.useRef(null),le=Y!=null,{openMethod:V,triggerProps:U}=Om(z);A.useSyncedValues({disabled:c,modal:I.type===void 0?f:void 0,openMethod:V,rootId:Po()}),vm(A);const{forceUnmount:$}=bm(z,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0})}),G=v.useRef(I.type!=="context-menu"),J=On();v.useEffect(()=>{if(z||(Z.current=null),I.type==="context-menu"){if(!z){J.clear(),G.current=!1;return}J.start(500,()=>{G.current=!0})}},[J,z,I.type]),Oe(()=>{!z&&!F&&A.set("hoverEnabled",!0)},[z,F,A]);const fe=v.useRef(!0),ie=On(),de=Ve((Ae,je)=>{const We=je.reason;if(z===Ae&&je.trigger===q&&H===We||(je.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!Ae&&je.trigger==null&&(je.trigger=q??void 0),s?.(Ae,je),je.isCanceled))return;A.state.floatingRootContext.dispatchOpenChange(Ae,je);const xt=je.event;if(Ae===!1&&xt?.type==="click"&&xt.pointerType==="touch"&&!fe.current)return;if(!Ae&&L!==null){const pt=A.context.itemDomElements.current[L];queueMicrotask(()=>{pt?.setAttribute("tabindex","-1")})}Ae&&We===ka?(fe.current=!1,ie.start(300,()=>{fe.current=!0})):(fe.current=!0,ie.clear());const wt=(We===$s||We===Pa)&&xt.detail===0&&xt?.isTrusted,Yt=!Ae&&(We===gf||We==null),Ze={open:Ae,openChangeReason:We};Z.current=je.event??null;const Ke=je.trigger?.id??null;(Ke||Ae)&&(Ze.activeTriggerId=Ke,Ze.activeTriggerElement=je.trigger??null),A.update(Ze),I.type==="menubar"&&(We===ka||We===vo||We===An||We===qh||We===yu)?A.set("instantType","group"):wt||Yt?A.set("instantType",wt?"click":"dismiss"):A.set("instantType",void 0)}),Se=v.useCallback(Ae=>{const je=Qe(Ae);return je.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},je},[A]),Fe=v.useCallback(()=>{A.setOpen(!1,Se(cm))},[A,Se]);v.useImperativeHandle(m,()=>({unmount:$,close:Fe}),[$,Fe]);let pe;I.type==="context-menu"&&(pe=I.context),v.useImperativeHandle(pe?.positionerRef,()=>W,[W]),v.useImperativeHandle(pe?.actionsRef,()=>({setOpen:de}),[de]);const Ee=wm({popupStore:A,onOpenChange:de}),De=Ee.context.events;v.useEffect(()=>{const Ae=({open:je,eventDetails:We})=>de(je,We);return De.on("setOpen",Ae),()=>{De?.off("setOpen",Ae)}},[De,de]);const Le=Sf(Ee,{enabled:!_,bubbles:{escapeKey:g&&I.type==="menu"},outsidePress(){return I.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:G.current},externalTree:le?k:void 0}),we=$S(Ee,{role:"menu"}),Te=ex(),ke=v.useCallback(Ae=>{A.select("activeIndex")!==Ae&&A.set("activeIndex",Ae)},[A]),ve=rk(Ee,{enabled:!_,listRef:A.context.itemDomElements,activeIndex:L,nested:I.type!==void 0,loopFocus:d,orientation:h,parentOrientation:I.type==="menubar"?I.context.orientation:void 0,rtl:Te==="rtl",disabledIndices:_u,onNavigate:ke,openOnArrowKeyDown:I.type!=="context-menu",externalTree:le?k:void 0,focusItemOnHover:C}),Ce=v.useCallback(Ae=>{A.context.typingRef.current=Ae},[A]),re=ok(Ee,{listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:L,resetMs:R4,onMatch:Ae=>{z&&Ae!==L&&A.set("activeIndex",Ae)},onTypingChange:Ce}),{getReferenceProps:me,getFloatingProps:ae,getItemProps:oe,getTriggerProps:Ie}=Nr([Le,we,ve,re]),Xe=v.useMemo(()=>{const Ae=Mr(me(),{onMouseMove(){A.set("allowMouseEnter",!0)}},U);return delete Ae.role,Ae},[me,A,U]),Ue=v.useMemo(()=>{const Ae=Ie();if(!Ae)return Ae;const je=Mr(Ae,U);return delete je.role,delete je["aria-controls"],je},[Ie,U]),qe=v.useMemo(()=>ae({onMouseMove(){A.set("allowMouseEnter",!0),I.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(Ae){const je=A.select("keyboardEventRelay");je&&!Ae.isPropagationStopped()&&je(Ae)}}),[ae,I.type,A]),ft=v.useMemo(()=>oe(),[oe]);A.useSyncedValues({floatingRootContext:Ee,activeTriggerProps:Xe,inactiveTriggerProps:Ue,popupProps:qe,itemProps:ft});const at=v.useMemo(()=>({store:A,parent:O}),[A,O]),ct=ue.jsx(Mx.Provider,{value:at,children:typeof n=="function"?n({payload:K}):n});return I.type===void 0||I.type==="context-menu"?ue.jsx(HD,{externalTree:k,children:ct}):ct});function QZ(t){const e=xs().store,n=v.useMemo(()=>({parentMenu:e}),[e]);return ue.jsx(KN.Provider,{value:n,children:ue.jsx(YN,{...t})})}function M9(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:i}=kS(),{ref:s,index:o}=Df(t),l=n===o,c=v.useRef(null),f=Ar(s,c);return{compositeProps:v.useMemo(()=>({tabIndex:l?0:-1,onFocus(){i(o)},onMouseMove(){const h=c.current;if(!e||!h)return;const m=h.hasAttribute("disabled")||h.ariaDisabled==="true";!l&&!m&&h.focus()}}),[l,i,o,e]),compositeRef:f,index:o}}function O9(t){const{render:e,className:n,style:i,state:s=Sn,props:o=_u,refs:l=_u,metadata:c,stateAttributesMapping:f,tag:d="div",...h}=t,{compositeProps:m,compositeRef:g}=M9({metadata:c});return Dt(d,t,{state:s,ref:[...l,g],props:[m,...o,h],stateAttributesMapping:f})}function kx(t){if(Zt(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid")??void 0;if(!js(t))return kx(Xs(t))}function GN(t,e){const n=v.useRef(null),i=Ve(o=>{Fn.flushSync(()=>{t.setOpen(!1,Qe(vo,o.nativeEvent,o.currentTarget))}),L5(n.current)?.focus()}),s=Ve(o=>{const l=t.select("positionerElement");if(l&&Ia(o,l))t.context.beforeContentFocusGuardRef.current?.focus();else{Fn.flushSync(()=>{t.setOpen(!1,Qe(vo,o.nativeEvent,o.currentTarget))});let c=I5(t.context.triggerFocusTargetRef.current||e.current);for(;c!==null&&Ge(l,c);){const f=c;if(c=HS(c),c===f)break}c?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:s}}function D9(t){const{enabled:e=!0,mouseDownAction:n,open:i}=t,s=v.useRef(!1);return v.useMemo(()=>e?{onMouseDown:o=>{(n==="open"&&!i||n==="close"&&i)&&(s.current=!0,yt(o.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:o=>{s.current&&(s.current=!1,o.preventBaseUIHandler())}}:Sn,[e,n,i])}const kh=2,ZZ=ZD(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:h=0,handle:m,payload:g,style:b,...x}=e,w=xs(!0),C=m?.store??w?.store;if(!C)throw new Error(zt(85));const E=Ti(c),M=C.useState("isTriggerActive",E),T=C.useState("floatingRootContext"),D=C.useState("isOpenedByTrigger",E),O=v.useRef(null),A=P9(),k=kS(!0),P=Io(),B=v.useMemo(()=>P??new FS,[P]),z=US(B),q=Js(),{registerTrigger:W,isMountedByThisTrigger:F}=ym(E,O,C,{payload:g,closeDelay:h,parent:A,floatingTreeRoot:B,floatingNodeId:z,floatingParentNodeId:q,keyboardEventRelay:k?.relayKeyboardEvent}),_=A.type==="menubar",H=C.useState("disabled"),I=o||H||_&&A.context.disabled,{getButtonProps:L,buttonRef:K}=ko({disabled:I,native:l});v.useEffect(()=>{!D&&A.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,D,A.type]);const Y=v.useRef(null),Z=On(),le=Ve(ke=>{if(!Y.current)return;Z.clear(),C.context.allowMouseUpTriggerRef.current=!1;const ve=ke.target;if(Ge(Y.current,ve)||Ge(C.select("positionerElement"),ve)||ve===Y.current||ve!=null&&kx(ve)===C.select("rootId"))return;const Ce=sN(Y.current);ke.clientX>=Ce.left-kh&&ke.clientX<=Ce.right+kh&&ke.clientY>=Ce.top-kh&&ke.clientY<=Ce.bottom+kh||B.events.emit("close",{domEvent:ke,reason:PS})});v.useEffect(()=>{D&&C.select("lastOpenChangeReason")===An&&yt(Y.current).addEventListener("mouseup",le,{once:!0})},[D,le,C]);const V=_&&A.context.hasSubmenuOpen,$=Cm(T,{enabled:(f??V)&&!I&&A.type!=="context-menu"&&(!_||V&&!F),handleClose:Tm({blockPointerEvents:!_}),mouseOnly:!0,move:!1,restMs:A.type===void 0?d:void 0,delay:{close:h},triggerElementRef:O,externalTree:B,isActiveTrigger:M,isClosing:()=>C.select("transitionStatus")==="ending"}),G=k9(D,C.select("lastOpenChangeReason")),J=bf(T,{enabled:!I&&A.type!=="context-menu",event:D&&_?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:A.type===void 0?G:!1}),fe=nk(T,{enabled:!I&&V}),ie=D9({open:D,enabled:_,mouseDownAction:"open"}),de=Nr([J,fe]),Se={disabled:I,open:D},Fe=C.useState("triggerProps",F),pe=[Y,n,K,W,O],Ee=[de.getReferenceProps(),$??Sn,Fe,{"aria-haspopup":"menu",id:E,onMouseDown:ke=>{if(C.select("open"))return;Z.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),yt(ke.currentTarget).addEventListener("mouseup",le,{once:!0})}},_?{role:"menuitem"}:{},ie,x,L],{preFocusGuardRef:De,handlePreFocusGuardFocus:Le,handleFocusTargetFocus:we}=GN(C,O),Te=Dt("button",e,{enabled:!_,stateAttributesMapping:Fu,state:Se,ref:pe,props:Ee});return _?ue.jsx(O9,{tag:"button",render:i,className:s,style:b,state:Se,refs:pe,props:Ee,stateAttributesMapping:Fu}):D?ue.jsxs(v.Fragment,{children:[ue.jsx(bo,{ref:De,onFocus:Le},`${E}-pre-focus-guard`),ue.jsx(v.Fragment,{children:Te},E),ue.jsx(bo,{ref:C.context.triggerFocusTargetRef,onFocus:we},`${E}-post-focus-guard`)]}):ue.jsx(v.Fragment,{children:Te},E)});function k9(t,e){const n=On(),[i,s]=v.useState(!1);return Oe(()=>{t&&e==="trigger-hover"?(s(!0),n.start(tD,()=>{s(!1)})):t||(n.clear(),s(!1))},[t,e,n]),i}function P9(){const t=Lf(!0),e=xs(!0),n=WN();return v.useMemo(()=>n?{type:"menubar",context:n}:t&&!e?{type:"context-menu",context:t}:{type:void 0},[t,e,n])}const JZ=v.forwardRef(function(e,n){const{render:i,className:s,label:o,id:l,nativeButton:c=!1,openOnHover:f=!0,delay:d=100,closeDelay:h=0,disabled:m=!1,style:g,...b}=e,x=Df(),w=Ym(),{store:C}=xs(),E=Ti(l),M=C.useState("open"),T=C.useState("floatingRootContext"),D=C.useState("floatingTreeRoot"),O=ek(E,C),A=v.useCallback(J=>{const fe=O(J);return J!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:E,activeTriggerElement:J,closeDelay:h}),fe},[O,h,C,E]),k=v.useRef(null),P=v.useCallback(J=>{k.current=J,C.set("activeTriggerElement",J)},[C]),B=qN();if(!B?.parentMenu)throw new Error(zt(37));C.useSyncedValue("closeDelay",h);const z=B.parentMenu,q=z.useState("itemProps"),W=z.useState("isActive",x.index),F=v.useMemo(()=>({type:"submenu-trigger",setActive(){z.set("activeIndex",x.index)}}),[z,x.index]),_=C.useState("disabled"),H=m||_,{getItemProps:I,itemRef:L}=Ox({closeOnClick:!1,disabled:H,highlighted:W,id:E,store:C,typingRef:z.context.typingRef,nativeButton:c,itemMetadata:F,nodeId:w?.context.nodeId}),K=C.useState("hoverEnabled"),Y=z.useState("allowMouseEnter"),Z=Cm(T,{enabled:K&&f&&!H,handleClose:Tm({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:d,delay:Y?{open:d,close:h}:0,triggerElementRef:k,externalTree:D,isClosing:()=>C.select("transitionStatus")==="ending"}),le=bf(T,{enabled:!H,event:"mousedown",toggle:!f,ignoreMouse:f,stickIfOpen:!1}),V=Nr([le]),U=C.useState("triggerProps",!0);return delete U.id,Dt("div",e,{state:{disabled:H,highlighted:W,open:M},stateAttributesMapping:mf,props:[V.getReferenceProps(),Z,U,q,{tabIndex:M||W?0:-1,onBlur(){W&&z.set("activeIndex",null)}},b,I],ref:[n,x.ref,L,A,P]})}),XN=v.createContext(void 0);function Bf(t){const e=v.useContext(XN);if(e===void 0&&!t)throw new Error(zt(47));return e}function N9(){return{...Sm(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const I9={...xm,disabled:be(t=>t.disabled),instantType:be(t=>t.instantType),openMethod:be(t=>t.openMethod),openChangeReason:be(t=>t.openChangeReason),modal:be(t=>t.modal),focusManagerModal:be(t=>t.focusManagerModal),stickIfOpen:be(t=>t.stickIfOpen),titleElementId:be(t=>t.titleElementId),descriptionElementId:be(t=>t.descriptionElementId),openOnHover:be(t=>t.openOnHover),closeDelay:be(t=>t.closeDelay),hasViewport:be(t=>t.hasViewport)};class Px extends xf{constructor(e){const n={...N9(),...e};n.open&&e?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),stickIfOpenTimeout:new ss,triggerElements:new lc},I9)}setOpen=(e,n)=>{const i=n.reason===An,s=n.reason===$s&&n.event.detail===0,o=!e&&(n.reason===gf||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const l=()=>{const c={open:e,openChangeReason:n.reason},f=n.trigger?.id??null;(f||e)&&(c.activeTriggerId=f,c.activeTriggerElement=n.trigger??null),this.update(c)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(tD,()=>{this.set("stickIfOpen",!1)}),Fn.flushSync(l)):l(),s||o?this.set("instantType",s?"click":"dismiss"):n.reason===vo?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,n){const i=kn(()=>new Px(n)).current,s=e??i;return um(i.disposeEffect),s}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function IA({props:t}){const{children:e,open:n,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:o,modal:l=!1,handle:c,triggerId:f,defaultTriggerId:d=null}=t,h=Px.useStore(c?.store,{modal:l,open:i,openProp:n,activeTriggerId:d,triggerIdProp:f});Cf(()=>{n===void 0&&h.state.open===!1&&i===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp("openProp",n),h.useControlledProp("triggerIdProp",f);const m=h.useState("open"),g=h.useState("payload");h.useContextCallback("onOpenChange",s),h.useContextCallback("onOpenChangeComplete",o);const{openMethod:b,triggerProps:x}=Om(m);vm(h);const{forceUnmount:w}=bm(m,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});v.useEffect(()=>{m||h.context.stickIfOpenTimeout.clear()},[h,m]);const C=v.useCallback(W=>{const F=Qe(W);return F.preventUnmountOnClose=()=>{h.set("preventUnmountingOnClose",!0)},F},[h]),E=v.useCallback(()=>{h.setOpen(!1,C(cm))},[h,C]);v.useImperativeHandle(t.actionsRef,()=>({unmount:w,close:E}),[w,E]);const M=wm({popupStore:h,onOpenChange:h.setOpen}),T=Sf(M,{outsidePressEvent:{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),D=$S(M),{getReferenceProps:O,getFloatingProps:A,getTriggerProps:k}=Nr([T,D]),P=v.useMemo(()=>O(x),[O,x]),B=v.useMemo(()=>k(x),[k,x]),z=v.useMemo(()=>A(),[A]);h.useSyncedValues({modal:l,openMethod:b,activeTriggerProps:P,inactiveTriggerProps:B,popupProps:z,floatingRootContext:M,nested:Js()!=null});const q=v.useMemo(()=>({store:h}),[h]);return ue.jsx(XN.Provider,{value:q,children:typeof e=="function"?e({payload:g}):e})}function eJ(t){return Bf(!0)?ue.jsx(IA,{props:t}):ue.jsx(HD,{children:ue.jsx(IA,{props:t})})}const L9=300,tJ=v.forwardRef(function(e,n){const{render:i,className:s,disabled:o=!1,nativeButton:l=!0,handle:c,payload:f,openOnHover:d=!1,delay:h=L9,closeDelay:m=0,id:g,style:b,...x}=e,w=Bf(!0),C=c?.store??w?.store;if(!C)throw new Error(zt(74));const E=Ti(g),M=C.useState("isTriggerActive",E),T=C.useState("floatingRootContext"),D=C.useState("isOpenedByTrigger",E),O=v.useRef(null),{registerTrigger:A,isMountedByThisTrigger:k}=ym(E,O,C,{payload:f,disabled:o,openOnHover:d,closeDelay:m}),P=C.useState("openChangeReason"),B=C.useState("stickIfOpen"),z=C.useState("openMethod"),q=C.useState("focusManagerModal"),W=Cm(T,{enabled:T!=null&&d&&(z!=="touch"||P!==$s),mouseOnly:!0,move:!1,handleClose:Tm(),restMs:h,delay:{close:m},triggerElementRef:O,isActiveTrigger:M,isClosing:()=>C.select("transitionStatus")==="ending"}),F=bf(T,{enabled:T!=null,stickIfOpen:B}),_=Nr([F]),H=C.useState("triggerProps",k),I={disabled:o,open:D},{getButtonProps:L,buttonRef:K}=ko({disabled:o,native:l}),Y=v.useMemo(()=>({open($){return $&&P===$s?Fu.open($):mf.open($)}}),[P]),Z=Dt("button",e,{state:I,ref:[K,n,A,O],props:[_.getReferenceProps(),W,H,{[AS]:"",id:E},x,L],stateAttributesMapping:Y}),{preFocusGuardRef:le,handlePreFocusGuardFocus:V,handleFocusTargetFocus:U}=GN(C,O);return M&&!q?ue.jsxs(v.Fragment,{children:[ue.jsx(bo,{ref:le,onFocus:V}),ue.jsx(v.Fragment,{children:Z},E),ue.jsx(bo,{ref:C.context.triggerFocusTargetRef,onFocus:U})]}):ue.jsx(v.Fragment,{children:Z},E)}),$N=v.createContext(void 0);function B9(){const t=v.useContext($N);if(t===void 0)throw new Error(zt(45));return t}const nJ=v.forwardRef(function(e,n){const{keepMounted:i=!1,...s}=e,{store:o}=Bf();return o.useState("mounted")||i?ue.jsx($N.Provider,{value:i,children:ue.jsx(pm,{ref:n,...s})}):null}),QN=v.createContext(void 0);function V9(){const t=v.useContext(QN);if(!t)throw new Error(zt(46));return t}const iJ=v.forwardRef(function(e,n){const{render:i,className:s,anchor:o,positionMethod:l="absolute",side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:m="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:w=!1,collisionAvoidance:C=MS,style:E,...M}=e,{store:T}=Bf(),D=B9(),O=US(),A=T.useState("floatingRootContext"),k=T.useState("mounted"),P=T.useState("open"),B=T.useState("openChangeReason"),z=T.useState("activeTriggerElement"),q=T.useState("modal"),W=T.useState("openMethod"),F=T.useState("positionerElement"),_=T.useState("instantType"),H=T.useState("transitionStatus"),I=T.useState("hasViewport"),L=v.useRef(null),K=YS(F,!1,!1),Y=Dm({anchor:o,floatingRootContext:A,positionMethod:l,mounted:k,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:b,collisionBoundary:m,collisionPadding:g,sticky:x,disableAnchorTracking:w,keepMounted:D,nodeId:O,collisionAvoidance:C,adaptiveOrigin:I?tx:void 0}),Z=A.useState("domReferenceElement");Oe(()=>{const $=Z,G=L.current;if($&&(L.current=$),G&&$&&$!==G){T.set("instantType",void 0);const J=new AbortController;return K(()=>{T.set("instantType","trigger-change")},J.signal),()=>{J.abort()}}},[Z,K,T]);const le={open:P,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,instant:_};bx(P&&q===!0&&B!==An,W==="touch",F,z);const V=v.useCallback($=>{T.set("positionerElement",$)},[T]),U=km(e,le,{styles:Y.positionerStyles,transitionStatus:H,props:M,refs:[n,V],hidden:!k,inert:!P});return ue.jsxs(QN.Provider,{value:Y,children:[k&&q===!0&&B!==An&&ue.jsx(Mm,{ref:T.context.internalBackdropRef,inert:Am(!P),cutout:z}),ue.jsx(_D,{id:O,children:U})]})}),z9=v.createContext(void 0);function _9(){const[t,e]=v.useState(0),n=Ve(()=>(e(s=>s+1),()=>{e(s=>Math.max(0,s-1))}));return{context:v.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}function H9(t){const{value:e,children:n}=t;return ue.jsx(z9.Provider,{value:e,children:n})}const F9={...Oo,...Pr},sJ=v.forwardRef(function(e,n){const{className:i,render:s,initialFocus:o,finalFocus:l,style:c,...f}=e,{store:d}=Bf(),h=V9(),m=Sx()!=null,{context:g,hasClosePart:b}=_9(),x=d.useState("open"),w=d.useState("openMethod"),C=d.useState("instantType"),E=d.useState("transitionStatus"),M=d.useState("popupProps"),T=d.useState("titleElementId"),D=d.useState("descriptionElementId"),O=d.useState("modal"),A=d.useState("mounted"),k=d.useState("openChangeReason"),P=d.useState("activeTriggerElement"),B=d.useState("floatingRootContext");er({open:x,ref:d.context.popupRef,onComplete(){x&&d.context.onOpenChangeComplete?.(!0)}});const z=d.useState("disabled"),q=d.useState("openOnHover"),W=d.useState("closeDelay");XS(B,{enabled:q&&!z,closeDelay:W});function F(Y){return Y==="touch"?d.context.popupRef.current:!0}const _=o===void 0?F:o,H={open:x,side:h.side,align:h.align,instant:C,transitionStatus:E},I=O!==!1&&b;d.useSyncedValue("focusManagerModal",I);const L=v.useCallback(Y=>{d.set("popupElement",Y)},[d]),K=Dt("div",e,{state:H,ref:[n,d.context.popupRef,L],props:[M,{"aria-labelledby":T,"aria-describedby":D,onKeyDown(Y){m&&Rm.has(Y.key)&&Y.stopPropagation()}},Tf(E),f],stateAttributesMapping:F9});return ue.jsx(mm,{context:B,openInteractionType:w,modal:I,disabled:!A||k===An,initialFocus:_,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Zt(P)?P:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:ue.jsx(H9,{value:g,children:K})})});var LA=1,U9=.9,j9=.8,W9=.17,lv=.1,av=.999,K9=.9999,q9=.99,Y9=/[\\\/_+.#"@\[\(\{&]/,G9=/[\\\/_+.#"@\[\(\{&]/g,X9=/[\s-]/,ZN=/[\s-]/g;function Hb(t,e,n,i,s,o,l){if(o===e.length)return s===t.length?LA:q9;var c=`${s},${o}`;if(l[c]!==void 0)return l[c];for(var f=i.charAt(o),d=n.indexOf(f,s),h=0,m,g,b,x;d>=0;)m=Hb(t,e,n,i,d+1,o+1,l),m>h&&(d===s?m*=LA:Y9.test(t.charAt(d-1))?(m*=j9,b=t.slice(s,d-1).match(G9),b&&s>0&&(m*=Math.pow(av,b.length))):X9.test(t.charAt(d-1))?(m*=U9,x=t.slice(s,d-1).match(ZN),x&&s>0&&(m*=Math.pow(av,x.length))):(m*=W9,s>0&&(m*=Math.pow(av,d-s))),t.charAt(d)!==e.charAt(o)&&(m*=K9)),(m<lv&&n.charAt(d-1)===i.charAt(o+1)||i.charAt(o+1)===i.charAt(o)&&n.charAt(d-1)!==i.charAt(o))&&(g=Hb(t,e,n,i,d+1,o+2,l),g*lv>m&&(m=g*lv)),m>h&&(h=m),d=n.indexOf(f,d+1);return l[c]=h,h}function BA(t){return t.toLowerCase().replace(ZN," ")}function $9(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Hb(t,e,BA(t),BA(e),0,0,{})}function yo(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t?.(s),n===!1||!s.defaultPrevented)return e?.(s)}}function VA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Co(...t){return e=>{let n=!1;const i=t.map(s=>{const o=VA(s,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<i.length;s++){const o=i[s];typeof o=="function"?o():VA(t[s],null)}}}}function Dl(...t){return v.useCallback(Co(...t),t)}function Q9(t,e){const n=v.createContext(e),i=o=>{const{children:l,...c}=o,f=v.useMemo(()=>c,Object.values(c));return ue.jsx(n.Provider,{value:f,children:l})};i.displayName=t+"Provider";function s(o){const l=v.useContext(n);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[i,s]}function Z9(t,e=[]){let n=[];function i(o,l){const c=v.createContext(l),f=n.length;n=[...n,l];const d=m=>{const{scope:g,children:b,...x}=m,w=g?.[t]?.[f]||c,C=v.useMemo(()=>x,Object.values(x));return ue.jsx(w.Provider,{value:C,children:b})};d.displayName=o+"Provider";function h(m,g){const b=g?.[t]?.[f]||c,x=v.useContext(b);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,h]}const s=()=>{const o=n.map(l=>v.createContext(l));return function(c){const f=c?.[t]||o;return v.useMemo(()=>({[`__scope${t}`]:{...c,[t]:f}}),[c,f])}};return s.scopeName=t,[i,J9(s,...e)]}function J9(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=i.reduce((c,{useScope:f,scopeName:d})=>{const m=f(o)[`__scope${d}`];return{...c,...m}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}var tf=globalThis?.document?v.useLayoutEffect:()=>{},e7=hf[" useId ".trim().toString()]||(()=>{}),t7=0;function Tr(t){const[e,n]=v.useState(e7());return tf(()=>{n(i=>i??String(t7++))},[t]),e?`radix-${e}`:""}var n7=hf[" useInsertionEffect ".trim().toString()]||tf;function i7({prop:t,defaultProp:e,onChange:n=()=>{},caller:i}){const[s,o,l]=s7({defaultProp:e,onChange:n}),c=t!==void 0,f=c?t:s;{const h=v.useRef(t!==void 0);v.useEffect(()=>{const m=h.current;m!==c&&console.warn(`${i} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,i])}const d=v.useCallback(h=>{if(c){const m=r7(h)?h(t):h;m!==t&&l.current?.(m)}else o(h)},[c,t,o,l]);return[f,d]}function s7({defaultProp:t,onChange:e}){const[n,i]=v.useState(t),s=v.useRef(n),o=v.useRef(e);return n7(()=>{o.current=e},[e]),v.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,i,o]}function r7(t){return typeof t=="function"}function JN(t){const e=o7(t),n=v.forwardRef((i,s)=>{const{children:o,...l}=i,c=v.Children.toArray(o),f=c.find(a7);if(f){const d=f.props.children,h=c.map(m=>m===f?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:m);return ue.jsx(e,{...l,ref:s,children:v.isValidElement(d)?v.cloneElement(d,void 0,h):null})}return ue.jsx(e,{...l,ref:s,children:o})});return n.displayName=`${t}.Slot`,n}function o7(t){const e=v.forwardRef((n,i)=>{const{children:s,...o}=n;if(v.isValidElement(s)){const l=u7(s),c=c7(o,s.props);return s.type!==v.Fragment&&(c.ref=i?Co(i,l):l),v.cloneElement(s,c)}return v.Children.count(s)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var l7=Symbol("radix.slottable");function a7(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===l7}function c7(t,e){const n={...e};for(const i in e){const s=t[i],o=e[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...c)=>{const f=o(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...t,...n}}function u7(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var f7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ir=f7.reduce((t,e)=>{const n=JN(`Primitive.${e}`),i=v.forwardRef((s,o)=>{const{asChild:l,...c}=s,f=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ue.jsx(f,{...c,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});function d7(t,e){t&&Fn.flushSync(()=>t.dispatchEvent(e))}function nf(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>e.current?.(...n),[])}function h7(t,e=globalThis?.document){const n=nf(t);v.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}var p7="DismissableLayer",Fb="dismissableLayer.update",m7="dismissableLayer.pointerDownOutside",g7="dismissableLayer.focusOutside",zA,eI=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tI=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:c,...f}=t,d=v.useContext(eI),[h,m]=v.useState(null),g=h?.ownerDocument??globalThis?.document,[,b]=v.useState({}),x=Dl(e,k=>m(k)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(C),M=h?w.indexOf(h):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,D=M>=E,O=b7(k=>{const P=k.target,B=[...d.branches].some(z=>z.contains(P));!D||B||(s?.(k),l?.(k),k.defaultPrevented||c?.())},g),A=S7(k=>{const P=k.target;[...d.branches].some(z=>z.contains(P))||(o?.(k),l?.(k),k.defaultPrevented||c?.())},g);return h7(k=>{M===d.layers.size-1&&(i?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},g),v.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(zA=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),_A(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=zA)}},[h,g,n,d]),v.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),_A())},[h,d]),v.useEffect(()=>{const k=()=>b({});return document.addEventListener(Fb,k),()=>document.removeEventListener(Fb,k)},[]),ue.jsx(Ir.div,{...f,ref:x,style:{pointerEvents:T?D?"auto":"none":void 0,...t.style},onFocusCapture:yo(t.onFocusCapture,A.onFocusCapture),onBlurCapture:yo(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:yo(t.onPointerDownCapture,O.onPointerDownCapture)})});tI.displayName=p7;var y7="DismissableLayerBranch",v7=v.forwardRef((t,e)=>{const n=v.useContext(eI),i=v.useRef(null),s=Dl(e,i);return v.useEffect(()=>{const o=i.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),ue.jsx(Ir.div,{...t,ref:s})});v7.displayName=y7;function b7(t,e=globalThis?.document){const n=nf(t),i=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!i.current){let f=function(){nI(m7,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=f,e.addEventListener("click",s.current,{once:!0})):f()}else e.removeEventListener("click",s.current);i.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",o),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}function S7(t,e=globalThis?.document){const n=nf(t),i=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!i.current&&nI(g7,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function _A(){const t=new CustomEvent(Fb);document.dispatchEvent(t)}function nI(t,e,n,{discrete:i}){const s=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),i?d7(s,o):s.dispatchEvent(o)}var cv="focusScope.autoFocusOnMount",uv="focusScope.autoFocusOnUnmount",HA={bubbles:!1,cancelable:!0},x7="FocusScope",iI=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=t,[c,f]=v.useState(null),d=nf(s),h=nf(o),m=v.useRef(null),g=Dl(e,w=>f(w)),b=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(i){let w=function(T){if(b.paused||!c)return;const D=T.target;c.contains(D)?m.current=D:so(m.current,{select:!0})},C=function(T){if(b.paused||!c)return;const D=T.relatedTarget;D!==null&&(c.contains(D)||so(m.current,{select:!0}))},E=function(T){if(document.activeElement===document.body)for(const O of T)O.removedNodes.length>0&&so(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const M=new MutationObserver(E);return c&&M.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),M.disconnect()}}},[i,c,b.paused]),v.useEffect(()=>{if(c){UA.add(b);const w=document.activeElement;if(!c.contains(w)){const E=new CustomEvent(cv,HA);c.addEventListener(cv,d),c.dispatchEvent(E),E.defaultPrevented||(w7(A7(sI(c)),{select:!0}),document.activeElement===w&&so(c))}return()=>{c.removeEventListener(cv,d),setTimeout(()=>{const E=new CustomEvent(uv,HA);c.addEventListener(uv,h),c.dispatchEvent(E),E.defaultPrevented||so(w??document.body,{select:!0}),c.removeEventListener(uv,h),UA.remove(b)},0)}}},[c,d,h,b]);const x=v.useCallback(w=>{if(!n&&!i||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(C&&E){const M=w.currentTarget,[T,D]=C7(M);T&&D?!w.shiftKey&&E===D?(w.preventDefault(),n&&so(T,{select:!0})):w.shiftKey&&E===T&&(w.preventDefault(),n&&so(D,{select:!0})):E===M&&w.preventDefault()}},[n,i,b.paused]);return ue.jsx(Ir.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});iI.displayName=x7;function w7(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(so(i,{select:e}),document.activeElement!==n)return}function C7(t){const e=sI(t),n=FA(e,t),i=FA(e.reverse(),t);return[n,i]}function sI(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function FA(t,e){for(const n of t)if(!E7(n,{upTo:e}))return n}function E7(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function T7(t){return t instanceof HTMLInputElement&&"select"in t}function so(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&T7(t)&&e&&t.select()}}var UA=R7();function R7(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=jA(t,e),t.unshift(e)},remove(e){t=jA(t,e),t[0]?.resume()}}}function jA(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function A7(t){return t.filter(e=>e.tagName!=="A")}var M7="Portal",rI=v.forwardRef((t,e)=>{const{container:n,...i}=t,[s,o]=v.useState(!1);tf(()=>o(!0),[]);const l=n||s&&globalThis?.document?.body;return l?PD.createPortal(ue.jsx(Ir.div,{...i,ref:e}),l):null});rI.displayName=M7;function O7(t,e){return v.useReducer((n,i)=>e[n][i]??n,t)}var Gm=t=>{const{present:e,children:n}=t,i=D7(e),s=typeof n=="function"?n({present:i.isPresent}):v.Children.only(n),o=Dl(i.ref,k7(s));return typeof n=="function"||i.isPresent?v.cloneElement(s,{ref:o}):null};Gm.displayName="Presence";function D7(t){const[e,n]=v.useState(),i=v.useRef(null),s=v.useRef(t),o=v.useRef("none"),l=t?"mounted":"unmounted",[c,f]=O7(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const d=Ph(i.current);o.current=c==="mounted"?d:"none"},[c]),tf(()=>{const d=i.current,h=s.current;if(h!==t){const g=o.current,b=Ph(d);t?f("MOUNT"):b==="none"||d?.display==="none"?f("UNMOUNT"):f(h&&g!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),tf(()=>{if(e){let d;const h=e.ownerDocument.defaultView??window,m=b=>{const w=Ph(i.current).includes(CSS.escape(b.animationName));if(b.target===e&&w&&(f("ANIMATION_END"),!s.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",d=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},g=b=>{b.target===e&&(o.current=Ph(i.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(d),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function Ph(t){return t?.animationName||"none"}function k7(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var fv=0;function P7(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??WA()),document.body.insertAdjacentElement("beforeend",t[1]??WA()),fv++,()=>{fv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),fv--}},[])}function WA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var _s=function(){return _s=Object.assign||function(e){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},_s.apply(this,arguments)};function oI(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]]);return n}function N7(t,e,n){if(n||arguments.length===2)for(var i=0,s=e.length,o;i<s;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}var np="right-scroll-bar-position",ip="width-before-scroll-bar",I7="with-scroll-bars-hidden",L7="--removed-body-scroll-bar-size";function dv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function B7(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=e,n.facade}var V7=typeof window<"u"?v.useLayoutEffect:v.useEffect,KA=new WeakMap;function z7(t,e){var n=B7(null,function(i){return t.forEach(function(s){return dv(s,i)})});return V7(function(){var i=KA.get(n);if(i){var s=new Set(i),o=new Set(t),l=n.current;s.forEach(function(c){o.has(c)||dv(c,null)}),o.forEach(function(c){s.has(c)||dv(c,l)})}KA.set(n,t)},[t]),n}function _7(t){return t}function H7(t,e){e===void 0&&(e=_7);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var l=e(o,i);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(o){for(i=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){i=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(o),l=n}var f=function(){var h=l;l=[],h.forEach(o)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(h){l.push(h),d()},filter:function(h){return l=l.filter(h),n}}}};return s}function F7(t){t===void 0&&(t={});var e=H7(null);return e.options=_s({async:!0,ssr:!1},t),e}var lI=function(t){var e=t.sideCar,n=oI(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return v.createElement(i,_s({},n))};lI.isSideCarExport=!0;function U7(t,e){return t.useMedium(e),lI}var aI=F7(),hv=function(){},Xm=v.forwardRef(function(t,e){var n=v.useRef(null),i=v.useState({onScrollCapture:hv,onWheelCapture:hv,onTouchMoveCapture:hv}),s=i[0],o=i[1],l=t.forwardProps,c=t.children,f=t.className,d=t.removeScrollBar,h=t.enabled,m=t.shards,g=t.sideCar,b=t.noRelative,x=t.noIsolation,w=t.inert,C=t.allowPinchZoom,E=t.as,M=E===void 0?"div":E,T=t.gapMode,D=oI(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=g,A=z7([n,e]),k=_s(_s({},D),s);return v.createElement(v.Fragment,null,h&&v.createElement(O,{sideCar:aI,removeScrollBar:d,shards:m,noRelative:b,noIsolation:x,inert:w,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:T}),l?v.cloneElement(v.Children.only(c),_s(_s({},k),{ref:A})):v.createElement(M,_s({},k,{className:f,ref:A}),c))});Xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xm.classNames={fullWidth:ip,zeroRight:np};var j7=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W7(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=j7();return e&&t.setAttribute("nonce",e),t}function K7(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function q7(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Y7=function(){var t=0,e=null;return{add:function(n){t==0&&(e=W7())&&(K7(e,n),q7(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},G7=function(){var t=Y7();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},cI=function(){var t=G7(),e=function(n){var i=n.styles,s=n.dynamic;return t(i,s),null};return e},X7={left:0,top:0,right:0,gap:0},pv=function(t){return parseInt(t||"",10)||0},$7=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[pv(n),pv(i),pv(s)]},Q7=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return X7;var e=$7(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},Z7=cI(),Fa="data-scroll-locked",J7=function(t,e,n,i){var s=t.left,o=t.top,l=t.right,c=t.gap;return n===void 0&&(n="margin"),`
24
+ .`.concat(I7,` {
25
+ overflow: hidden `).concat(i,`;
26
+ padding-right: `).concat(c,"px ").concat(i,`;
27
+ }
28
+ body[`).concat(Fa,`] {
29
+ overflow: hidden `).concat(i,`;
30
+ overscroll-behavior: contain;
31
+ `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&`
32
+ padding-left: `.concat(s,`px;
33
+ padding-top: `).concat(o,`px;
34
+ padding-right: `).concat(l,`px;
35
+ margin-left:0;
36
+ margin-top:0;
37
+ margin-right: `).concat(c,"px ").concat(i,`;
38
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(i,";")].filter(Boolean).join(""),`
39
+ }
40
+
41
+ .`).concat(np,` {
42
+ right: `).concat(c,"px ").concat(i,`;
43
+ }
44
+
45
+ .`).concat(ip,` {
46
+ margin-right: `).concat(c,"px ").concat(i,`;
47
+ }
48
+
49
+ .`).concat(np," .").concat(np,` {
50
+ right: 0 `).concat(i,`;
51
+ }
52
+
53
+ .`).concat(ip," .").concat(ip,` {
54
+ margin-right: 0 `).concat(i,`;
55
+ }
56
+
57
+ body[`).concat(Fa,`] {
58
+ `).concat(L7,": ").concat(c,`px;
59
+ }
60
+ `)},qA=function(){var t=parseInt(document.body.getAttribute(Fa)||"0",10);return isFinite(t)?t:0},eW=function(){v.useEffect(function(){return document.body.setAttribute(Fa,(qA()+1).toString()),function(){var t=qA()-1;t<=0?document.body.removeAttribute(Fa):document.body.setAttribute(Fa,t.toString())}},[])},tW=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,s=i===void 0?"margin":i;eW();var o=v.useMemo(function(){return Q7(s)},[s]);return v.createElement(Z7,{styles:J7(o,!e,s,n?"":"!important")})},Ub=!1;if(typeof window<"u")try{var Nh=Object.defineProperty({},"passive",{get:function(){return Ub=!0,!0}});window.addEventListener("test",Nh,Nh),window.removeEventListener("test",Nh,Nh)}catch{Ub=!1}var ma=Ub?{passive:!1}:!1,nW=function(t){return t.tagName==="TEXTAREA"},uI=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!nW(t)&&n[e]==="visible")},iW=function(t){return uI(t,"overflowY")},sW=function(t){return uI(t,"overflowX")},YA=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=fI(t,i);if(s){var o=dI(t,i),l=o[1],c=o[2];if(l>c)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},rW=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},oW=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},fI=function(t,e){return t==="v"?iW(e):sW(e)},dI=function(t,e){return t==="v"?rW(e):oW(e)},lW=function(t,e){return t==="h"&&e==="rtl"?-1:1},aW=function(t,e,n,i,s){var o=lW(t,window.getComputedStyle(e).direction),l=o*i,c=n.target,f=e.contains(c),d=!1,h=l>0,m=0,g=0;do{if(!c)break;var b=dI(t,c),x=b[0],w=b[1],C=b[2],E=w-C-o*x;(x||E)&&fI(t,c)&&(m+=E,g+=x);var M=c.parentNode;c=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!f&&c!==document.body||f&&(e.contains(c)||e===c));return(h&&Math.abs(m)<1||!h&&Math.abs(g)<1)&&(d=!0),d},Ih=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},GA=function(t){return[t.deltaX,t.deltaY]},XA=function(t){return t&&"current"in t?t.current:t},cW=function(t,e){return t[0]===e[0]&&t[1]===e[1]},uW=function(t){return`
61
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
62
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
63
+ `)},fW=0,ga=[];function dW(t){var e=v.useRef([]),n=v.useRef([0,0]),i=v.useRef(),s=v.useState(fW++)[0],o=v.useState(cI)[0],l=v.useRef(t);v.useEffect(function(){l.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var w=N7([t.lockRef.current],(t.shards||[]).map(XA),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var c=v.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var E=Ih(w),M=n.current,T="deltaX"in w?w.deltaX:M[0]-E[0],D="deltaY"in w?w.deltaY:M[1]-E[1],O,A=w.target,k=Math.abs(T)>Math.abs(D)?"h":"v";if("touches"in w&&k==="h"&&A.type==="range")return!1;var P=window.getSelection(),B=P&&P.anchorNode,z=B?B===A||B.contains(A):!1;if(z)return!1;var q=YA(k,A);if(!q)return!0;if(q?O=k:(O=k==="v"?"h":"v",q=YA(k,A)),!q)return!1;if(!i.current&&"changedTouches"in w&&(T||D)&&(i.current=O),!O)return!0;var W=i.current||O;return aW(W,C,w,W==="h"?T:D)},[]),f=v.useCallback(function(w){var C=w;if(!(!ga.length||ga[ga.length-1]!==o)){var E="deltaY"in C?GA(C):Ih(C),M=e.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&cW(O.delta,E)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var T=(l.current.shards||[]).map(XA).filter(Boolean).filter(function(O){return O.contains(C.target)}),D=T.length>0?c(C,T[0]):!l.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),d=v.useCallback(function(w,C,E,M){var T={name:w,delta:C,target:E,should:M,shadowParent:hW(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(D){return D!==T})},1)},[]),h=v.useCallback(function(w){n.current=Ih(w),i.current=void 0},[]),m=v.useCallback(function(w){d(w.type,GA(w),w.target,c(w,t.lockRef.current))},[]),g=v.useCallback(function(w){d(w.type,Ih(w),w.target,c(w,t.lockRef.current))},[]);v.useEffect(function(){return ga.push(o),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",f,ma),document.addEventListener("touchmove",f,ma),document.addEventListener("touchstart",h,ma),function(){ga=ga.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,ma),document.removeEventListener("touchmove",f,ma),document.removeEventListener("touchstart",h,ma)}},[]);var b=t.removeScrollBar,x=t.inert;return v.createElement(v.Fragment,null,x?v.createElement(o,{styles:uW(s)}):null,b?v.createElement(tW,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function hW(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const pW=U7(aI,dW);var hI=v.forwardRef(function(t,e){return v.createElement(Xm,_s({},t,{ref:e,sideCar:pW}))});hI.classNames=Xm.classNames;var mW=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ya=new WeakMap,Lh=new WeakMap,Bh={},mv=0,pI=function(t){return t&&(t.host||pI(t.parentNode))},gW=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=pI(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},yW=function(t,e,n,i){var s=gW(e,Array.isArray(t)?t:[t]);Bh[n]||(Bh[n]=new WeakMap);var o=Bh[n],l=[],c=new Set,f=new Set(s),d=function(m){!m||c.has(m)||(c.add(m),d(m.parentNode))};s.forEach(d);var h=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(g){if(c.has(g))h(g);else try{var b=g.getAttribute(i),x=b!==null&&b!=="false",w=(ya.get(g)||0)+1,C=(o.get(g)||0)+1;ya.set(g,w),o.set(g,C),l.push(g),w===1&&x&&Lh.set(g,!0),C===1&&g.setAttribute(n,"true"),x||g.setAttribute(i,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return h(e),c.clear(),mv++,function(){l.forEach(function(m){var g=ya.get(m)-1,b=o.get(m)-1;ya.set(m,g),o.set(m,b),g||(Lh.has(m)||m.removeAttribute(i),Lh.delete(m)),b||m.removeAttribute(n)}),mv--,mv||(ya=new WeakMap,ya=new WeakMap,Lh=new WeakMap,Bh={})}},vW=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),s=mW(t);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),yW(i,s,n,"aria-hidden")):function(){return null}},$m="Dialog",[mI]=Z9($m),[bW,ws]=mI($m),gI=t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:s,onOpenChange:o,modal:l=!0}=t,c=v.useRef(null),f=v.useRef(null),[d,h]=i7({prop:i,defaultProp:s??!1,onChange:o,caller:$m});return ue.jsx(bW,{scope:e,triggerRef:c,contentRef:f,contentId:Tr(),titleId:Tr(),descriptionId:Tr(),open:d,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(m=>!m),[h]),modal:l,children:n})};gI.displayName=$m;var yI="DialogTrigger",SW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(yI,n),o=Dl(e,s.triggerRef);return ue.jsx(Ir.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Lx(s.open),...i,ref:o,onClick:yo(t.onClick,s.onOpenToggle)})});SW.displayName=yI;var Nx="DialogPortal",[xW,vI]=mI(Nx,{forceMount:void 0}),bI=t=>{const{__scopeDialog:e,forceMount:n,children:i,container:s}=t,o=ws(Nx,e);return ue.jsx(xW,{scope:e,forceMount:n,children:v.Children.map(i,l=>ue.jsx(Gm,{present:n||o.open,children:ue.jsx(rI,{asChild:!0,container:s,children:l})}))})};bI.displayName=Nx;var jp="DialogOverlay",SI=v.forwardRef((t,e)=>{const n=vI(jp,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,o=ws(jp,t.__scopeDialog);return o.modal?ue.jsx(Gm,{present:i||o.open,children:ue.jsx(CW,{...s,ref:e})}):null});SI.displayName=jp;var wW=JN("DialogOverlay.RemoveScroll"),CW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(jp,n);return ue.jsx(hI,{as:wW,allowPinchZoom:!0,shards:[s.contentRef],children:ue.jsx(Ir.div,{"data-state":Lx(s.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),Rl="DialogContent",xI=v.forwardRef((t,e)=>{const n=vI(Rl,t.__scopeDialog),{forceMount:i=n.forceMount,...s}=t,o=ws(Rl,t.__scopeDialog);return ue.jsx(Gm,{present:i||o.open,children:o.modal?ue.jsx(EW,{...s,ref:e}):ue.jsx(TW,{...s,ref:e})})});xI.displayName=Rl;var EW=v.forwardRef((t,e)=>{const n=ws(Rl,t.__scopeDialog),i=v.useRef(null),s=Dl(e,n.contentRef,i);return v.useEffect(()=>{const o=i.current;if(o)return vW(o)},[]),ue.jsx(wI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yo(t.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:yo(t.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&o.preventDefault()}),onFocusOutside:yo(t.onFocusOutside,o=>o.preventDefault())})}),TW=v.forwardRef((t,e)=>{const n=ws(Rl,t.__scopeDialog),i=v.useRef(!1),s=v.useRef(!1);return ue.jsx(wI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(i.current||n.triggerRef.current?.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),wI=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=t,c=ws(Rl,n),f=v.useRef(null),d=Dl(e,f);return P7(),ue.jsxs(ue.Fragment,{children:[ue.jsx(iI,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:ue.jsx(tI,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Lx(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),ue.jsxs(ue.Fragment,{children:[ue.jsx(OW,{titleId:c.titleId}),ue.jsx(kW,{contentRef:f,descriptionId:c.descriptionId})]})]})}),Ix="DialogTitle",RW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(Ix,n);return ue.jsx(Ir.h2,{id:s.titleId,...i,ref:e})});RW.displayName=Ix;var CI="DialogDescription",AW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(CI,n);return ue.jsx(Ir.p,{id:s.descriptionId,...i,ref:e})});AW.displayName=CI;var EI="DialogClose",MW=v.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,s=ws(EI,n);return ue.jsx(Ir.button,{type:"button",...i,ref:e,onClick:yo(t.onClick,()=>s.onOpenChange(!1))})});MW.displayName=EI;function Lx(t){return t?"open":"closed"}var TI="DialogTitleWarning",[rJ,RI]=Q9(TI,{contentName:Rl,titleName:Ix,docsSlug:"dialog"}),OW=({titleId:t})=>{const e=RI(TI),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
64
+
65
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
66
+
67
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},DW="DialogDescriptionWarning",kW=({contentRef:t,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${RI(DW).contentName}}.`;return v.useEffect(()=>{const s=t.current?.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(i))},[i,t,e]),null},PW=gI,NW=bI,IW=SI,LW=xI,BW=Symbol.for("react.lazy"),Wp=hf[" use ".trim().toString()];function VW(t){return typeof t=="object"&&t!==null&&"then"in t}function AI(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===BW&&"_payload"in t&&VW(t._payload)}function zW(t){const e=_W(t),n=v.forwardRef((i,s)=>{let{children:o,...l}=i;AI(o)&&typeof Wp=="function"&&(o=Wp(o._payload));const c=v.Children.toArray(o),f=c.find(FW);if(f){const d=f.props.children,h=c.map(m=>m===f?v.Children.count(d)>1?v.Children.only(null):v.isValidElement(d)?d.props.children:null:m);return ue.jsx(e,{...l,ref:s,children:v.isValidElement(d)?v.cloneElement(d,void 0,h):null})}return ue.jsx(e,{...l,ref:s,children:o})});return n.displayName=`${t}.Slot`,n}function _W(t){const e=v.forwardRef((n,i)=>{let{children:s,...o}=n;if(AI(s)&&typeof Wp=="function"&&(s=Wp(s._payload)),v.isValidElement(s)){const l=jW(s),c=UW(o,s.props);return s.type!==v.Fragment&&(c.ref=i?Co(i,l):l),v.cloneElement(s,c)}return v.Children.count(s)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var HW=Symbol("radix.slottable");function FW(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===HW}function UW(t,e){const n={...e};for(const i in e){const s=t[i],o=e[i];/^on[A-Z]/.test(i)?s&&o?n[i]=(...c)=>{const f=o(...c);return s(...c),f}:s&&(n[i]=s):i==="style"?n[i]={...s,...o}:i==="className"&&(n[i]=[s,o].filter(Boolean).join(" "))}return{...t,...n}}function jW(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var WW=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vo=WW.reduce((t,e)=>{const n=zW(`Primitive.${e}`),i=v.forwardRef((s,o)=>{const{asChild:l,...c}=s,f=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),ue.jsx(f,{...c,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{}),uu='[cmdk-group=""]',gv='[cmdk-group-items=""]',KW='[cmdk-group-heading=""]',MI='[cmdk-item=""]',$A=`${MI}:not([aria-disabled="true"])`,jb="cmdk-item-select",Sa="data-value",qW=(t,e,n)=>$9(t,e,n),OI=v.createContext(void 0),Vf=()=>v.useContext(OI),DI=v.createContext(void 0),Bx=()=>v.useContext(DI),kI=v.createContext(void 0),PI=v.forwardRef((t,e)=>{let n=xa(()=>{var V,U;return{search:"",value:(U=(V=t.value)!=null?V:t.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),i=xa(()=>new Set),s=xa(()=>new Map),o=xa(()=>new Map),l=xa(()=>new Set),c=NI(t),{label:f,children:d,value:h,onValueChange:m,filter:g,shouldFilter:b,loop:x,disablePointerSelection:w=!1,vimBindings:C=!0,...E}=t,M=Tr(),T=Tr(),D=Tr(),O=v.useRef(null),A=iK();Al(()=>{if(h!==void 0){let V=h.trim();n.current.value=V,k.emit()}},[h]),Al(()=>{A(6,F)},[]);let k=v.useMemo(()=>({subscribe:V=>(l.current.add(V),()=>l.current.delete(V)),snapshot:()=>n.current,setState:(V,U,$)=>{var G,J,fe,ie;if(!Object.is(n.current[V],U)){if(n.current[V]=U,V==="search")W(),z(),A(1,q);else if(V==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let de=document.getElementById(D);de?de.focus():(G=document.getElementById(M))==null||G.focus()}if(A(7,()=>{var de;n.current.selectedItemId=(de=_())==null?void 0:de.id,k.emit()}),$||A(5,F),((J=c.current)==null?void 0:J.value)!==void 0){let de=U??"";(ie=(fe=c.current).onValueChange)==null||ie.call(fe,de);return}}k.emit()}},emit:()=>{l.current.forEach(V=>V())}}),[]),P=v.useMemo(()=>({value:(V,U,$)=>{var G;U!==((G=o.current.get(V))==null?void 0:G.value)&&(o.current.set(V,{value:U,keywords:$}),n.current.filtered.items.set(V,B(U,$)),A(2,()=>{z(),k.emit()}))},item:(V,U)=>(i.current.add(V),U&&(s.current.has(U)?s.current.get(U).add(V):s.current.set(U,new Set([V]))),A(3,()=>{W(),z(),n.current.value||q(),k.emit()}),()=>{o.current.delete(V),i.current.delete(V),n.current.filtered.items.delete(V);let $=_();A(4,()=>{W(),$?.getAttribute("id")===V&&q(),k.emit()})}),group:V=>(s.current.has(V)||s.current.set(V,new Set),()=>{o.current.delete(V),s.current.delete(V)}),filter:()=>c.current.shouldFilter,label:f||t["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:M,inputId:D,labelId:T,listInnerRef:O}),[]);function B(V,U){var $,G;let J=(G=($=c.current)==null?void 0:$.filter)!=null?G:qW;return V?J(V,n.current.search,U):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let V=n.current.filtered.items,U=[];n.current.filtered.groups.forEach(G=>{let J=s.current.get(G),fe=0;J.forEach(ie=>{let de=V.get(ie);fe=Math.max(de,fe)}),U.push([G,fe])});let $=O.current;H().sort((G,J)=>{var fe,ie;let de=G.getAttribute("id"),Se=J.getAttribute("id");return((fe=V.get(Se))!=null?fe:0)-((ie=V.get(de))!=null?ie:0)}).forEach(G=>{let J=G.closest(gv);J?J.appendChild(G.parentElement===J?G:G.closest(`${gv} > *`)):$.appendChild(G.parentElement===$?G:G.closest(`${gv} > *`))}),U.sort((G,J)=>J[1]-G[1]).forEach(G=>{var J;let fe=(J=O.current)==null?void 0:J.querySelector(`${uu}[${Sa}="${encodeURIComponent(G[0])}"]`);fe?.parentElement.appendChild(fe)})}function q(){let V=H().find($=>$.getAttribute("aria-disabled")!=="true"),U=V?.getAttribute(Sa);k.setState("value",U||void 0)}function W(){var V,U,$,G;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=i.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let fe of i.current){let ie=(U=(V=o.current.get(fe))==null?void 0:V.value)!=null?U:"",de=(G=($=o.current.get(fe))==null?void 0:$.keywords)!=null?G:[],Se=B(ie,de);n.current.filtered.items.set(fe,Se),Se>0&&J++}for(let[fe,ie]of s.current)for(let de of ie)if(n.current.filtered.items.get(de)>0){n.current.filtered.groups.add(fe);break}n.current.filtered.count=J}function F(){var V,U,$;let G=_();G&&(((V=G.parentElement)==null?void 0:V.firstChild)===G&&(($=(U=G.closest(uu))==null?void 0:U.querySelector(KW))==null||$.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function _(){var V;return(V=O.current)==null?void 0:V.querySelector(`${MI}[aria-selected="true"]`)}function H(){var V;return Array.from(((V=O.current)==null?void 0:V.querySelectorAll($A))||[])}function I(V){let U=H()[V];U&&k.setState("value",U.getAttribute(Sa))}function L(V){var U;let $=_(),G=H(),J=G.findIndex(ie=>ie===$),fe=G[J+V];(U=c.current)!=null&&U.loop&&(fe=J+V<0?G[G.length-1]:J+V===G.length?G[0]:G[J+V]),fe&&k.setState("value",fe.getAttribute(Sa))}function K(V){let U=_(),$=U?.closest(uu),G;for(;$&&!G;)$=V>0?tK($,uu):nK($,uu),G=$?.querySelector($A);G?k.setState("value",G.getAttribute(Sa)):L(V)}let Y=()=>I(H().length-1),Z=V=>{V.preventDefault(),V.metaKey?Y():V.altKey?K(1):L(1)},le=V=>{V.preventDefault(),V.metaKey?I(0):V.altKey?K(-1):L(-1)};return v.createElement(Vo.div,{ref:e,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:V=>{var U;(U=E.onKeyDown)==null||U.call(E,V);let $=V.nativeEvent.isComposing||V.keyCode===229;if(!(V.defaultPrevented||$))switch(V.key){case"n":case"j":{C&&V.ctrlKey&&Z(V);break}case"ArrowDown":{Z(V);break}case"p":case"k":{C&&V.ctrlKey&&le(V);break}case"ArrowUp":{le(V);break}case"Home":{V.preventDefault(),I(0);break}case"End":{V.preventDefault(),Y();break}case"Enter":{V.preventDefault();let G=_();if(G){let J=new Event(jb);G.dispatchEvent(J)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:rK},f),Qm(t,V=>v.createElement(DI.Provider,{value:k},v.createElement(OI.Provider,{value:P},V))))}),YW=v.forwardRef((t,e)=>{var n,i;let s=Tr(),o=v.useRef(null),l=v.useContext(kI),c=Vf(),f=NI(t),d=(i=(n=f.current)==null?void 0:n.forceMount)!=null?i:l?.forceMount;Al(()=>{if(!d)return c.item(s,l?.id)},[d]);let h=II(s,o,[t.value,t.children,o],t.keywords),m=Bx(),g=Eo(A=>A.value&&A.value===h.current),b=Eo(A=>d||c.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);v.useEffect(()=>{let A=o.current;if(!(!A||t.disabled))return A.addEventListener(jb,x),()=>A.removeEventListener(jb,x)},[b,t.onSelect,t.disabled]);function x(){var A,k;w(),(k=(A=f.current).onSelect)==null||k.call(A,h.current)}function w(){m.setState("value",h.current,!0)}if(!b)return null;let{disabled:C,value:E,onSelect:M,forceMount:T,keywords:D,...O}=t;return v.createElement(Vo.div,{ref:Co(o,e),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!g,"data-disabled":!!C,"data-selected":!!g,onPointerMove:C||c.getDisablePointerSelection()?void 0:w,onClick:C?void 0:x},t.children)}),GW=v.forwardRef((t,e)=>{let{heading:n,children:i,forceMount:s,...o}=t,l=Tr(),c=v.useRef(null),f=v.useRef(null),d=Tr(),h=Vf(),m=Eo(b=>s||h.filter()===!1?!0:b.search?b.filtered.groups.has(l):!0);Al(()=>h.group(l),[]),II(l,c,[t.value,t.heading,f]);let g=v.useMemo(()=>({id:l,forceMount:s}),[s]);return v.createElement(Vo.div,{ref:Co(c,e),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&v.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Qm(t,b=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},v.createElement(kI.Provider,{value:g},b))))}),XW=v.forwardRef((t,e)=>{let{alwaysRender:n,...i}=t,s=v.useRef(null),o=Eo(l=>!l.search);return!n&&!o?null:v.createElement(Vo.div,{ref:Co(s,e),...i,"cmdk-separator":"",role:"separator"})}),$W=v.forwardRef((t,e)=>{let{onValueChange:n,...i}=t,s=t.value!=null,o=Bx(),l=Eo(d=>d.search),c=Eo(d=>d.selectedItemId),f=Vf();return v.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),v.createElement(Vo.input,{ref:e,...i,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":c,id:f.inputId,type:"text",value:s?t.value:l,onChange:d=>{s||o.setState("search",d.target.value),n?.(d.target.value)}})}),QW=v.forwardRef((t,e)=>{let{children:n,label:i="Suggestions",...s}=t,o=v.useRef(null),l=v.useRef(null),c=Eo(d=>d.selectedItemId),f=Vf();return v.useEffect(()=>{if(l.current&&o.current){let d=l.current,h=o.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let b=d.offsetHeight;h.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(m),g.unobserve(d)}}},[]),v.createElement(Vo.div,{ref:Co(o,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:f.listId},Qm(t,d=>v.createElement("div",{ref:Co(l,f.listInnerRef),"cmdk-list-sizer":""},d)))}),ZW=v.forwardRef((t,e)=>{let{open:n,onOpenChange:i,overlayClassName:s,contentClassName:o,container:l,...c}=t;return v.createElement(PW,{open:n,onOpenChange:i},v.createElement(NW,{container:l},v.createElement(IW,{"cmdk-overlay":"",className:s}),v.createElement(LW,{"aria-label":t.label,"cmdk-dialog":"",className:o},v.createElement(PI,{ref:e,...c}))))}),JW=v.forwardRef((t,e)=>Eo(n=>n.filtered.count===0)?v.createElement(Vo.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),eK=v.forwardRef((t,e)=>{let{progress:n,children:i,label:s="Loading...",...o}=t;return v.createElement(Vo.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Qm(t,l=>v.createElement("div",{"aria-hidden":!0},l)))}),oJ=Object.assign(PI,{List:QW,Item:YW,Input:$W,Group:GW,Separator:XW,Dialog:ZW,Empty:JW,Loading:eK});function tK(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function nK(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function NI(t){let e=v.useRef(t);return Al(()=>{e.current=t}),e}var Al=typeof window>"u"?v.useEffect:v.useLayoutEffect;function xa(t){let e=v.useRef();return e.current===void 0&&(e.current=t()),e}function Eo(t){let e=Bx(),n=()=>t(e.snapshot());return v.useSyncExternalStore(e.subscribe,n,n)}function II(t,e,n,i=[]){let s=v.useRef(),o=Vf();return Al(()=>{var l;let c=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),f=i.map(d=>d.trim());o.value(t,c,f),(l=e.current)==null||l.setAttribute(Sa,c),s.current=c}),s}var iK=()=>{let[t,e]=v.useState(),n=xa(()=>new Map);return Al(()=>{n.current.forEach(i=>i()),n.current=new Map},[t]),(i,s)=>{n.current.set(i,s),e({})}};function sK(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Qm({asChild:t,children:e},n){return t&&v.isValidElement(e)?v.cloneElement(sK(e),{ref:e.ref},n(e.props.children)):n(e)}var rK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const oK=1024;let lK=0;class Ji{constructor(e,n){this.from=e,this.to=n}}class St{constructor(e={}){this.id=lK++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=di.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}}St.closedBy=new St({deserialize:t=>t.split(" ")});St.openedBy=new St({deserialize:t=>t.split(" ")});St.group=new St({deserialize:t=>t.split(" ")});St.isolate=new St({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});St.contextHash=new St({perNode:!0});St.lookAhead=new St({perNode:!0});St.mounted=new St({perNode:!0});class Ua{constructor(e,n,i,s=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=s}static get(e){return e&&e.props&&e.props[St.mounted.id]}}const aK=Object.create(null);class di{constructor(e,n,i,s=0){this.name=e,this.props=n,this.id=i,this.flags=s}static define(e){let n=e.props&&e.props.length?Object.create(null):aK,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new di(e.name||"",n,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(s)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(St.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let s of i.split(" "))n[s]=e[i];return i=>{for(let s=i.prop(St.group),o=-1;o<(s?s.length:0);o++){let l=n[o<0?i.name:s[o]];if(l)return l}}}}di.none=new di("",Object.create(null),0,8);class Vx{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let s=null;for(let o of e){let l=o(i);if(l){s||(s=Object.assign({},i.props));let c=l[1],f=l[0];f.combine&&f.id in s&&(c=f.combine(s[f.id],c)),s[f.id]=c}}n.push(s?new di(i.name,s,i.id,i.flags):i)}return new Vx(n)}}const Vh=new WeakMap,QA=new WeakMap;var Qt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Qt||(Qt={}));class en{constructor(e,n,i,s,o){if(this.type=e,this.children=n,this.positions=i,this.length=s,this.props=null,o&&o.length){this.props=Object.create(null);for(let[l,c]of o)this.props[typeof l=="number"?l:l.id]=c}}toString(){let e=Ua.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let s=i.toString();s&&(n&&(n+=","),n+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Kp(this.topNode,e)}cursorAt(e,n=0,i=0){let s=Vh.get(this)||this.topNode,o=new Kp(s);return o.moveTo(e,n),Vh.set(this,o._tree),o}get topNode(){return new ni(this,0,0,null)}resolve(e,n=0){let i=sf(Vh.get(this)||this.topNode,e,n,!1);return Vh.set(this,i),i}resolveInner(e,n=0){let i=sf(QA.get(this)||this.topNode,e,n,!0);return QA.set(this,i),i}resolveStack(e,n=0){return fK(this,e,n)}iterate(e){let{enter:n,leave:i,from:s=0,to:o=this.length}=e,l=e.mode||0,c=(l&Qt.IncludeAnonymous)>0;for(let f=this.cursor(l|Qt.IncludeAnonymous);;){let d=!1;if(f.from<=o&&f.to>=s&&(!c&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&i&&(c||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Hx(di.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,s)=>new en(this.type,n,i,s,this.propValues),e.makeTree||((n,i,s)=>new en(di.none,n,i,s)))}static build(e){return dK(e)}}en.empty=new en(di.none,[],[],0);class zx{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new zx(this.buffer,this.index)}}class To{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return di.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],s=this.set.types[n],o=s.name;if(/\W/.test(o)&&!s.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let l=[];for(;e<i;)l.push(this.childString(e)),e=this.buffer[e+3];return o+"("+l.join(",")+")"}findChild(e,n,i,s,o){let{buffer:l}=this,c=-1;for(let f=e;f!=n&&!(LI(o,s,l[f+1],l[f+2])&&(c=f,i>0));f=l[f+3]);return c}slice(e,n,i){let s=this.buffer,o=new Uint16Array(n-e),l=0;for(let c=e,f=0;c<n;){o[f++]=s[c++],o[f++]=s[c++]-i;let d=o[f++]=s[c++]-i;o[f++]=s[c++]-e,l=Math.max(l,d)}return new To(o,l,this.set)}}function LI(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function sf(t,e,n,i){for(var s;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let l=!i&&t instanceof ni&&t.index<0?null:t.parent;if(!l)return t;t=l}let o=i?0:Qt.IgnoreOverlays;if(i)for(let l=t,c=l.parent;c;l=c,c=l.parent)l instanceof ni&&l.index<0&&((s=c.enter(e,n,o))===null||s===void 0?void 0:s.from)!=l.from&&(t=c);for(;;){let l=t.enter(e,n,o);if(!l)return t;t=l}}class BI{cursor(e=0){return new Kp(this,e)}getChild(e,n=null,i=null){let s=ZA(this,e,n,i);return s.length?s[0]:null}getChildren(e,n=null,i=null){return ZA(this,e,n,i)}resolve(e,n=0){return sf(this,e,n,!1)}resolveInner(e,n=0){return sf(this,e,n,!0)}matchContext(e){return Wb(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let s=n.lastChild;if(!s||s.to!=n.to)break;s.type.isError&&s.from==s.to?(i=n,n=s.prevSibling):n=s}return i}get node(){return this}get next(){return this.parent}}class ni extends BI{constructor(e,n,i,s){super(),this._tree=e,this.from=n,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,s,o=0){for(let l=this;;){for(let{children:c,positions:f}=l._tree,d=n>0?c.length:-1;e!=d;e+=n){let h=c[e],m=f[e]+l.from,g;if(!(!(o&Qt.EnterBracketed&&h instanceof en&&(g=Ua.get(h))&&!g.overlay&&g.bracketed&&i>=m&&i<=m+h.length)&&!LI(s,i,m,m+h.length))){if(h instanceof To){if(o&Qt.ExcludeBuffers)continue;let b=h.findChild(0,h.buffer.length,n,i-m,s);if(b>-1)return new Fs(new cK(l,h,e,m),null,b)}else if(o&Qt.IncludeAnonymous||!h.type.isAnonymous||_x(h)){let b;if(!(o&Qt.IgnoreMounts)&&(b=Ua.get(h))&&!b.overlay)return new ni(b.tree,m,e,l);let x=new ni(h,m,e,l);return o&Qt.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?h.children.length-1:0,n,i,s,o)}}}if(o&Qt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+n:e=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let s;if(!(i&Qt.IgnoreOverlays)&&(s=Ua.get(this._tree))&&s.overlay){let o=e-this.from,l=i&Qt.EnterBracketed&&s.bracketed;for(let{from:c,to:f}of s.overlay)if((n>0||l?c<=o:c<o)&&(n<0||l?f>=o:f>o))return new ni(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ZA(t,e,n,i){let s=t.cursor(),o=[];if(!s.firstChild())return o;if(n!=null){for(let l=!1;!l;)if(l=s.type.is(n),!s.nextSibling())return o}for(;;){if(i!=null&&s.type.is(i))return o;if(s.type.is(e)&&o.push(s.node),!s.nextSibling())return i==null?o:[]}}function Wb(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}class cK{constructor(e,n,i,s){this.parent=e,this.buffer=n,this.index=i,this.start=s}}class Fs extends BI{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.context.start,i);return o<0?null:new Fs(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Qt.ExcludeBuffers)return null;let{buffer:s}=this.context,o=s.findChild(this.index+4,s.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Fs(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fs(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Fs(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,s=this.index+4,o=i.buffer[this.index+3];if(o>s){let l=i.buffer[this.index+1];e.push(i.slice(s,o,l)),n.push(0)}return new en(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function VI(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let l=t[o];(l.from>n.from||l.to<n.to)&&(n=l,e=o)}let i=n instanceof ni&&n.index<0?null:n.parent,s=t.slice();return i?s[e]=i:s.splice(e,1),new uK(s,n)}class uK{constructor(e,n){this.heads=e,this.node=n}get next(){return VI(this.heads)}}function fK(t,e,n){let i=t.resolveInner(e,n),s=null;for(let o=i instanceof ni?i:i.context.parent;o;o=o.parent)if(o.index<0){let l=o.parent;(s||(s=[i])).push(l.resolve(e,n)),o=l}else{let l=Ua.get(o.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let c=new ni(l.tree,l.overlay[0].from+o.from,-1,o);(s||(s=[i])).push(sf(c,e,n,!1))}}return s?VI(s):i}class Kp{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Qt.EnterBracketed,e instanceof ni)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=n||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof ni?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:s}=this.buffer,o=s.findChild(this.index+4,s.buffer[this.index+3],e,n-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Qt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Qt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Qt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(n.findChild(s,this.index,-1,0,4))}else{let s=n.buffer[this.index+3];if(s<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(s.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:i}=s)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let o=n+e,l=e<0?-1:i._tree.children.length;o!=l;o+=e){let c=i._tree.children[o];if(this.mode&Qt.IncludeAnonymous||c instanceof To||!c.type.isAnonymous||_x(c))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let s=this.index,o=this.stack.length;o>=0;){for(let l=e;l;l=l._parent)if(l.index==s){if(s==this.index)return l;n=l,i=o+1;break e}s=this.stack[--o]}for(let s=i;s<this.stack.length;s++)n=new Fs(this.buffer,n,this.stack[s]);return this.bufferNode=new Fs(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&n&&n(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return Wb(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let s=e.length-1,o=this.stack.length-1;s>=0;o--){if(o<0)return Wb(this._tree,e,s);let l=i[n.buffer[this.stack[o]]];if(!l.isAnonymous){if(e[s]&&e[s]!=l.name)return!1;s--}}return!0}}function _x(t){return t.children.some(e=>e instanceof To||!e.type.isAnonymous||_x(e))}function dK(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:s=oK,reused:o=[],minRepeatType:l=i.types.length}=t,c=Array.isArray(n)?new zx(n,n.length):n,f=i.types,d=0,h=0;function m(O,A,k,P,B,z){let{id:q,start:W,end:F,size:_}=c,H=h,I=d;if(_<0)if(c.next(),_==-1){let le=o[q];k.push(le),P.push(W-O);return}else if(_==-3){d=q;return}else if(_==-4){h=q;return}else throw new RangeError(`Unrecognized record size: ${_}`);let L=f[q],K,Y,Z=W-O;if(F-W<=s&&(Y=C(c.pos-A,B))){let le=new Uint16Array(Y.size-Y.skip),V=c.pos-Y.size,U=le.length;for(;c.pos>V;)U=E(Y.start,le,U);K=new To(le,F-Y.start,i),Z=Y.start-O}else{let le=c.pos-_;c.next();let V=[],U=[],$=q>=l?q:-1,G=0,J=F;for(;c.pos>le;)$>=0&&c.id==$&&c.size>=0?(c.end<=J-s&&(x(V,U,W,G,c.end,J,$,H,I),G=V.length,J=c.end),c.next()):z>2500?g(W,le,V,U):m(W,le,V,U,$,z+1);if($>=0&&G>0&&G<V.length&&x(V,U,W,G,W,J,$,H,I),V.reverse(),U.reverse(),$>-1&&G>0){let fe=b(L,I);K=Hx(L,V,U,0,V.length,0,F-W,fe,fe)}else K=w(L,V,U,F-W,H-F,I)}k.push(K),P.push(Z)}function g(O,A,k,P){let B=[],z=0,q=-1;for(;c.pos>A;){let{id:W,start:F,end:_,size:H}=c;if(H>4)c.next();else{if(q>-1&&F<q)break;q<0&&(q=_-s),B.push(W,F,_),z++,c.next()}}if(z){let W=new Uint16Array(z*4),F=B[B.length-2];for(let _=B.length-3,H=0;_>=0;_-=3)W[H++]=B[_],W[H++]=B[_+1]-F,W[H++]=B[_+2]-F,W[H++]=H;k.push(new To(W,B[2]-F,i)),P.push(F-O)}}function b(O,A){return(k,P,B)=>{let z=0,q=k.length-1,W,F;if(q>=0&&(W=k[q])instanceof en){if(!q&&W.type==O&&W.length==B)return W;(F=W.prop(St.lookAhead))&&(z=P[q]+W.length+F)}return w(O,k,P,B,z,A)}}function x(O,A,k,P,B,z,q,W,F){let _=[],H=[];for(;O.length>P;)_.push(O.pop()),H.push(A.pop()+k-B);O.push(w(i.types[q],_,H,z-B,W-z,F)),A.push(B-k)}function w(O,A,k,P,B,z,q){if(z){let W=[St.contextHash,z];q=q?[W].concat(q):[W]}if(B>25){let W=[St.lookAhead,B];q=q?[W].concat(q):[W]}return new en(O,A,k,P,q)}function C(O,A){let k=c.fork(),P=0,B=0,z=0,q=k.end-s,W={size:0,start:0,skip:0};e:for(let F=k.pos-O;k.pos>F;){let _=k.size;if(k.id==A&&_>=0){W.size=P,W.start=B,W.skip=z,z+=4,P+=4,k.next();continue}let H=k.pos-_;if(_<0||H<F||k.start<q)break;let I=k.id>=l?4:0,L=k.start;for(k.next();k.pos>H;){if(k.size<0)if(k.size==-3||k.size==-4)I+=4;else break e;else k.id>=l&&(I+=4);k.next()}B=L,P+=_,z+=I}return(A<0||P==O)&&(W.size=P,W.start=B,W.skip=z),W.size>4?W:void 0}function E(O,A,k){let{id:P,start:B,end:z,size:q}=c;if(c.next(),q>=0&&P<l){let W=k;if(q>4){let F=c.pos-(q-4);for(;c.pos>F;)k=E(O,A,k)}A[--k]=W,A[--k]=z-O,A[--k]=B-O,A[--k]=P}else q==-3?d=P:q==-4&&(h=P);return k}let M=[],T=[];for(;c.pos>0;)m(t.start||0,t.bufferStart||0,M,T,-1,0);let D=(e=t.length)!==null&&e!==void 0?e:M.length?T[0]+M[0].length:0;return new en(f[t.topID],M.reverse(),T.reverse(),D)}const JA=new WeakMap;function sp(t,e){if(!t.isAnonymous||e instanceof To||e.type!=t)return 1;let n=JA.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof en)){n=1;break}n+=sp(t,i)}JA.set(e,n)}return n}function Hx(t,e,n,i,s,o,l,c,f){let d=0;for(let x=i;x<s;x++)d+=sp(t,e[x]);let h=Math.ceil(d*1.5/8),m=[],g=[];function b(x,w,C,E,M){for(let T=C;T<E;){let D=T,O=w[T],A=sp(t,x[T]);for(T++;T<E;T++){let k=sp(t,x[T]);if(A+k>=h)break;A+=k}if(T==D+1){if(A>h){let k=x[D];b(k.children,k.positions,0,k.children.length,w[D]+M);continue}m.push(x[D])}else{let k=w[T-1]+x[T-1].length-O;m.push(Hx(t,x,w,D,T,O,k,null,f))}g.push(O+M-o)}}return b(e,n,i,s,0),(c||f)(m,g,l)}class lJ{constructor(){this.map=new WeakMap}setBuffer(e,n,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(n,i)}getBuffer(e,n){let i=this.map.get(e);return i&&i.get(n)}set(e,n){e instanceof Fs?this.setBuffer(e.context.buffer,e.index,n):e instanceof ni&&this.map.set(e.tree,n)}get(e){return e instanceof Fs?this.getBuffer(e.context.buffer,e.index):e instanceof ni?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Rr{constructor(e,n,i,s,o=!1,l=!1){this.from=e,this.to=n,this.tree=i,this.offset=s,this.open=(o?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let s=[new Rr(0,e.length,e,0,!1,i)];for(let o of n)o.to>e.length&&s.push(o);return s}static applyChanges(e,n,i=128){if(!n.length)return e;let s=[],o=1,l=e.length?e[0]:null;for(let c=0,f=0,d=0;;c++){let h=c<n.length?n[c]:null,m=h?h.fromA:1e9;if(m-f>=i)for(;l&&l.from<m;){let g=l;if(f>=g.from||m<=g.to||d){let b=Math.max(g.from,f)-d,x=Math.min(g.to,m)-d;g=b>=x?null:new Rr(b,x,g.tree,g.offset+d,c>0,!!h)}if(g&&s.push(g),l.to>m)break;l=o<e.length?e[o++]:null}if(!h)break;f=h.toA,d=h.toA-h.toB}return s}}class zI{startParse(e,n,i){return typeof e=="string"&&(e=new hK(e)),i=i?i.length?i.map(s=>new Ji(s.from,s.to)):[new Ji(0,0)]:[new Ji(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let s=this.startParse(e,n,i);for(;;){let o=s.advance();if(o)return o}}}class hK{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function aJ(t){return(e,n,i,s)=>new mK(e,t,n,i,s)}class eM{constructor(e,n,i,s,o,l){this.parser=e,this.parse=n,this.overlay=i,this.bracketed=s,this.target=o,this.from=l}}function tM(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class pK{constructor(e,n,i,s,o,l,c,f){this.parser=e,this.predicate=n,this.mounts=i,this.index=s,this.start=o,this.bracketed=l,this.target=c,this.prev=f,this.depth=0,this.ranges=[]}}const Kb=new St({perNode:!0});class mK{constructor(e,n,i,s,o){this.nest=n,this.input=i,this.fragments=s,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new en(i.type,i.children,i.positions,i.length,i.propValues.concat([[Kb,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[St.mounted.id]=new Ua(n,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new vK(this.fragments),n=null,i=null,s=new Kp(new ni(this.baseTree,this.ranges[0].from,0,null),Qt.IncludeAnonymous|Qt.IgnoreMounts);e:for(let o,l;;){let c=!0,f;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)c=!1;else if(e.hasNode(s)){if(n){let d=n.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(d)for(let h of d.mount.overlay){let m=h.from+d.pos,g=h.to+d.pos;m>=s.from&&g<=s.to&&!n.ranges.some(b=>b.from<g&&b.to>m)&&n.ranges.push({from:m,to:g})}}c=!1}else if(i&&(l=gK(i.ranges,s.from,s.to)))c=l!=2;else if(!s.type.isAnonymous&&(o=this.nest(s,this.input))&&(s.from<s.to||!o.overlay)){s.tree||(yK(s),n&&n.depth++,i&&i.depth++);let d=e.findMounts(s.from,o.parser);if(typeof o.overlay=="function")n=new pK(o.parser,o.overlay,d,this.inner.length,s.from,!!o.bracketed,s.tree,n);else{let h=sM(this.ranges,o.overlay||(s.from<s.to?[new Ji(s.from,s.to)]:[]));h.length&&tM(h),(h.length||!o.overlay)&&this.inner.push(new eM(o.parser,h.length?o.parser.startParse(this.input,rM(d,h),h):o.parser.startParse(""),o.overlay?o.overlay.map(m=>new Ji(m.from-s.from,m.to-s.from)):null,!!o.bracketed,s.tree,h.length?h[0].from:s.from)),o.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):c=!1}}else if(n&&(f=n.predicate(s))&&(f===!0&&(f=new Ji(s.from,s.to)),f.from<f.to)){let d=n.ranges.length-1;d>=0&&n.ranges[d].to==f.from?n.ranges[d]={from:n.ranges[d].from,to:f.to}:n.ranges.push(f)}if(c&&s.firstChild())n&&n.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(n&&!--n.depth){let d=sM(this.ranges,n.ranges);d.length&&(tM(d),this.inner.splice(n.index,0,new eM(n.parser,n.parser.startParse(this.input,rM(n.mounts,d),d),n.ranges.map(h=>new Ji(h.from-n.start,h.to-n.start)),n.bracketed,n.target,d[0].from))),n=n.prev}i&&!--i.depth&&(i=i.prev)}}}}function gK(t,e,n){for(let i of t){if(i.from>=n)break;if(i.to>e)return i.from<=e&&i.to>=n?2:1}return 0}function nM(t,e,n,i,s,o){if(e<n){let l=t.buffer[e+1];i.push(t.slice(e,n,l)),s.push(l-o)}}function yK(t){let{node:e}=t,n=[],i=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let s=t.tree,o=s.children.indexOf(i),l=s.children[o],c=l.buffer,f=[o];function d(h,m,g,b,x,w){let C=n[w],E=[],M=[];nM(l,h,C,E,M,b);let T=c[C+1],D=c[C+2];f.push(E.length);let O=w?d(C+4,c[C+3],l.set.types[c[C]],T,D-T,w-1):e.toTree();return E.push(O),M.push(T-b),nM(l,c[C+3],m,E,M,b),new en(g,E,M,x)}s.children[o]=d(0,c.length,di.none,0,l.length,n.length-1);for(let h of f){let m=t.tree.children[h],g=t.tree.positions[h];t.yield(new ni(m,g+t.from,h,t._tree))}}class iM{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Qt.IncludeAnonymous|Qt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,i=e-this.offset;for(;!this.done&&n.from<i;)n.to>=e&&n.enter(i,1,Qt.IgnoreOverlays|Qt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof en)n=n.children[0];else break}return!1}}class vK{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(n=i.tree.prop(Kb))!==null&&n!==void 0?n:i.to,this.inner=new iM(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(Kb))!==null&&e!==void 0?e:n.to,this.inner=new iM(n.tree,-n.offset)}}findMounts(e,n){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let l=(i=o.tree)===null||i===void 0?void 0:i.prop(St.mounted);if(l&&l.parser==n)for(let c=this.fragI;c<this.fragments.length;c++){let f=this.fragments[c];if(f.from>=o.to)break;f.tree==this.curFrag.tree&&s.push({frag:f,pos:o.from-f.offset,mount:l})}}}return s}}function sM(t,e){let n=null,i=e;for(let s=1,o=0;s<t.length;s++){let l=t[s-1].to,c=t[s].from;for(;o<i.length;o++){let f=i[o];if(f.from>=c)break;f.to<=l||(n||(i=n=e.slice()),f.from<l?(n[o]=new Ji(f.from,l),f.to>c&&n.splice(o+1,0,new Ji(c,f.to))):f.to>c?n[o--]=new Ji(c,f.to):n.splice(o--,1))}}return i}function bK(t,e,n,i){let s=0,o=0,l=!1,c=!1,f=-1e9,d=[];for(;;){let h=s==t.length?1e9:l?t[s].to:t[s].from,m=o==e.length?1e9:c?e[o].to:e[o].from;if(l!=c){let g=Math.max(f,n),b=Math.min(h,m,i);g<b&&d.push(new Ji(g,b))}if(f=Math.min(h,m),f==1e9)break;h==f&&(l?(l=!1,s++):l=!0),m==f&&(c?(c=!1,o++):c=!0)}return d}function rM(t,e){let n=[];for(let{pos:i,mount:s,frag:o}of t){let l=i+(s.overlay?s.overlay[0].from:0),c=l+s.tree.length,f=Math.max(o.from,l),d=Math.min(o.to,c);if(s.overlay){let h=s.overlay.map(g=>new Ji(g.from+i,g.to+i)),m=bK(e,h,f,d);for(let g=0,b=f;;g++){let x=g==m.length,w=x?d:m[g].from;if(w>b&&n.push(new Rr(b,w,s.tree,-l,o.from>=b||o.openStart,o.to<=w||o.openEnd)),x)break;b=m[g].to}}else n.push(new Rr(f,d,s.tree,-l,o.from>=l||o.openStart,o.to<=c||o.openEnd))}return n}let SK=0;class $i{constructor(e,n,i,s){this.name=e,this.set=n,this.base=i,this.modified=s,this.id=SK++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof $i&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new $i(i,[],null,[]);if(s.set.push(s),n)for(let o of n.set)s.set.push(o);return s}static defineModifier(e){let n=new qp(e);return i=>i.modified.indexOf(n)>-1?i:qp.get(i.base||i,i.modified.concat(n).sort((s,o)=>s.id-o.id))}}let xK=0;class qp{constructor(e){this.name=e,this.instances=[],this.id=xK++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(c=>c.base==e&&wK(n,c.modified));if(i)return i;let s=[],o=new $i(e.name,s,e,n);for(let c of n)c.instances.push(o);let l=CK(n);for(let c of e.set)if(!c.modified.length)for(let f of l)s.push(qp.get(c,f));return o}}function wK(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function CK(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,s=e.length;i<s;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function EK(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let s of n.split(" "))if(s){let o=[],l=2,c=s;for(let m=0;;){if(c=="..."&&m>0&&m+3==s.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(c);if(!g)throw new RangeError("Invalid path: "+s);if(o.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),m+=g[0].length,m==s.length)break;let b=s[m++];if(m==s.length&&b=="!"){l=0;break}if(b!="/")throw new RangeError("Invalid path: "+s);c=s.slice(m)}let f=o.length-1,d=o[f];if(!d)throw new RangeError("Invalid path: "+s);let h=new rf(i,l,f>0?o.slice(0,f):null);e[d]=h.sort(e[d])}}return _I.add(e)}const _I=new St({combine(t,e){let n,i,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),n&&n.mode==s.mode&&!s.context&&!n.context)continue;let o=new rf(s.tags,s.mode,s.context);n?n.next=o:i=o,n=o}return i}});class rf{constructor(e,n,i,s){this.tags=e,this.mode=n,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}rf.empty=new rf([],2,null);function HI(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let l of o.tag)n[l.id]=o.class;let{scope:i,all:s=null}=e||{};return{style:o=>{let l=s;for(let c of o)for(let f of c.set){let d=n[f.id];if(d){l=l?l+" "+d:d;break}}return l},scope:i}}function TK(t,e){let n=null;for(let i of t){let s=i.style(e);s&&(n=n?n+" "+s:s)}return n}function RK(t,e,n,i=0,s=t.length){let o=new AK(i,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),i,s,"",o.highlighters),o.flush(s)}class AK{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,s,o){let{type:l,from:c,to:f}=e;if(c>=i||f<=n)return;l.isTop&&(o=this.highlighters.filter(b=>!b.scope||b.scope(l)));let d=s,h=MK(e)||rf.empty,m=TK(o,h.tags);if(m&&(d&&(d+=" "),d+=m,h.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,c),d),h.opaque)return;let g=e.tree&&e.tree.prop(St.mounted);if(g&&g.overlay){let b=e.node.enter(g.overlay[0].from+c,1),x=this.highlighters.filter(C=>!C.scope||C.scope(g.tree.type)),w=e.firstChild();for(let C=0,E=c;;C++){let M=C<g.overlay.length?g.overlay[C]:null,T=M?M.from+c:f,D=Math.max(n,E),O=Math.min(i,T);if(D<O&&w)for(;e.from<O&&(this.highlightRange(e,D,O,s,o),this.startSpan(Math.min(O,e.to),d),!(e.to>=T||!e.nextSibling())););if(!M||T>i)break;E=M.to+c,E>n&&(this.highlightRange(b.cursor(),Math.max(n,M.from+c),Math.min(i,E),"",x),this.startSpan(Math.min(i,E),d))}w&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,s,o),this.startSpan(Math.min(i,e.to),d)}while(e.nextSibling());e.parent()}}}function MK(t){let e=t.type.prop(_I);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Re=$i.define,zh=Re(),lo=Re(),oM=Re(lo),lM=Re(lo),ao=Re(),_h=Re(ao),yv=Re(ao),Ns=Re(),rl=Re(Ns),ks=Re(),Ps=Re(),qb=Re(),fu=Re(qb),Hh=Re(),Me={comment:zh,lineComment:Re(zh),blockComment:Re(zh),docComment:Re(zh),name:lo,variableName:Re(lo),typeName:oM,tagName:Re(oM),propertyName:lM,attributeName:Re(lM),className:Re(lo),labelName:Re(lo),namespace:Re(lo),macroName:Re(lo),literal:ao,string:_h,docString:Re(_h),character:Re(_h),attributeValue:Re(_h),number:yv,integer:Re(yv),float:Re(yv),bool:Re(ao),regexp:Re(ao),escape:Re(ao),color:Re(ao),url:Re(ao),keyword:ks,self:Re(ks),null:Re(ks),atom:Re(ks),unit:Re(ks),modifier:Re(ks),operatorKeyword:Re(ks),controlKeyword:Re(ks),definitionKeyword:Re(ks),moduleKeyword:Re(ks),operator:Ps,derefOperator:Re(Ps),arithmeticOperator:Re(Ps),logicOperator:Re(Ps),bitwiseOperator:Re(Ps),compareOperator:Re(Ps),updateOperator:Re(Ps),definitionOperator:Re(Ps),typeOperator:Re(Ps),controlOperator:Re(Ps),punctuation:qb,separator:Re(qb),bracket:fu,angleBracket:Re(fu),squareBracket:Re(fu),paren:Re(fu),brace:Re(fu),content:Ns,heading:rl,heading1:Re(rl),heading2:Re(rl),heading3:Re(rl),heading4:Re(rl),heading5:Re(rl),heading6:Re(rl),contentSeparator:Re(Ns),list:Re(Ns),quote:Re(Ns),emphasis:Re(Ns),strong:Re(Ns),link:Re(Ns),monospace:Re(Ns),strikethrough:Re(Ns),inserted:Re(),deleted:Re(),changed:Re(),invalid:Re(),meta:Hh,documentMeta:Re(Hh),annotation:Re(Hh),processingInstruction:Re(Hh),definition:$i.defineModifier("definition"),constant:$i.defineModifier("constant"),function:$i.defineModifier("function"),standard:$i.defineModifier("standard"),local:$i.defineModifier("local"),special:$i.defineModifier("special")};for(let t in Me){let e=Me[t];e instanceof $i&&(e.name=t)}const cJ=HI([{tag:Me.link,class:"tok-link"},{tag:Me.heading,class:"tok-heading"},{tag:Me.emphasis,class:"tok-emphasis"},{tag:Me.strong,class:"tok-strong"},{tag:Me.keyword,class:"tok-keyword"},{tag:Me.atom,class:"tok-atom"},{tag:Me.bool,class:"tok-bool"},{tag:Me.url,class:"tok-url"},{tag:Me.labelName,class:"tok-labelName"},{tag:Me.inserted,class:"tok-inserted"},{tag:Me.deleted,class:"tok-deleted"},{tag:Me.literal,class:"tok-literal"},{tag:Me.string,class:"tok-string"},{tag:Me.number,class:"tok-number"},{tag:[Me.regexp,Me.escape,Me.special(Me.string)],class:"tok-string2"},{tag:Me.variableName,class:"tok-variableName"},{tag:Me.local(Me.variableName),class:"tok-variableName tok-local"},{tag:Me.definition(Me.variableName),class:"tok-variableName tok-definition"},{tag:Me.special(Me.variableName),class:"tok-variableName2"},{tag:Me.definition(Me.propertyName),class:"tok-propertyName tok-definition"},{tag:Me.typeName,class:"tok-typeName"},{tag:Me.namespace,class:"tok-namespace"},{tag:Me.className,class:"tok-className"},{tag:Me.macroName,class:"tok-macroName"},{tag:Me.propertyName,class:"tok-propertyName"},{tag:Me.operator,class:"tok-operator"},{tag:Me.comment,class:"tok-comment"},{tag:Me.meta,class:"tok-meta"},{tag:Me.invalid,class:"tok-invalid"},{tag:Me.punctuation,class:"tok-punctuation"}]);var vv;const pl=new St;function FI(t){return He.define({combine:t?e=>e.concat(t):void 0})}const OK=new St;class Bi{constructor(e,n,i=[],s=""){this.data=e,this.name=s,Ut.prototype.hasOwnProperty("tree")||Object.defineProperty(Ut.prototype,"tree",{get(){return os(this)}}),this.parser=n,this.extension=[nc.of(this),Ut.languageData.of((o,l,c)=>{let f=aM(o,l,c),d=f.type.prop(pl);if(!d)return[];let h=o.facet(d),m=f.type.prop(OK);if(m){let g=f.resolve(l-f.from,c);for(let b of m)if(b.test(g,o)){let x=o.facet(b.facet);return b.type=="replace"?x:x.concat(h)}}return h})].concat(i)}isActiveAt(e,n,i=-1){return aM(e,n,i).type.prop(pl)==this.data}findRegions(e){let n=e.facet(nc);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],s=(o,l)=>{if(o.prop(pl)==this.data){i.push({from:l,to:l+o.length});return}let c=o.prop(St.mounted);if(c){if(c.tree.prop(pl)==this.data){if(c.overlay)for(let f of c.overlay)i.push({from:f.from+l,to:f.to+l});else i.push({from:l,to:l+o.length});return}else if(c.overlay){let f=i.length;if(s(c.tree,c.overlay[0].from+l),i.length>f)return}}for(let f=0;f<o.children.length;f++){let d=o.children[f];d instanceof en&&s(d,o.positions[f]+l)}};return s(os(e),0),i}get allowsNesting(){return!0}}Bi.setState=Jt.define();function aM(t,e,n){let i=t.facet(nc),s=os(t).topNode;if(!i||i.allowsNesting)for(let o=s;o;o=o.enter(e,n,Qt.ExcludeBuffers|Qt.EnterBracketed))o.type.isTop&&(s=o);return s}class Yb extends Bi{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=FI(e.languageData);return new Yb(n,e.parser.configure({props:[pl.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new Yb(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function os(t){let e=t.field(Bi.state,!1);return e?e.tree:en.empty}function DK(t,e,n=50){var i;let s=(i=t.field(Bi.state,!1))===null||i===void 0?void 0:i.context;if(!s)return null;let o=s.viewport;s.updateViewport({from:0,to:e});let l=s.isDone(e)||s.work(n,e)?s.tree:null;return s.updateViewport(o),l}function uJ(t,e=t.viewport.to,n=100){let i=DK(t.state,e,n);return i!=os(t.state)&&t.dispatch({}),!!i}class kK{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}}let du=null;class ec{constructor(e,n,i=[],s,o,l,c,f){this.parser=e,this.state=n,this.fragments=i,this.tree=s,this.treeLen=o,this.viewport=l,this.skipped=c,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new ec(e,n,[],en.empty,0,i,[],null)}startParse(){return this.parser.startParse(new kK(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=en.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Rr.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Rr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=du;du=this;try{return e()}finally{du=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=cM(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:s,treeLen:o,viewport:l,skipped:c}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,h,m,g)=>f.push({fromA:d,toA:h,fromB:m,toB:g})),i=Rr.applyChanges(i,f),s=en.empty,o=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){c=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),m=e.mapPos(d.to,-1);h<m&&c.push({from:h,to:m})}}}return new ec(this.parser,n,i,s,o,l,c,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:o}=this.skipped[i];s<e.to&&o>e.from&&(this.fragments=cM(this.fragments,s,o),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends zI{createParse(n,i,s){let o=s[0].from,l=s[s.length-1].to;return{parsedPos:o,advance(){let f=du;if(f){for(let d of s)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=l,new en(di.none,[],[],l-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return du}}function cM(t,e,n){return Rr.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class tc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new tc(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=ec.create(e.facet(nc).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new tc(i)}}Bi.state=tr.define({create:tc.init,update(t,e){for(let n of e.effects)if(n.is(Bi.setState))return n.value;return e.startState.facet(nc)!=e.state.facet(nc)?tc.init(e.state):t.apply(e)}});let UI=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(UI=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const bv=typeof navigator<"u"&&(!((vv=navigator.scheduling)===null||vv===void 0)&&vv.isInputPending)?()=>navigator.scheduling.isInputPending():null,PK=ys.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Bi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Bi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=UI(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,o=i.field(Bi.state);if(o.tree==o.context.tree&&o.context.isDone(s+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!bv?Math.max(25,e.timeRemaining()-5):1e9),c=o.context.treeLen<s&&i.doc.length>s+1e3,f=o.context.work(()=>bv&&bv()||Date.now()>l,s+(c?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Bi.setState.of(new tc(o.context))})),this.chunkBudget>0&&!(f&&!c)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Hs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),nc=He.define({combine(t){return t.length?t[0]:null},enables:t=>[Bi.state,PK,Je.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class dJ{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class jI{constructor(e,n,i,s,o,l=void 0){this.name=e,this.alias=n,this.extensions=i,this.filename=s,this.loadFunc=o,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:i}=e;if(!n){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(i)}return new jI(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,n,i)}static matchFilename(e,n){for(let s of e)if(s.filename&&s.filename.test(n))return s;let i=/\.([^.]+)$/.exec(n);if(i){for(let s of e)if(s.extensions.indexOf(i[1])>-1)return s}return null}static matchLanguageName(e,n,i=!0){n=n.toLowerCase();for(let s of e)if(s.alias.some(o=>o==n))return s;if(i)for(let s of e)for(let o of s.alias){let l=n.indexOf(o);if(l>-1&&(o.length>2||!/\w/.test(n[l-1])&&!/\w/.test(n[l+o.length])))return s}return null}}const NK=He.define(),Fx=He.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Ml(t){let e=t.facet(Fx);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Yp(t,e){let n="",i=t.tabSize,s=t.facet(Fx)[0];if(s==" "){for(;e>=i;)n+=" ",e-=i;s=" "}for(let o=0;o<e;o++)n+=s;return n}function WI(t,e){t instanceof Ut&&(t=new Zm(t));for(let i of t.state.facet(NK)){let s=i(t,e);if(s!==void 0)return s}let n=os(t.state);return n.length>=e?IK(t,n,e):null}class Zm{constructor(e,n={}){this.state=e,this.options=n,this.unit=Ml(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:o}=this.options;return s!=null&&s>=i.from&&s<=i.to?o&&s==e?{text:"",from:e}:(n<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(e,n);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,n=1){let{text:i,from:s}=this.lineAt(e,n),o=this.countColumn(i,e-s),l=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return l>-1&&(o+=l-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,n=e.length){return Bm(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:s}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let l=o(s);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const KI=new St;function IK(t,e,n){let i=e.resolveStack(n),s=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(s!=i.node){let o=[];for(let l=s;l&&!(l.from<i.node.from||l.to>i.node.to||l.from==i.node.from&&l.type==i.node.type);l=l.parent)o.push(l);for(let l=o.length-1;l>=0;l--)i={node:o[l],next:i}}return qI(i,t,n)}function qI(t,e,n){for(let i=t;i;i=i.next){let s=BK(i.node);if(s)return s(Ux.create(e,n,i))}return 0}function LK(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function BK(t){let e=t.type.prop(KI);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(St.closedBy))){let s=t.lastChild,o=s&&i.indexOf(s.name)>-1;return l=>YI(l,!0,1,void 0,o&&!LK(l)?s.from:void 0)}return t.parent==null?VK:null}function VK(){return 0}class Ux extends Zm{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new Ux(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(zK(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return qI(this.context.next,this.base,this.pos)}}function zK(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function _K(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let s=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),l=s==null||s<=o.from?o.to:Math.min(o.to,s);for(let c=n.to;;){let f=e.childAfter(c);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=l)return null;let d=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+d}}c=f.to}}function hJ({closing:t,align:e=!0,units:n=1}){return i=>YI(i,e,n,t)}function YI(t,e,n,i,s){let o=t.textAfter,l=o.match(/^\s*/)[0].length,c=i&&o.slice(l,l+i.length)==i||s==t.pos+l,f=e?_K(t):null;return f?c?t.column(f.from):t.column(f.to):t.baseIndent+(c?0:t.unit*n)}const pJ=t=>t.baseIndent;function mJ({except:t,units:e=1}={}){return n=>{let i=t&&t.test(n.textAfter);return n.baseIndent+(i?0:e*n.unit)}}const HK=He.define(),FK=new St;function gJ(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function UK(t,e,n){let i=os(t);if(i.length<n)return null;let s=i.resolveStack(n,1),o=null;for(let l=s;l;l=l.next){let c=l.node;if(c.to<=n||c.from>n)continue;if(o&&c.from<e)break;let f=c.type.prop(FK);if(f&&(c.to<i.length-50||i.length==t.doc.length||!jK(c))){let d=f(c,t);d&&d.from<=n&&d.from>=e&&d.to>n&&(o=d)}}return o}function jK(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function WK(t,e,n){for(let i of t.facet(HK)){let s=i(t,e,n);if(s)return s}return UK(t,e,n)}function GI(t,e){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);return n>=i?void 0:{from:n,to:i}}const XI=Jt.define({map:GI}),$I=Jt.define({map:GI});function KK(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(i=>i.from<=n&&i.to>=n)||e.push(t.lineBlockAt(n));return e}const jx=tr.define({create(){return nn.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=uM(t,n,i)),t=t.map(e.changes);for(let n of e.effects)if(n.is(XI)&&!YK(t,n.value.from,n.value.to)){let{preparePlaceholder:i}=e.state.facet(QI),s=i?nn.replace({widget:new ZK(i(e.state,n.value))}):fM;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is($I)&&(t=t.update({filter:(i,s)=>n.value.from!=i||n.value.to!=s,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=uM(t,e.selection.main.head)),t},provide:t=>Je.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(i,s)=>{n.push(i,s)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let i=t[n++],s=t[n++];if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(fM.range(i,s))}return nn.set(e,!0)}});function uM(t,e,n=e){let i=!1;return t.between(e,n,(s,o)=>{s<n&&o>e&&(i=!0)}),i?t.update({filterFrom:e,filterTo:n,filter:(s,o)=>s>=n||o<=e}):t}function qK(t,e,n){var i;let s=null;return(i=t.field(jx,!1))===null||i===void 0||i.between(e,n,(o,l)=>{(!s||s.from>o)&&(s={from:o,to:l})}),s}function YK(t,e,n){let i=!1;return t.between(e,e,(s,o)=>{s==e&&o==n&&(i=!0)}),i}function GK(t,e){return t.field(jx,!1)?e:e.concat(Jt.appendConfig.of(QK()))}const yJ=t=>{for(let e of KK(t)){let n=WK(t.state,e.from,e.to);if(n)return t.dispatch({effects:GK(t.state,[XI.of(n),XK(t,n)])}),!0}return!1};function XK(t,e,n=!0){let i=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Je.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${t.state.phrase("to")} ${s}.`)}const $K={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},QI=He.define({combine(t){return Lm(t,$K)}});function QK(t){return[jx,JK]}function ZI(t,e){let{state:n}=t,i=n.facet(QI),s=l=>{let c=t.lineBlockAt(t.posAtDOM(l.target)),f=qK(t.state,c.from,c.to);f&&t.dispatch({effects:$I.of(f)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(t,s,e);let o=document.createElement("span");return o.textContent=i.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=s,o}const fM=nn.replace({widget:new class extends Ol{toDOM(t){return ZI(t,null)}}});class ZK extends Ol{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ZI(e,this.value)}}const JK=Je.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Jm{constructor(e,n){this.specs=e;let i;function s(c){let f=So.newName();return(i||(i=Object.create(null)))["."+f]=c,f}const o=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,l=n.scope;this.scope=l instanceof Bi?c=>c.prop(pl)==l.data:l?c=>c==l:void 0,this.style=HI(e.map(c=>({tag:c.tag,class:c.class||s(Object.assign({},c,{tag:null}))})),{all:o}).style,this.module=i?new So(i):null,this.themeType=n.themeType}static define(e,n){return new Jm(e,n||{})}}const Gb=He.define(),JI=He.define({combine(t){return t.length?[t[0]]:null}});function Sv(t){let e=t.facet(Gb);return e.length?e:t.facet(JI)}function vJ(t,e){let n=[tq],i;return t instanceof Jm&&(t.module&&n.push(Je.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(JI.of(t)):i?n.push(Gb.computeN([Je.darkTheme],s=>s.facet(Je.darkTheme)==(i=="dark")?[t]:[])):n.push(Gb.of(t)),n}class eq{constructor(e){this.markCache=Object.create(null),this.tree=os(e.state),this.decorations=this.buildDeco(e,Sv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=os(e.state),i=Sv(e.state),s=i!=Sv(e.startState),{viewport:o}=e.view,l=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!s&&n.type==this.tree.type&&l>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(n!=this.tree||e.viewportChanged||s)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return nn.none;let i=new Yu;for(let{from:s,to:o}of e.visibleRanges)RK(this.tree,n,(l,c,f)=>{i.add(l,c,this.markCache[f]||(this.markCache[f]=nn.mark({class:f})))},s,o);return i.finish()}}const tq=Nm.high(ys.fromClass(eq,{decorations:t=>t.decorations})),bJ=Jm.define([{tag:Me.meta,color:"#404740"},{tag:Me.link,textDecoration:"underline"},{tag:Me.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Me.emphasis,fontStyle:"italic"},{tag:Me.strong,fontWeight:"bold"},{tag:Me.strikethrough,textDecoration:"line-through"},{tag:Me.keyword,color:"#708"},{tag:[Me.atom,Me.bool,Me.url,Me.contentSeparator,Me.labelName],color:"#219"},{tag:[Me.literal,Me.inserted],color:"#164"},{tag:[Me.string,Me.deleted],color:"#a11"},{tag:[Me.regexp,Me.escape,Me.special(Me.string)],color:"#e40"},{tag:Me.definition(Me.variableName),color:"#00f"},{tag:Me.local(Me.variableName),color:"#30a"},{tag:[Me.typeName,Me.namespace],color:"#085"},{tag:Me.className,color:"#167"},{tag:[Me.special(Me.variableName),Me.macroName],color:"#256"},{tag:Me.definition(Me.propertyName),color:"#00c"},{tag:Me.comment,color:"#940"},{tag:Me.invalid,color:"#f00"}]),nq=1e4,iq="()[]{}",sq=new St;function Xb(t,e,n){let i=t.prop(e<0?St.openedBy:St.closedBy);if(i)return i;if(t.name.length==1){let s=n.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[n[s+e]]}return null}function $b(t){let e=t.type.prop(sq);return e?e(t.node):t}function Ta(t,e,n,i={}){let s=i.maxScanDistance||nq,o=i.brackets||iq,l=os(t),c=l.resolveInner(e,n);for(let f=c;f;f=f.parent){let d=Xb(f.type,n,o);if(d&&f.from<f.to){let h=$b(f);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return rq(t,e,n,f,h,d,o)}}return oq(t,e,n,l,c.type,s,o)}function rq(t,e,n,i,s,o,l){let c=i.parent,f={from:s.from,to:s.to},d=0,h=c?.cursor();if(h&&(n<0?h.childBefore(i.from):h.childAfter(i.to)))do if(n<0?h.to<=i.from:h.from>=i.to){if(d==0&&o.indexOf(h.type.name)>-1&&h.from<h.to){let m=$b(h);return{start:f,end:m?{from:m.from,to:m.to}:void 0,matched:!0}}else if(Xb(h.type,n,l))d++;else if(Xb(h.type,-n,l)){if(d==0){let m=$b(h);return{start:f,end:m&&m.from<m.to?{from:m.from,to:m.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:f,matched:!1}}function oq(t,e,n,i,s,o,l){let c=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=l.indexOf(c);if(f<0||f%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!h.next().done&&g<=o;){let b=h.value;n<0&&(g+=b.length);let x=e+g*n;for(let w=n>0?0:b.length-1,C=n>0?b.length:-1;w!=C;w+=n){let E=l.indexOf(b[w]);if(!(E<0||i.resolveInner(x+w,1).type!=s))if(E%2==0==n>0)m++;else{if(m==1)return{start:d,end:{from:x+w,to:x+w+1},matched:E>>1==f>>1};m--}}n>0&&(g+=b.length)}return h.done?{start:d,matched:!1}:null}function dM(t,e,n,i=0,s=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=s;for(let l=i;l<e;l++)t.charCodeAt(l)==9?o+=n-o%n:o++;return o}class eL{constructor(e,n,i,s){this.string=e,this.tabSize=n,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),i;if(typeof e=="string"?i=n==e:i=n&&(e instanceof RegExp?e.test(n):e(n)),i)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=dM(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:dM(this.string,null,this.tabSize)}match(e,n,i){if(typeof e=="string"){let s=l=>i?l.toLowerCase():l,o=this.string.substr(this.pos,e.length);return s(o)==s(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&n!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function lq(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||aq,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||Kx,mergeTokens:t.mergeTokens!==!1}}function aq(t){if(typeof t!="object")return t;let e={};for(let n in t){let i=t[n];e[n]=i instanceof Array?i.slice():i}return e}const hM=new WeakMap;class tL extends Bi{constructor(e){let n=FI(e.languageData),i=lq(e),s,o=new class extends zI{createParse(l,c,f){return new uq(s,l,c,f)}};super(n,o,[],e.name),this.topNode=hq(n,this),s=this,this.streamParser=i,this.stateAfter=new St({perNode:!0}),this.tokenTable=e.tokenTable?new rL(i.tokenTable):dq}static define(e){return new tL(e)}getIndent(e){let n,{overrideIndentation:i}=e.options;i&&(n=hM.get(e.state),n!=null&&n<e.pos-1e4&&(n=void 0));let s=Wx(this,e.node.tree,e.node.from,e.node.from,n??e.pos),o,l;if(s?(l=s.state,o=s.pos+1):(l=this.streamParser.startState(e.unit),o=e.node.from),e.pos-o>1e4)return null;for(;o<e.pos;){let f=e.state.doc.lineAt(o),d=Math.min(e.pos,f.to);if(f.length){let h=i?i(f.from):-1,m=new eL(f.text,e.state.tabSize,e.unit,h<0?void 0:h);for(;m.pos<d-f.from;)iL(this.streamParser.token,m,l)}else this.streamParser.blankLine(l,e.unit);if(d==e.pos)break;o=f.to+1}let c=e.lineAt(e.pos);return i&&n==null&&hM.set(e.state,c.from),this.streamParser.indent(l,/^\s*(.*)/.exec(c.text)[1],e)}get allowsNesting(){return!1}}function Wx(t,e,n,i,s){let o=n>=i&&n+e.length<=s&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let l=e.children.length-1;l>=0;l--){let c=e.children[l],f=n+e.positions[l],d=c instanceof en&&f<s&&Wx(t,c,f,i,s);if(d)return d}return null}function nL(t,e,n,i,s){if(s&&n<=0&&i>=e.length)return e;!s&&n==0&&e.type==t.topNode&&(s=!0);for(let o=e.children.length-1;o>=0;o--){let l=e.positions[o],c=e.children[o],f;if(l<i&&c instanceof en){if(!(f=nL(t,c,n-l,i-l,s)))break;return s?new en(e.type,e.children.slice(0,o).concat(f),e.positions.slice(0,o+1),l+f.length):f}}return null}function cq(t,e,n,i,s){for(let o of e){let l=o.from+(o.openStart?25:0),c=o.to-(o.openEnd?25:0),f=l<=n&&c>n&&Wx(t,o.tree,0-o.offset,n,c),d;if(f&&f.pos<=i&&(d=nL(t,o.tree,n+o.offset,f.pos+o.offset,!1)))return{state:f.state,tree:d}}return{state:t.streamParser.startState(s?Ml(s):4),tree:en.empty}}class uq{constructor(e,n,i,s){this.lang=e,this.input=n,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let o=ec.get(),l=s[0].from,{state:c,tree:f}=cq(e,i,l,this.to,o?.state);this.state=c,this.parsedPos=this.chunkStart=l+f.length;for(let d=0;d<f.children.length;d++)this.chunks.push(f.children[d]),this.chunkPos.push(f.positions[d]);o&&this.parsedPos<o.viewport.from-1e5&&s.some(d=>d.from<=o.viewport.from&&d.to>=o.viewport.from)&&(this.state=this.lang.streamParser.startState(Ml(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=ec.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(n,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
68
+ `&&(n="");else{let i=n.indexOf(`
69
+ `);i>-1&&(n=n.slice(0,i))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),i=e+n.length;for(let s=this.rangeIndex;;){let o=this.ranges[s].to;if(o>=i||(n=n.slice(0,o-(i-n.length)),s++,s==this.ranges.length))break;let l=this.ranges[s].from,c=this.lineAfter(l);n+=c,i=l+c.length}return{line:n,end:i}}skipGapsTo(e,n,i){for(;;){let s=this.ranges[this.rangeIndex].to,o=e+n;if(i>0?s>o:s>=o)break;let l=this.ranges[++this.rangeIndex].from;n+=l-s}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,i,s){let o=4;if(this.ranges.length>1){s=this.skipGapsTo(n,s,1),n+=s;let c=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,o+=this.chunk.length-c}let l=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&o==4&&l>=0&&this.chunk[l]==e&&this.chunk[l+2]==n?this.chunk[l+2]=i:this.chunk.push(e,n,i,o),s}parseLine(e){let{line:n,end:i}=this.nextLine(),s=0,{streamParser:o}=this.lang,l=new eL(n,e?e.state.tabSize:4,e?Ml(e.state):2);if(l.eol())o.blankLine(this.state,l.indentUnit);else for(;!l.eol();){let c=iL(o.token,l,this.state);if(c&&(s=this.emitToken(this.lang.tokenTable.resolve(c),this.parsedPos+l.start,this.parsedPos+l.pos,s)),l.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=en.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:fq,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new en(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new en(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function iL(t,e,n){e.start=e.pos;for(let i=0;i<10;i++){let s=t(e,n);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Kx=Object.create(null),of=[di.none],fq=new Vx(of),pM=[],mM=Object.create(null),sL=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])sL[t]=oL(Kx,e);class rL{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),sL)}resolve(e){return e?this.table[e]||(this.table[e]=oL(this.extra,e)):0}}const dq=new rL(Kx);function xv(t,e){pM.indexOf(t)>-1||(pM.push(t),console.warn(e))}function oL(t,e){let n=[];for(let c of e.split(" ")){let f=[];for(let d of c.split(".")){let h=t[d]||Me[d];h?typeof h=="function"?f.length?f=f.map(h):xv(d,`Modifier ${d} used at start of tag`):f.length?xv(d,`Tag ${d} used as modifier`):f=Array.isArray(h)?h:[h]:xv(d,`Unknown highlighting tag ${d}`)}for(let d of f)n.push(d)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+n.map(c=>c.id),o=mM[s];if(o)return o.id;let l=mM[s]=di.define({id:of.length,name:i,props:[EK({[i]:n})]});return of.push(l),l.id}function hq(t,e){let n=di.define({id:of.length,name:"Document",props:[pl.add(()=>t),KI.add(()=>i=>e.getIndent(i))],top:!0});return of.push(n),n}fn.RTL,fn.LTR;const pq=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=Yx(t.state,n.from);return i.line?mq(t):i.block?yq(t):!1};function qx(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let s=t(e,n);return s?(i(n.update(s)),!0):!1}}const mq=qx(Sq,0),gq=qx(lL,0),yq=qx((t,e)=>lL(t,e,bq(e)),0);function Yx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const hu=50;function vq(t,{open:e,close:n},i,s){let o=t.sliceDoc(i-hu,i),l=t.sliceDoc(s,s+hu),c=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(l)[0].length,d=o.length-c;if(o.slice(d-e.length,d)==e&&l.slice(f,f+n.length)==n)return{open:{pos:i-c,margin:c&&1},close:{pos:s+f,margin:f&&1}};let h,m;s-i<=2*hu?h=m=t.sliceDoc(i,s):(h=t.sliceDoc(i,i+hu),m=t.sliceDoc(s-hu,s));let g=/^\s*/.exec(h)[0].length,b=/\s*$/.exec(m)[0].length,x=m.length-b-n.length;return h.slice(g,g+e.length)==e&&m.slice(x,x+n.length)==n?{open:{pos:i+g+e.length,margin:/\s/.test(h.charAt(g+e.length))?1:0},close:{pos:s-b-n.length,margin:/\s/.test(m.charAt(x-1))?1:0}}:null}function bq(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),s=n.to<=i.to?i:t.doc.lineAt(n.to);s.from>i.from&&s.from==n.to&&(s=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function lL(t,e,n=e.selection.ranges){let i=n.map(o=>Yx(e,o.from).block);if(!i.every(o=>o))return null;let s=n.map((o,l)=>vq(e,i[l],o.from,o.to));if(t!=2&&!s.every(o=>o))return{changes:e.changes(n.map((o,l)=>s[l]?[]:[{from:o.from,insert:i[l].open+" "},{from:o.to,insert:" "+i[l].close}]))};if(t!=1&&s.some(o=>o)){let o=[];for(let l=0,c;l<s.length;l++)if(c=s[l]){let f=i[l],{open:d,close:h}=c;o.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+f.close.length})}return{changes:o}}return null}function Sq(t,e,n=e.selection.ranges){let i=[],s=-1;e:for(let{from:o,to:l}of n){let c=i.length,f=1e9,d;for(let h=o;h<=l;){let m=e.doc.lineAt(h);if(d==null&&(d=Yx(e,m.from).line,!d))continue e;if(m.from>s&&(o==l||l>m.from)){s=m.from;let g=/^\s*/.exec(m.text)[0].length,b=g==m.length,x=m.text.slice(g,g+d.length)==d?g:-1;g<m.text.length&&g<f&&(f=g),i.push({line:m,comment:x,token:d,indent:g,empty:b,single:!1})}h=m.to+1}if(f<1e9)for(let h=c;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=f);i.length==c+1&&(i[c].single=!0)}if(t!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:c,token:f,indent:d,empty:h,single:m}of i)(m||!h)&&o.push({from:c.from+d,insert:f+" "});let l=e.changes(o);return{changes:l,selection:e.selection.map(l,1)}}else if(t!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:l,comment:c,token:f}of i)if(c>=0){let d=l.from+c,h=d+f.length;l.text[h-l.from]==" "&&h++,o.push({from:d,to:h})}return{changes:o}}return null}const Qb=Lo.define(),xq=Lo.define(),wq=He.define(),aL=He.define({combine(t){return Lm(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,s)=>e(i,s)||n(i,s)})}}),cL=tr.define({create(){return Us.empty},update(t,e){let n=e.state.facet(aL),i=e.annotation(Qb);if(i){let f=Ci.fromTransaction(e,i.selection),d=i.side,h=d==0?t.undone:t.done;return f?h=Gp(h,h.length,n.minDepth,f):h=dL(h,e.startState.selection),new Us(d==0?i.rest:h,d==0?h:i.rest)}let s=e.annotation(xq);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(Bn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ci.fromTransaction(e),l=e.annotation(Bn.time),c=e.annotation(Bn.userEvent);return o?t=t.addChanges(o,l,c,n,e):e.selection&&(t=t.addSelection(e.startState.selection,l,c,n.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Us(t.done.map(Ci.fromJSON),t.undone.map(Ci.fromJSON))}});function SJ(t={}){return[cL,aL.of(t),Je.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?uL:e.inputType=="historyRedo"?Zb:null;return i?(e.preventDefault(),i(n)):!1}})]}function eg(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let s=n.field(cL,!1);if(!s)return!1;let o=s.pop(t,n,e);return o?(i(o),!0):!1}}const uL=eg(0,!1),Zb=eg(1,!1),Cq=eg(0,!0),Eq=eg(1,!0);class Ci{constructor(e,n,i,s,o){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=s,this.selectionsAfter=o}setSelAfter(e){return new Ci(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Ci(e.changes&&In.fromJSON(e.changes),[],e.mapped&&Ys.fromJSON(e.mapped),e.startSelection&&xe.fromJSON(e.startSelection),e.selectionsAfter.map(xe.fromJSON))}static fromTransaction(e,n){let i=es;for(let s of e.startState.facet(wq)){let o=s(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new Ci(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,es)}static selection(e){return new Ci(void 0,es,void 0,void 0,e)}}function Gp(t,e,n,i){let s=e+1>n+20?e-n-1:0,o=t.slice(s,e);return o.push(i),o}function Tq(t,e){let n=[],i=!1;return t.iterChangedRanges((s,o)=>n.push(s,o)),e.iterChangedRanges((s,o,l,c)=>{for(let f=0;f<n.length;){let d=n[f++],h=n[f++];c>=d&&l<=h&&(i=!0)}}),i}function Rq(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function fL(t,e){return t.length?e.length?t.concat(e):t:e}const es=[],Aq=200;function dL(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Aq));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Gp(t,t.length-1,1e9,n.setSelAfter(i)))}else return[Ci.selection([e])]}function Mq(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function wv(t,e){if(!t.length)return t;let n=t.length,i=es;for(;n;){let s=Oq(t[n-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let o=t.slice(0,n);return o[n-1]=s,o}else e=s.mapped,n--,i=s.selectionsAfter}return i.length?[Ci.selection(i)]:es}function Oq(t,e,n){let i=fL(t.selectionsAfter.length?t.selectionsAfter.map(c=>c.map(e)):es,n);if(!t.changes)return Ci.selection(i);let s=t.changes.map(e),o=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(o):o;return new Ci(s,Jt.mapEffects(t.effects,e),l,t.startSelection.map(o),i)}const Dq=/^(input\.type|delete)($|\.)/;class Us{constructor(e,n,i=0,s=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Us(this.done,this.undone):this}addChanges(e,n,i,s,o){let l=this.done,c=l[l.length-1];return c&&c.changes&&!c.changes.empty&&e.changes&&(!i||Dq.test(i))&&(!c.selectionsAfter.length&&n-this.prevTime<s.newGroupDelay&&s.joinToEvent(o,Tq(c.changes,e.changes))||i=="input.type.compose")?l=Gp(l,l.length-1,s.minDepth,new Ci(e.changes.compose(c.changes),fL(Jt.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,es)):l=Gp(l,l.length,s.minDepth,e),new Us(l,es,n,i)}addSelection(e,n,i,s){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:es;return o.length>0&&n-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Rq(o[o.length-1],e)?this:new Us(dL(this.done,e),this.undone,n,i)}addMapping(e){return new Us(wv(this.done,e),wv(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let o=s[s.length-1],l=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(i&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:Qb.of({side:e,rest:Mq(s),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let c=s.length==1?es:s.slice(0,s.length-1);return o.mapped&&(c=wv(c,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:Qb.of({side:e,rest:c,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Us.empty=new Us(es,es);const xJ=[{key:"Mod-z",run:uL,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Zb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Zb,preventDefault:!0},{key:"Mod-u",run:Cq,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Eq,preventDefault:!0}];function fc(t,e){return xe.create(t.ranges.map(e),t.mainIndex)}function Cs(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Es({state:t,dispatch:e},n){let i=fc(t.selection,n);return i.eq(t.selection,!0)?!1:(e(Cs(t,i)),!0)}function tg(t,e){return xe.cursor(e?t.to:t.from)}function Gx(t,e){return Es(t,n=>n.empty?t.moveByChar(n,e):tg(n,e))}function si(t){return t.textDirectionAt(t.state.selection.main.head)==fn.LTR}const hL=t=>Gx(t,!si(t)),pL=t=>Gx(t,si(t)),wJ=t=>Gx(t,!1);function mL(t,e){return Es(t,n=>n.empty?t.moveByGroup(n,e):tg(n,e))}const kq=t=>mL(t,!si(t)),Pq=t=>mL(t,si(t));function Nq(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function ng(t,e,n){let i=os(t).resolveInner(e.head),s=n?St.closedBy:St.openedBy;for(let f=e.head;;){let d=n?i.childAfter(f):i.childBefore(f);if(!d)break;Nq(t,d,s)?i=d:f=n?d.to:d.from}let o=i.type.prop(s),l,c;return o&&(l=n?Ta(t,i.from,1):Ta(t,i.to,-1))&&l.matched?c=n?l.end.to:l.end.from:c=n?i.to:i.from,xe.cursor(c,n?-1:1)}const Iq=t=>Es(t,e=>ng(t.state,e,!si(t))),Lq=t=>Es(t,e=>ng(t.state,e,si(t)));function gL(t,e){return Es(t,n=>{if(!n.empty)return tg(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}const yL=t=>gL(t,!1),vL=t=>gL(t,!0);function bL(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,s;if(e){for(let o of t.state.facet(Je.scrollMargins)){let l=o(t);l?.top&&(n=Math.max(l?.top,n)),l?.bottom&&(i=Math.max(l?.bottom,i))}s=t.scrollDOM.clientHeight-n-i}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function SL(t,e){let n=bL(t),{state:i}=t,s=fc(i.selection,l=>l.empty?t.moveVertically(l,e,n.height):tg(l,e));if(s.eq(i.selection))return!1;let o;if(n.selfScroll){let l=t.coordsAtPos(i.selection.main.head),c=t.scrollDOM.getBoundingClientRect(),f=c.top+n.marginTop,d=c.bottom-n.marginBottom;l&&l.top>f&&l.bottom<d&&(o=Je.scrollIntoView(s.main.head,{y:"start",yMargin:l.top-f}))}return t.dispatch(Cs(i,s),{effects:o}),!0}const gM=t=>SL(t,!1),Jb=t=>SL(t,!0);function zo(t,e,n){let i=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,n);if(s.head==e.head&&s.head!=(n?i.to:i.from)&&(s=t.moveToLineBoundary(e,n,!1)),!n&&s.head==i.from&&i.length){let o=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(s=xe.cursor(i.from+o))}return s}const Bq=t=>Es(t,e=>zo(t,e,!0)),Vq=t=>Es(t,e=>zo(t,e,!1)),zq=t=>Es(t,e=>zo(t,e,!si(t))),_q=t=>Es(t,e=>zo(t,e,si(t))),Hq=t=>Es(t,e=>xe.cursor(t.lineBlockAt(e.head).from,1)),Fq=t=>Es(t,e=>xe.cursor(t.lineBlockAt(e.head).to,-1));function Uq(t,e,n){let i=!1,s=fc(t.selection,o=>{let l=Ta(t,o.head,-1)||Ta(t,o.head,1)||o.head>0&&Ta(t,o.head-1,1)||o.head<t.doc.length&&Ta(t,o.head+1,-1);if(!l||!l.end)return o;i=!0;let c=l.start.from==o.head?l.end.to:l.end.from;return xe.cursor(c)});return i?(e(Cs(t,s)),!0):!1}const jq=({state:t,dispatch:e})=>Uq(t,e);function ls(t,e){let n=fc(t.state.selection,i=>{let s=e(i);return xe.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Cs(t.state,n)),!0)}function xL(t,e){return ls(t,n=>t.moveByChar(n,e))}const wL=t=>xL(t,!si(t)),CL=t=>xL(t,si(t));function EL(t,e){return ls(t,n=>t.moveByGroup(n,e))}const Wq=t=>EL(t,!si(t)),Kq=t=>EL(t,si(t)),qq=t=>ls(t,e=>ng(t.state,e,!si(t))),Yq=t=>ls(t,e=>ng(t.state,e,si(t)));function TL(t,e){return ls(t,n=>t.moveVertically(n,e))}const RL=t=>TL(t,!1),AL=t=>TL(t,!0);function ML(t,e){return ls(t,n=>t.moveVertically(n,e,bL(t).height))}const yM=t=>ML(t,!1),vM=t=>ML(t,!0),Gq=t=>ls(t,e=>zo(t,e,!0)),Xq=t=>ls(t,e=>zo(t,e,!1)),$q=t=>ls(t,e=>zo(t,e,!si(t))),Qq=t=>ls(t,e=>zo(t,e,si(t))),Zq=t=>ls(t,e=>xe.cursor(t.lineBlockAt(e.head).from)),Jq=t=>ls(t,e=>xe.cursor(t.lineBlockAt(e.head).to)),bM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:0})),!0),SM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.doc.length})),!0),xM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.selection.main.anchor,head:0})),!0),wM=({state:t,dispatch:e})=>(e(Cs(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),eY=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),tY=({state:t,dispatch:e})=>{let n=ig(t).map(({from:i,to:s})=>xe.range(i,Math.min(s+1,t.doc.length)));return e(t.update({selection:xe.create(n),userEvent:"select"})),!0},nY=({state:t,dispatch:e})=>{let n=fc(t.selection,i=>{let s=os(t),o=s.resolveStack(i.from,1);if(i.empty){let l=s.resolveStack(i.from,-1);l.node.from>=o.node.from&&l.node.to<=o.node.to&&(o=l)}for(let l=o;l;l=l.next){let{node:c}=l;if((c.from<i.from&&c.to>=i.to||c.to>i.to&&c.from<=i.from)&&l.next)return xe.range(c.to,c.from)}return i});return n.eq(t.selection)?!1:(e(Cs(t,n)),!0)};function OL(t,e){let{state:n}=t,i=n.selection,s=n.selection.ranges.slice();for(let o of n.selection.ranges){let l=n.doc.lineAt(o.head);if(e?l.to<t.state.doc.length:l.from>0)for(let c=o;;){let f=t.moveVertically(c,e);if(f.head<l.from||f.head>l.to){s.some(d=>d.head==f.head)||s.push(f);break}else{if(f.head==c.head)break;c=f}}}return s.length==i.ranges.length?!1:(t.dispatch(Cs(n,xe.create(s,s.length-1))),!0)}const iY=t=>OL(t,!1),sY=t=>OL(t,!0),rY=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=xe.create([n.main]):n.main.empty||(i=xe.create([xe.cursor(n.main.head)])),i?(e(Cs(t,i)),!0):!1};function zf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,s=i.changeByRange(o=>{let{from:l,to:c}=o;if(l==c){let f=e(o);f<l?(n="delete.backward",f=Fh(t,f,!1)):f>l&&(n="delete.forward",f=Fh(t,f,!0)),l=Math.min(l,f),c=Math.max(c,f)}else l=Fh(t,l,!1),c=Fh(t,c,!0);return l==c?{range:o}:{changes:{from:l,to:c},range:xe.cursor(l,l<o.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(i.update(s,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Je.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Fh(t,e,n){if(t instanceof Je)for(let i of t.state.facet(Je.atomicRanges).map(s=>s(t)))i.between(e,e,(s,o)=>{s<e&&o>e&&(e=n?o:s)});return e}const DL=(t,e,n)=>zf(t,i=>{let s=i.from,{state:o}=t,l=o.doc.lineAt(s),c,f;if(n&&!e&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(c=l.text.slice(0,s-l.from))){if(c[c.length-1]==" ")return s-1;let d=Bm(c,o.tabSize),h=d%Ml(o)||Ml(o);for(let m=0;m<h&&c[c.length-1-m]==" ";m++)s--;f=s}else f=Qn(l.text,s-l.from,e,e)+l.from,f==s&&l.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(f-l.from,s-l.from))&&(f=Qn(l.text,f-l.from,!1,!1)+l.from);return f}),eS=t=>DL(t,!1,!0),kL=t=>DL(t,!0,!1),PL=(t,e)=>zf(t,n=>{let i=n.head,{state:s}=t,o=s.doc.lineAt(i),l=s.charCategorizer(i);for(let c=null;;){if(i==(e?o.to:o.from)){i==n.head&&o.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let f=Qn(o.text,i-o.from,e)+o.from,d=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),h=l(d);if(c!=null&&h!=c)break;(d!=" "||i!=n.head)&&(c=h),i=f}return i}),NL=t=>PL(t,!1),oY=t=>PL(t,!0),lY=t=>zf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),aY=t=>zf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),cY=t=>zf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),uY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:It.of(["",""])},range:xe.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},fY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let s=i.from,o=t.doc.lineAt(s),l=s==o.from?s-1:Qn(o.text,s-o.from,!1)+o.from,c=s==o.to?s+1:Qn(o.text,s-o.from,!0)+o.from;return{changes:{from:l,to:c,insert:t.doc.slice(s,c).append(t.doc.slice(l,s))},range:xe.cursor(c)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ig(t){let e=[],n=-1;for(let i of t.selection.ranges){let s=t.doc.lineAt(i.from),o=t.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=t.doc.lineAt(i.to-1)),n>=s.number){let l=e[e.length-1];l.to=o.to,l.ranges.push(i)}else e.push({from:s.from,to:o.to,ranges:[i]});n=o.number+1}return e}function IL(t,e,n){if(t.readOnly)return!1;let i=[],s=[];for(let o of ig(t)){if(n?o.to==t.doc.length:o.from==0)continue;let l=t.doc.lineAt(n?o.to+1:o.from-1),c=l.length+1;if(n){i.push({from:o.to,to:l.to},{from:o.from,insert:l.text+t.lineBreak});for(let f of o.ranges)s.push(xe.range(Math.min(t.doc.length,f.anchor+c),Math.min(t.doc.length,f.head+c)))}else{i.push({from:l.from,to:o.from},{from:o.to,insert:t.lineBreak+l.text});for(let f of o.ranges)s.push(xe.range(f.anchor-c,f.head-c))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:xe.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const dY=({state:t,dispatch:e})=>IL(t,e,!1),hY=({state:t,dispatch:e})=>IL(t,e,!0);function LL(t,e,n){if(t.readOnly)return!1;let i=[];for(let o of ig(t))n?i.push({from:o.from,insert:t.doc.slice(o.from,o.to)+t.lineBreak}):i.push({from:o.to,insert:t.lineBreak+t.doc.slice(o.from,o.to)});let s=t.changes(i);return e(t.update({changes:s,selection:t.selection.map(s,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const pY=({state:t,dispatch:e})=>LL(t,e,!1),mY=({state:t,dispatch:e})=>LL(t,e,!0),gY=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ig(e).map(({from:s,to:o})=>(s>0?s--:o<e.doc.length&&o++,{from:s,to:o}))),i=fc(e.selection,s=>{let o;if(t.lineWrapping){let l=t.lineBlockAt(s.head),c=t.coordsAtPos(s.head,s.assoc||1);c&&(o=l.bottom+t.documentTop-c.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,o)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function yY(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=os(t).resolveInner(e),i=n.childBefore(e),s=n.childAfter(e),o;return i&&s&&i.to<=e&&s.from>=e&&(o=i.type.prop(St.closedBy))&&o.indexOf(s.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const CM=BL(!1),vY=BL(!0);function BL(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:o,to:l}=s,c=e.doc.lineAt(o),f=!t&&o==l&&yY(e,o);t&&(o=l=(l<=c.to?c:e.doc.lineAt(l)).to);let d=new Zm(e,{simulateBreak:o,simulateDoubleBreak:!!f}),h=WI(d,o);for(h==null&&(h=Bm(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));l<c.to&&/\s/.test(c.text[l-c.from]);)l++;f?{from:o,to:l}=f:o>c.from&&o<c.from+100&&!/\S/.test(c.text.slice(0,o))&&(o=c.from);let m=["",Yp(e,h)];return f&&m.push(Yp(e,d.lineIndent(c.from,-1))),{changes:{from:o,to:l,insert:It.of(m)},range:xe.cursor(o+1+m[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Xx(t,e){let n=-1;return t.changeByRange(i=>{let s=[];for(let l=i.from;l<=i.to;){let c=t.doc.lineAt(l);c.number>n&&(i.empty||i.to>c.from)&&(e(c,s,i),n=c.number),l=c.to+1}let o=t.changes(s);return{changes:s,range:xe.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const bY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new Zm(t,{overrideIndentation:o=>{let l=n[o];return l??-1}}),s=Xx(t,(o,l,c)=>{let f=WI(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let d=/^\s*/.exec(o.text)[0],h=Yp(t,f);(d!=h||c.from<o.from+d.length)&&(n[o.from]=f,l.push({from:o.from,to:o.from+d.length,insert:h}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},VL=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Xx(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Fx)})}),{userEvent:"input.indent"})),!0),zL=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Xx(t,(n,i)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let o=Bm(s,t.tabSize),l=0,c=Yp(t,Math.max(0,o-Ml(t)));for(;l<s.length&&l<c.length&&s.charCodeAt(l)==c.charCodeAt(l);)l++;i.push({from:n.from+l,to:n.from+s.length,insert:c.slice(l)})}),{userEvent:"delete.dedent"})),!0),SY=t=>(t.setTabFocusMode(),!0),xY=[{key:"Ctrl-b",run:hL,shift:wL,preventDefault:!0},{key:"Ctrl-f",run:pL,shift:CL},{key:"Ctrl-p",run:yL,shift:RL},{key:"Ctrl-n",run:vL,shift:AL},{key:"Ctrl-a",run:Hq,shift:Zq},{key:"Ctrl-e",run:Fq,shift:Jq},{key:"Ctrl-d",run:kL},{key:"Ctrl-h",run:eS},{key:"Ctrl-k",run:lY},{key:"Ctrl-Alt-h",run:NL},{key:"Ctrl-o",run:uY},{key:"Ctrl-t",run:fY},{key:"Ctrl-v",run:Jb}],wY=[{key:"ArrowLeft",run:hL,shift:wL,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:kq,shift:Wq,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:zq,shift:$q,preventDefault:!0},{key:"ArrowRight",run:pL,shift:CL,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Pq,shift:Kq,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_q,shift:Qq,preventDefault:!0},{key:"ArrowUp",run:yL,shift:RL,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bM,shift:xM},{mac:"Ctrl-ArrowUp",run:gM,shift:yM},{key:"ArrowDown",run:vL,shift:AL,preventDefault:!0},{mac:"Cmd-ArrowDown",run:SM,shift:wM},{mac:"Ctrl-ArrowDown",run:Jb,shift:vM},{key:"PageUp",run:gM,shift:yM},{key:"PageDown",run:Jb,shift:vM},{key:"Home",run:Vq,shift:Xq,preventDefault:!0},{key:"Mod-Home",run:bM,shift:xM},{key:"End",run:Bq,shift:Gq,preventDefault:!0},{key:"Mod-End",run:SM,shift:wM},{key:"Enter",run:CM,shift:CM},{key:"Mod-a",run:eY},{key:"Backspace",run:eS,shift:eS,preventDefault:!0},{key:"Delete",run:kL,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:NL,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:oY,preventDefault:!0},{mac:"Mod-Backspace",run:aY,preventDefault:!0},{mac:"Mod-Delete",run:cY,preventDefault:!0}].concat(xY.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),CJ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Iq,shift:qq},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Lq,shift:Yq},{key:"Alt-ArrowUp",run:dY},{key:"Shift-Alt-ArrowUp",run:pY},{key:"Alt-ArrowDown",run:hY},{key:"Shift-Alt-ArrowDown",run:mY},{key:"Mod-Alt-ArrowUp",run:iY},{key:"Mod-Alt-ArrowDown",run:sY},{key:"Escape",run:rY},{key:"Mod-Enter",run:vY},{key:"Alt-l",mac:"Ctrl-l",run:tY},{key:"Mod-i",run:nY,preventDefault:!0},{key:"Mod-[",run:zL},{key:"Mod-]",run:VL},{key:"Mod-Alt-\\",run:bY},{key:"Shift-Mod-k",run:gY},{key:"Shift-Mod-\\",run:jq},{key:"Mod-/",run:pq},{key:"Alt-A",run:gq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:SY}].concat(wY),EJ={key:"Tab",run:VL,shift:zL};function CY(t,e,n){const i=new Array(t);return new Proxy(i,{get(s,o,l){if(typeof o=="string"){const c=o.charCodeAt(0);if(c>=48&&c<=57){const f=+o;if(Number.isInteger(f)&&f>=0&&f<t){let d=s[f];if(!d){const h=e[f*2];d=s[f]={index:f,key:n(f),start:h,size:e[f*2+1],end:h+e[f*2+1],lane:0}}return d}}if(o==="length")return t}return Reflect.get(s,o,l)}})}function va(t,e,n){let i=n.initialDeps??[],s,o=!0;function l(){const c=t();return(c.length!==i.length||c.some((d,h)=>i[h]!==d))&&(i=c,s=e(...c),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1),s}return l.updateDeps=c=>{i=c},l}function EM(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const EY=(t,e)=>Math.abs(t-e)<1.01,TY=(t,e,n)=>{let i;return function(...s){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,s),n)}};let pu;const Cv=()=>{if(pu!==void 0)return pu;if(typeof navigator>"u")return pu=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return pu=!0;const t=navigator.maxTouchPoints;return pu=navigator.platform==="MacIntel"&&t!==void 0&&t>0},TM=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},RY=t=>t,AY=t=>{const e=Math.max(t.startIndex-t.overscan,0),i=Math.min(t.endIndex+t.overscan,t.count-1)-e+1,s=new Array(i);for(let o=0;o<i;o++)s[o]=e+o;return s},MY=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const s=l=>{const{width:c,height:f}=l;e({width:Math.round(c),height:Math.round(f)})};if(s(TM(n)),!i.ResizeObserver)return()=>{};const o=new i.ResizeObserver(l=>{const c=()=>{const f=l[0];if(f?.borderBoxSize){const d=f.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s(TM(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Xp={passive:!0},OY=typeof window>"u"?!0:"onscrollend"in window,DY=(t,e,n)=>{const i=t.scrollElement;if(!i)return;const s=t.targetWindow;if(!s)return;const o=t.options.useScrollendEvent&&OY;let l=0;const c=o?null:TY(s,()=>e(l,!1),t.options.isScrollingResetDelay),f=m=>()=>{l=n(i),c?.(),e(l,m)},d=f(!0),h=f(!1);return i.addEventListener("scroll",d,Xp),o&&i.addEventListener("scrollend",h,Xp),()=>{i.removeEventListener("scroll",d),o&&i.removeEventListener("scrollend",h)}},kY=(t,e)=>DY(t,e,n=>{const{horizontal:i,isRtl:s}=t.options;return i?n.scrollLeft*(s&&-1||1):n.scrollTop}),PY=(t,e,n)=>{if(n.options.useCachedMeasurements){const i=n.indexFromElement(t),s=n.options.getItemKey(i);return n.itemSizeCache.get(s)??n.options.estimateSize(i)}if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}if(!e){const i=n.indexFromElement(t),s=n.options.getItemKey(i),o=n.itemSizeCache.get(s);if(o!==void 0)return o}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},NY=(t,{adjustments:e=0,behavior:n},i)=>{var s,o;(o=(s=i.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[i.options.horizontal?"left":"top"]:t+e,behavior:n})},IY=NY;class LY{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,i,s;return((s=(i=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:i.now)==null?void 0:s.call(i))??Date.now()},this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const l=()=>{const c=o.target,f=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);for(const[d,h]of this.elementsCache)if(h===c){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(f)&&this.resizeItem(f,this.options.measureElement(c,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=i())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=i())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=i())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var i,s;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:RY,rangeExtractor:AY,onChange:()=>{},measureElement:PY,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const g in n){const b=n[g];b!==void 0&&(o[g]=b)}const l=this.options;let c=null,f=null,d=!1;if(l!==void 0&&l.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const g=l.count,b=o.count,x=this.getMeasurements(),w=g>0?((i=x[0])==null?void 0:i.key)??l.getItemKey(0):null,C=g>0?((s=x[g-1])==null?void 0:s.key)??l.getItemKey(g-1):null;if(b!==g||g>0&&b>0&&(o.getItemKey(0)!==w||o.getItemKey(b-1)!==C)){d=!0;const T=g>0?this.getVirtualItemForOffset(this.getScrollOffset())??x[0]:null;T&&(c=[T.key,this.getScrollOffset()-T.start]);const D=o.followOnAppend===!0?"auto":o.followOnAppend||null;D&&b>g&&this.isAtEnd(l.scrollEndThreshold)&&(g===0||o.getItemKey(b-1)!==C)&&(f=D)}}this.options=o,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,m=0;if(c&&this.scrollOffset!==null){const[g,b]=c,x=this.getMeasurements(),{count:w,getItemKey:C}=this.options;let E=0;for(;E<w&&C(E)!==g;)E++;if(E<w){const M=x[E];if(M){const T=M.start+b;T!==this.scrollOffset&&(m=T-this.scrollOffset,this.scrollOffset=T,h=!0)}}}(h||f)&&(this.pendingScrollAnchor=[h?c[0]:null,h?c[1]:0,f,m])},this.notify=n=>{var i,s;(s=(i=this.options).onChange)==null||s.call(i,this,n)},this.maybeNotify=va(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,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.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}if(this.scrollElement=i,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.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{if(l&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const c=this.getScrollOffset();this.scrollDirection=l?c===o?this.scrollDirection:c<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Cv()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",l,Xp),o.addEventListener("touchend",c,Xp),this.unsubs.push(()=>{o.removeEventListener("touchstart",l),o.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[o,l,c,f]=s;o!==null&&!c&&(Cv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?f!==0&&(this._iosDeferredAdjustment+=f):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),i=this.getMaxScrollOffset();if(n<0||n>i)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,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,i)=>{const s=new Map,o=new Map;for(let l=i-1;l>=0;l--){const c=n[l];if(s.has(c.lane))continue;const f=o.get(c.lane);if(f==null||c.end>f.end?o.set(c.lane,c):c.end<f.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((l,c)=>l.end===c.end?l.index-c.index:l.end-c.end)[0]:void 0},this.getMeasurementOptions=va(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,i,s,o,l,c,f)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMin=null,{count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:l,lanes:c,laneAssignmentMode:f}),{key:!1}),this.getMeasurements=va(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:i,scrollMargin:s,getItemKey:o,enabled:l,lanes:c,laneAssignmentMode:f},d)=>{const h=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),c===1){const x=this.options.gap,w=n*2;let C=this._flatMeasurements;if(!C||C.length<w){const T=new Float64Array(w);C&&m>0&&T.set(C.subarray(0,m*2)),C=T,this._flatMeasurements=C}let E;if(m===0)E=i+s;else{const T=m-1;E=C[T*2]+C[T*2+1]+x}for(let T=m;T<n;T++){const D=o(T),O=h.get(D),A=typeof O=="number"?O:this.options.estimateSize(T);C[T*2]=E,C[T*2+1]=A,E+=A+x}const M=CY(n,C,o);return this.measurementsCache=M,M}const g=this.measurementsCache.slice(0,m),b=new Array(c).fill(void 0);for(let x=0;x<m;x++){const w=g[x];w&&(b[w.lane]=x)}for(let x=m;x<n;x++){const w=o(x),C=this.laneAssignments.get(x);let E,M;const T=f==="estimate"||h.has(w);if(C!==void 0&&this.options.lanes>1){E=C;const k=b[E],P=k!==void 0?g[k]:void 0;M=P?P.end+this.options.gap:i+s}else{const k=this.options.lanes===1?g[x-1]:this.getFurthestMeasurement(g,x);M=k?k.end+this.options.gap:i+s,E=k?k.lane:x%this.options.lanes,this.options.lanes>1&&T&&this.laneAssignments.set(x,E)}const D=h.get(w),O=typeof D=="number"?D:this.options.estimateSize(x),A=M+O;g[x]={index:x,start:M,size:O,end:A,key:w,lane:E},b[E]=x}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=va(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,i,s,o)=>{if(n.length===0||i===0)return this.range=null,null;const l=Math.max(this.getTotalSize()-i,0),c=Math.min(Math.max(s,0),l);return this.range=VY(n,i,c,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=va(()=>{let n=null,i=null;const s=this.calculateRange();return s&&(n=s.startIndex,i=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,s,o,l)=>o===null||l===null?[]:n({startIndex:o,endIndex:l,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,s=n.getAttribute(i);return s?parseInt(s,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,s-o),c=Math.min(this.options.count-1,s+o);return n>=l&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,c)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(c))});return}const i=this.indexFromElement(n),s=this.options.getItemKey(i),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,i)=>{var s,o;if(n<0||n>=this.options.count)return;let l,c,f;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)f=this.options.getItemKey(n),c=d[n*2],l=d[n*2+1];else{const g=this.measurementsCache[n];if(!g)return;f=g.key,c=g.start,l=g.size}const h=this.itemSizeCache.get(f)??l,m=i-h;if(m!==0){const g=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=g?this.getTotalSize():0,x=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:f,start:c,size:l,end:c+l,lane:0},m,this):c<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(f)||this.scrollDirection!=="backward"));(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(f,i),this.itemSizeCacheVersion++,g?this.applyScrollAdjustment(this.getTotalSize()-b):x&&this.applyScrollAdjustment(m),this.notify(!1)}},this.getVirtualItems=va(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,i)=>{const s=[];for(let o=0,l=n.length;o<l;o++){const c=n[o],f=i[c];s.push(f)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length===0)return;const s=this._flatMeasurements,o=this.options.lanes===1&&s!=null,l=_L(0,i.length-1,o?c=>s[c*2]:c=>EM(i[c]).start,n);return EM(i[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,i,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),l=this.getScrollOffset();i==="auto"&&(i=n>=l+o?"end":"start"),i==="center"?n+=(s-o)/2:i==="end"&&(n-=o);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(i==="auto")if(l.end>=o+s-this.options.scrollPaddingEnd)i="end";else if(l.start<=o+this.options.scrollPaddingStart)i="start";else return[o,i];if(i==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),i];const c=i==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,i,l.size),i]},this.scrollToOffset=(n,{align:i="start",behavior:s="auto"}={})=>{const o=this.getOffsetForAlignment(n,i),l=this.now();this.scrollState={index:null,align:i,behavior:s,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:i="auto",behavior:s="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,i);if(!o)return;const[l,c]=o,f=this.now();this.scrollState={index:n,align:c,behavior:s,startedAt:f,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:i="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let s;if(i.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=i.length-1,l=this._flatMeasurements;l!=null?s=l[o*2]+l[o*2+1]:s=((n=i[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let l=i.length-1;for(;l>=0&&o.some(c=>c===null);){const c=i[l];o[c.lane]===null&&(o[c.lane]=c.end),l--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const i=this.getMeasurements();for(const s of i)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:i,behavior:s})=>{this._intendedScrollOffset=n+(i??0),this.options.scrollToFn(n,{behavior:s,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,n){e!==0&&(Cv()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=i?i[0]:this.scrollState.lastTargetOffset,o=1,l=s!==this.scrollState.lastTargetOffset;if(!l&&EY(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const c=this.getSize()||600,f=Math.abs(s-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&f>c;this.scrollState.lastTargetOffset=s,d||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const _L=(t,e,n,i)=>{for(;t<=e;){const s=(t+e)/2|0,o=n(s);if(o<i)t=s+1;else if(o>i)e=s-1;else return s}return t>0?t-1:0};function BY(t,e,n){let i=0;for(;i<=e;){const s=(i+e)/2|0,o=t[s*2];if(o<n)i=s+1;else if(o>n)e=s-1;else return s}return i>0?i-1:0}function VY(t,e,n,i,s){const o=t.length-1;if(t.length<=i)return{startIndex:0,endIndex:o};if(i===1&&s!==null){const d=BY(s,o,n);let h=d;const m=n+e;for(;h<o&&s[h*2]+s[h*2+1]<m;)h++;return{startIndex:d,endIndex:h}}let c=_L(0,o,d=>t[d].start,n),f=c;if(i===1)for(;f<o&&t[f].end<n+e;)f++;else if(i>1){const d=Array(i).fill(0);for(;f<o&&d.some(m=>m<n+e);){const m=t[f];d[m.lane]=m.end,f++}const h=Array(i).fill(n+e);for(;c>=0&&h.some(m=>m>=n);){const m=t[c];h[m.lane]=m.start,c--}c=Math.max(0,c-c%i),f=Math.min(o,f+(i-1-f%i))}return{startIndex:c,endIndex:f}}const Ev=typeof document<"u"?v.useLayoutEffect:v.useEffect;function zY({useFlushSync:t=!0,directDomUpdates:e=!1,directDomUpdatesMode:n="transform",...i}){const s=v.useReducer(d=>d+1,0)[1],o=v.useRef({enabled:e,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=e,o.current.mode=n;const l=d=>{const h=o.current;if(!h.enabled||!h.container)return;const m=d.getTotalSize();if(m!==h.lastSize){h.lastSize=m;const E=d.options.horizontal?"width":"height";h.container.style[E]=`${m}px`}const g=!!d.options.horizontal,b=h.mode==="transform",x=g?"left":"top",w=d.options.scrollMargin,C=d.getVirtualItems();for(const E of C){const M=E.start-w,T=d.elementsCache.get(E.key);T&&h.lastPositions.get(T)!==M&&(h.lastPositions.set(T,M),b?T.style.transform=g?`translate3d(${M}px, 0, 0)`:`translate3d(0, ${M}px, 0)`:T.style[x]=`${M}px`)}},c={...i,onChange:(d,h)=>{var m;const g=o.current;let b=!0;if(g.enabled){l(d);const x=d.range,w=g.prevRange;b=!w||w.isScrolling!==d.isScrolling||w.startIndex!==x?.startIndex||w.endIndex!==x?.endIndex,b&&(g.prevRange=x?{startIndex:x.startIndex,endIndex:x.endIndex,isScrolling:d.isScrolling}:null)}b&&(t&&h?Fn.flushSync(s):s()),(m=i.onChange)==null||m.call(i,d,h)}},[f]=v.useState(()=>{const d=new LY(c);return Object.assign(d,{containerRef:h=>{const m=o.current;if(m.container=h,m.lastSize=null,h&&m.enabled){const g=d.getTotalSize();m.lastSize=g;const b=d.options.horizontal?"width":"height";h.style[b]=`${g}px`}}})});return f.setOptions(c),Ev(()=>f._didMount(),[]),Ev(()=>f._willUpdate()),Ev(()=>{l(f)}),f}function TJ(t){return zY({observeElementRect:MY,observeElementOffset:kY,scrollToFn:IY,...t})}function $x(t,e){t.indexOf(e)===-1&&t.push(e)}function ic(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Qs=(t,e,n)=>n>e?e:n<t?t:n;let Qx=()=>{};const kr={},HL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function FL(t){return typeof t=="object"&&t!==null}const UL=t=>/^0[^.\s]+$/u.test(t);function jL(t){let e;return()=>(e===void 0&&(e=t()),e)}const ns=t=>t,_Y=(t,e)=>n=>e(t(n)),_f=(...t)=>t.reduce(_Y),sc=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class Zx{constructor(){this.subscriptions=[]}add(e){return $x(this.subscriptions,e),()=>ic(this.subscriptions,e)}notify(e,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,i);else for(let o=0;o<s;o++){const l=this.subscriptions[o];l&&l(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const is=t=>t*1e3,ts=t=>t/1e3;function WL(t,e){return e?t*(1e3/e):0}const HY=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},KL=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,FY=1e-7,UY=12;function jY(t,e,n,i,s){let o,l,c=0;do l=e+(n-e)/2,o=KL(l,i,s)-t,o>0?n=l:e=l;while(Math.abs(o)>FY&&++c<UY);return l}function Hf(t,e,n,i){if(t===e&&n===i)return ns;const s=o=>jY(o,0,1,t,n);return o=>o===0||o===1?o:KL(s(o),e,i)}const qL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,YL=t=>e=>1-t(1-e),GL=Hf(.33,1.53,.69,.99),Jx=YL(GL),XL=qL(Jx),$L=t=>(t*=2)<1?.5*Jx(t):.5*(2-Math.pow(2,-10*(t-1))),ew=t=>1-Math.sin(Math.acos(t)),QL=YL(ew),ZL=qL(ew),WY=Hf(.42,0,1,1),KY=Hf(0,0,.58,1),JL=Hf(.42,0,.58,1),eB=t=>Array.isArray(t)&&typeof t[0]!="number";function tB(t,e){return eB(t)?t[HY(0,t.length,e)]:t}const nB=t=>Array.isArray(t)&&typeof t[0]=="number",qY={linear:ns,easeIn:WY,easeInOut:JL,easeOut:KY,circIn:ew,circInOut:ZL,circOut:QL,backIn:Jx,backInOut:XL,backOut:GL,anticipate:$L},YY=t=>typeof t=="string",RM=t=>{if(nB(t)){Qx(t.length===4);const[e,n,i,s]=t;return Hf(e,n,i,s)}else if(YY(t))return qY[t];return t},Uh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function GY(t,e){let n=new Set,i=new Set,s=!1,o=!1;const l=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function f(h){l.has(h)&&(d.schedule(h),t()),h(c)}const d={schedule:(h,m=!1,g=!1)=>{const x=g&&s?n:i;return m&&l.add(h),x.has(h)||x.add(h),h},cancel:h=>{i.delete(h),l.delete(h)},process:h=>{if(c=h,s){o=!0;return}s=!0,[n,i]=[i,n],n.forEach(f),n.clear(),s=!1,o&&(o=!1,d.process(h))}};return d}const XY=40;function iB(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,l=Uh.reduce((T,D)=>(T[D]=GY(o),T),{}),{setup:c,read:f,resolveKeyframes:d,preUpdate:h,update:m,preRender:g,render:b,postRender:x}=l,w=()=>{const T=kr.useManualTiming?s.timestamp:performance.now();n=!1,kr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(T-s.timestamp,XY),1)),s.timestamp=T,s.isProcessing=!0,c.process(s),f.process(s),d.process(s),h.process(s),m.process(s),g.process(s),b.process(s),x.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(w))},C=()=>{n=!0,i=!0,s.isProcessing||t(w)};return{schedule:Uh.reduce((T,D)=>{const O=l[D];return T[D]=(A,k=!1,P=!1)=>(n||C(),O.schedule(A,k,P)),T},{}),cancel:T=>{for(let D=0;D<Uh.length;D++)l[Uh[D]].cancel(T)},state:s,steps:l}}const{schedule:sn,cancel:Ro,state:Gn,steps:Tv}=iB(typeof requestAnimationFrame<"u"?requestAnimationFrame:ns,!0);let rp;function $Y(){rp=void 0}const ci={now:()=>(rp===void 0&&ci.set(Gn.isProcessing||kr.useManualTiming?Gn.timestamp:performance.now()),rp),set:t=>{rp=t,queueMicrotask($Y)}},sB=t=>e=>typeof e=="string"&&e.startsWith(t),rB=sB("--"),QY=sB("var(--"),tw=t=>QY(t)?ZY.test(t.split("/*")[0].trim()):!1,ZY=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function AM(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const dc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},lf={...dc,transform:t=>Qs(0,1,t)},jh={...dc,default:1},Lu=t=>Math.round(t*1e5)/1e5,nw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function JY(t){return t==null}const eG=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iw=(t,e)=>n=>!!(typeof n=="string"&&eG.test(n)&&n.startsWith(t)||e&&!JY(n)&&Object.prototype.hasOwnProperty.call(n,e)),oB=(t,e,n)=>i=>{if(typeof i!="string")return i;const[s,o,l,c]=i.match(nw);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},tG=t=>Qs(0,255,t),Rv={...dc,transform:t=>Math.round(tG(t))},ml={test:iw("rgb","red"),parse:oB("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Rv.transform(t)+", "+Rv.transform(e)+", "+Rv.transform(n)+", "+Lu(lf.transform(i))+")"};function nG(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const tS={test:iw("#"),parse:nG,transform:ml.transform},Ff=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ro=Ff("deg"),Gs=Ff("%"),ze=Ff("px"),iG=Ff("vh"),sG=Ff("vw"),MM={...Gs,parse:t=>Gs.parse(t)/100,transform:t=>Gs.transform(t*100)},Ra={test:iw("hsl","hue"),parse:oB("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Gs.transform(Lu(e))+", "+Gs.transform(Lu(n))+", "+Lu(lf.transform(i))+")"},Rn={test:t=>ml.test(t)||tS.test(t)||Ra.test(t),parse:t=>ml.test(t)?ml.parse(t):Ra.test(t)?Ra.parse(t):tS.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ml.transform(t):Ra.transform(t),getAnimatableNone:t=>{const e=Rn.parse(t);return e.alpha=0,Rn.transform(e)}},rG=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oG(t){return isNaN(t)&&typeof t=="string"&&(t.match(nw)?.length||0)+(t.match(rG)?.length||0)>0}const lB="number",aB="color",lG="var",aG="var(",OM="${}",cG=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function af(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const c=e.replace(cG,f=>(Rn.test(f)?(i.color.push(o),s.push(aB),n.push(Rn.parse(f))):f.startsWith(aG)?(i.var.push(o),s.push(lG),n.push(f)):(i.number.push(o),s.push(lB),n.push(parseFloat(f))),++o,OM)).split(OM);return{values:n,split:c,indexes:i,types:s}}function cB(t){return af(t).values}function uB(t){const{split:e,types:n}=af(t),i=e.length;return s=>{let o="";for(let l=0;l<i;l++)if(o+=e[l],s[l]!==void 0){const c=n[l];c===lB?o+=Lu(s[l]):c===aB?o+=Rn.transform(s[l]):o+=s[l]}return o}}const uG=t=>typeof t=="number"?0:Rn.test(t)?Rn.getAnimatableNone(t):t;function fG(t){const e=cB(t);return uB(t)(e.map(uG))}const gs={test:oG,parse:cB,createTransformer:uB,getAnimatableNone:fG};function Av(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function dG({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let s=0,o=0,l=0;if(!e)s=o=l=n;else{const c=n<.5?n*(1+e):n+e-n*e,f=2*n-c;s=Av(f,c,t+1/3),o=Av(f,c,t),l=Av(f,c,t-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:i}}function $p(t,e){return n=>n>0?e:t}const un=(t,e,n)=>t+(e-t)*n,Mv=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},hG=[tS,ml,Ra],pG=t=>hG.find(e=>e.test(t));function DM(t){const e=pG(t);if(!e)return!1;let n=e.parse(t);return e===Ra&&(n=dG(n)),n}const kM=(t,e)=>{const n=DM(t),i=DM(e);if(!n||!i)return $p(t,e);const s={...n};return o=>(s.red=Mv(n.red,i.red,o),s.green=Mv(n.green,i.green,o),s.blue=Mv(n.blue,i.blue,o),s.alpha=un(n.alpha,i.alpha,o),ml.transform(s))},nS=new Set(["none","hidden"]);function mG(t,e){return nS.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function gG(t,e){return n=>un(t,e,n)}function sw(t){return typeof t=="number"?gG:typeof t=="string"?tw(t)?$p:Rn.test(t)?kM:bG:Array.isArray(t)?fB:typeof t=="object"?Rn.test(t)?kM:yG:$p}function fB(t,e){const n=[...t],i=n.length,s=t.map((o,l)=>sw(o)(o,e[l]));return o=>{for(let l=0;l<i;l++)n[l]=s[l](o);return n}}function yG(t,e){const n={...t,...e},i={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(i[s]=sw(t[s])(t[s],e[s]));return s=>{for(const o in i)n[o]=i[o](s);return n}}function vG(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],l=t.indexes[o][i[o]],c=t.values[l]??0;n[s]=c,i[o]++}return n}const bG=(t,e)=>{const n=gs.createTransformer(e),i=af(t),s=af(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?nS.has(t)&&!s.values.length||nS.has(e)&&!i.values.length?mG(t,e):_f(fB(vG(i,s),s.values),n):$p(t,e)};function dB(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?un(t,e,n):sw(t)(t,e)}const SG=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>sn.update(e,n),stop:()=>Ro(e),now:()=>Gn.isProcessing?Gn.timestamp:ci.now()}},hB=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let o=0;o<s;o++)i+=Math.round(t(o/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Qp=2e4;function rw(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<Qp;)e+=n,i=t.next(e);return e>=Qp?1/0:e}function pB(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(rw(i),Qp);return{type:"keyframes",ease:o=>i.next(s*o).value/e,duration:ts(s)}}const xG=5;function mB(t,e,n){const i=Math.max(e-xG,0);return WL(n-t(i),e-i)}const gn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ov=.001;function wG({duration:t=gn.duration,bounce:e=gn.bounce,velocity:n=gn.velocity,mass:i=gn.mass}){let s,o,l=1-e;l=Qs(gn.minDamping,gn.maxDamping,l),t=Qs(gn.minDuration,gn.maxDuration,ts(t)),l<1?(s=d=>{const h=d*l,m=h*t,g=h-n,b=iS(d,l),x=Math.exp(-m);return Ov-g/b*x},o=d=>{const m=d*l*t,g=m*n+n,b=Math.pow(l,2)*Math.pow(d,2)*t,x=Math.exp(-m),w=iS(Math.pow(d,2),l);return(-s(d)+Ov>0?-1:1)*((g-b)*x)/w}):(s=d=>{const h=Math.exp(-d*t),m=(d-n)*t+1;return-Ov+h*m},o=d=>{const h=Math.exp(-d*t),m=(n-d)*(t*t);return h*m});const c=5/t,f=EG(s,o,c);if(t=is(t),isNaN(f))return{stiffness:gn.stiffness,damping:gn.damping,duration:t};{const d=Math.pow(f,2)*i;return{stiffness:d,damping:l*2*Math.sqrt(i*d),duration:t}}}const CG=12;function EG(t,e,n){let i=n;for(let s=1;s<CG;s++)i=i-t(i)/e(i);return i}function iS(t,e){return t*Math.sqrt(1-e*e)}const TG=["duration","bounce"],RG=["stiffness","damping","mass"];function PM(t,e){return e.some(n=>t[n]!==void 0)}function AG(t){let e={velocity:gn.velocity,stiffness:gn.stiffness,damping:gn.damping,mass:gn.mass,isResolvedFromDuration:!1,...t};if(!PM(t,RG)&&PM(t,TG))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,o=2*Qs(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:gn.mass,stiffness:s,damping:o}}else{const n=wG({...t,velocity:0});e={...e,...n,mass:gn.mass},e.isResolvedFromDuration=!0}return e}function cf(t=gn.visualDuration,e=gn.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:f,damping:d,mass:h,duration:m,velocity:g,isResolvedFromDuration:b}=AG({...n,velocity:-ts(n.velocity||0)}),x=g||0,w=d/(2*Math.sqrt(f*h)),C=l-o,E=ts(Math.sqrt(f/h)),M=Math.abs(C)<5;i||(i=M?gn.restSpeed.granular:gn.restSpeed.default),s||(s=M?gn.restDelta.granular:gn.restDelta.default);let T;if(w<1){const O=iS(E,w);T=A=>{const k=Math.exp(-w*E*A);return l-k*((x+w*E*C)/O*Math.sin(O*A)+C*Math.cos(O*A))}}else if(w===1)T=O=>l-Math.exp(-E*O)*(C+(x+E*C)*O);else{const O=E*Math.sqrt(w*w-1);T=A=>{const k=Math.exp(-w*E*A),P=Math.min(O*A,300);return l-k*((x+w*E*C)*Math.sinh(P)+O*C*Math.cosh(P))/O}}const D={calculatedDuration:b&&m||null,next:O=>{const A=T(O);if(b)c.done=O>=m;else{let k=O===0?x:0;w<1&&(k=O===0?is(x):mB(T,O,A));const P=Math.abs(k)<=i,B=Math.abs(l-A)<=s;c.done=P&&B}return c.value=c.done?l:A,c},toString:()=>{const O=Math.min(rw(D),Qp),A=hB(k=>D.next(O*k).value,O,30);return O+"ms "+A},toTransition:()=>{}};return D}cf.applyToOptions=t=>{const e=pB(t,100,cf);return t.ease=e.ease,t.duration=is(e.duration),t.type="keyframes",t};function sS({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:f,restDelta:d=.5,restSpeed:h}){const m=t[0],g={done:!1,value:m},b=P=>c!==void 0&&P<c||f!==void 0&&P>f,x=P=>c===void 0?f:f===void 0||Math.abs(c-P)<Math.abs(f-P)?c:f;let w=n*e;const C=m+w,E=l===void 0?C:l(C);E!==C&&(w=E-m);const M=P=>-w*Math.exp(-P/i),T=P=>E+M(P),D=P=>{const B=M(P),z=T(P);g.done=Math.abs(B)<=d,g.value=g.done?E:z};let O,A;const k=P=>{b(g.value)&&(O=P,A=cf({keyframes:[g.value,x(g.value)],velocity:mB(T,P,g.value),damping:s,stiffness:o,restDelta:d,restSpeed:h}))};return k(0),{calculatedDuration:null,next:P=>{let B=!1;return!A&&O===void 0&&(B=!0,D(P),k(P)),O!==void 0&&P>=O?A.next(P-O):(!B&&D(P),g)}}}function MG(t,e,n){const i=[],s=n||kr.mix||dB,o=t.length-1;for(let l=0;l<o;l++){let c=s(t[l],t[l+1]);if(e){const f=Array.isArray(e)?e[l]||ns:e;c=_f(f,c)}i.push(c)}return i}function OG(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(Qx(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const c=MG(e,i,s),f=c.length,d=h=>{if(l&&h<t[0])return e[0];let m=0;if(f>1)for(;m<t.length-2&&!(h<t[m+1]);m++);const g=sc(t[m],t[m+1],h);return c[m](g)};return n?h=>d(Qs(t[0],t[o-1],h)):d}function gB(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=sc(0,e,i);t.push(un(n,1,s))}}function yB(t){const e=[0];return gB(e,t.length-1),e}function DG(t,e){return t.map(n=>n*e)}function kG(t,e){return t.map(()=>e||JL).splice(0,t.length-1)}function Bu({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=eB(i)?i.map(RM):RM(i),o={done:!1,value:e[0]},l=DG(n&&n.length===e.length?n:yB(e),t),c=OG(l,e,{ease:Array.isArray(s)?s:kG(e,s)});return{calculatedDuration:t,next:f=>(o.value=c(f),o.done=f>=t,o)}}const PG=t=>t!==null;function ow(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(PG),c=s<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!c||i===void 0?o[c]:i}const NG={decay:sS,inertia:sS,tween:Bu,keyframes:Bu,spring:cf};function vB(t){typeof t.type=="string"&&(t.type=NG[t.type])}class lw{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const IG=t=>t/100;class aw extends lw{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==ci.now()&&this.tick(ci.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;vB(e);const{type:n=Bu,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:l=0}=e;let{keyframes:c}=e;const f=n||Bu;f!==Bu&&typeof c[0]!="number"&&(this.mixKeyframes=_f(IG,dB(c[0],c[1])),c=[0,100]);const d=f({...e,keyframes:c});o==="mirror"&&(this.mirroredGenerator=f({...e,keyframes:[...c].reverse(),velocity:-l})),d.calculatedDuration===null&&(d.calculatedDuration=rw(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:f}=this;if(this.startTime===null)return i.next(0);const{delay:d=0,keyframes:h,repeat:m,repeatType:g,repeatDelay:b,type:x,onUpdate:w,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const E=this.currentTime-d*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,D=i;if(m){const P=Math.min(this.currentTime,s)/c;let B=Math.floor(P),z=P%1;!z&&P>=1&&(z=1),z===1&&B--,B=Math.min(B,m+1),B%2&&(g==="reverse"?(z=1-z,b&&(z-=b/c)):g==="mirror"&&(D=l)),T=Qs(0,1,z)*c}const O=M?{done:!1,value:h[0]}:D.next(T);o&&(O.value=o(O.value));let{done:A}=O;!M&&f!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return k&&x!==sS&&(O.value=ow(h,this.options,C,this.speed)),w&&w(O.value),k&&this.finish(),O}then(e,n){return this.finished.then(e,n)}get duration(){return ts(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ts(e)}get time(){return ts(this.currentTime)}set time(e){e=is(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(ci.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ts(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=SG,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ci.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function LG(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const gl=t=>t*180/Math.PI,rS=t=>{const e=gl(Math.atan2(t[1],t[0]));return oS(e)},BG={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:rS,rotateZ:rS,skewX:t=>gl(Math.atan(t[1])),skewY:t=>gl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},oS=t=>(t=t%360,t<0&&(t+=360),t),NM=rS,IM=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),LM=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),VG={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:IM,scaleY:LM,scale:t=>(IM(t)+LM(t))/2,rotateX:t=>oS(gl(Math.atan2(t[6],t[5]))),rotateY:t=>oS(gl(Math.atan2(-t[2],t[0]))),rotateZ:NM,rotate:NM,skewX:t=>gl(Math.atan(t[4])),skewY:t=>gl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function lS(t){return t.includes("scale")?1:0}function aS(t,e){if(!t||t==="none")return lS(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=VG,s=n;else{const c=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=BG,s=c}if(!s)return lS(e);const o=i[e],l=s[1].split(",").map(_G);return typeof o=="function"?o(l):l[o]}const zG=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return aS(n,e)};function _G(t){return parseFloat(t.trim())}const hc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pc=new Set(hc),BM=t=>t===dc||t===ze,HG=new Set(["x","y","z"]),FG=hc.filter(t=>!HG.has(t));function UG(t){const e=[];return FG.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const ho={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>aS(e,"x"),y:(t,{transform:e})=>aS(e,"y")};ho.translateX=ho.x;ho.translateY=ho.y;const yl=new Set;let cS=!1,uS=!1,fS=!1;function bB(){if(uS){const t=Array.from(yl).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=UG(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([o,l])=>{i.getValue(o)?.set(l)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}uS=!1,cS=!1,yl.forEach(t=>t.complete(fS)),yl.clear()}function SB(){yl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(uS=!0)})}function jG(){fS=!0,SB(),bB(),fS=!1}class cw{constructor(e,n,i,s,o,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=o,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(yl.add(this),cS||(cS=!0,sn.read(SB),sn.resolveKeyframes(bB))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const o=s?.get(),l=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&n){const c=i.readValue(n,l);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=l),s&&o===void 0&&s.set(e[0])}LG(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yl.delete(this)}cancel(){this.state==="scheduled"&&(yl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const WG=t=>t.startsWith("--");function KG(t,e,n){WG(e)?t.style.setProperty(e,n):t.style[e]=n}const qG={};function xB(t,e){const n=jL(t);return()=>qG[e]??n()}const YG=xB(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),wB=xB(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Eu=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,VM={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Eu([0,.65,.55,1]),circOut:Eu([.55,0,1,.45]),backIn:Eu([.31,.01,.66,-.59]),backOut:Eu([.33,1.53,.69,.99])};function CB(t,e){if(t)return typeof t=="function"?wB()?hB(t,e):"ease-out":nB(t)?Eu(t):Array.isArray(t)?t.map(n=>CB(n,e)||VM.easeOut):VM[t]}function GG(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:l="loop",ease:c="easeOut",times:f}={},d=void 0){const h={[e]:n};f&&(h.offset=f);const m=CB(c,s);Array.isArray(m)&&(h.easing=m);const g={delay:i,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"};return d&&(g.pseudoElement=d),t.animate(h,g)}function uw(t){return typeof t=="function"&&"applyToOptions"in t}function XG({type:t,...e}){return uw(t)&&wB()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class EB extends lw{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:l=!1,finalKeyframe:c,onComplete:f}=e;this.isPseudoElement=!!o,this.allowFlatten=l,this.options=e,Qx(typeof e.type!="string");const d=XG(e);this.animation=GG(n,i,s,d,o),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const h=ow(s,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(h):KG(n,i,h),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return ts(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ts(e)}get time(){return ts(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=is(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&YG()?(this.animation.timeline=e,ns):n(this)}}const TB={anticipate:$L,backInOut:XL,circInOut:ZL};function $G(t){return t in TB}function QG(t){typeof t.ease=="string"&&$G(t.ease)&&(t.ease=TB[t.ease])}const Dv=10;class ZG extends EB{constructor(e){QG(e),vB(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...l}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const c=new aw({...l,autoplay:!1}),f=Math.max(Dv,ci.now()-this.startTime),d=Qs(0,Dv,f-Dv);n.setWithVelocity(c.sample(Math.max(0,f-d)).value,c.sample(f).value,d),c.stop()}}const zM=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gs.test(t)||t==="0")&&!t.startsWith("url("));function JG(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function e2(t,e,n,i){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],l=zM(s,e),c=zM(o,e);return!l||!c?!1:JG(t)||(n==="spring"||uw(n))&&i}function dS(t){t.duration=0,t.type="keyframes"}const t2=new Set(["opacity","clipPath","filter","transform"]),n2=jL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function i2(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:l}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=e.owner.getProps();return n2()&&n&&t2.has(n)&&(n!=="transform"||!d)&&!f&&!i&&s!=="mirror"&&o!==0&&l!=="inertia"}const s2=40;class r2 extends lw{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:l="loop",keyframes:c,name:f,motionValue:d,element:h,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ci.now();const g={autoplay:e,delay:n,type:i,repeat:s,repeatDelay:o,repeatType:l,name:f,motionValue:d,element:h,...m},b=h?.KeyframeResolver||cw;this.keyframeResolver=new b(c,(x,w,C)=>this.onKeyframesResolved(x,w,g,!C),f,d,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:l,velocity:c,delay:f,isHandoff:d,onUpdate:h}=i;this.resolvedAt=ci.now(),e2(e,o,l,c)||((kr.instantAnimations||!f)&&h?.(ow(e,i,n)),e[0]=e[e.length-1],dS(i),i.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>s2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},b=!d&&i2(g),x=g.motionValue?.owner?.current,w=b?new ZG({...g,element:x}):new aw(g);w.finished.then(()=>{this.notifyFinished()}).catch(ns),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),jG()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class o2{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=n}attachTimeline(e){const n=this.animations.map(i=>i.attachTimeline(e));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return _M(this.animations,"duration")}get iterationDuration(){return _M(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function _M(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];s!==null&&s>n&&(n=s)}return n}class l2 extends o2{then(e,n){return this.finished.finally(e).then(()=>{})}}function RB(t,e,n,i=0,s=1){const o=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),l=t.size,c=(l-1)*i;return typeof n=="function"?n(o,l):s===1?o*i:c-o*i}const a2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function c2(t){const e=a2.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function AB(t,e,n=1){const[i,s]=c2(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const l=o.trim();return HL(l)?parseFloat(l):l}return tw(s)?AB(s,e,n+1):s}const u2={type:"spring",stiffness:500,damping:25,restSpeed:10},f2=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),d2={type:"keyframes",duration:.8},h2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},p2=(t,{keyframes:e})=>e.length>2?d2:pc.has(t)?t.startsWith("scale")?f2(e[1]):u2:h2,m2=t=>t!==null;function g2(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(m2),o=e&&n!=="loop"&&e%2===1?0:s.length-1;return s[o]}function MB(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function fw(t,e){const n=t?.[e]??t?.default??t;return n!==t?MB(n,t):n}function y2({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:l,repeatDelay:c,from:f,elapsed:d,...h}){return!!Object.keys(h).length}const dw=(t,e,n,i={},s,o)=>l=>{const c=fw(i,t)||{},f=c.delay||i.delay||0;let{elapsed:d=0}=i;d=d-is(f);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-d,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:e,element:o?void 0:s};y2(c)||Object.assign(h,p2(t,h)),h.duration&&(h.duration=is(h.duration)),h.repeatDelay&&(h.repeatDelay=is(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(dS(h),h.delay===0&&(m=!0)),(kr.instantAnimations||kr.skipAnimations||s?.shouldSkipAnimations)&&(m=!0,dS(h),h.delay=0),h.allowFlatten=!c.type&&!c.ease,m&&!o&&e.get()!==void 0){const g=g2(h.keyframes,c);if(g!==void 0){sn.update(()=>{h.onUpdate(g),h.onComplete()});return}}return c.isSync?new aw(h):new r2(h)};function HM(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function hw(t,e,n,i){if(typeof e=="function"){const[s,o]=HM(i);e=e(n!==void 0?n:t.custom,s,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,o]=HM(i);e=e(n!==void 0?n:t.custom,s,o)}return e}function ja(t,e,n){const i=t.getProps();return hw(i,e,n!==void 0?n:i.custom,t)}const OB=new Set(["width","height","top","left","right","bottom",...hc]),FM=30,v2=t=>!isNaN(parseFloat(t));class b2{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=ci.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ci.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=v2(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Zx);const i=this.events[e].add(n);return e==="change"?()=>{i(),sn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ci.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>FM)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,FM);return WL(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ao(t,e){return new b2(t,e)}const hS=t=>Array.isArray(t);function S2(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ao(n))}function x2(t){return hS(t)?t[t.length-1]||0:t}function w2(t,e){const n=ja(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const l in o){const c=x2(o[l]);S2(t,l,c)}}const Un=t=>!!(t&&t.getVelocity);function C2(t){return!!(Un(t)&&t.add)}function pS(t,e){const n=t.getValue("willChange");if(C2(n))return n.add(e);if(!n&&kr.WillChange){const i=new kr.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function pw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const E2="framerAppearId",DB="data-"+pw(E2);function kB(t){return t.props[DB]}function T2({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function mw(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:l,...c}=e;const f=t.getDefaultTransition();o=o?MB(o,f):f;const d=o?.reduceMotion;i&&(o=i);const h=[],m=s&&t.animationState&&t.animationState.getState()[s];for(const g in c){const b=t.getValue(g,t.latestValues[g]??null),x=c[g];if(x===void 0||m&&T2(m,g))continue;const w={delay:n,...fw(o||{},g)},C=b.get();if(C!==void 0&&!b.isAnimating&&!Array.isArray(x)&&x===C&&!w.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const D=kB(t);if(D){const O=window.MotionHandoffAnimation(D,g,sn);O!==null&&(w.startTime=O,E=!0)}}pS(t,g);const M=d??t.shouldReduceMotion;b.start(dw(g,b,x,M&&OB.has(g)?{type:!1}:w,t,E));const T=b.animation;T&&h.push(T)}if(l){const g=()=>sn.update(()=>{l&&w2(t,l)});h.length?Promise.all(h).then(g):g()}return h}function mS(t,e,n={}){const i=ja(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(mw(t,i,n)):()=>Promise.resolve(),l=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=s;return R2(t,e,f,d,h,m,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[f,d]=c==="beforeChildren"?[o,l]:[l,o];return f().then(()=>d())}else return Promise.all([o(),l(n.delay)])}function R2(t,e,n=0,i=0,s=0,o=1,l){const c=[];for(const f of t.variantChildren)f.notify("AnimationStart",e),c.push(mS(f,e,{...l,delay:n+(typeof i=="function"?0:i)+RB(t.variantChildren,f,i,s,o)}).then(()=>f.notify("AnimationComplete",e)));return Promise.all(c)}function A2(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const s=e.map(o=>mS(t,o,n));i=Promise.all(s)}else if(typeof e=="string")i=mS(t,e,n);else{const s=typeof e=="function"?ja(t,e,n.custom):e;i=Promise.all(mw(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const M2={test:t=>t==="auto",parse:t=>t},PB=t=>e=>e.test(t),NB=[dc,ze,Gs,ro,sG,iG,M2],UM=t=>NB.find(PB(t));function O2(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||UL(t):!0}const D2=new Set(["brightness","contrast","saturate","opacity"]);function k2(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(nw)||[];if(!i)return t;const s=n.replace(i,"");let o=D2.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const P2=/\b([a-z-]*)\(.*?\)/gu,gS={...gs,getAnimatableNone:t=>{const e=t.match(P2);return e?e.map(k2).join(" "):t}},yS={...gs,getAnimatableNone:t=>{const e=gs.parse(t);return gs.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},jM={...dc,transform:Math.round},N2={rotate:ro,rotateX:ro,rotateY:ro,rotateZ:ro,scale:jh,scaleX:jh,scaleY:jh,scaleZ:jh,skew:ro,skewX:ro,skewY:ro,distance:ze,translateX:ze,translateY:ze,translateZ:ze,x:ze,y:ze,z:ze,perspective:ze,transformPerspective:ze,opacity:lf,originX:MM,originY:MM,originZ:ze},gw={borderWidth:ze,borderTopWidth:ze,borderRightWidth:ze,borderBottomWidth:ze,borderLeftWidth:ze,borderRadius:ze,borderTopLeftRadius:ze,borderTopRightRadius:ze,borderBottomRightRadius:ze,borderBottomLeftRadius:ze,width:ze,maxWidth:ze,height:ze,maxHeight:ze,top:ze,right:ze,bottom:ze,left:ze,inset:ze,insetBlock:ze,insetBlockStart:ze,insetBlockEnd:ze,insetInline:ze,insetInlineStart:ze,insetInlineEnd:ze,padding:ze,paddingTop:ze,paddingRight:ze,paddingBottom:ze,paddingLeft:ze,paddingBlock:ze,paddingBlockStart:ze,paddingBlockEnd:ze,paddingInline:ze,paddingInlineStart:ze,paddingInlineEnd:ze,margin:ze,marginTop:ze,marginRight:ze,marginBottom:ze,marginLeft:ze,marginBlock:ze,marginBlockStart:ze,marginBlockEnd:ze,marginInline:ze,marginInlineStart:ze,marginInlineEnd:ze,fontSize:ze,backgroundPositionX:ze,backgroundPositionY:ze,...N2,zIndex:jM,fillOpacity:lf,strokeOpacity:lf,numOctaves:jM},I2={...gw,color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,filter:gS,WebkitFilter:gS,mask:yS,WebkitMask:yS},IB=t=>I2[t],L2=new Set([gS,yS]);function LB(t,e){let n=IB(t);return L2.has(n)||(n=gs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const B2=new Set(["auto","none","0"]);function V2(t,e,n){let i=0,s;for(;i<t.length&&!s;){const o=t[i];typeof o=="string"&&!B2.has(o)&&af(o).values.length&&(s=t[i]),i++}if(s&&n)for(const o of e)t[o]=LB(n,s)}class z2 extends cw{constructor(e,n,i,s,o){super(e,n,i,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let m=e[h];if(typeof m=="string"&&(m=m.trim(),tw(m))){const g=AB(m,n.current);g!==void 0&&(e[h]=g),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!OB.has(i)||e.length!==2)return;const[s,o]=e,l=UM(s),c=UM(o),f=AM(s),d=AM(o);if(f!==d&&ho[i]){this.needsMeasurement=!0;return}if(l!==c)if(BM(l)&&BM(c))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else ho[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||O2(e[s]))&&i.push(s);i.length&&V2(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ho[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(i,s).jump(s,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=ho[n](e.measureViewportBox(),window.getComputedStyle(e.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const _2=new Set(["opacity","clipPath","filter","transform"]);function yw(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(i=>i!=null)}const BB=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function H2(t){return FL(t)&&"offsetHeight"in t}const{schedule:vw}=iB(queueMicrotask,!1),hs={x:!1,y:!1};function VB(){return hs.x||hs.y}function F2(t){return t==="x"||t==="y"?hs[t]?null:(hs[t]=!0,()=>{hs[t]=!1}):hs.x||hs.y?null:(hs.x=hs.y=!0,()=>{hs.x=hs.y=!1})}function zB(t,e){const n=yw(t),i=new AbortController,s={passive:!0,...e,signal:i.signal};return[n,s,()=>i.abort()]}function U2(t){return!(t.pointerType==="touch"||VB())}function j2(t,e,n={}){const[i,s,o]=zB(t,n);return i.forEach(l=>{let c=!1,f=!1,d;const h=()=>{l.removeEventListener("pointerleave",x)},m=C=>{d&&(d(C),d=void 0),h()},g=C=>{c=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),f&&(f=!1,m(C))},b=()=>{c=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},x=C=>{if(C.pointerType!=="touch"){if(c){f=!0;return}m(C)}},w=C=>{if(!U2(C))return;f=!1;const E=e(l,C);typeof E=="function"&&(d=E,l.addEventListener("pointerleave",x,s))};l.addEventListener("pointerenter",w,s),l.addEventListener("pointerdown",b,s)}),o}const _B=(t,e)=>e?t===e?!0:_B(t,e.parentElement):!1,bw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,W2=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function K2(t){return W2.has(t.tagName)||t.isContentEditable===!0}const q2=new Set(["INPUT","SELECT","TEXTAREA"]);function Y2(t){return q2.has(t.tagName)||t.isContentEditable===!0}const op=new WeakSet;function WM(t){return e=>{e.key==="Enter"&&t(e)}}function kv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const G2=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=WM(()=>{if(op.has(n))return;kv(n,"down");const s=WM(()=>{kv(n,"up")}),o=()=>kv(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function KM(t){return bw(t)&&!VB()}const qM=new WeakSet;function X2(t,e,n={}){const[i,s,o]=zB(t,n),l=c=>{const f=c.currentTarget;if(!KM(c)||qM.has(c))return;op.add(f),n.stopPropagation&&qM.add(c);const d=e(f,c),h=(b,x)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",g),op.has(f)&&op.delete(f),KM(b)&&typeof d=="function"&&d(b,{success:x})},m=b=>{h(b,f===window||f===document||n.useGlobalTarget||_B(f,b.target))},g=b=>{h(b,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",g,s)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,s),H2(c)&&(c.addEventListener("focus",d=>G2(d,s)),!K2(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),o}function sg(t){return FL(t)&&"ownerSVGElement"in t}const lp=new WeakMap;let ap;const HB=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:sg(i)&&"getBBox"in i?i.getBBox()[e]:i[n],$2=HB("inline","width","offsetWidth"),Q2=HB("block","height","offsetHeight");function Z2({target:t,borderBoxSize:e}){lp.get(t)?.forEach(n=>{n(t,{get width(){return $2(t,e)},get height(){return Q2(t,e)}})})}function J2(t){t.forEach(Z2)}function eX(){typeof ResizeObserver>"u"||(ap=new ResizeObserver(J2))}function tX(t,e){ap||eX();const n=yw(t);return n.forEach(i=>{let s=lp.get(i);s||(s=new Set,lp.set(i,s)),s.add(e),ap?.observe(i)}),()=>{n.forEach(i=>{const s=lp.get(i);s?.delete(e),s?.size||ap?.unobserve(i)})}}const cp=new Set;let Aa;function nX(){Aa=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};cp.forEach(e=>e(t))},window.addEventListener("resize",Aa)}function iX(t){return cp.add(t),Aa||nX(),()=>{cp.delete(t),!cp.size&&typeof Aa=="function"&&(window.removeEventListener("resize",Aa),Aa=void 0)}}function YM(t,e){return typeof t=="function"?iX(t):tX(t,e)}function FB(t){return sg(t)&&t.tagName==="svg"}const sX=[...NB,Rn,gs],rX=t=>sX.find(PB(t)),GM=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ma=()=>({x:GM(),y:GM()}),XM=()=>({min:0,max:0}),Tn=()=>({x:XM(),y:XM()}),uf=new WeakMap;function rg(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ff(t){return typeof t=="string"||Array.isArray(t)}const Sw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xw=["initial",...Sw];function og(t){return rg(t.animate)||xw.some(e=>ff(t[e]))}function UB(t){return!!(og(t)||t.variants)}function oX(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Un(s))t.addValue(i,s);else if(Un(o))t.addValue(i,Ao(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const l=t.getValue(i);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=t.getStaticValue(i);t.addValue(i,Ao(l!==void 0?l:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const vS={current:null},jB={current:!1},lX=typeof window<"u";function aX(){if(jB.current=!0,!!lX)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vS.current=t.matches;t.addEventListener("change",e),e()}else vS.current=!1}const $M=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zp={};function WB(t){Zp=t}function cX(){return Zp}class KB{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:l,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=cw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=ci.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,sn.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=c;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=f,this.blockInitialAnimation=!!l,this.isControllingVariants=og(n),this.isVariantNode=UB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:m,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in g){const x=g[b];d[b]!==void 0&&Un(x)&&x.set(d[b])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,uf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(jB.current||aX(),this.shouldReduceMotion=vS.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ro(this.notifyUpdate),Ro(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&_2.has(e)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:f,ease:d,duration:h}=n.accelerate,m=new EB({element:this.current,name:e,keyframes:c,times:f,ease:d,duration:is(h)}),g=l(m);this.valueSubscriptions.set(e,()=>{g(),m.cancel()});return}const i=pc.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[e]=l,this.props.onUpdate&&sn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Zp){const n=Zp[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tn()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<$M.length;i++){const s=$M[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,l=e[o];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=oX(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Ao(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(HL(i)||UL(i))?i=parseFloat(i):!rX(i)&&gs.test(n)&&(i=LB(e,n)),this.setBaseTarget(e,Un(i)?i.get():i)),Un(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=hw(this.props,n,this.presenceContext?.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Un(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Zx),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vw.render(this.render)}}class qB extends KB{constructor(){super(...arguments),this.KeyframeResolver=z2}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Un(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class _o{constructor(e){this.isMounted=!1,this.node=e}update(){}}function YB({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function uX({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function fX(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Pv(t){return t===void 0||t===1}function bS({scale:t,scaleX:e,scaleY:n}){return!Pv(t)||!Pv(e)||!Pv(n)}function al(t){return bS(t)||GB(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function GB(t){return QM(t.x)||QM(t.y)}function QM(t){return t&&t!=="0%"}function Jp(t,e,n){const i=t-n,s=e*i;return n+s}function ZM(t,e,n,i,s){return s!==void 0&&(t=Jp(t,s,i)),Jp(t,n,i)+e}function SS(t,e=0,n=1,i,s){t.min=ZM(t.min,e,n,i,s),t.max=ZM(t.max,e,n,i,s)}function XB(t,{x:e,y:n}){SS(t.x,e.translate,e.scale,e.originPoint),SS(t.y,n.translate,n.scale,n.originPoint)}const JM=.999999999999,eO=1.0000000000001;function dX(t,e,n,i=!1){const s=n.length;if(!s)return;e.x=e.y=1;let o,l;for(let c=0;c<s;c++){o=n[c],l=o.projectionDelta;const{visualElement:f}=o.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Da(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,XB(t,l)),i&&al(o.latestValues)&&Da(t,o.latestValues))}e.x<eO&&e.x>JM&&(e.x=1),e.y<eO&&e.y>JM&&(e.y=1)}function Oa(t,e){t.min=t.min+e,t.max=t.max+e}function tO(t,e,n,i,s=.5){const o=un(t.min,t.max,s);SS(t,e,n,o,i)}function Da(t,e){tO(t.x,e.x,e.scaleX,e.scale,e.originX),tO(t.y,e.y,e.scaleY,e.scale,e.originY)}function $B(t,e){return YB(fX(t.getBoundingClientRect(),e))}function hX(t,e,n){const i=$B(t,n),{scroll:s}=e;return s&&(Oa(i.x,s.offset.x),Oa(i.y,s.offset.y)),i}const pX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},mX=hc.length;function gX(t,e,n){let i="",s=!0;for(let o=0;o<mX;o++){const l=hc[o],c=t[l];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(l.startsWith("scale")?1:0);else{const d=parseFloat(c);f=l.startsWith("scale")?d===1:d===0}if(!f||n){const d=BB(c,gw[l]);if(!f){s=!1;const h=pX[l]||l;i+=`${h}(${d}) `}n&&(e[l]=d)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function ww(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let l=!1,c=!1;for(const f in e){const d=e[f];if(pc.has(f)){l=!0;continue}else if(rB(f)){s[f]=d;continue}else{const h=BB(d,gw[f]);f.startsWith("origin")?(c=!0,o[f]=h):i[f]=h}}if(e.transform||(l||n?i.transform=gX(e,t.transform,n):i.transform&&(i.transform="none")),c){const{originX:f="50%",originY:d="50%",originZ:h=0}=o;i.transformOrigin=`${f} ${d} ${h}`}}function QB(t,{style:e,vars:n},i,s){const o=t.style;let l;for(l in e)o[l]=e[l];s?.applyProjectionStyles(o,i);for(l in n)o.setProperty(l,n[l])}function nO(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mu={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ze.test(t))t=parseFloat(t);else return t;const n=nO(t,e.target.x),i=nO(t,e.target.y);return`${n}% ${i}%`}},yX={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=gs.parse(t);if(s.length>5)return i;const o=gs.createTransformer(t),l=typeof s[0]!="number"?1:0,c=n.x.scale*e.x,f=n.y.scale*e.y;s[0+l]/=c,s[1+l]/=f;const d=un(c,f,.5);return typeof s[2+l]=="number"&&(s[2+l]/=d),typeof s[3+l]=="number"&&(s[3+l]/=d),o(s)}},xS={borderRadius:{...mu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mu,borderTopRightRadius:mu,borderBottomLeftRadius:mu,borderBottomRightRadius:mu,boxShadow:yX};function ZB(t,{layout:e,layoutId:n}){return pc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!xS[t]||t==="opacity")}function Cw(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const l in i)(Un(i[l])||s&&Un(s[l])||ZB(l,t)||n?.getValue(l)?.liveStyle!==void 0)&&(o[l]=i[l]);return o}function vX(t){return window.getComputedStyle(t)}class JB extends qB{constructor(){super(...arguments),this.type="html",this.renderInstance=QB}readValueFromInstance(e,n){if(pc.has(n))return this.projection?.isProjecting?lS(n):zG(e,n);{const i=vX(e),s=(rB(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return $B(e,n)}build(e,n,i){ww(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return Cw(e,n,i)}}function bX(t,e){return t in e}class SX extends KB{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(bX(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return Tn()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}const xX={offset:"stroke-dashoffset",array:"stroke-dasharray"},wX={offset:"strokeDashoffset",array:"strokeDasharray"};function CX(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?xX:wX;t[o.offset]=`${-i}`,t[o.array]=`${e} ${n}`}const EX=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eV(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:l=0,...c},f,d,h){if(ww(t,c,d),f){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:m,style:g}=t;m.transform&&(g.transform=m.transform,delete m.transform),(g.transform||m.transformOrigin)&&(g.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),g.transform&&(g.transformBox=h?.transformBox??"fill-box",delete m.transformBox);for(const b of EX)m[b]!==void 0&&(g[b]=m[b],delete m[b]);e!==void 0&&(m.x=e),n!==void 0&&(m.y=n),i!==void 0&&(m.scale=i),s!==void 0&&CX(m,s,o,l,!1)}const tV=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),nV=t=>typeof t=="string"&&t.toLowerCase()==="svg";function TX(t,e,n,i){QB(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(tV.has(s)?s:pw(s),e.attrs[s])}function iV(t,e,n){const i=Cw(t,e,n);for(const s in t)if(Un(t[s])||Un(e[s])){const o=hc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=t[s]}return i}class sV extends qB{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(pc.has(n)){const i=IB(n);return i&&i.default||0}return n=tV.has(n)?n:pw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return iV(e,n,i)}build(e,n,i){eV(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){TX(e,n,i,s)}mount(e){this.isSVGTag=nV(e.tagName),super.mount(e)}}const RX=xw.length;function rV(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?rV(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<RX;n++){const i=xw[n],s=t.props[i];(ff(s)||s===!1)&&(e[i]=s)}return e}function oV(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const AX=[...Sw].reverse(),MX=Sw.length;function OX(t){return e=>Promise.all(e.map(({animation:n,options:i})=>A2(t,n,i)))}function DX(t){let e=OX(t),n=iO(),i=!0;const s=f=>(d,h)=>{const m=ja(t,h,f==="exit"?t.presenceContext?.custom:void 0);if(m){const{transition:g,transitionEnd:b,...x}=m;d={...d,...x,...b}}return d};function o(f){e=f(t)}function l(f){const{props:d}=t,h=rV(t.parent)||{},m=[],g=new Set;let b={},x=1/0;for(let C=0;C<MX;C++){const E=AX[C],M=n[E],T=d[E]!==void 0?d[E]:h[E],D=ff(T),O=E===f?M.isActive:null;O===!1&&(x=C);let A=T===h[E]&&T!==d[E]&&D;if(A&&i&&t.manuallyAnimateOnMount&&(A=!1),M.protectedKeys={...b},!M.isActive&&O===null||!T&&!M.prevProp||rg(T)||typeof T=="boolean")continue;if(E==="exit"&&M.isActive&&O!==!0){M.prevResolvedValues&&(b={...b,...M.prevResolvedValues});continue}const k=kX(M.prevProp,T);let P=k||E===f&&M.isActive&&!A&&D||C>x&&D,B=!1;const z=Array.isArray(T)?T:[T];let q=z.reduce(s(E),{});O===!1&&(q={});const{prevResolvedValues:W={}}=M,F={...W,...q},_=L=>{P=!0,g.has(L)&&(B=!0,g.delete(L)),M.needsAnimating[L]=!0;const K=t.getValue(L);K&&(K.liveStyle=!1)};for(const L in F){const K=q[L],Y=W[L];if(b.hasOwnProperty(L))continue;let Z=!1;hS(K)&&hS(Y)?Z=!oV(K,Y):Z=K!==Y,Z?K!=null?_(L):g.add(L):K!==void 0&&g.has(L)?_(L):M.protectedKeys[L]=!0}M.prevProp=T,M.prevResolvedValues=q,M.isActive&&(b={...b,...q}),i&&t.blockInitialAnimation&&(P=!1);const H=A&&k;P&&(!H||B)&&m.push(...z.map(L=>{const K={type:E};if(typeof L=="string"&&i&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:Y}=t,Z=ja(Y,L);if(Y.enteringChildren&&Z){const{delayChildren:le}=Z.transition||{};K.delay=RB(Y.enteringChildren,t,le)}}return{animation:L,options:K}}))}if(g.size){const C={};if(typeof d.initial!="boolean"){const E=ja(t,Array.isArray(d.initial)?d.initial[0]:d.initial);E&&E.transition&&(C.transition=E.transition)}g.forEach(E=>{const M=t.getBaseTarget(E),T=t.getValue(E);T&&(T.liveStyle=!0),C[E]=M??null}),m.push({animation:C})}let w=!!m.length;return i&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(w=!1),i=!1,w?e(m):Promise.resolve()}function c(f,d){if(n[f].isActive===d)return Promise.resolve();t.variantChildren?.forEach(m=>m.animationState?.setActive(f,d)),n[f].isActive=d;const h=l(f);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=iO()}}}function kX(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!oV(e,t):!1}function ol(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iO(){return{animate:ol(!0),whileInView:ol(),whileHover:ol(),whileTap:ol(),whileDrag:ol(),whileFocus:ol(),exit:ol()}}function sO(t,e){t.min=e.min,t.max=e.max}function ds(t,e){sO(t.x,e.x),sO(t.y,e.y)}function rO(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const lV=1e-4,PX=1-lV,NX=1+lV,aV=.01,IX=0-aV,LX=0+aV;function ui(t){return t.max-t.min}function BX(t,e,n){return Math.abs(t-e)<=n}function oO(t,e,n,i=.5){t.origin=i,t.originPoint=un(e.min,e.max,t.origin),t.scale=ui(n)/ui(e),t.translate=un(n.min,n.max,t.origin)-t.originPoint,(t.scale>=PX&&t.scale<=NX||isNaN(t.scale))&&(t.scale=1),(t.translate>=IX&&t.translate<=LX||isNaN(t.translate))&&(t.translate=0)}function Vu(t,e,n,i){oO(t.x,e.x,n.x,i?i.originX:void 0),oO(t.y,e.y,n.y,i?i.originY:void 0)}function lO(t,e,n){t.min=n.min+e.min,t.max=t.min+ui(e)}function VX(t,e,n){lO(t.x,e.x,n.x),lO(t.y,e.y,n.y)}function aO(t,e,n){t.min=e.min-n.min,t.max=t.min+ui(e)}function em(t,e,n){aO(t.x,e.x,n.x),aO(t.y,e.y,n.y)}function cO(t,e,n,i,s){return t-=e,t=Jp(t,1/n,i),s!==void 0&&(t=Jp(t,1/s,i)),t}function zX(t,e=0,n=1,i=.5,s,o=t,l=t){if(Gs.test(e)&&(e=parseFloat(e),e=un(l.min,l.max,e/100)-l.min),typeof e!="number")return;let c=un(o.min,o.max,i);t===o&&(c-=e),t.min=cO(t.min,e,n,c,s),t.max=cO(t.max,e,n,c,s)}function uO(t,e,[n,i,s],o,l){zX(t,e[n],e[i],e[s],e.scale,o,l)}const _X=["x","scaleX","originX"],HX=["y","scaleY","originY"];function fO(t,e,n,i){uO(t.x,e,_X,n?n.x:void 0,i?i.x:void 0),uO(t.y,e,HX,n?n.y:void 0,i?i.y:void 0)}function dO(t){return t.translate===0&&t.scale===1}function cV(t){return dO(t.x)&&dO(t.y)}function hO(t,e){return t.min===e.min&&t.max===e.max}function FX(t,e){return hO(t.x,e.x)&&hO(t.y,e.y)}function pO(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function uV(t,e){return pO(t.x,e.x)&&pO(t.y,e.y)}function mO(t){return ui(t.x)/ui(t.y)}function gO(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Is(t){return[t("x"),t("y")]}function UX(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,l=n?.z||0;if((s||o||l)&&(i=`translate3d(${s}px, ${o}px, ${l}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:d,rotate:h,rotateX:m,rotateY:g,skewX:b,skewY:x}=n;d&&(i=`perspective(${d}px) ${i}`),h&&(i+=`rotate(${h}deg) `),m&&(i+=`rotateX(${m}deg) `),g&&(i+=`rotateY(${g}deg) `),b&&(i+=`skewX(${b}deg) `),x&&(i+=`skewY(${x}deg) `)}const c=t.x.scale*e.x,f=t.y.scale*e.y;return(c!==1||f!==1)&&(i+=`scale(${c}, ${f})`),i||"none"}const fV=["TopLeft","TopRight","BottomLeft","BottomRight"],jX=fV.length,yO=t=>typeof t=="string"?parseFloat(t):t,vO=t=>typeof t=="number"||ze.test(t);function WX(t,e,n,i,s,o){s?(t.opacity=un(0,n.opacity??1,KX(i)),t.opacityExit=un(e.opacity??1,0,qX(i))):o&&(t.opacity=un(e.opacity??1,n.opacity??1,i));for(let l=0;l<jX;l++){const c=`border${fV[l]}Radius`;let f=bO(e,c),d=bO(n,c);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||vO(f)===vO(d)?(t[c]=Math.max(un(yO(f),yO(d),i),0),(Gs.test(d)||Gs.test(f))&&(t[c]+="%")):t[c]=d}(e.rotate||n.rotate)&&(t.rotate=un(e.rotate||0,n.rotate||0,i))}function bO(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const KX=dV(0,.5,QL),qX=dV(.5,.95,ns);function dV(t,e,n){return i=>i<t?0:i>e?1:n(sc(t,e,i))}function hV(t,e,n){const i=Un(t)?t:Ao(t);return i.start(dw("",i,e,n)),i.animation}function df(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const YX=(t,e)=>t.depth-e.depth;class GX{constructor(){this.children=[],this.isDirty=!1}add(e){$x(this.children,e),this.isDirty=!0}remove(e){ic(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(YX),this.isDirty=!1,this.children.forEach(e)}}function XX(t,e){const n=ci.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(Ro(i),t(o-e))};return sn.setup(i,!0),()=>Ro(i)}function up(t){return Un(t)?t.get():t}class $X{constructor(){this.members=[]}add(e){$x(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&s.isConnected===!1&&i.isPresent!==!1&&!i.snapshot&&ic(this.members,i)}e.scheduleRender()}remove(e){if(ic(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const o=this.members[s],l=o.instance;if(o.isPresent!==!1&&(!l||l.isConnected!==!1)){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender();const s=i.options.layoutDependency,o=e.options.layoutDependency;if(!(s!==void 0&&o!==void 0&&s===o)){const f=i.instance;f&&f.isConnected===!1&&!i.snapshot||(e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:c}=e.options;c===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const fp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nv=["","X","Y","Z"],QX=1e3;let ZX=0;function Iv(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function pV(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=kB(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",sn,!(s||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&pV(i)}function mV({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(l={},c=e?.()){this.id=ZX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(t$),this.nodes.forEach(r$),this.nodes.forEach(o$),this.nodes.forEach(n$)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new GX)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Zx),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const f=this.eventHandlers.get(l);f&&f.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=sg(l)&&!FB(l),this.instance=l;const{layoutId:c,layout:f,visualElement:d}=this.options;if(d&&!d.current&&d.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||c)&&(this.isLayoutDirty=!0),t){let h,m=0;const g=()=>this.root.updateBlockedByResize=!1;sn.read(()=>{m=window.innerWidth}),t(l,()=>{const b=window.innerWidth;b!==m&&(m=b,this.root.updateBlockedByResize=!0,h&&h(),h=XX(g,250),fp.hasAnimatedSinceResize&&(fp.hasAnimatedSinceResize=!1,this.nodes.forEach(wO)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||f)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m,hasRelativeLayoutChanged:g,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||f$,{onLayoutAnimationStart:w,onLayoutAnimationComplete:C}=d.getProps(),E=!this.targetLayout||!uV(this.targetLayout,b),M=!m&&g;if(this.options.layoutRoot||this.resumeFrom||M||m&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...fw(x,"layout"),onPlay:w,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,M)}else m||wO(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ro(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(l$),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:c,layout:f}=this.options;if(c===void 0&&!f)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(SO);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(xO);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(s$),this.nodes.forEach(JX),this.nodes.forEach(e$)):this.nodes.forEach(xO),this.clearAllSnapshots();const c=ci.now();Gn.delta=Qs(0,1e3/60,c-Gn.timestamp),Gn.timestamp=c,Gn.isProcessing=!0,Tv.update.process(Gn),Tv.preRender.process(Gn),Tv.render.process(Gn),Gn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(i$),this.sharedNodes.forEach(a$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ui(this.snapshot.measuredBox.x)&&!ui(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Tn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const f=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:f,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!cV(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;l&&this.instance&&(c||al(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let f=this.removeElementScroll(c);return l&&(f=this.removeTransform(f)),d$(f),{animationId:this.root.animationId,measuredBox:c,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Tn();const c=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(h$))){const{scroll:d}=this.root;d&&(Oa(c.x,d.offset.x),Oa(c.y,d.offset.y))}return c}removeElementScroll(l){const c=Tn();if(ds(c,l),this.scroll?.wasRoot)return c;for(let f=0;f<this.path.length;f++){const d=this.path[f],{scroll:h,options:m}=d;d!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&ds(c,l),Oa(c.x,h.offset.x),Oa(c.y,h.offset.y))}return c}applyTransform(l,c=!1){const f=Tn();ds(f,l);for(let d=0;d<this.path.length;d++){const h=this.path[d];!c&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Da(f,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),al(h.latestValues)&&Da(f,h.latestValues)}return al(this.latestValues)&&Da(f,this.latestValues),f}removeTransform(l){const c=Tn();ds(c,l);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!d.instance||!al(d.latestValues))continue;bS(d.latestValues)&&d.updateSnapshot();const h=Tn(),m=d.measurePageBox();ds(h,m),fO(c,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,h)}return al(this.latestValues)&&fO(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Gn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==c;if(!(l||f&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:m}=this.options;if(!this.layout||!(h||m))return;this.resolvedRelativeTargetAt=Gn.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Tn(),this.targetWithTransforms=Tn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),VX(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ds(this.target,this.layout.layoutBox),XB(this.target,this.targetDelta)):ds(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||bS(this.parent.latestValues)||GB(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,f){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tn(),this.relativeTargetOrigin=Tn(),em(this.relativeTargetOrigin,c,f),ds(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),c=!!this.resumingFrom||this!==l;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Gn.timestamp&&(f=!1),f)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;ds(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,g=this.treeScale.y;dX(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Tn());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(rO(this.prevProjectionDelta.x,this.projectionDelta.x),rO(this.prevProjectionDelta.y,this.projectionDelta.y)),Vu(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==g||!gO(this.projectionDelta.x,this.prevProjectionDelta.x)||!gO(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ma(),this.projectionDelta=Ma(),this.projectionDeltaWithTransform=Ma()}setAnimationOrigin(l,c=!1){const f=this.snapshot,d=f?f.latestValues:{},h={...this.latestValues},m=Ma();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=Tn(),b=f?f.source:void 0,x=this.layout?this.layout.source:void 0,w=b!==x,C=this.getStack(),E=!C||C.members.length<=1,M=!!(w&&!E&&this.options.crossfade===!0&&!this.path.some(u$));this.animationProgress=0;let T;this.mixTargetDelta=D=>{const O=D/1e3;CO(m.x,l.x,O),CO(m.y,l.y,O),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(em(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),c$(this.relativeTarget,this.relativeTargetOrigin,g,O),T&&FX(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Tn()),ds(T,this.relativeTarget)),w&&(this.animationValues=h,WX(h,d,this.latestValues,O,M,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ro(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sn.update(()=>{fp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ao(0)),this.motionValue.jump(0,!1),this.currentAnimation=hV(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:f,layout:d,latestValues:h}=l;if(!(!c||!f||!d)){if(this!==l&&this.layout&&d&&gV(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Tn();const m=ui(this.layout.layoutBox.x);f.x.min=l.target.x.min,f.x.max=f.x.min+m;const g=ui(this.layout.layoutBox.y);f.y.min=l.target.y.min,f.y.max=f.y.min+g}ds(c,f),Da(c,h),Vu(this.projectionDeltaWithTransform,this.layoutCorrected,c,h)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new $X),this.sharedNodes.get(l).add(c);const d=c.options.initialPromotionConfig;c.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:f}=l;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(c=!0),!c)return;const d={};f.z&&Iv("z",l,d,this.animationValues);for(let h=0;h<Nv.length;h++)Iv(`rotate${Nv[h]}`,l,d,this.animationValues),Iv(`skew${Nv[h]}`,l,d,this.animationValues);l.render();for(const h in d)l.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=up(c?.pointerEvents)||"",l.transform=f?f(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=up(c?.pointerEvents)||""),this.hasProjected&&!al(this.latestValues)&&(l.transform=f?f({},""):"none",this.hasProjected=!1);return}l.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=UX(this.projectionDeltaWithTransform,this.treeScale,h);f&&(m=f(h,m)),l.transform=m;const{x:g,y:b}=this.projectionDelta;l.transformOrigin=`${g.origin*100}% ${b.origin*100}% 0`,d.animationValues?l.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:l.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in xS){if(h[x]===void 0)continue;const{correct:w,applyTo:C,isCSSVariable:E}=xS[x],M=m==="none"?h[x]:w(h[x],d);if(C){const T=C.length;for(let D=0;D<T;D++)l[C[D]]=M}else E?this.options.visualElement.renderState.vars[x]=M:l[x]=M}this.options.layoutId&&(l.pointerEvents=d===this?up(c?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(SO),this.root.sharedNodes.clear()}}}function JX(t){t.updateLayout()}function e$(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;s==="size"?Is(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=ui(m);m.min=n[h].min,m.max=m.min+g}):gV(s,e.layoutBox,n)&&Is(h=>{const m=o?e.measuredBox[h]:e.layoutBox[h],g=ui(n[h]);m.max=m.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+g)});const l=Ma();Vu(l,n,e.layoutBox);const c=Ma();o?Vu(c,t.applyTransform(i,!0),e.measuredBox):Vu(c,n,e.layoutBox);const f=!cV(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:g}=h;if(m&&g){const b=Tn();em(b,e.layoutBox,m.layoutBox);const x=Tn();em(x,n,g.layoutBox),uV(b,x)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=b,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function t$(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function n$(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function i$(t){t.clearSnapshot()}function SO(t){t.clearMeasurements()}function xO(t){t.isLayoutDirty=!1}function s$(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function wO(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function r$(t){t.resolveTargetDelta()}function o$(t){t.calcProjection()}function l$(t){t.resetSkewAndRotation()}function a$(t){t.removeLeadSnapshot()}function CO(t,e,n){t.translate=un(e.translate,0,n),t.scale=un(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function EO(t,e,n,i){t.min=un(e.min,n.min,i),t.max=un(e.max,n.max,i)}function c$(t,e,n,i){EO(t.x,e.x,n.x,i),EO(t.y,e.y,n.y,i)}function u$(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const f$={duration:.45,ease:[.4,0,.1,1]},TO=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),RO=TO("applewebkit/")&&!TO("chrome/")?Math.round:ns;function AO(t){t.min=RO(t.min),t.max=RO(t.max)}function d$(t){AO(t.x),AO(t.y)}function gV(t,e,n){return t==="position"||t==="preserve-aspect"&&!BX(mO(e),mO(n),.2)}function h$(t){return t!==t.root&&t.scroll?.wasRoot}const p$=mV({attachResizeListener:(t,e)=>df(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Lv={current:void 0},yV=mV({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Lv.current){const t=new p$({});t.mount(window),t.setOptions({layoutScroll:!0}),Lv.current=t}return Lv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function Ew(t){return typeof t=="object"&&!Array.isArray(t)}function vV(t,e,n,i){return t==null?[]:typeof t=="string"&&Ew(e)?yw(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function m$(t,e,n){return t*(e+1)}function MO(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function g$(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(ic(t,s),i--)}}function y$(t,e,n,i,s,o){g$(t,s,o);for(let l=0;l<e.length;l++)t.push({value:e[l],at:un(s,o,i[l]),easing:tB(n,l)})}function v$(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function b$(t,e){return t.at===e.at?t.value===null?1:e.value===null?-1:0:t.at-e.at}const S$="easeInOut";function x$(t,{defaultTransition:e={},...n}={},i,s){const o=e.duration||.3,l=new Map,c=new Map,f={},d=new Map;let h=0,m=0,g=0;for(let b=0;b<t.length;b++){const x=t[b];if(typeof x=="string"){d.set(x,m);continue}else if(!Array.isArray(x)){d.set(x.name,MO(m,x.at,h,d));continue}let[w,C,E={}]=x;E.at!==void 0&&(m=MO(m,E.at,h,d));let M=0;const T=(D,O,A,k=0,P=0)=>{const B=w$(D),{delay:z=0,times:q=yB(B),type:W=e.type||"keyframes",repeat:F,repeatType:_,repeatDelay:H=0,...I}=O;let{ease:L=e.ease||"easeOut",duration:K}=O;const Y=typeof z=="function"?z(k,P):z,Z=B.length,le=uw(W)?W:s?.[W||"keyframes"];if(Z<=2&&le){let G=100;if(Z===2&&T$(B)){const ie=B[1]-B[0];G=Math.abs(ie)}const J={...e,...I};K!==void 0&&(J.duration=is(K));const fe=pB(J,G,le);L=fe.ease,K=fe.duration}K??(K=o);const V=m+Y;q.length===1&&q[0]===0&&(q[1]=1);const U=q.length-B.length;if(U>0&&gB(q,U),B.length===1&&B.unshift(null),F){K=m$(K,F);const G=[...B],J=[...q];L=Array.isArray(L)?[...L]:[L];const fe=[...L];for(let ie=0;ie<F;ie++){B.push(...G);for(let de=0;de<G.length;de++)q.push(J[de]+(ie+1)),L.push(de===0?"linear":tB(fe,de-1))}v$(q,F)}const $=V+K;y$(A,B,L,q,V,$),M=Math.max(Y+K,M),g=Math.max($,g)};if(Un(w)){const D=OO(w,c);T(C,E,DO("default",D))}else{const D=vV(w,C,i,f),O=D.length;for(let A=0;A<O;A++){C=C,E=E;const k=D[A],P=OO(k,c);for(const B in C)T(C[B],C$(E,B),DO(B,P),A,O)}}h=m,m+=M}return c.forEach((b,x)=>{for(const w in b){const C=b[w];C.sort(b$);const E=[],M=[],T=[];for(let k=0;k<C.length;k++){const{at:P,value:B,easing:z}=C[k];E.push(B),M.push(sc(0,g,P)),T.push(z||"easeOut")}M[0]!==0&&(M.unshift(0),E.unshift(E[0]),T.unshift(S$)),M[M.length-1]!==1&&(M.push(1),E.push(null)),l.has(x)||l.set(x,{keyframes:{},transition:{}});const D=l.get(x);D.keyframes[w]=E;const{type:O,...A}=e;D.transition[w]={...A,duration:g,ease:T,times:M,...n}}}),l}function OO(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function DO(t,e){return e[t]||(e[t]=[]),e[t]}function w$(t){return Array.isArray(t)?t:[t]}function C$(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const E$=t=>typeof t=="number",T$=t=>t.every(E$);function R$(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=sg(t)&&!FB(t)?new sV(e):new JB(e);n.mount(t),uf.set(t,n)}function A$(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new SX(e);n.mount(t),uf.set(t,n)}function M$(t,e){return Un(t)||typeof t=="number"||typeof t=="string"&&!Ew(e)}function bV(t,e,n,i){const s=[];if(M$(t,e))s.push(hV(t,Ew(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=vV(t,e,i),l=o.length;for(let c=0;c<l;c++){const f=o[c],d=f instanceof Element?R$:A$;uf.has(f)||d(f);const h=uf.get(f),m={...n};"delay"in m&&typeof m.delay=="function"&&(m.delay=m.delay(c,l)),s.push(...mw(h,{...e,transition:m},{}))}}return s}function O$(t,e,n){const i=[],s=t.map(l=>{if(Array.isArray(l)&&typeof l[0]=="function"){const c=l[0],f=Ao(0);return f.on("change",c),l.length===1?[f,[0,1]]:l.length===2?[f,[0,1],l[1]]:[f,l[1],l[2]]}return l});return x$(s,e,n,{spring:cf}).forEach(({keyframes:l,transition:c},f)=>{i.push(...bV(f,l,c))}),i}function D$(t){return Array.isArray(t)&&t.some(Array.isArray)}function k$(t={}){const{scope:e,reduceMotion:n}=t;function i(s,o,l){let c=[],f;if(D$(s))c=O$(s,n!==void 0?{reduceMotion:n,...o}:o,e);else{const{onComplete:h,...m}=l||{};typeof h=="function"&&(f=h),c=bV(s,o,n!==void 0?{reduceMotion:n,...m}:m,e)}const d=new l2(c);return f&&d.finished.then(f),e&&(e.animations.push(d),d.finished.then(()=>{ic(e.animations,d)})),d}return i}const AJ=k$(),kO=(t,e)=>Math.abs(t-e);function P$(t,e){const n=kO(t.x,e.x),i=kO(t.y,e.y);return Math.sqrt(n**2+i**2)}const SV=v.createContext({});function xV(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const wV=typeof window<"u",N$=wV?v.useLayoutEffect:v.useEffect,Tw=v.createContext(null),Rw=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function I$(t=!0){const e=v.useContext(Tw);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=e,o=v.useId();v.useEffect(()=>{if(t)return s(o)},[t]);const l=v.useCallback(()=>t&&i&&i(o),[o,i,t]);return!n&&i?[!1,l]:[!0]}const CV=v.createContext({strict:!1}),PO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let NO=!1;function L$(){if(NO)return;const t={};for(const e in PO)t[e]={isEnabled:n=>PO[e].some(i=>!!n[i])};WB(t),NO=!0}function EV(){return L$(),cX()}function B$(t){const e=EV();for(const n in t)e[n]={...e[n],...t[n]};WB(e)}const V$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function tm(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||V$.has(t)}let TV=t=>!tm(t);function z$(t){typeof t=="function"&&(TV=e=>e.startsWith("on")?!tm(e):t(e))}try{z$(require("@emotion/is-prop-valid").default)}catch{}function _$(t,e,n){const i={};for(const s in t)s==="values"&&typeof t.values=="object"||(TV(s)||n===!0&&tm(s)||!e&&!tm(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}const lg=v.createContext({});function H$(t,e){if(og(t)){const{initial:n,animate:i}=t;return{initial:n===!1||ff(n)?n:void 0,animate:ff(i)?i:void 0}}return t.inherit!==!1?e:{}}function F$(t){const{initial:e,animate:n}=H$(t,v.useContext(lg));return v.useMemo(()=>({initial:e,animate:n}),[IO(e),IO(n)])}function IO(t){return Array.isArray(t)?t.join(" "):t}const Aw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function RV(t,e,n){for(const i in e)!Un(e[i])&&!ZB(i,n)&&(t[i]=e[i])}function U$({transformTemplate:t},e){return v.useMemo(()=>{const n=Aw();return ww(n,e,t),Object.assign({},n.vars,n.style)},[e])}function j$(t,e){const n=t.style||{},i={};return RV(i,n,t),Object.assign(i,U$(t,e)),i}function W$(t,e){const n={},i=j$(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const AV=()=>({...Aw(),attrs:{}});function K$(t,e,n,i){const s=v.useMemo(()=>{const o=AV();return eV(o,e,nV(i),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};RV(o,t.style,t),s.style={...o,...s.style}}return s}const q$=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mw(t){return typeof t!="string"||t.includes("-")?!1:!!(q$.indexOf(t)>-1||/[A-Z]/u.test(t))}function Y$(t,e,n,{latestValues:i},s,o=!1,l){const f=(l??Mw(t)?K$:W$)(e,i,s,t),d=_$(e,typeof t=="string",o),h=t!==v.Fragment?{...d,...f,ref:n}:{},{children:m}=e,g=v.useMemo(()=>Un(m)?m.get():m,[m]);return v.createElement(t,{...h,children:g})}function G$({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:X$(n,i,s,t),renderState:e()}}function X$(t,e,n,i){const s={},o=i(t,{});for(const g in o)s[g]=up(o[g]);let{initial:l,animate:c}=t;const f=og(t),d=UB(t);e&&d&&!f&&t.inherit!==!1&&(l===void 0&&(l=e.initial),c===void 0&&(c=e.animate));let h=n?n.initial===!1:!1;h=h||l===!1;const m=h?c:l;if(m&&typeof m!="boolean"&&!rg(m)){const g=Array.isArray(m)?m:[m];for(let b=0;b<g.length;b++){const x=hw(t,g[b]);if(x){const{transitionEnd:w,transition:C,...E}=x;for(const M in E){let T=E[M];if(Array.isArray(T)){const D=h?T.length-1:0;T=T[D]}T!==null&&(s[M]=T)}for(const M in w)s[M]=w[M]}}}return s}const MV=t=>(e,n)=>{const i=v.useContext(lg),s=v.useContext(Tw),o=()=>G$(t,e,i,s);return n?o():xV(o)},$$=MV({scrapeMotionValuesFromProps:Cw,createRenderState:Aw}),Q$=MV({scrapeMotionValuesFromProps:iV,createRenderState:AV}),Z$=Symbol.for("motionComponentSymbol");function J$(t,e,n){const i=v.useRef(n);v.useInsertionEffect(()=>{i.current=n});const s=v.useRef(null);return v.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const l=i.current;if(typeof l=="function")if(o){const c=l(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):l(o);else l&&(l.current=o)},[e])}const OV=v.createContext({});function wa(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function eQ(t,e,n,i,s,o){const{visualElement:l}=v.useContext(lg),c=v.useContext(CV),f=v.useContext(Tw),d=v.useContext(Rw),h=d.reducedMotion,m=d.skipAnimations,g=v.useRef(null),b=v.useRef(!1);i=i||c.renderer,!g.current&&i&&(g.current=i(t,{visualState:e,parent:l,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:h,skipAnimations:m,isSVG:o}),b.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const x=g.current,w=v.useContext(OV);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&tQ(g.current,n,s,w);const C=v.useRef(!1);v.useInsertionEffect(()=>{x&&C.current&&x.update(n,f)});const E=n[DB],M=v.useRef(!!E&&!window.MotionHandoffIsComplete?.(E)&&window.MotionHasOptimisedAnimation?.(E));return N$(()=>{b.current=!0,x&&(C.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),M.current&&x.animationState&&x.animationState.animateChanges())}),v.useEffect(()=>{x&&(!M.current&&x.animationState&&x.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(E)}),M.current=!1),x.enteringChildren=void 0)}),x}function tQ(t,e,n,i){const{layoutId:s,layout:o,drag:l,dragConstraints:c,layoutScroll:f,layoutRoot:d,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:DV(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!l||c&&wa(c),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:f,layoutRoot:d})}function DV(t){if(t)return t.options.allowProjection!==!1?t.projection:DV(t.parent)}function Bv(t,{forwardMotionProps:e=!1,type:n}={},i,s){i&&B$(i);const o=n?n==="svg":Mw(t),l=o?Q$:$$;function c(d,h){let m;const g={...v.useContext(Rw),...d,layoutId:nQ(d)},{isStatic:b}=g,x=F$(d),w=l(d,b);if(!b&&wV){iQ();const C=sQ(g);m=C.MeasureLayout,x.visualElement=eQ(t,w,g,s,C.ProjectionNode,o)}return ue.jsxs(lg.Provider,{value:x,children:[m&&x.visualElement?ue.jsx(m,{visualElement:x.visualElement,...g}):null,Y$(t,d,J$(w,x.visualElement,h),w,b,e,o)]})}c.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const f=v.forwardRef(c);return f[Z$]=t,f}function nQ({layoutId:t}){const e=v.useContext(SV).id;return e&&t!==void 0?e+"-"+t:t}function iQ(t,e){v.useContext(CV).strict}function sQ(t){const e=EV(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function rQ(t,e){if(typeof Proxy>"u")return Bv;const n=new Map,i=(o,l)=>Bv(o,l,t,e),s=(o,l)=>i(o,l);return new Proxy(s,{get:(o,l)=>l==="create"?i:(n.has(l)||n.set(l,Bv(l,void 0,t,e)),n.get(l))})}const oQ=(t,e)=>e.isSVG??Mw(t)?new sV(e):new JB(e,{allowProjection:t!==v.Fragment});class lQ extends _o{constructor(e){super(e),e.animationState||(e.animationState=DX(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();rg(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let aQ=0;class cQ extends _o{constructor(){super(...arguments),this.id=aQ++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const uQ={animation:{Feature:lQ},exit:{Feature:cQ}};function Uf(t){return{point:{x:t.pageX,y:t.pageY}}}const fQ=t=>e=>bw(e)&&t(e,Uf(e));function zu(t,e,n,i){return df(t,e,fQ(n),i)}const kV=({current:t})=>t?t.ownerDocument.defaultView:null,LO=new Set(["auto","scroll"]);class PV{constructor(e,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:l=3,element:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=zv(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=P$(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:C}=b,{timestamp:E}=Gn;this.history.push({...C,timestamp:E});const{onStart:M,onMove:T}=this.handlers;x||(M&&M(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=Vv(x,this.transformPagePoint),sn.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:w,onSessionEnd:C,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=zv(b.type==="pointercancel"?this.lastMoveEventInfo:Vv(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(b,M),C&&C(b,M)},!bw(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=s||window;const f=Uf(e),d=Vv(f,this.transformPagePoint),{point:h}=d,{timestamp:m}=Gn;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(e,zv(d,this.history)),this.removeListeners=_f(zu(this.contextWindow,"pointermove",this.handlePointerMove),zu(this.contextWindow,"pointerup",this.handlePointerUp),zu(this.contextWindow,"pointercancel",this.handlePointerUp)),c&&this.startScrollTracking(c)}startScrollTracking(e){let n=e.parentElement;for(;n;){const i=getComputedStyle(n);(LO.has(i.overflowX)||LO.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const i=e===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,s),sn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ro(this.updatePoint)}}function Vv(t,e){return e?{point:e(t.point)}:t}function BO(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zv({point:t},e){return{point:t,delta:BO(t,NV(e)),offset:BO(t,dQ(e)),velocity:hQ(e,.1)}}function dQ(t){return t[0]}function NV(t){return t[t.length-1]}function hQ(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=NV(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>is(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>is(e)*2&&(i=t[1]);const o=ts(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const l={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function pQ(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?un(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?un(n,t,i.max):Math.min(t,n)),t}function VO(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function mQ(t,{top:e,left:n,bottom:i,right:s}){return{x:VO(t.x,n,s),y:VO(t.y,e,i)}}function zO(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function gQ(t,e){return{x:zO(t.x,e.x),y:zO(t.y,e.y)}}function yQ(t,e){let n=.5;const i=ui(t),s=ui(e);return s>i?n=sc(e.min,e.max-i,t.min):i>s&&(n=sc(t.min,t.max-s,e.min)),Qs(0,1,n)}function vQ(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const wS=.35;function bQ(t=wS){return t===!1?t=0:t===!0&&(t=wS),{x:_O(t,"left","right"),y:_O(t,"top","bottom")}}function _O(t,e,n){return{min:HO(t,e),max:HO(t,n)}}function HO(t,e){return typeof t=="number"?t:t[e]||0}const SQ=new WeakMap;class xQ{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=m=>{n&&this.snapToCursor(Uf(m).point),this.stopAnimation()},l=(m,g)=>{const{drag:b,dragPropagation:x,onDragStart:w}=this.getProps();if(b&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=F2(b),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Is(E=>{let M=this.getAxisMotionValue(E).get()||0;if(Gs.test(M)){const{projection:T}=this.visualElement;if(T&&T.layout){const D=T.layout.layoutBox[E];D&&(M=ui(D)*(parseFloat(M)/100))}}this.originPoint[E]=M}),w&&sn.update(()=>w(m,g),!1,!0),pS(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},c=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g;const{dragPropagation:b,dragDirectionLock:x,onDirectionLock:w,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:E}=g;if(x&&this.currentDirection===null){this.currentDirection=CQ(E),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",g.point,E),this.updateAxis("y",g.point,E),this.visualElement.render(),C&&sn.update(()=>C(m,g),!1,!0)},f=(m,g)=>{this.latestPointerEvent=m,this.latestPanInfo=g,this.stop(m,g),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new PV(e,{onSessionStart:o,onStart:l,onMove:c,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:kV(this.visualElement),element:this.visualElement.current})}stop(e,n){const i=e||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&sn.postRender(()=>c(i,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,i){const{drag:s}=this.getProps();if(!i||!Wh(e,s,this.currentDirection))return;const o=this.getAxisMotionValue(e);let l=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(l=pQ(l,this.constraints[e],this.elastic[e])),o.set(l)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;e&&wa(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=mQ(i.layoutBox,e):this.constraints=!1,this.elastic=bQ(n),s!==this.constraints&&!wa(e)&&i&&this.constraints&&!this.hasMutatedConstraints&&Is(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vQ(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!wa(e))return!1;const i=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=hX(i,s.root,this.visualElement.getTransformPagePoint());let l=gQ(s.layout.layoutBox,o);if(n){const c=n(uX(l));this.hasMutatedConstraints=!!c,c&&(l=YB(c))}return l}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),f=this.constraints||{},d=Is(h=>{if(!Wh(h,n,this.currentDirection))return;let m=f&&f[h]||{};l&&(m={min:0,max:0});const g=s?200:1e6,b=s?40:1e7,x={type:"inertia",velocity:i?e[h]:0,bounceStiffness:g,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(h,x)});return Promise.all(d).then(c)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return pS(this.visualElement,e),i.start(dw(e,i,0,n,this.visualElement,!1))}stopAnimation(){Is(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Is(n=>{const{drag:i}=this.getProps();if(!Wh(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:c}=s.layout.layoutBox[n],f=o.get()||0;o.set(e[n]-un(l,c,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!wa(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Is(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const f=c.get();s[l]=yQ({min:f,max:f},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Is(l=>{if(!Wh(l,e,null))return;const c=this.getAxisMotionValue(l),{min:f,max:d}=this.constraints[l];c.set(un(f,d,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;SQ.set(this.visualElement,this);const e=this.visualElement.current,n=zu(e,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps(),g=d.target,b=g!==e&&Y2(g);h&&m&&!b&&this.start(d)});let i;const s=()=>{const{dragConstraints:d}=this.getProps();wa(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=wQ(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,l=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),sn.read(s);const c=df(window,"resize",()=>this.scalePositionWithinConstraints()),f=o.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Is(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=d[m].translate,g.set(g.get()+d[m].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),f&&f(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:l=wS,dragMomentum:c=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:l,dragMomentum:c}}}function FO(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function wQ(t,e,n){const i=YM(t,FO(n)),s=YM(e,FO(n));return()=>{i(),s()}}function Wh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function CQ(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class EQ extends _o{constructor(e){super(e),this.removeGroupControls=ns,this.removeListeners=ns,this.controls=new xQ(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ns}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const _v=t=>(e,n)=>{t&&sn.update(()=>t(e,n),!1,!0)};class TQ extends _o{constructor(){super(...arguments),this.removePointerDownListener=ns}onPointerDown(e){this.session=new PV(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:kV(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:_v(e),onStart:_v(n),onMove:_v(i),onEnd:(o,l)=>{delete this.session,s&&sn.postRender(()=>s(o,l))}}}mount(){this.removePointerDownListener=zu(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Hv=!1;class RQ extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),Hv&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:l}=i;return l&&(l.isPresent=o,e.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),Hv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==o?l.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?l.promote():l.relegate()||sn.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vw.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=e;Hv=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function IV(t){const[e,n]=I$(),i=v.useContext(SV);return ue.jsx(RQ,{...t,layoutGroup:i,switchLayoutGroup:v.useContext(OV),isPresent:e,safeToRemove:n})}const AQ={pan:{Feature:TQ},drag:{Feature:EQ,ProjectionNode:yV,MeasureLayout:IV}};function UO(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&sn.postRender(()=>o(e,Uf(e)))}class MQ extends _o{mount(){const{current:e}=this.node;e&&(this.unmount=j2(e,(n,i)=>(UO(this.node,i,"Start"),s=>UO(this.node,s,"End"))))}unmount(){}}class OQ extends _o{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_f(df(this.node.current,"focus",()=>this.onFocus()),df(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function jO(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&sn.postRender(()=>o(e,Uf(e)))}class DQ extends _o{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=X2(e,(s,o)=>(jO(this.node,o,"Start"),(l,{success:c})=>jO(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const CS=new WeakMap,Fv=new WeakMap,kQ=t=>{const e=CS.get(t.target);e&&e(t)},PQ=t=>{t.forEach(kQ)};function NQ({root:t,...e}){const n=t||document;Fv.has(n)||Fv.set(n,{});const i=Fv.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(PQ,{root:t,...e})),i[s]}function IQ(t,e,n){const i=NQ(e);return CS.set(t,n),i.observe(t),()=>{CS.delete(t),i.unobserve(t)}}const LQ={some:0,all:1};class BQ extends _o{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=e,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:LQ[s]},c=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),g=d?h:m;g&&g(f)};return IQ(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(VQ(e,n))&&this.startObserver()}unmount(){}}function VQ({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const zQ={inView:{Feature:BQ},tap:{Feature:DQ},focus:{Feature:OQ},hover:{Feature:MQ}},_Q={layout:{ProjectionNode:yV,MeasureLayout:IV}},HQ={...uQ,...zQ,...AQ,..._Q},MJ=rQ(HQ,oQ);function OJ(t){const e=xV(()=>Ao(t)),{isStatic:n}=v.useContext(Rw);if(n){const[,i]=v.useState(t);v.useEffect(()=>e.on("change",i),[])}return e}function DJ(t){const[e,n]=v.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=v.useRef(null),s=v.useRef(null),o=v.useRef(null),l=v.useRef(null),c=v.useRef(!0),f=v.useRef(null),d=Po(),h=v.useMemo(()=>({anchor:e,setAnchor:n,actionsRef:o,backdropRef:i,internalBackdropRef:s,positionerRef:l,allowMouseUpTriggerRef:c,initialCursorPointRef:f,rootId:d}),[e,d]);return ue.jsx(zN.Provider,{value:h,children:ue.jsx(Mx.Provider,{value:void 0,children:ue.jsx(YN,{...t})})})}const WO=500,kJ=v.forwardRef(function(e,n){const{render:i,className:s,style:o,...l}=e,{setAnchor:c,actionsRef:f,internalBackdropRef:d,backdropRef:h,positionerRef:m,allowMouseUpTriggerRef:g,initialCursorPointRef:b,rootId:x}=Lf(!1),{store:w}=xs(!1),C=w.useState("open"),E=w.useState("disabled"),M=v.useRef(null),T=v.useRef(null),D=On(),O=On(),A=v.useRef(!1);function k(_,H,I){const L=I.type.startsWith("touch");b.current={x:_,y:H},c({getBoundingClientRect(){return DOMRect.fromRect({width:L?10:0,height:L?10:0,x:_,y:H})}}),A.current=!1,f.current?.setOpen(!0,Qe($s,I)),O.start(WO,()=>{A.current=!0})}function P(_){if(E)return;g.current=!0,xi(_),k(_.clientX,_.clientY,_.nativeEvent);const H=yt(M.current);ht(H,"mouseup",I=>{if(g.current=!1,!A.current)return;O.clear(),A.current=!1;const L=Zn(I);Ge(m.current,L)||x&&L&&kx(L)===x||f.current?.setOpen(!1,Qe(PS,I))},{once:!0})}function B(_){if(!E&&(g.current=!1,_.touches.length===1)){_.stopPropagation();const H=_.touches[0];T.current={x:H.clientX,y:H.clientY},D.start(WO,()=>{T.current&&k(T.current.x,T.current.y,_.nativeEvent)})}}function z(_){if(D.isStarted()&&T.current&&_.touches.length===1){const H=_.touches[0],I=10,L=Math.abs(H.clientX-T.current.x),K=Math.abs(H.clientY-T.current.y);(L>I||K>I)&&D.clear()}}function q(){D.clear(),T.current=null}return v.useEffect(()=>{function _(I){if(E)return;const K=Zn(I);(Ge(M.current,K)||Ge(d.current,K)||Ge(h.current,K))&&I.preventDefault()}const H=yt(M.current);return ht(H,"contextmenu",_)},[h,E,d]),Dt("div",e,{state:{open:C},ref:[M,n],props:[{onContextMenu:P,onTouchStart:B,onTouchMove:z,onTouchEnd:q,onTouchCancel:q,style:{WebkitTouchCallout:"none"}},l],stateAttributesMapping:Fu})});export{KI as $,Ls as A,os as B,dp as C,oK as D,Bn as E,It as F,Fx as G,Lo as H,Qt as I,xe as J,nn as K,tr as L,Je as M,Vx as N,Nm as O,zI as P,z8 as Q,Li as R,Jt as S,Hu as T,Ol as U,He as V,im as W,Sl as X,dJ as Y,OK as Z,Yb as _,Kh as a,FZ as a$,pJ as a0,mJ as a1,hJ as a2,FK as a3,gJ as a4,FI as a5,lJ as a6,aJ as a7,sq as a8,$i as a9,Bq as aA,wJ as aB,DK as aC,gZ as aD,fn as aE,eL as aF,bY as aG,CM as aH,hL as aI,uL as aJ,Zb as aK,Fn as aL,MJ as aM,WQ as aN,BZ as aO,LZ as aP,TN as aQ,zZ as aR,VZ as aS,UZ as aT,HZ as aU,_Z as aV,jZ as aW,Tl as aX,bj as aY,vj as aZ,PN as a_,HK as aa,Bm as ab,Bi as ac,Ut as ad,pl as ae,jI as af,ec as ag,tL as ah,Nb as ai,Lm as aj,vZ as ak,bZ as al,ys as am,Yu as an,BF as ao,VF as ap,dZ as aq,Cr as ar,Qn as as,pa as at,pZ as au,yJ as av,Ta as aw,VL as ax,zL as ay,Vq as az,wf as b,ef as b$,OJ as b0,AJ as b1,$Q as b2,XQ as b3,KQ as b4,GQ as b5,QQ as b6,YQ as b7,qQ as b8,qj as b9,sx as bA,aF as bB,wZ as bC,CZ as bD,TZ as bE,EZ as bF,RZ as bG,AZ as bH,MZ as bI,OZ as bJ,DZ as bK,kZ as bL,PZ as bM,NZ as bN,YN as bO,ZZ as bP,GZ as bQ,XZ as bR,$Z as bS,QZ as bT,JZ as bU,eJ as bV,tJ as bW,nJ as bX,iJ as bY,sJ as bZ,oJ as b_,Xj as ba,TJ as bb,DJ as bc,kJ as bd,qZ as be,YZ as bf,KZ as bg,WZ as bh,IZ as bi,xZ as bj,ZQ as bk,JQ as bl,oZ as bm,eZ as bn,tZ as bo,nZ as bp,iZ as bq,sZ as br,rZ as bs,QH as bt,aZ as bu,cZ as bv,Ak as bw,uZ as bx,Yn as by,fZ as bz,Ti as c,NN as c0,RK as c1,HI as c2,SJ as c3,mZ as c4,wY as c5,xJ as c6,Im as c7,yZ as c8,IY as c9,vJ as ca,Jm as cb,bJ as cc,cJ as cd,$8 as ce,SZ as cf,EJ as cg,CJ as ch,uJ as ci,jQ as cj,lZ as ck,YS as d,Ve as e,Qe as f,Oe as g,zt as h,Pr as i,Dt as j,ue as k,ko as l,fm as m,Ar as n,um as o,ht as p,rc as q,pf as r,er as s,$s as t,Ep as u,di as v,St as w,en as x,EK as y,Me as z};